From: Greg Farnum Date: Mon, 11 Jul 2016 22:51:53 +0000 (-0700) Subject: client: add UserPerm-based _lookup() and make_request() functions X-Git-Tag: v11.0.1~36^2~93 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=db40270bed999d9b6db906ea21f9864dadc9b4a9;p=ceph.git client: add UserPerm-based _lookup() and make_request() functions Signed-off-by: Greg Farnum --- diff --git a/src/client/Client.h b/src/client/Client.h index ed407d692a3..127c5748bb8 100644 --- a/src/client/Client.h +++ b/src/client/Client.h @@ -378,6 +378,13 @@ protected: //MClientRequest *req, int uid, int gid, InodeRef *ptarget = 0, bool *pcreated = 0, int use_mds=-1, bufferlist *pdirbl=0); + + int make_request(MetaRequest *req, const UserPerm& perm, + InodeRef *ptarget = 0, bool *pcreated = 0, + int use_mds=-1, bufferlist *pdirbl=0) { + return make_request(req, perm.uid(), perm.gid(), ptarget, pcreated, + use_mds, pdirbl); + } void put_request(MetaRequest *request); void unregister_request(MetaRequest *request); @@ -773,6 +780,10 @@ private: // call these with client_lock held! int _do_lookup(Inode *dir, const string& name, int mask, InodeRef *target, int uid, int gid); int _lookup(Inode *dir, const string& dname, int mask, InodeRef *target, int uid, int gid); + int _lookup(Inode *dir, const string& dname, int mask, InodeRef *target, + const UserPerm& perm) { + return _lookup(dir, dname, mask, target, perm.uid(), perm.gid()); + } int _link(Inode *in, Inode *dir, const char *name, const UserPerm& perm, InodeRef *inp = 0);