From: Jeff Layton Date: Mon, 29 Aug 2016 11:16:38 +0000 (-0400) Subject: ceph: break up ll_getattr into two functions X-Git-Tag: v11.0.1~326^2~29 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=34c6d592a0d2325d46a2829effdad6f7429a656e;p=ceph.git ceph: break up ll_getattr into two functions ...in preparation for adding a ll_getattrx. Signed-off-by: Jeff Layton --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 47eef726e54..f8cdce0e870 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -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; } diff --git a/src/client/Client.h b/src/client/Client.h index b30ddee9789..1a7cefd2257 100644 --- a/src/client/Client.h +++ b/src/client/Client.h @@ -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();