]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
erasure-code: do not hide overloaded ErasureCode::parse() 5149/head
authorKefu Chai <kchai@redhat.com>
Mon, 6 Jul 2015 04:53:59 +0000 (12:53 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 6 Jul 2015 09:29:19 +0000 (17:29 +0800)
* this change fixes the warning from clang:
  ErasureCodeJerasure::parse' hides overloaded virtual function
  [-Woverloaded-virtual]
* some erasure codecs' ErasureCode::parse() rewrites the profile
  using the default values when parsing it if the corresponding
  items are not specified. and we don't call ErasureCode::parse()
  via its children's references. so no need to make it a virtual
  function.
* and ErasureCode::parse() is used as a helper function by its
  children, so make it `protected`
* and parse() in ErasureCode's children is but a helper function
  called by ctor, descendants' parse() and init(). so make them
  protected or private accordingly.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/erasure-code/ErasureCode.h
src/erasure-code/isa/ErasureCodeIsa.h
src/erasure-code/jerasure/ErasureCodeJerasure.h
src/erasure-code/shec/ErasureCodeShec.h

index 294f538e5de4a5966b7dcdaea1c334307388c2c7..bad6d8140f37c04d5497766de693d92883998b2d 100644 (file)
@@ -78,9 +78,6 @@ namespace ceph {
                               const map<int, bufferlist> &chunks,
                               map<int, bufferlist> *decoded);
 
-    virtual int parse(const ErasureCodeProfile &profile,
-                     ostream *ss);
-
     virtual const vector<int> &get_chunk_mapping() const;
 
     int to_mapping(const ErasureCodeProfile &profile,
@@ -107,6 +104,10 @@ namespace ceph {
     virtual int decode_concat(const map<int, bufferlist> &chunks,
                              bufferlist *decoded);
 
+  protected:
+    int parse(const ErasureCodeProfile &profile,
+             ostream *ss);
+
   private:
     int chunk_index(unsigned int i) const;
   };
index e7c6525b3211220cc54fd65727bc0cc4895bee49..63aa5f34036043ad0fdceab2fc6ccefed4032b53 100644 (file)
@@ -108,11 +108,11 @@ public:
 
   virtual unsigned get_alignment() const = 0;
 
-  virtual int parse(ErasureCodeProfile &profile,
-                    ostream *ss) = 0;
-
   virtual void prepare() = 0;
 
+ private:
+  virtual int parse(ErasureCodeProfile &profile,
+                    ostream *ss) = 0;
 };
 
 // -----------------------------------------------------------------------------
@@ -157,12 +157,11 @@ public:
 
   virtual unsigned get_alignment() const;
 
-  virtual int parse(ErasureCodeProfile &profile,
-                    ostream *ss);
-
   virtual void prepare();
 
-
+ private:
+  virtual int parse(ErasureCodeProfile &profile,
+                    ostream *ss);
 };
 
 #endif
index 51c319ebcf26d62b90412159fc86514f2ad7aa8b..df60dac6a35f15963070ffe58692daae3d3e53b4 100644 (file)
@@ -51,8 +51,6 @@ public:
 
   virtual ~ErasureCodeJerasure() {}
   
-  virtual int parse(ErasureCodeProfile &profile, ostream *ss);
-
   virtual int create_ruleset(const string &name,
                             CrushWrapper &crush,
                             ostream *ss) const;
@@ -86,6 +84,8 @@ public:
   virtual unsigned get_alignment() const = 0;
   virtual void prepare() = 0;
   static bool is_prime(int value);
+protected:
+  virtual int parse(ErasureCodeProfile &profile, ostream *ss);
 };
 
 class ErasureCodeJerasureReedSolomonVandermonde : public ErasureCodeJerasure {
@@ -113,8 +113,9 @@ public:
                                char **coding,
                                int blocksize);
   virtual unsigned get_alignment() const;
-  virtual int parse(ErasureCodeProfile &profile, ostream *ss);
   virtual void prepare();
+private:
+  virtual int parse(ErasureCodeProfile &profile, ostream *ss);
 };
 
 class ErasureCodeJerasureReedSolomonRAID6 : public ErasureCodeJerasure {
@@ -141,8 +142,9 @@ public:
                                char **coding,
                                int blocksize);
   virtual unsigned get_alignment() const;
-  virtual int parse(ErasureCodeProfile &profile, ostream *ss);
   virtual void prepare();
+private:
+  virtual int parse(ErasureCodeProfile &profile, ostream *ss);
 };
 
 #define DEFAULT_PACKETSIZE "2048"
@@ -177,8 +179,9 @@ public:
                                char **coding,
                                int blocksize);
   virtual unsigned get_alignment() const;
-  virtual int parse(ErasureCodeProfile &profile, ostream *ss);
   void prepare_schedule(int *matrix);
+private:
+  virtual int parse(ErasureCodeProfile &profile, ostream *ss);
 };
 
 class ErasureCodeJerasureCauchyOrig : public ErasureCodeJerasureCauchy {
@@ -230,8 +233,9 @@ public:
   virtual bool check_packetsize(ostream *ss) const;
   virtual int revert_to_default(ErasureCodeProfile &profile,
                                ostream *ss);
-  virtual int parse(ErasureCodeProfile &profile, ostream *ss);
   virtual void prepare();
+private:
+  virtual int parse(ErasureCodeProfile &profile, ostream *ss);
 };
 
 class ErasureCodeJerasureBlaumRoth : public ErasureCodeJerasureLiberation {
@@ -255,8 +259,9 @@ public:
     DEFAULT_W = "8";
   }
 
-  virtual int parse(ErasureCodeProfile &profile, ostream *ss);
   virtual void prepare();
+private:
+  virtual int parse(ErasureCodeProfile &profile, ostream *ss);
 };
 
 #endif
index 672e0fa44fad1333d8d633ab4879f5973caf149f..a943f0859725f2f9a0fdf5dcf1a7c6277c43ef2c 100644 (file)
@@ -115,8 +115,9 @@ public:
                          char **coding,
                          int blocksize) = 0;
   virtual unsigned get_alignment() const = 0;
-  virtual int parse(const ErasureCodeProfile &profile) = 0;
   virtual void prepare() = 0;
+private:
+  virtual int parse(const ErasureCodeProfile &profile) = 0;
 };
 
 class ErasureCodeShecReedSolomonVandermonde : public ErasureCodeShec {
@@ -139,8 +140,9 @@ public:
                          char **coding,
                          int blocksize);
   virtual unsigned get_alignment() const;
-  virtual int parse(const ErasureCodeProfile &profile);
   virtual void prepare();
+private:
+  virtual int parse(const ErasureCodeProfile &profile);
 };
 
 #endif