]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph: break up ll_getattr into two functions
authorJeff Layton <jlayton@redhat.com>
Mon, 29 Aug 2016 11:16:38 +0000 (07:16 -0400)
committerJeff Layton <jlayton@redhat.com>
Mon, 29 Aug 2016 11:16:38 +0000 (07:16 -0400)
...in preparation for adding a ll_getattrx.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
src/client/Client.cc
src/client/Client.h

index 47eef726e549734569872f5f9a61c39d72ff86ab..f8cdce0e870390eb860da9583ac0a5c61153315b 100644 (file)
@@ -9679,24 +9679,29 @@ Inode *Client::ll_get_inode(vinodeno_t vino)
   return in;
 }
 
-int Client::ll_getattr(Inode *in, struct stat *attr, int uid, int gid)
+int Client::_ll_getattr(Inode *in, int uid, int gid)
 {
-  Mutex::Locker lock(client_lock);
-
   vinodeno_t vino = _get_vino(in);
 
   ldout(cct, 3) << "ll_getattr " << vino << dendl;
   tout(cct) << "ll_getattr" << std::endl;
   tout(cct) << vino.ino.val << std::endl;
 
-  int res;
   if (vino.snapid < CEPH_NOSNAP)
-    res = 0;
+    return 0;
   else
-    res = _getattr(in, CEPH_STAT_CAP_INODE_ALL, uid, gid);
+    return _getattr(in, CEPH_STAT_CAP_INODE_ALL, uid, gid);
+}
+
+int Client::ll_getattr(Inode *in, struct stat *attr, int uid, int gid)
+{
+  Mutex::Locker lock(client_lock);
+
+  int res = _ll_getattr(in, uid, gid);
+
   if (res == 0)
     fill_stat(in, attr);
-  ldout(cct, 3) << "ll_getattr " << vino << " = " << res << dendl;
+  ldout(cct, 3) << "ll_getattr " << _get_vino(in) << " = " << res << dendl;
   return res;
 }
 
index b30ddee978939d22b6c3ea54720d2c4695d9840d..1a7cefd2257e531975dc55791eb54b18663224e9 100644 (file)
@@ -908,6 +908,8 @@ private:
 
   mds_rank_t _get_random_up_mds() const;
 
+  int _ll_getattr(Inode *in, int uid, int gid);
+
 public:
   int mount(const std::string &mount_root, bool require_mds=false);
   void unmount();