f->close_section();
}
}
- size_t extra_space = 0;
- if (bluefs->slow_dev_expander) {
- extra_space = bluefs->slow_dev_expander->available_freespace(alloc_size);
- }
- f->dump_int("available_from_bluestore", extra_space);
f->close_section();
} else if (command == "bluefs stats") {
std::stringstream ss;
{
PerfCountersBuilder b(cct, "bluefs",
l_bluefs_first, l_bluefs_last);
- b.add_u64_counter(l_bluefs_gift_bytes, "gift_bytes",
- "Bytes gifted from BlueStore", NULL, 0, unit_t(UNIT_BYTES));
- b.add_u64_counter(l_bluefs_reclaim_bytes, "reclaim_bytes",
- "Bytes reclaimed by BlueStore", NULL, 0, unit_t(UNIT_BYTES));
b.add_u64(l_bluefs_db_total_bytes, "db_total_bytes",
"Total bytes (main db device)",
"b", PerfCountersBuilder::PRIO_USEFUL, unit_t(UNIT_BYTES));
alloc[id]->init_add_free(offset, length);
}
- if (logger)
- logger->inc(l_bluefs_gift_bytes, length);
dout(10) << __func__ << " done" << dendl;
}
-int BlueFS::reclaim_blocks(unsigned id, uint64_t want,
- PExtentVector *extents)
-{
- std::unique_lock l(lock);
- dout(1) << __func__ << " bdev " << id
- << " want 0x" << std::hex << want << std::dec << dendl;
- ceph_assert(id < alloc.size());
- ceph_assert(alloc[id]);
- int64_t got = 0;
-
- interval_set<uint64_t> granular;
- while (want > 0 && !block_unused_too_granular[id].empty()) {
- auto p = block_unused_too_granular[id].begin();
- dout(20) << __func__ << " unused " << (int)id << ":"
- << std::hex << p.get_start() << "~" << p.get_len() << dendl;
- extents->push_back({p.get_start(), p.get_len()});
- granular.insert(p.get_start(), p.get_len());
- if (want >= p.get_len()) {
- want -= p.get_len();
- } else {
- want = 0;
- }
- got += p.get_len();
- block_unused_too_granular[id].erase(p);
- }
-
- if (want > 0) {
- got += alloc[id]->allocate(want, alloc_size[id], 0, extents);
- ceph_assert(got != 0);
- if (got < 0) {
- derr << __func__ << " failed to allocate space to return to bluestore"
- << dendl;
- alloc[id]->dump();
- block_unused_too_granular[id].insert(granular);
- return got;
- }
-
- for (auto& p : *extents) {
- block_all[id].erase(p.offset, p.length);
- log_t.op_alloc_rm(id, p.offset, p.length);
- }
-
- flush_bdev();
- int r = _flush_and_sync_log(l);
- ceph_assert(r == 0);
- }
-
- logger->inc(l_bluefs_reclaim_bytes, got);
- dout(1) << __func__ << " bdev " << id << " want 0x" << std::hex << want
- << " got " << *extents << dendl;
- return 0;
-}
-
void BlueFS::handle_discard(unsigned id, interval_set<uint64_t>& to_release)
{
dout(10) << __func__ << " bdev " << id << dendl;
<< " = 0x" << owned
<< " : using 0x" << owned - free
<< std::dec << "(" << byte_u_t(owned - free) << ")";
- if (i == _get_slow_device_id()) {
- ceph_assert(slow_dev_expander);
- ceph_assert(alloc[i]);
- free = slow_dev_expander->available_freespace(alloc_size[i]);
- out << std::hex
- << " : bluestore has 0x" << free
- << std::dec << "(" << byte_u_t(free) << ") available";
- }
out << "\n";
}
}
return names[id];
}
-int BlueFS::_expand_slow_device(uint64_t need, PExtentVector& extents)
-{
- int r = -ENOSPC;
- if (slow_dev_expander) {
- auto id = _get_slow_device_id();
- auto min_alloc_size = alloc_size[id];
- ceph_assert(id <= alloc.size() && alloc[id]);
- auto min_need = round_up_to(need, min_alloc_size);
- need = std::max(need,
- slow_dev_expander->get_recommended_expansion_delta(
- alloc[id]->get_free(), block_all[id].size()));
-
- need = round_up_to(need, min_alloc_size);
- dout(10) << __func__ << " expanding slow device by 0x"
- << std::hex << need << std::dec
- << dendl;
- r = slow_dev_expander->allocate_freespace(min_need, need, extents);
- }
- return r;
-}
-
int BlueFS::_allocate_without_fallback(uint8_t id, uint64_t len,
PExtentVector* extents)
{
dout(1) << __func__ << " unable to allocate 0x" << std::hex << len
<< " on bdev " << (int)id << ", free 0x"
<< (alloc[id] ? alloc[id]->get_free() : (uint64_t)-1)
- << "; fallback to slow device expander "
<< std::dec << dendl;
- extents.clear();
- if (_expand_slow_device(len, extents) == 0) {
- id = _get_slow_device_id();
- for (auto& e : extents) {
- _add_block_extent(id, e.offset, e.length);
- }
- extents.clear();
- auto* last_alloc = alloc[id];
- ceph_assert(last_alloc);
- // try again
- alloc_len = last_alloc->allocate(round_up_to(len, alloc_size[id]),
- alloc_size[id], hint, &extents);
- if (alloc_len < 0 || alloc_len < (int64_t)len) {
- if (alloc_len > 0) {
- last_alloc->release(extents);
- }
- derr << __func__ << " failed to allocate 0x" << std::hex << len
- << " on bdev " << (int)id
- << ", free 0x" << last_alloc->get_free() << std::dec << dendl;
- return -ENOSPC;
- }
- } else {
- derr << __func__ << " failed to expand slow device to fit +0x"
- << std::hex << len << std::dec
- << dendl;
- return -ENOSPC;
- }
+ return -ENOSPC;
} else {
uint64_t total_allocated =
block_all[id].size() - alloc[id]->get_free();
// allocate superblock reserved space. note that we do not mark
// bluefs space as allocated in the freelist; we instead rely on
- // bluefs_extents.
+ // bluefs doing that itself.
auto reserved = _get_ondisk_reserved();
fm->allocate(0, reserved, t);
- if (cct->_conf->bluestore_bluefs) {
- ceph_assert(bluefs_extents.num_intervals() == 1);
- interval_set<uint64_t>::iterator p = bluefs_extents.begin();
- reserved = round_up_to(p.get_start() + p.get_len(), min_alloc_size);
- dout(20) << __func__ << " reserved 0x" << std::hex << reserved << std::dec
- << " for bluefs" << dendl;
- }
-
if (cct->_conf->bluestore_debug_prefill > 0) {
uint64_t end = bdev->get_size() - reserved;
dout(1) << __func__ << " pre-fragmenting freespace, using "
ceph_assert(alloc == NULL);
ceph_assert(bdev->get_size());
- if (bluefs) {
- bluefs_extents.clear();
- auto r = bluefs->get_block_extents(bluefs_layout.shared_bdev,
- &bluefs_extents);
- if (r < 0) {
- lderr(cct) << __func__ << " failed to retrieve bluefs_extents: "
- << cpp_strerror(r) << dendl;
-
- return r;
- }
- dout(10) << __func__ << " bluefs extents 0x"
- << std::hex << bluefs_extents << std::dec
- << dendl;
- }
-
uint64_t alloc_size = min_alloc_size;
if (bdev->is_smr()) {
alloc_size = _piggyback_zoned_device_parameters_onto(alloc_size);
}
fm->enumerate_reset();
- // also mark bluefs space as allocated
- for (auto e = bluefs_extents.begin(); e != bluefs_extents.end(); ++e) {
- alloc->init_rm_free(e.get_start(), e.get_len());
- }
-
dout(1) << __func__ << " loaded " << byte_u_t(bytes)
<< " in " << num << " extents"
<< " available " << byte_u_t(alloc->get_free())
alloc->shutdown();
delete alloc;
alloc = NULL;
- bluefs_extents.clear();
}
int BlueStore::_open_fsid(bool create)
<< cpp_strerror(r) << dendl;
goto free_bluefs;
}
- if (create) {
- // note: we always leave the first SUPER_RESERVED (8k) of the device unused
- uint64_t start, initial;
- if (bdev->is_smr()) {
- // For now, we allocate all of the conventional region on HM-SMR drive to
- // bluefs and assume that it never outgrows that region.
- start = _get_ondisk_reserved();
- initial = bdev->get_conventional_region_size() - start;
- } else {
- initial = bdev->get_size() * (cct->_conf->bluestore_bluefs_min_ratio +
- cct->_conf->bluestore_bluefs_gift_ratio);
- initial = std::max(initial, cct->_conf->bluestore_bluefs_min);
- uint64_t alloc_size = cct->_conf->bluefs_shared_alloc_size;
- if (alloc_size % min_alloc_size) {
- derr << __func__ << " bluefs_shared_alloc_size 0x" << std::hex
- << alloc_size << " is not a multiple of "
- << "min_alloc_size 0x" << min_alloc_size << std::dec << dendl;
- r = -EINVAL;
- goto free_bluefs;
- }
- // align to bluefs's alloc_size
- initial = p2roundup(initial, alloc_size);
- // put bluefs in the middle of the device in case it is an HDD
- start = p2align((bdev->get_size() - initial) / 2, alloc_size);
- //avoiding superblock overwrite
- start = std::max(alloc_size, start);
- ceph_assert(start >=_get_ondisk_reserved());
- }
-
- bluefs->add_block_extent(bluefs_layout.shared_bdev, start, initial);
- bluefs_extents.insert(start, initial);
- ++out_of_sync_fm;
- }
-
+
bfn = path + "/block.wal";
if (::stat(bfn.c_str(), &st) == 0) {
r = bluefs->add_block_device(BlueFS::BDEV_WAL, bfn,
void BlueStore::_close_db_and_around(bool read_only)
{
if (bluefs) {
- if (!read_only && out_of_sync_fm.fetch_and(0)) {
- _sync_bluefs_and_fm();
- }
_close_db(read_only);
- while(!read_only && out_of_sync_fm.fetch_and(0)) {
- // if seen some allocations during close - repeat open_db, sync fm, close
- dout(0) << __func__ << " syncing FreelistManager" << dendl;
- int r = _open_db(false, false, false);
- if (r < 0) {
- derr << __func__
- << " unable to open db, FreelistManager is probably out of sync"
- << dendl;
- break;
- }
- _sync_bluefs_and_fm();
- _close_db(false);
- }
if (!_kv_only) {
_close_alloc();
_close_fm();
}
}
-// updates legacy bluefs related recs in DB to a state valid for
-// downgrades from nautilus.
-void BlueStore::_sync_bluefs_and_fm()
-{
- if (cct->_conf->bluestore_bluefs_db_compatibility) {
- bufferlist bl;
- encode(bluefs_extents, bl);
- dout(20) << __func__ << " bluefs_extents at KV is now 0x"
- << std::hex << bluefs_extents << std::dec
- << dendl;
- KeyValueDB::Transaction synct = db->get_transaction();
- synct->set(PREFIX_SUPER, "bluefs_extents", bl);
- synct->set(PREFIX_SUPER, "bluefs_extents_back", bl);
-
- // Nice thing is that we don't need to update FreelistManager here.
- // It always has corresponding bits set to 'Free' for both Nautilus+ and
- // pre-Nautilis releases.
- // So once we get an extent to bluefs_extents this means it's
- // been free in allocator and hence it's free in FM too.
-
- db->submit_transaction_sync(synct);
- }
-}
-
int BlueStore::open_db_environment(KeyValueDB **pdb)
{
string kv_dir_fn;
// simplify the dir names, too, as "seen" by rocksdb
fn = "db";
}
- bluefs->set_slow_device_expander(this);
BlueFSVolumeSelector::paths paths;
bluefs->get_vselector_paths(fn, paths);
}
}
-
-int BlueStore::allocate_bluefs_freespace(
- uint64_t min_size,
- uint64_t size,
- PExtentVector* extents_out)
-{
- ceph_assert(min_size <= size);
- if (size) {
- // round up to alloc size
- uint64_t alloc_size = bluefs->get_alloc_size(bluefs_layout.shared_bdev);
- min_size = p2roundup(min_size, alloc_size);
- size = p2roundup(size, alloc_size);
-
- PExtentVector extents_local;
- PExtentVector* extents = extents_out ? extents_out : &extents_local;
-
-
- uint64_t gift;
- uint64_t allocated = 0;
- int64_t alloc_len;
- auto need = size;
- auto extent_count0 = extents->size();
- do {
- // hard cap to fit into 32 bits
- gift = std::min<uint64_t>(size, 1ull << 30);
- dout(10) << __func__ << " gifting " << gift
- << " (" << byte_u_t(gift) << ")" << dendl;
-
- alloc_len = alloc->allocate(gift, alloc_size, 0, 0, extents);
- if (alloc_len > 0) {
- allocated += alloc_len;
- size -= alloc_len;
- }
-
- if (alloc_len < 0 ||
- (alloc_len < (int64_t)gift && (min_size > allocated))) {
- derr << __func__
- << " failed to allocate on 0x" << std::hex << gift
- << " min_size 0x" << min_size
- << " > allocated total 0x" << allocated
- << " bluefs_shared_alloc_size 0x" << alloc_size
- << " allocated 0x" << (alloc_len < 0 ? 0 : alloc_len)
- << " available 0x " << alloc->get_free()
- << std::dec << dendl;
-
- _dump_alloc_on_failure();
- alloc->release(*extents);
- extents->clear();
- return -ENOSPC;
- }
- } while (size && alloc_len > 0);
- _collect_allocation_stats(need, alloc_size, extents->size() - extent_count0);
-
- for (auto& e : *extents) {
- dout(5) << __func__ << " gifting " << e << " to bluefs" << dendl;
- bluefs_extents.insert(e.offset, e.length);
- ++out_of_sync_fm;
- // apply to bluefs if not requested from outside
- if (!extents_out) {
- bluefs->add_block_extent(bluefs_layout.shared_bdev, e.offset, e.length);
- }
- }
- }
- return 0;
-}
-
-uint64_t BlueStore::available_freespace(uint64_t alloc_size) {
- uint64_t total = 0;
- auto iterated_allocation = [&](uint64_t off, uint64_t len) {
- //only count in size that is alloc_size aligned
- uint64_t dist_to_alignment;
- uint64_t offset_in_block = off & (alloc_size - 1);
- if (offset_in_block == 0)
- dist_to_alignment = 0;
- else
- dist_to_alignment = alloc_size - offset_in_block;
- if (dist_to_alignment >= len)
- return;
- len -= dist_to_alignment;
- total += p2align(len, alloc_size);
- };
- alloc->dump(iterated_allocation);
- return total;
-}
-
-int64_t BlueStore::_get_bluefs_size_delta(uint64_t bluefs_free, uint64_t bluefs_total)
-{
- float bluefs_free_ratio = (float)bluefs_free / (float)bluefs_total;
-
- uint64_t my_free = alloc->get_free();
- uint64_t total = bdev->get_size();
- float my_free_ratio = (float)my_free / (float)total;
-
- uint64_t total_free = bluefs_free + my_free;
-
- float bluefs_ratio = (float)bluefs_free / (float)total_free;
-
- dout(10) << __func__
- << " bluefs " << byte_u_t(bluefs_free)
- << " free (" << bluefs_free_ratio
- << ") bluestore " << byte_u_t(my_free)
- << " free (" << my_free_ratio
- << "), bluefs_ratio " << bluefs_ratio
- << dendl;
-
- uint64_t gift = 0;
- uint64_t reclaim = 0;
- if (bluefs_ratio < cct->_conf->bluestore_bluefs_min_ratio) {
- gift = cct->_conf->bluestore_bluefs_gift_ratio * total_free;
- if (gift >= my_free)
- gift = my_free / 2;
- dout(10) << __func__ << " bluefs_ratio " << bluefs_ratio
- << " < min_ratio " << cct->_conf->bluestore_bluefs_min_ratio
- << ", should gift " << byte_u_t(gift) << dendl;
- } else if (bluefs_ratio > cct->_conf->bluestore_bluefs_max_ratio) {
- reclaim = cct->_conf->bluestore_bluefs_reclaim_ratio * total_free;
- if (bluefs_total - reclaim < cct->_conf->bluestore_bluefs_min)
- reclaim = bluefs_total - cct->_conf->bluestore_bluefs_min;
- if (reclaim >= bluefs_free)
- reclaim = bluefs_free / 2;
- dout(10) << __func__ << " bluefs_ratio " << bluefs_ratio
- << " > max_ratio " << cct->_conf->bluestore_bluefs_max_ratio
- << ", should reclaim " << byte_u_t(reclaim) << dendl;
- }
-
- // don't take over too much of the freespace
- uint64_t free_cap = cct->_conf->bluestore_bluefs_max_ratio * total_free;
- if (bluefs_total < cct->_conf->bluestore_bluefs_min &&
- cct->_conf->bluestore_bluefs_min < free_cap) {
- uint64_t g = cct->_conf->bluestore_bluefs_min - bluefs_total;
- dout(10) << __func__ << " bluefs_total " << bluefs_total
- << " < min " << cct->_conf->bluestore_bluefs_min
- << ", should gift " << byte_u_t(g) << dendl;
- if (g > gift)
- gift = g;
- reclaim = 0;
- }
- uint64_t min_free =
- cct->_conf.get_val<Option::size_t>("bluestore_bluefs_min_free");
- if (bluefs_free < min_free &&
- min_free < free_cap) {
- uint64_t g = min_free - bluefs_free;
- dout(10) << __func__ << " bluefs_free " << bluefs_free
- << " < min " << min_free
- << ", should gift " << byte_u_t(g) << dendl;
- if (g > gift)
- gift = g;
- reclaim = 0;
- }
- uint64_t max_free =
- cct->_conf.get_val<Option::size_t>("bluestore_bluefs_max_free");
- if (bluefs_free > max_free) {
- dout(10) << __func__ << " bluefs_free " << bluefs_free
- << " > max " << max_free
- << ", stop gifting for now" << dendl;
- gift = 0;
- }
- ceph_assert((int64_t)gift >= 0);
- ceph_assert((int64_t)reclaim >= 0);
- return gift > 0 ? (int64_t)gift : -(int64_t)reclaim;
-}
-
-int BlueStore::_balance_bluefs_freespace()
-{
- int ret = 0;
- ceph_assert(bluefs);
-
- vector<pair<uint64_t,uint64_t>> bluefs_usage; // <free, total> ...
- bluefs->get_usage(&bluefs_usage);
- ceph_assert(bluefs_usage.size() > bluefs_layout.shared_bdev);
-
- bool clear_alert = true;
- if (bluefs_layout.shared_bdev == BlueFS::BDEV_SLOW) {
- auto& p = bluefs_usage[bluefs_layout.shared_bdev];
- if (p.first != p.second) {
- auto& db = bluefs_usage[BlueFS::BDEV_DB];
- ostringstream ss;
- ss << "spilled over " << byte_u_t(p.second - p.first)
- << " metadata from 'db' device (" << byte_u_t(db.second - db.first)
- << " used of " << byte_u_t(db.second) << ") to slow device";
- _set_spillover_alert(ss.str());
- clear_alert = false;
- }
- }
- if (clear_alert) {
- _clear_spillover_alert();
- }
-
- // fixme: look at primary bdev only for now
- int64_t delta = _get_bluefs_size_delta(
- bluefs_usage[bluefs_layout.shared_bdev].first,
- bluefs_usage[bluefs_layout.shared_bdev].second);
-
- // reclaim from bluefs?
- if (delta < 0) {
- // round up to alloc size
- uint64_t alloc_size = bluefs->get_alloc_size(bluefs_layout.shared_bdev);
- auto reclaim = p2roundup(uint64_t(-delta), alloc_size);
-
- // hard cap to fit into 32 bits
- reclaim = std::min<uint64_t>(reclaim, 1ull << 30);
- dout(10) << __func__ << " reclaiming " << reclaim
- << " (" << byte_u_t(reclaim) << ")" << dendl;
-
- while (reclaim > 0) {
- // NOTE: this will block and do IO.
- PExtentVector extents;
- int r = bluefs->reclaim_blocks(bluefs_layout.shared_bdev, reclaim,
- &extents);
- if (r < 0) {
- derr << __func__ << " failed to reclaim space from bluefs"
- << dendl;
- break;
- }
- for (auto e : extents) {
- ++out_of_sync_fm;
- bluefs_extents.erase(e.offset, e.length);
- bluefs_extents_reclaiming.insert(e.offset, e.length);
- reclaim -= e.length;
- }
- }
-
- ret = 1;
- }
-
- return ret;
-}
-
int BlueStore::_open_collections()
{
dout(10) << __func__ << dendl;
}
}
- if (out_of_sync_fm.fetch_and(0)) {
- _sync_bluefs_and_fm();
- }
-
out_close_fm:
_close_fm();
out_close_db:
used_space += bluefs->get_total(src_id) - bluefs->get_free(src_id);
}
uint64_t target_free = bluefs->get_free(id);
- if (id == BlueFS::BDEV_SLOW && target_free < used_space) {
- // will need to remount full BlueStore instance to allocate more space
- _umount_for_bluefs();
-
- r = mount();
- ceph_assert(r == 0);
- dout(1) << __func__
- << " Allocating more space at slow device for BlueFS: +"
- << used_space - target_free << " bytes" << dendl;
- r = allocate_bluefs_freespace(
- used_space - target_free,
- used_space - target_free,
- nullptr);
-
- umount();
- if (r != 0) {
- derr << __func__
- << " can't migrate, unable to allocate extra space: "
- << used_space - target_free << " at target:" << id
- << dendl;
- return -ENOSPC;
- }
-
- r = _mount_for_bluefs();
- ceph_assert(r == 0);
- } else if (target_free < used_space) {
+ if (target_free < used_space) {
derr << __func__
<< " can't migrate, free space at target: " << target_free
<< " is less than required space: " << used_space
}
if (bluefs) {
- if( cct->_conf->bluestore_bluefs_db_compatibility) {
- interval_set<uint64_t> bluefs_extents_db;
- bufferlist bl;
- db->get(PREFIX_SUPER, "bluefs_extents", &bl);
- auto p = bl.cbegin();
- auto prev_errors = errors;
- try {
- decode(bluefs_extents_db, p);
- bluefs_extents_db.union_of(bluefs_extents);
- bluefs_extents_db.subtract(bluefs_extents);
- if (!bluefs_extents_db.empty()) {
- derr << "fsck error: bluefs_extents inconsistency, "
- << "downgrade to previous releases might be broken."
- << dendl;
- ++errors;
- }
- }
- catch (ceph::buffer::error& e) {
- derr << "fsck error: failed to retrieve bluefs_extents from kv" << dendl;
- ++errors;
- }
- if (errors != prev_errors && repair) {
- repairer.fix_bluefs_extents(out_of_sync_fm);
- }
- }
-
- for (auto e = bluefs_extents.begin(); e != bluefs_extents.end(); ++e) {
- apply_for_bitset_range(
- e.get_start(), e.get_len(), fm->get_alloc_size(), used_blocks,
- [&](uint64_t pos, mempool_dynamic_bitset &bs) {
- bs.set(pos);
- });
- }
int r = bluefs->fsck();
if (r < 0) {
return r;
dout(1) << __func__ << " checking freelist vs allocated" << dendl;
{
- // remove bluefs_extents from used set since the freelist doesn't
- // know they are allocated.
- for (auto e = bluefs_extents.begin(); e != bluefs_extents.end(); ++e) {
- apply_for_bitset_range(
- e.get_start(), e.get_len(), fm->get_alloc_size(), used_blocks,
- [&](uint64_t pos, mempool_dynamic_bitset &bs) {
- bs.reset(pos);
- }
- );
- }
fm->enumerate_reset();
uint64_t offset, length;
while (fm->enumerate_next(db, &offset, &length)) {
// transaction is ready for commit.
throttle.release_kv_throttle(costs);
- if (bluefs &&
- after_flush - bluefs_last_balance >
- ceph::make_timespan(cct->_conf->bluestore_bluefs_balance_interval)) {
- bluefs_last_balance = after_flush;
- int r = _balance_bluefs_freespace();
- ceph_assert(r >= 0);
- }
-
// cleanup sync deferred keys
for (auto b : deferred_stable) {
for (auto& txc : b->txcs) {
cct->_conf->bluestore_log_op_age);
}
- if (bluefs) {
- if (!bluefs_extents_reclaiming.empty()) {
- dout(0) << __func__ << " releasing old bluefs 0x" << std::hex
- << bluefs_extents_reclaiming << std::dec << dendl;
- int r = 0;
- if (cct->_conf->bdev_enable_discard && cct->_conf->bdev_async_discard) {
- r = bdev->queue_discard(bluefs_extents_reclaiming);
- if (r == 0) {
- goto clear;
- }
- } else if (cct->_conf->bdev_enable_discard) {
- for (auto p = bluefs_extents_reclaiming.begin(); p != bluefs_extents_reclaiming.end(); ++p) {
- bdev->discard(p.get_start(), p.get_len());
- }
- }
-
- alloc->release(bluefs_extents_reclaiming);
-clear:
- bluefs_extents_reclaiming.clear();
- }
- }
-
l.lock();
// previously deferred "done" are now "stable" by virtue of this
// commit cycle.
return true;
}
-bool BlueStoreRepairer::fix_bluefs_extents(std::atomic<uint64_t>& out_of_sync_flag)
-{
- // this is just a stub to count num of repairs properly,
- // actual repair happens in BlueStore::_close_db_and_around()
- // while doing _sync_bluefs_and_fm
- ++out_of_sync_flag;
- ++to_repair_cnt;
- return true;
-}
-
bool BlueStoreRepairer::preprocess_misreference(KeyValueDB *db)
{
if (misreferenced_extents.size()) {