]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: kill find_entry() method of pg_log_t
authorxie xingguo <xie.xingguo@zte.com.cn>
Wed, 13 Apr 2016 07:02:58 +0000 (15:02 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Sat, 23 Apr 2016 01:11:25 +0000 (09:11 +0800)
 1. it is never used by anyone.
 2. the implementation of this method is a little bit problematic, e.g.,
    we don't do sanity check against traversing cross the list boundary.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/osd/osd_types.h

index 2dd16b012cad686f2b589f54b6aab4c458b2b7ca..72d11b62dfd5eadbe7c9de179c2974e391579513 100644 (file)
@@ -2664,42 +2664,6 @@ struct pg_log_t {
     return head.version - tail.version;
   }
 
-  list<pg_log_entry_t>::const_iterator find_entry(eversion_t v) const {
-    int fromhead = head.version - v.version;
-    int fromtail = v.version - tail.version;
-    list<pg_log_entry_t>::const_iterator p;
-    if (fromhead < fromtail) {
-      p = log.end();
-      --p;
-      while (p->version > v)
-       --p;
-      return p;
-    } else {
-      p = log.begin();
-      while (p->version < v)
-       ++p;
-      return p;
-    }      
-  }
-
-  list<pg_log_entry_t>::iterator find_entry(eversion_t v) {
-    int fromhead = head.version - v.version;
-    int fromtail = v.version - tail.version;
-    list<pg_log_entry_t>::iterator p;
-    if (fromhead < fromtail) {
-      p = log.end();
-      --p;
-      while (p->version > v)
-       --p;
-      return p;
-    } else {
-      p = log.begin();
-      while (p->version < v)
-       ++p;
-      return p;
-    }      
-  }
-
   static void filter_log(spg_t import_pgid, const OSDMap &curmap,
     const string &hit_set_namespace, const pg_log_t &in,
     pg_log_t &out, pg_log_t &reject);
@@ -2725,7 +2689,7 @@ struct pg_log_t {
    * copy up to N entries
    *
    * @param other source log
-   * @param max max number of entreis to copy
+   * @param max max number of entries to copy
    */
   void copy_up_to(const pg_log_t &other, int max);