]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
objclass, osd: dissect PGLSFilter into the osd_types.h header.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Mon, 12 Aug 2019 13:32:38 +0000 (15:32 +0200)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Sat, 24 Aug 2019 01:33:59 +0000 (03:33 +0200)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/cls/cephfs/cls_cephfs.cc
src/cls/hello/cls_hello.cc
src/crimson/osd/osd.cc
src/objclass/objclass.h
src/osd/PrimaryLogPG.cc
src/osd/osd_types.cc
src/osd/osd_types.h

index d05fee1d6ea7f6fc6db4ba50dfe5d29d89ef810a..7207a6b4b849debc5c5b81566ca95d47e17bcb6e 100644 (file)
@@ -17,6 +17,7 @@
 #include <errno.h>
 
 #include "objclass/objclass.h"
+#include "osd/osd_types.h"
 
 #include "cls_cephfs.h"
 
index ac3beb3b6871addf7df0695f1d9513deec89303d..c2b71d270846d7413875abd6e6e7e0ee454e7a3d 100644 (file)
@@ -35,6 +35,7 @@
 #include <cerrno>
 
 #include "objclass/objclass.h"
+#include "osd/osd_types.h"
 
 using ceph::bufferlist;
 using std::string;
index f243213810bdb1e51e10adeeb7ecf477a53873d2..e38bb9defd4a07aff2aaf1c7586adf6837682c03 100644 (file)
@@ -51,14 +51,6 @@ namespace {
 using ceph::common::local_conf;
 using ceph::os::FuturizedStore;
 
-PGLSFilter::PGLSFilter() : cct(nullptr)
-{
-}
-
-PGLSFilter::~PGLSFilter()
-{
-}
-
 namespace ceph::osd {
 
 OSD::OSD(int id, uint32_t nonce,
index ed8d2c5251464bb1b2206ed32f710fb4a4f9feb1..de43905e29fdc9aad57b8aa2acfafa990b18eade 100644 (file)
@@ -14,6 +14,7 @@
 #include "include/rados/objclass.h"
 
 struct obj_list_watch_response_t;
+class PGLSFilter;
 
 extern "C" {
 #endif
@@ -74,36 +75,6 @@ extern void class_fini(void);
 
 #ifdef __cplusplus
 }
-class PGLSFilter {
-  CephContext* cct;
-protected:
-  std::string xattr;
-public:
-  PGLSFilter();
-  virtual ~PGLSFilter();
-  virtual bool filter(const hobject_t &obj,
-                      const ceph::buffer::list& xattr_data) const = 0;
-
-  /**
-   * Arguments passed from the RADOS client.  Implementations must
-   * handle any encoding errors, and return an appropriate error code,
-   * or 0 on valid input.
-   */
-  virtual int init(ceph::buffer::list::const_iterator &params) = 0;
-
-  /**
-   * xattr key, or empty string.  If non-empty, this xattr will be fetched
-   * and the value passed into ::filter
-   */
-  virtual const std::string& get_xattr() const { return xattr; }
-
-  /**
-   * If true, objects without the named xattr (if xattr name is not empty)
-   * will be rejected without calling ::filter
-   */
-  virtual bool reject_empty_xattr() const { return true; }
-};
-
 // Classes expose a filter constructor that returns a subclass of PGLSFilter
 typedef PGLSFilter* (*cls_cxx_filter_factory_t)();
 
index a1be37f2d084e70e78ab11787b4a49c906528369..5eed61a8b2cb2ac4fc54a2f410d2786cca8b2ea2 100644 (file)
@@ -76,14 +76,6 @@ static ostream& _prefix(std::ostream *_dout, T *pg) {
 
 MEMPOOL_DEFINE_OBJECT_FACTORY(PrimaryLogPG, replicatedpg, osd);
 
-PGLSFilter::PGLSFilter() : cct(nullptr)
-{
-}
-
-PGLSFilter::~PGLSFilter()
-{
-}
-
 /**
  * The CopyCallback class defines an interface for completions to the
  * copy_start code. Users of the copy infrastructure must implement
index 37166a2386e4ab85888a5926a491bb7c40fa6928..f0311cc13a1994e3af0398926eab5bd764e209bf 100644 (file)
@@ -6692,3 +6692,11 @@ void init_pg_ondisk(
   encode(struct_v, values[string(infover_key)]);
   t.omap_setkeys(coll, pgmeta_oid, values);
 }
+
+PGLSFilter::PGLSFilter() : cct(nullptr)
+{
+}
+
+PGLSFilter::~PGLSFilter()
+{
+}
index 3755d14d5d1babcf482883aac5a24ffd72460729..23962c34dd4a9628906d60fb5bd3470bb20ed4fa 100644 (file)
@@ -6095,4 +6095,35 @@ struct omap_stat_t {
  int64_t omap_keys;
 };
 
+// filter for pg listings
+class PGLSFilter {
+  CephContext* cct;
+protected:
+  std::string xattr;
+public:
+  PGLSFilter();
+  virtual ~PGLSFilter();
+  virtual bool filter(const hobject_t &obj,
+                      const ceph::buffer::list& xattr_data) const = 0;
+
+  /**
+   * Arguments passed from the RADOS client.  Implementations must
+   * handle any encoding errors, and return an appropriate error code,
+   * or 0 on valid input.
+   */
+  virtual int init(ceph::buffer::list::const_iterator &params) = 0;
+
+  /**
+   * xattr key, or empty string.  If non-empty, this xattr will be fetched
+   * and the value passed into ::filter
+   */
+  virtual const std::string& get_xattr() const { return xattr; }
+
+  /**
+   * If true, objects without the named xattr (if xattr name is not empty)
+   * will be rejected without calling ::filter
+   */
+  virtual bool reject_empty_xattr() const { return true; }
+};
+
 #endif