From: David Disseldorp Date: Mon, 15 Apr 2019 18:03:02 +0000 (+0200) Subject: client: remove unused vxattr length helpers X-Git-Tag: v14.2.2~95^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2544582156a58a4cecd8e08c60003b72b219711f;p=ceph.git client: remove unused vxattr length helpers _listxattr() now calculates the length of vxattrs dynamically, so these helpers, which incorrectly ignore vxattr.exists_cb(), can be removed. Signed-off-by: David Disseldorp (cherry picked from commit 9eab573b0a30fe1965d5d4031881128377f64c7d) --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 25c98408c00..92a53f58942 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -276,9 +276,6 @@ Client::Client(Messenger *m, MonClient *mc, Objecter *objecter_) { _reset_faked_inos(); - _dir_vxattrs_name_size = _vxattrs_calcu_name_size(_dir_vxattrs); - _file_vxattrs_name_size = _vxattrs_calcu_name_size(_file_vxattrs); - user_id = cct->_conf->client_mount_uid; group_id = cct->_conf->client_mount_gid; @@ -11952,17 +11949,6 @@ const Client::VXattr *Client::_match_vxattr(Inode *in, const char *name) return NULL; } -size_t Client::_vxattrs_calcu_name_size(const VXattr *vxattr) -{ - size_t len = 0; - while (!vxattr->name.empty()) { - if (!vxattr->hidden) - len += vxattr->name.length() + 1; - vxattr++; - } - return len; -} - int Client::ll_readlink(Inode *in, char *buf, size_t buflen, const UserPerm& perms) { std::lock_guard lock(client_lock); diff --git a/src/client/Client.h b/src/client/Client.h index 952579f0916..a671e147cff 100644 --- a/src/client/Client.h +++ b/src/client/Client.h @@ -1168,19 +1168,9 @@ private: bool _vxattrcb_snap_btime_exists(Inode *in); size_t _vxattrcb_snap_btime(Inode *in, char *val, size_t size); - size_t _vxattrs_calcu_name_size(const VXattr *vxattrs); - static const VXattr *_get_vxattrs(Inode *in); static const VXattr *_match_vxattr(Inode *in, const char *name); - size_t _vxattrs_name_size(const VXattr *vxattrs) { - if (vxattrs == _dir_vxattrs) - return _dir_vxattrs_name_size; - else if (vxattrs == _file_vxattrs) - return _file_vxattrs_name_size; - return 0; - } - int _do_filelock(Inode *in, Fh *fh, int lock_type, int op, int sleep, struct flock *fl, uint64_t owner, bool removing=false); int _interrupt_filelock(MetaRequest *req); @@ -1203,8 +1193,6 @@ private: uint32_t deleg_timeout = 0; - size_t _file_vxattrs_name_size; - size_t _dir_vxattrs_name_size; client_switch_interrupt_callback_t switch_interrupt_cb = nullptr; client_remount_callback_t remount_cb = nullptr;