From: Patrick Donnelly Date: Mon, 10 Oct 2016 22:14:18 +0000 (-0400) Subject: mds: group filesystem access methods X-Git-Tag: v10.2.6~36^2~6^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8a028b07d40b3e5f483de3fd896bf39e57f7b51f;p=ceph.git mds: group filesystem access methods Signed-off-by: Patrick Donnelly (cherry picked from commit 59de9919a0e8388c1b8e7968187de6b1b6492425) --- diff --git a/src/mds/FSMap.h b/src/mds/FSMap.h index 46614f69809b..cbeb7b37b740 100644 --- a/src/mds/FSMap.h +++ b/src/mds/FSMap.h @@ -375,15 +375,22 @@ public: }); } - size_t filesystem_count() const {return filesystems.size();} - bool filesystem_exists(fs_cluster_id_t fscid) const - {return filesystems.count(fscid) > 0;} - epoch_t get_epoch() const { return epoch; } void inc_epoch() { epoch++; } + size_t filesystem_count() const {return filesystems.size();} + bool filesystem_exists(fs_cluster_id_t fscid) const {return filesystems.count(fscid) > 0;} std::shared_ptr get_filesystem(fs_cluster_id_t fscid) const {return std::const_pointer_cast(filesystems.at(fscid));} std::shared_ptr get_filesystem(void) const {return std::const_pointer_cast(filesystems.begin()->second);} + std::shared_ptr get_filesystem(const std::string &name) const + { + for (auto &i : filesystems) { + if (i.second->mds_map.fs_name == name) { + return std::const_pointer_cast(i.second); + } + } + return nullptr; + } int parse_filesystem( std::string const &ns_str, @@ -418,17 +425,6 @@ public: void get_health(list >& summary, list > *detail) const; - std::shared_ptr get_filesystem(const std::string &name) const - { - for (auto &i : filesystems) { - if (i.second->mds_map.fs_name == name) { - return i.second; - } - } - - return nullptr; - } - /** * Assert that the FSMap, Filesystem, MDSMap, mds_info_t relations are * all self-consistent.