]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
client: privatize some class members
authorPatrick Donnelly <pdonnell@redhat.com>
Sun, 5 Aug 2018 05:06:59 +0000 (22:06 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Sun, 5 Aug 2018 05:06:59 +0000 (22:06 -0700)
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/client/Client.cc
src/client/Client.h

index 102667b4fa17510ea75bdab14d80ecd08030f2dc..e0fb5ee52076e8615f3ff49aa34d16e3ec196572 100644 (file)
@@ -230,18 +230,18 @@ vinodeno_t Client::map_faked_ino(ino_t ino)
 
 Client::Client(Messenger *m, MonClient *mc, Objecter *objecter_)
   : Dispatcher(m->cct),
-    m_command_hook(this),
     timer(m->cct, client_lock),
+    client_lock("Client::client_lock"),
+    messenger(m),
+    monclient(mc),
+    objecter(objecter_),
+    whoami(mc->get_global_id()),
     async_ino_invalidator(m->cct),
     async_dentry_invalidator(m->cct),
     interrupt_finisher(m->cct),
     remount_finisher(m->cct),
     objecter_finisher(m->cct),
-    client_lock("Client::client_lock"),
-    messenger(m),
-    monclient(mc),
-    objecter(objecter_),
-    whoami(mc->get_global_id())
+    m_command_hook(this)
 {
   _reset_faked_inos();
 
@@ -14227,7 +14227,7 @@ int StandaloneClient::init()
   objecter->init();
 
   client_lock.Lock();
-  assert(!initialized);
+  assert(!is_initialized());
 
   messenger->add_dispatcher_tail(objecter);
   messenger->add_dispatcher_tail(this);
index 6dc263e7b8b7e762649643bc40e355e42d0222ff..55643e959687f1891ceb47b992204994656267e9 100644 (file)
@@ -743,30 +743,9 @@ public:
 
   xlist<Inode*> &get_dirty_list() { return dirty_list; }
 
-  client_switch_interrupt_callback_t switch_interrupt_cb = nullptr;
-  client_remount_callback_t remount_cb = nullptr;
-  client_ino_callback_t ino_invalidate_cb = nullptr;
-  client_dentry_callback_t dentry_invalidate_cb = nullptr;
-  client_umask_callback_t umask_cb = nullptr;
-  void *callback_handle = nullptr;
-  bool can_invalidate_dentries = false;
-
-  CommandHook m_command_hook;
-
   SafeTimer timer;
 
-  Finisher async_ino_invalidator;
-  Finisher async_dentry_invalidator;
-  Finisher interrupt_finisher;
-  Finisher remount_finisher;
-  Finisher objecter_finisher;
-
-  Context *tick_event = nullptr;
-  utime_t last_cap_renew;
-
   std::unique_ptr<PerfCounters> logger;
-
-  // cluster descriptors
   std::unique_ptr<MDSMap> mdsmap;
 
 
@@ -775,6 +754,9 @@ protected:
   static const unsigned CHECK_CAPS_NODELAY = 0x1;
   static const unsigned CHECK_CAPS_SYNCHRONOUS = 0x2;
 
+
+  bool is_initialized() const { return initialized; }
+
   void check_caps(Inode *in, unsigned flags);
 
   void set_cap_epoch_barrier(epoch_t e);
@@ -974,90 +956,20 @@ protected:
   Inode*                 root_ancestor = nullptr;
   LRU                    lru;    // lru list of Dentry's in our local metadata cache.
 
-  // dirty_list keeps all the dirty inodes before flushing.
-  xlist<Inode*> delayed_list, dirty_list;
-  int num_flushing_caps = 0;
-  ceph::unordered_map<inodeno_t,SnapRealm*> snap_realms;
-  std::map<std::string, std::string> metadata;
-
-  // trace generation
-  ofstream traceout;
-
-  Cond mount_cond, sync_cond;
-
-  std::map<std::pair<int64_t,std::string>, int> pool_perms;
-  list<Cond*> waiting_for_pool_perm;
-
   InodeRef cwd;
 
-  // mds requests
-  ceph_tid_t last_tid = 0;
-  ceph_tid_t oldest_tid = 0; // oldest incomplete mds request, excluding setfilelock requests
-  map<ceph_tid_t, MetaRequest*> mds_requests;
-
-  // cap flushing
-  ceph_tid_t last_flush_tid = 1;
-
-  // file handles, etc.
-  interval_set<int> free_fd_set;  // unused fds
-  ceph::unordered_map<int, Fh*> fd_map;
-  set<Fh*> ll_unclosed_fh_set;
-  ceph::unordered_set<dir_result_t*> opened_dirs;
-  
-  bool   initialized = false;
-  bool   mounted = false;
-  bool   unmounting = false;
-  bool   blacklisted = false;
-
-  // When an MDS has sent us a REJECT, remember that and don't
-  // contact it again.  Remember which inst rejected us, so that
-  // when we talk to another inst with the same rank we can
-  // try again.
-  std::map<mds_rank_t, entity_addrvec_t> rejected_by_mds;
-
-  int local_osd = -ENXIO;
-  epoch_t local_osd_epoch = 0;
-
-  int unsafe_sync_write = 0;
-
   std::unique_ptr<Filer>             filer;
   std::unique_ptr<ObjectCacher>      objectcacher;
   std::unique_ptr<WritebackHandler>  writeback_handler;
 
-  ceph::unordered_map<vinodeno_t, Inode*> inode_map;
-  ceph::unordered_map<ino_t, vinodeno_t> faked_ino_map;
-  interval_set<ino_t> free_faked_inos;
-  ino_t last_used_faked_ino;
-
   Messenger *messenger;
   MonClient *monclient;
   Objecter  *objecter;
 
   client_t whoami;
 
-  int user_id, group_id;
-  int acl_type = NO_ACL;
-
-  epoch_t cap_epoch_barrier = 0;
-
-  // mds sessions
-  map<mds_rank_t, MetaSession> mds_sessions;  // mds -> push seq
-  list<Cond*> waiting_for_mdsmap;
-
-  // FSMap, for when using mds_command
-  list<Cond*> waiting_for_fsmap;
-  std::unique_ptr<FSMap> fsmap;
-  std::unique_ptr<FSMapUser> fsmap_user;
-
-  // MDS command state
-  CommandTable<MDSCommandOp> command_table;
-
-  bool _use_faked_inos;
 
 private:
-  /* Flags for VXattr */
-  static const unsigned VXATTR_RSTAT = 0x1;
-
   struct C_Readahead : public Context {
     C_Readahead(Client *c, Fh *f);
     ~C_Readahead() override;
@@ -1090,6 +1002,15 @@ private:
     MAY_READ = 4,
   };
 
+
+  /* Flags for VXattr */
+  static const unsigned VXATTR_RSTAT = 0x1;
+
+  static const VXattr _dir_vxattrs[];
+  static const VXattr _file_vxattrs[];
+
+
+
   void fill_dirent(struct dirent *de, const char *name, int type, uint64_t ino, loff_t next_off);
 
   int _opendir(Inode *in, dir_result_t **dirpp, const UserPerm& perms);
@@ -1262,12 +1183,97 @@ private:
   int _lookup_ino(inodeno_t ino, const UserPerm& perms, Inode **inode=NULL);
   bool _ll_forget(Inode *in, int count);
 
-  static const VXattr _dir_vxattrs[];
-  static const VXattr _file_vxattrs[];
 
   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;
+  client_ino_callback_t ino_invalidate_cb = nullptr;
+  client_dentry_callback_t dentry_invalidate_cb = nullptr;
+  client_umask_callback_t umask_cb = nullptr;
+  void *callback_handle = nullptr;
+  bool can_invalidate_dentries = false;
+
+  Finisher async_ino_invalidator;
+  Finisher async_dentry_invalidator;
+  Finisher interrupt_finisher;
+  Finisher remount_finisher;
+  Finisher objecter_finisher;
+
+  Context *tick_event = nullptr;
+  utime_t last_cap_renew;
+
+  CommandHook m_command_hook;
+
+  int user_id, group_id;
+  int acl_type = NO_ACL;
+
+  epoch_t cap_epoch_barrier = 0;
+
+  // mds sessions
+  map<mds_rank_t, MetaSession> mds_sessions;  // mds -> push seq
+  list<Cond*> waiting_for_mdsmap;
+
+  // FSMap, for when using mds_command
+  list<Cond*> waiting_for_fsmap;
+  std::unique_ptr<FSMap> fsmap;
+  std::unique_ptr<FSMapUser> fsmap_user;
+
+  // MDS command state
+  CommandTable<MDSCommandOp> command_table;
+
+  bool _use_faked_inos;
+
+  // file handles, etc.
+  interval_set<int> free_fd_set;  // unused fds
+  ceph::unordered_map<int, Fh*> fd_map;
+  set<Fh*> ll_unclosed_fh_set;
+  ceph::unordered_set<dir_result_t*> opened_dirs;
+
+  bool   initialized = false;
+  bool   mounted = false;
+  bool   unmounting = false;
+  bool   blacklisted = false;
+
+  ceph::unordered_map<vinodeno_t, Inode*> inode_map;
+  ceph::unordered_map<ino_t, vinodeno_t> faked_ino_map;
+  interval_set<ino_t> free_faked_inos;
+  ino_t last_used_faked_ino;
+
+  // When an MDS has sent us a REJECT, remember that and don't
+  // contact it again.  Remember which inst rejected us, so that
+  // when we talk to another inst with the same rank we can
+  // try again.
+  std::map<mds_rank_t, entity_addrvec_t> rejected_by_mds;
+
+  int local_osd = -ENXIO;
+  epoch_t local_osd_epoch = 0;
+
+  int unsafe_sync_write = 0;
+
+  // mds requests
+  ceph_tid_t last_tid = 0;
+  ceph_tid_t oldest_tid = 0; // oldest incomplete mds request, excluding setfilelock requests
+  map<ceph_tid_t, MetaRequest*> mds_requests;
+
+  // cap flushing
+  ceph_tid_t last_flush_tid = 1;
+
+  // dirty_list keeps all the dirty inodes before flushing.
+  xlist<Inode*> delayed_list, dirty_list;
+  int num_flushing_caps = 0;
+  ceph::unordered_map<inodeno_t,SnapRealm*> snap_realms;
+  std::map<std::string, std::string> metadata;
+
+  // trace generation
+  ofstream traceout;
+
+  Cond mount_cond, sync_cond;
+
+  std::map<std::pair<int64_t,std::string>, int> pool_perms;
+  list<Cond*> waiting_for_pool_perm;
 };
 
 /**