From eed76834f2bd827fb9b3289bf42aadd400cfbe37 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 4 May 2016 13:41:41 -0400 Subject: [PATCH] os/bluestore: drop dead overlay code Signed-off-by: Sage Weil --- src/os/bluestore/BlueStore.cc | 84 ----------------------------------- 1 file changed, 84 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index b88a352ee8f99..e6bdd006d3e32 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -4789,90 +4789,6 @@ int BlueStore::_do_write_overlays(TransContext *txc, assert(0 == "this is all broken"); - uint64_t min_alloc_size = g_conf->bluestore_min_alloc_size; - - uint64_t offset = 0; - uint64_t length = 0; - bluestore_wal_op_t *op = NULL; - - map::iterator p = - o->onode.overlay_map.lower_bound(orig_offset); - while (true) { - if (p != o->onode.overlay_map.end() && p->first < orig_offset + orig_length) { - if (!op) { - dout(10) << __func__ << " overlay " << p->first - << "~" << p->second.length << " " << p->second - << " (first)" << dendl; - op = _get_wal_op(txc, o); - op->nid = o->onode.nid; - op->op = bluestore_wal_op_t::OP_WRITE; - op->overlays.push_back(p->second); - offset = p->first; - length = p->second.length; - - if (o->onode.put_overlay_ref(p->second.key)) { - string key; - get_overlay_key(o->onode.nid, p->second.key, &key); - txc->t->rm_single_key(PREFIX_OVERLAY, key); - } - o->onode.overlay_map.erase(p++); - continue; - } - - // contiguous? and in the same allocation unit? - if (offset + length == p->first && - p->first % min_alloc_size) { - dout(10) << __func__ << " overlay " << p->first - << "~" << p->second.length << " " << p->second - << " (contiguous)" << dendl; - op->overlays.push_back(p->second); - length += p->second.length; - - if (o->onode.put_overlay_ref(p->second.key)) { - string key; - get_overlay_key(o->onode.nid, p->second.key, &key); - txc->t->rm_single_key(PREFIX_OVERLAY, key); - } - o->onode.overlay_map.erase(p++); - continue; - } - } - if (!op) { - break; - } - assert(length <= min_alloc_size); - - // emit - map::iterator bp = o->onode.find_extent(offset); - if (bp == o->onode.block_map.end() || - length == min_alloc_size) { - uint64_t cow_rmw_head = 0, cow_rmw_tail = 0; - int r = _do_allocate(txc, c, o, offset, length, 0, false, - &cow_rmw_head, &cow_rmw_tail); - if (r < 0) - return r; - bp = o->onode.find_extent(offset); - if (bp->second.has_flag(bluestore_extent_t::FLAG_UNWRITTEN)) { - dout(10) << __func__ << " zero new allocation " << bp->second << dendl; - bdev->aio_zero(bp->second.offset, bp->second.length, &txc->ioc); - bp->second.clear_flag(bluestore_extent_t::FLAG_UNWRITTEN); - } - } - uint64_t x_off = offset - bp->first; - dout(10) << __func__ << " wal write " << offset << "~" << length - << " to extent " << bp->first << ": " << bp->second - << " x_off " << x_off << " overlay data from " - << offset << "~" << length << dendl; - op->extent.offset = bp->second.offset + x_off; - op->extent.length = length; - op = NULL; - - if (p == o->onode.overlay_map.end() || p->first >= orig_offset + orig_length) { - break; - } - ++p; - } - txc->write_onode(o); return 0; } -- 2.39.5