]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: narrow scope of 'pos' 11377/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Mon, 10 Oct 2016 11:39:18 +0000 (19:39 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Mon, 10 Oct 2016 11:39:18 +0000 (19:39 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/BlueStore.cc

index a2de50857dd42c0616a9b375abfbafefac325f35..72eaf41d36c42199582e23e70caa73af46b1852d 100644 (file)
@@ -1243,7 +1243,6 @@ ostream& operator<<(ostream& out, const BlueStore::Blob& b)
 
 void BlueStore::Blob::discard_unallocated()
 {
-  size_t pos = 0;
   if (blob.is_compressed()) {
     bool discard = false;
     bool all_invalid = true;
@@ -1260,6 +1259,7 @@ void BlueStore::Blob::discard_unallocated()
       shared_blob->bc.discard(0, blob.get_compressed_payload_original_length());
     }
   } else {
+    size_t pos = 0;
     for (auto e : blob.extents) {
       if (!e.is_valid()) {
         shared_blob->bc.discard(pos, e.length);