]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: remove unused vxattr length helpers
authorDavid Disseldorp <ddiss@suse.de>
Mon, 15 Apr 2019 18:03:02 +0000 (20:03 +0200)
committerVicente Cheng <freeze.bilsted@gmail.com>
Wed, 1 May 2019 01:12:10 +0000 (01:12 +0000)
_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 <ddiss@suse.de>
(cherry picked from commit 9eab573b0a30fe1965d5d4031881128377f64c7d)

src/client/Client.cc
src/client/Client.h

index 25c98408c0088dc8e1c10596b2471c6a97d82a13..92a53f5894251d0ffc5cf42d0d8ddfa215fd6bb0 100644 (file)
@@ -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);
index 952579f0916a80713a06ee961064940dffb3ac6c..a671e147cff3c5122fe0c93ed6e258b5dfb490fc 100644 (file)
@@ -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;