From: Patrick Donnelly Date: Sun, 5 Aug 2018 05:06:59 +0000 (-0700) Subject: client: privatize some class members X-Git-Tag: v14.0.1~520^2~5^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=62623dae7fe16d872a598843a901dbce087a6905;p=ceph-ci.git client: privatize some class members Signed-off-by: Patrick Donnelly --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 102667b4fa1..e0fb5ee5207 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -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); diff --git a/src/client/Client.h b/src/client/Client.h index 6dc263e7b8b..55643e95968 100644 --- a/src/client/Client.h +++ b/src/client/Client.h @@ -743,30 +743,9 @@ public: xlist &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 logger; - - // cluster descriptors std::unique_ptr 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 delayed_list, dirty_list; - int num_flushing_caps = 0; - ceph::unordered_map snap_realms; - std::map metadata; - - // trace generation - ofstream traceout; - - Cond mount_cond, sync_cond; - - std::map, int> pool_perms; - list 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 mds_requests; - - // cap flushing - ceph_tid_t last_flush_tid = 1; - - // file handles, etc. - interval_set free_fd_set; // unused fds - ceph::unordered_map fd_map; - set ll_unclosed_fh_set; - ceph::unordered_set 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 rejected_by_mds; - - int local_osd = -ENXIO; - epoch_t local_osd_epoch = 0; - - int unsafe_sync_write = 0; - std::unique_ptr filer; std::unique_ptr objectcacher; std::unique_ptr writeback_handler; - ceph::unordered_map inode_map; - ceph::unordered_map faked_ino_map; - interval_set 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_sessions; // mds -> push seq - list waiting_for_mdsmap; - - // FSMap, for when using mds_command - list waiting_for_fsmap; - std::unique_ptr fsmap; - std::unique_ptr fsmap_user; - - // MDS command state - CommandTable 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_sessions; // mds -> push seq + list waiting_for_mdsmap; + + // FSMap, for when using mds_command + list waiting_for_fsmap; + std::unique_ptr fsmap; + std::unique_ptr fsmap_user; + + // MDS command state + CommandTable command_table; + + bool _use_faked_inos; + + // file handles, etc. + interval_set free_fd_set; // unused fds + ceph::unordered_map fd_map; + set ll_unclosed_fh_set; + ceph::unordered_set opened_dirs; + + bool initialized = false; + bool mounted = false; + bool unmounting = false; + bool blacklisted = false; + + ceph::unordered_map inode_map; + ceph::unordered_map faked_ino_map; + interval_set 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 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 mds_requests; + + // cap flushing + ceph_tid_t last_flush_tid = 1; + + // dirty_list keeps all the dirty inodes before flushing. + xlist delayed_list, dirty_list; + int num_flushing_caps = 0; + ceph::unordered_map snap_realms; + std::map metadata; + + // trace generation + ofstream traceout; + + Cond mount_cond, sync_cond; + + std::map, int> pool_perms; + list waiting_for_pool_perm; }; /**