]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PGBackend/ReplicatedBackend: factor out logical to ondisk size mapping
authorSamuel Just <sam.just@inktank.com>
Sat, 8 Feb 2014 22:04:14 +0000 (14:04 -0800)
committerSamuel Just <sam.just@inktank.com>
Tue, 18 Feb 2014 04:12:15 +0000 (20:12 -0800)
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/PGBackend.cc
src/osd/PGBackend.h
src/osd/ReplicatedBackend.h

index 80fca2a5cdce044cd1971e7b8817cd9de0ca5102..1b594f2a1c7c57c270c133b766a5782d5023f0f8 100644 (file)
@@ -416,6 +416,7 @@ map<pg_shard_t, ScrubMap *>::const_iterator
               << dendl;
       continue;
     }
+
     bufferlist bl;
     bl.push_back(k->second);
     object_info_t oi;
@@ -430,7 +431,8 @@ map<pg_shard_t, ScrubMap *>::const_iterator
       // invalid object info, probably corrupt
       continue;
     }
-    if (oi.size != i->second.size) {
+    uint64_t correct_size = be_get_ondisk_size(oi.size);
+    if (correct_size != i->second.size) {
       // invalid size, probably corrupt
       dout(10) << __func__ << ": rejecting osd " << j->first
               << " for obj " << obj
index aecd3ae078b444091f4fb3c26f02e4d3cde7754e..9bc783a2fc85bba2bad030aebb0633b0d7c64fdf 100644 (file)
      const vector<int> &acting,
      ostream &errorstream);
 
+   virtual uint64_t be_get_ondisk_size(
+     uint64_t logical_size) { assert(0); return 0; }
    virtual void be_deep_scrub(
      const hobject_t &poid,
      ScrubMap::object &o,
index 87022bb4632f3a35cdf1896b5a0044637c74ceb6..0d29aed98f70ec2d561ac322d7f87ca8aa3d6ca8 100644 (file)
@@ -407,6 +407,7 @@ private:
     const hobject_t &obj,
     ScrubMap::object &o,
     ThreadPool::TPHandle &handle);
+  uint64_t be_get_ondisk_size(uint64_t logical_size) { return logical_size; }
 };
 
 #endif