]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/PrimaryLogPG: remove unused "parent" pgls-filter
authorKefu Chai <kchai@redhat.com>
Thu, 15 Aug 2019 02:34:19 +0000 (10:34 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 15 Aug 2019 02:38:35 +0000 (10:38 +0800)
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 <kchai@redhat.com>
src/osd/PrimaryLogPG.cc

index 23f6dc5221154437eba00f8cfb36c65d3a210d89..0d4787cd2a8a1df7f436bdc1f95e96e5c3594d25 100644 (file)
@@ -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 &params) 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<inode_backpointer_t>::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(".");