From 778409caed30664fad7713b3302306fd9a9fdf6b Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 15 Aug 2019 10:34:19 +0800 Subject: [PATCH] osd/PrimaryLogPG: remove unused "parent" pgls-filter it's implemented using `PGLSParentFilter`, and this filter has never been used. the only possible user would be `cephfs-data-scan`, but it's using `PGLSCephFSFilter` which is referened with "cephfs.inode_tag". Signed-off-by: Kefu Chai --- src/osd/PrimaryLogPG.cc | 49 +---------------------------------------- 1 file changed, 1 insertion(+), 48 deletions(-) diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 23f6dc52211..0d4787cd2a8 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -780,51 +780,6 @@ public: bufferlist& outdata) override; }; -class PGLSParentFilter : public PGLSFilter { - inodeno_t parent_ino; -public: - CephContext* cct; - explicit PGLSParentFilter(CephContext* cct) : cct(cct) { - xattr = "_parent"; - } - int init(bufferlist::const_iterator ¶ms) override - { - try { - decode(parent_ino, params); - } catch (buffer::error &e) { - return -EINVAL; - } - generic_dout(0) << "parent_ino=" << parent_ino << dendl; - - return 0; - } - ~PGLSParentFilter() override {} - bool filter(const hobject_t &obj, bufferlist& xattr_data, - bufferlist& outdata) override; -}; - -bool PGLSParentFilter::filter(const hobject_t &obj, - bufferlist& xattr_data, bufferlist& outdata) -{ - auto iter = xattr_data.cbegin(); - inode_backtrace_t bt; - - generic_dout(0) << "PGLSParentFilter::filter" << dendl; - - decode(bt, iter); - - vector::iterator vi; - for (vi = bt.ancestors.begin(); vi != bt.ancestors.end(); ++vi) { - generic_dout(0) << "vi->dirino=" << vi->dirino << " parent_ino=" << parent_ino << dendl; - if (vi->dirino == parent_ino) { - encode(*vi, outdata); - return true; - } - } - - return false; -} - bool PGLSPlainFilter::filter(const hobject_t &obj, bufferlist& xattr_data, bufferlist& outdata) { @@ -870,9 +825,7 @@ int PrimaryLogPG::get_pgls_filter(bufferlist::const_iterator& iter, PGLSFilter * return -EINVAL; } - if (type.compare("parent") == 0) { - filter = new PGLSParentFilter(cct); - } else if (type.compare("plain") == 0) { + if (type.compare("plain") == 0) { filter = new PGLSPlainFilter(); } else { std::size_t dot = type.find("."); -- 2.39.5