]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: add UserPerm-based _lookup() and make_request() functions
authorGreg Farnum <gfarnum@redhat.com>
Mon, 11 Jul 2016 22:51:53 +0000 (15:51 -0700)
committerGreg Farnum <gfarnum@redhat.com>
Wed, 31 Aug 2016 21:35:14 +0000 (14:35 -0700)
Signed-off-by: Greg Farnum <gfarnum@redhat.com>
src/client/Client.h

index ed407d692a37829c06556cb295002e3731310fd0..127c5748bb8110e18217b3bd75a7fd25a6081f6d 100644 (file)
@@ -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);