]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore: drop COW_TAIL extent flag
authorSage Weil <sage@redhat.com>
Wed, 4 May 2016 18:11:52 +0000 (14:11 -0400)
committerSage Weil <sage@redhat.com>
Wed, 4 May 2016 18:11:52 +0000 (14:11 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc
src/os/bluestore/bluestore_types.cc
src/os/bluestore/bluestore_types.h

index 54258088b51e08895d9922b65204c0fa040a4d90..c81f40e5b1349cd5ee573e2ab5efac62b15a64b1 100644 (file)
@@ -5272,9 +5272,9 @@ int BlueStore::_do_allocate(
                  << cow_head_op->extent << dendl;
       }
       if (e.length == length && cow_tail_op) {
-        // we set the COW flag to indicate that all or part of this new extent
-        // will be copied from the previous allocation.
-        e.flags |= bluestore_extent_t::FLAG_COW_TAIL;
+        // we set cow_tail_extent to indicate that all or part of this
+        // new extent will be copied from the previous allocation.
+       *cow_tail_extent = e.offset;
         // extent.offset is the logical object offset
         assert(cow_tail_op->extent.offset >= offset);
         assert(cow_tail_op->extent.end() <= offset + length);
@@ -5506,7 +5506,7 @@ int BlueStore::_do_write(
       uint64_t end = ROUND_UP_TO(offset + length, block_size);
       if (end < bp->first + bp->second.length &&
          end <= o->onode.size &&
-         !bp->second.has_flag(bluestore_extent_t::FLAG_COW_TAIL)) {
+         cow_tail_extent != bp->second.offset) {
        uint64_t z_len = bp->first + bp->second.length - end;
        uint64_t x_off = end - bp->first;
        dout(20) << __func__ << " zero " << end << "~" << z_len
@@ -5525,7 +5525,6 @@ int BlueStore::_do_write(
                 << " x_off " << x_off << dendl;
        _do_overlay_trim(txc, o, offset, length);
        bdev->aio_write(bp->second.offset + x_off, bl, &txc->ioc, buffered);
-       bp->second.clear_flag(bluestore_extent_t::FLAG_COW_TAIL);
        ++bp;
        continue;
       }
@@ -5566,7 +5565,6 @@ int BlueStore::_do_write(
       dout(20) << __func__ << " past eof, padding out tail block" << dendl;
       _pad_zeros_tail(txc, o, &bl, offset, &length, block_size);
     }
-    bp->second.clear_flag(bluestore_extent_t::FLAG_COW_TAIL);
     op->extent.offset = bp->second.offset + offset - bp->first;
     op->extent.length = length;
     op->data = bl;
@@ -5587,18 +5585,6 @@ int BlueStore::_do_write(
     o->onode.size = orig_offset + orig_length;
   }
 
-  // make sure we didn't leave unwritten extents behind
-  for (map<uint64_t,bluestore_extent_t>::iterator p = o->onode.block_map.begin();
-       p != o->onode.block_map.end();
-       ++p) {
-    if (p->second.has_flag(bluestore_extent_t::FLAG_COW_TAIL)) {
-      derr << __func__ << " left behind a COW extent, out of sync with "
-          << "_do_allocate" << dendl;
-      _dump_onode(o, 0);
-      assert(0 == "leaked cow extent");
-    }
-  }
-
  out:
   return r;
 }
@@ -5700,7 +5686,6 @@ void BlueStore::_do_zero_tail_extent(
        dout(10) << __func__ << " wal zero tail partial block "
                 << x_off << "~" << x_len << " at " << op->extent
                 << dendl;
-       assert(!pp->second.has_flag(bluestore_extent_t::FLAG_COW_TAIL));
       }
       if (offset > end_block) {
        // end was block-aligned.  zero the rest of the extent now.
index a76fbdfb25994989344c6142b532d8685370f8c6..9d30e8407d6d1cd523b4de6532fed251a32564f8 100644 (file)
@@ -107,11 +107,6 @@ string bluestore_extent_t::get_flags_string(unsigned flags)
       s += '+';
     s += "shared";
   }
-  if (flags & FLAG_COW_TAIL) {
-    if (s.length())
-      s += '+';
-    s += "cow_tail";
-  }
   return s;
 }
 
index 9529843efd3ec95e902d0bb19a29bbe3da055e4e..91b86c9c17cf9d8626a05aadd66369bdfad12df0 100644 (file)
@@ -58,7 +58,6 @@ WRITE_CLASS_ENCODER(bluestore_cnode_t)
 struct bluestore_extent_t {
   enum {
     FLAG_SHARED = 2,      ///< extent is shared by another object, and refcounted
-    FLAG_COW_TAIL = 8,    ///< extent has pending wal OP_COPY for tail
   };
   static string get_flags_string(unsigned flags);