From: Greg Farnum Date: Wed, 3 Aug 2016 05:37:37 +0000 (-0700) Subject: client: pass UserPerm to ll_walk() X-Git-Tag: v11.0.1~36^2~40 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e9156ad790bed24b8a49cefc140a096e33c43259;p=ceph.git client: pass UserPerm to ll_walk() Signed-off-by: Greg Farnum --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 597d2ae24a1..4dc04b05afb 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -9533,7 +9533,8 @@ int Client::ll_lookup(Inode *parent, const char *name, struct stat *attr, return r; } -int Client::ll_walk(const char* name, Inode **out, struct stat *attr) +int Client::ll_walk(const char* name, Inode **out, struct stat *attr, + const UserPerm& perms) { Mutex::Locker lock(client_lock); filepath fp(name, 0); @@ -9544,7 +9545,7 @@ int Client::ll_walk(const char* name, Inode **out, struct stat *attr) tout(cct) << "ll_walk" << std::endl; tout(cct) << name << std::endl; - rc = path_walk(fp, &in, false); + rc = path_walk(fp, &in, perms, false); if (rc < 0) { attr->st_ino = 0; *out = NULL; diff --git a/src/client/Client.h b/src/client/Client.h index 9638fc4cfaa..b02871e6e69 100644 --- a/src/client/Client.h +++ b/src/client/Client.h @@ -1245,7 +1245,8 @@ public: int ll_commit_blocks(Inode *in, uint64_t offset, uint64_t length); int ll_statfs(Inode *in, struct statvfs *stbuf, const UserPerm& perms); - int ll_walk(const char* name, Inode **i, struct stat *attr); // XXX in? + int ll_walk(const char* name, Inode **i, struct stat *attr, + const UserPerm& perms); // XXX in? uint32_t ll_stripe_unit(Inode *in); int ll_file_layout(Inode *in, file_layout_t *layout); uint64_t ll_snap_seq(Inode *in); diff --git a/src/libcephfs.cc b/src/libcephfs.cc index c85544ade26..ccace2907f0 100644 --- a/src/libcephfs.cc +++ b/src/libcephfs.cc @@ -1438,7 +1438,8 @@ extern "C" int ceph_ll_walk(class ceph_mount_info *cmount, const char *name, struct Inode **i, struct stat *attr) { - return(cmount->get_client()->ll_walk(name, i, attr)); + UserPerm perms = cmount->get_client()->pick_my_perms(); + return (cmount->get_client()->ll_walk(name, i, attr, perms)); } extern "C" int ceph_ll_getattr(class ceph_mount_info *cmount,