From: Sage Weil Date: Wed, 4 May 2016 18:11:52 +0000 (-0400) Subject: os/bluestore: drop COW_TAIL extent flag X-Git-Tag: v11.0.0~655^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=264aab626836022890a7115e274776f9faf6464a;p=ceph-ci.git os/bluestore: drop COW_TAIL extent flag Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 54258088b51..c81f40e5b13 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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::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. diff --git a/src/os/bluestore/bluestore_types.cc b/src/os/bluestore/bluestore_types.cc index a76fbdfb259..9d30e8407d6 100644 --- a/src/os/bluestore/bluestore_types.cc +++ b/src/os/bluestore/bluestore_types.cc @@ -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; } diff --git a/src/os/bluestore/bluestore_types.h b/src/os/bluestore/bluestore_types.h index 9529843efd3..91b86c9c17c 100644 --- a/src/os/bluestore/bluestore_types.h +++ b/src/os/bluestore/bluestore_types.h @@ -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);