]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: pass UserPerm to lookup_hash()
authorGreg Farnum <gfarnum@redhat.com>
Sat, 30 Jul 2016 01:59:13 +0000 (18:59 -0700)
committerGreg Farnum <gfarnum@redhat.com>
Wed, 21 Sep 2016 23:33:50 +0000 (16:33 -0700)
Signed-off-by: Greg Farnum <gfarnum@redhat.com>
src/client/Client.cc
src/client/Client.h
src/client/SyntheticClient.cc
src/client/SyntheticClient.h

index 0f4beff9dbc72d1d7e7cb11a0db41a9696c40406..5219cb60c9f45f400d2060a2f1b70ea0f934348f 100644 (file)
@@ -7575,7 +7575,8 @@ int Client::open(const char *relpath, int flags, mode_t mode)
   return open(relpath, flags, mode, 0, 0, 0, NULL);
 }
 
-int Client::lookup_hash(inodeno_t ino, inodeno_t dirino, const char *name)
+int Client::lookup_hash(inodeno_t ino, inodeno_t dirino, const char *name,
+                       const UserPerm& perms)
 {
   Mutex::Locker lock(client_lock);
   ldout(cct, 3) << "lookup_hash enter(" << ino << ", #" << dirino << "/" << name << ") = " << dendl;
@@ -7591,7 +7592,6 @@ int Client::lookup_hash(inodeno_t ino, inodeno_t dirino, const char *name)
   path2.push_dentry(string(f));
   req->set_filepath2(path2);
 
-  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_hash exit(" << ino << ", #" << dirino << "/" << name << ") = " << r << dendl;
index f42d5244bf25693f84cbf63dda23604d589f769e..96dda3d30af2801a318790fc3d5ce0c828f86a6e 100644 (file)
@@ -1121,7 +1121,8 @@ public:
   int mknod(const char *path, mode_t mode, dev_t rdev=0);
   int open(const char *path, int flags, mode_t mode=0);
   int open(const char *path, int flags, mode_t mode, int stripe_unit, int stripe_count, int object_size, const char *data_pool);
-  int lookup_hash(inodeno_t ino, inodeno_t dirino, const char *name);
+  int lookup_hash(inodeno_t ino, inodeno_t dirino, const char *name,
+                 const UserPerm& perms);
   int lookup_ino(inodeno_t ino, Inode **inode=NULL);
   int lookup_parent(Inode *in, Inode **parent=NULL);
   int lookup_name(Inode *in, Inode *parent);
index 7a7dacfb5eda64d0136a604e878f21a38244364c..434418193de5008d47ae55196f10d403a2654981 100644 (file)
@@ -877,7 +877,7 @@ int SyntheticClient::run()
        sscanf(diname.c_str(), "%llx", (long long unsigned*)&dirino.val);
        string name = get_sarg(0);
        if (run_me()) {
-         lookup_hash(ino, dirino, name.c_str());
+         lookup_hash(ino, dirino, name.c_str(), perms);
        }
       }
       break;
@@ -3336,9 +3336,10 @@ void SyntheticClient::import_find(const char *base, const char *find, bool data)
 }
 
 
-int SyntheticClient::lookup_hash(inodeno_t ino, inodeno_t dirino, const char *name)
+int SyntheticClient::lookup_hash(inodeno_t ino, inodeno_t dirino,
+                                const char *name, const UserPerm& perms)
 {
-  int r = client->lookup_hash(ino, dirino, name);
+  int r = client->lookup_hash(ino, dirino, name, perms);
   dout(0) << "lookup_hash(" << ino << ", #" << dirino << "/" << name << ") = " << r << dendl;
   return r;
 }
index b4d3210fcf59de7b027da04af531ad5f6ac21f74..dadbbd08df74bfbbd50eaa75cc9c053ecf7be41c 100644 (file)
@@ -265,7 +265,8 @@ class SyntheticClient {
 
   void import_find(const char *basedir, const char *find, bool writedata);
 
-  int lookup_hash(inodeno_t ino, inodeno_t dirino, const char *name);
+  int lookup_hash(inodeno_t ino, inodeno_t dirino, const char *name,
+                 const UserPerm& perms);
   int lookup_ino(inodeno_t ino);
 
   int chunk_file(string &filename);