]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: pass UserPerm to lookup_name()
authorGreg Farnum <gfarnum@redhat.com>
Tue, 2 Aug 2016 00:49:13 +0000 (17:49 -0700)
committerGreg Farnum <gfarnum@redhat.com>
Wed, 21 Sep 2016 23:33:51 +0000 (16:33 -0700)
Signed-off-by: Greg Farnum <gfarnum@redhat.com>
src/client/Client.cc
src/client/Client.h
src/libcephfs.cc

index 700c243f72bde6e9d4836f9136720ed10300d9d7..50699c716c0ba97999c8eb95c257c43cce215088 100644 (file)
@@ -7672,7 +7672,7 @@ int Client::lookup_parent(Inode *ino, const UserPerm& perms, Inode **parent)
  * Populate the parent dentry for `ino`, provided it is
  * a child of `parent`.
  */
-int Client::lookup_name(Inode *ino, Inode *parent)
+int Client::lookup_name(Inode *ino, Inode *parent, const UserPerm& perms)
 {
   assert(parent->is_dir());
 
@@ -7684,7 +7684,6 @@ int Client::lookup_name(Inode *ino, Inode *parent)
   req->set_filepath(filepath(ino->ino));
   req->set_inode(ino);
 
-  UserPerm perms(get_uid(), get_gid()); // FIXME
   int r = make_request(req, perms, NULL, NULL, rand() % mdsmap->get_num_in_mds());
   ldout(cct, 3) << "lookup_name exit(" << ino->ino << ") = " << r << dendl;
   return r;
index ab1b867e06252b1e7fb446b83acde2b5a7f5f1bb..7fa22ed378bf8ecf0e35e311ad9658a8fb21c1a5 100644 (file)
@@ -1125,7 +1125,7 @@ public:
                  const UserPerm& perms);
   int lookup_ino(inodeno_t ino, const UserPerm& perms, Inode **inode=NULL);
   int lookup_parent(Inode *in, const UserPerm& perms, Inode **parent=NULL);
-  int lookup_name(Inode *in, Inode *parent);
+  int lookup_name(Inode *in, Inode *parent, const UserPerm& perms);
   int close(int fd);
   loff_t lseek(int fd, loff_t offset, int whence, const UserPerm& perms);
   int read(int fd, char *buf, loff_t size, loff_t offset=-1);
index 681bc19404aca4899ebee699cf1bf1929af4ef3b..97db35758b397037ed9fc00dece3890f472e285f 100644 (file)
@@ -1399,7 +1399,7 @@ extern "C" int ceph_ll_lookup_inode(
   assert(parent != NULL);
 
   // Finally, get the name (dentry) of the requested inode
-  r = (cmount->get_client())->lookup_name(*inode, parent);
+  r = (cmount->get_client())->lookup_name(*inode, parent, perms);
   if (r) {
     // Unexpected error
     (cmount->get_client())->ll_forget(parent, 1);