From: Greg Farnum Date: Tue, 2 Aug 2016 00:49:13 +0000 (-0700) Subject: client: pass UserPerm to lookup_name() X-Git-Tag: v11.0.1~36^2~50 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=898154fd84b417f15dcedd889973554b1bcee3c9;p=ceph.git client: pass UserPerm to lookup_name() Signed-off-by: Greg Farnum --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 700c243f72bd..50699c716c0b 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -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; diff --git a/src/client/Client.h b/src/client/Client.h index ab1b867e0625..7fa22ed378bf 100644 --- a/src/client/Client.h +++ b/src/client/Client.h @@ -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); diff --git a/src/libcephfs.cc b/src/libcephfs.cc index 681bc19404ac..97db35758b39 100644 --- a/src/libcephfs.cc +++ b/src/libcephfs.cc @@ -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);