From: Igor Fedotov Date: Mon, 15 Aug 2022 18:02:14 +0000 (+0300) Subject: os/bluestore: rename Collection::onode_map to onode_space X-Git-Tag: v18.1.0~404^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0c02f3e31fcbde45da87bf5104037e87e5c80e64;p=ceph.git os/bluestore: rename Collection::onode_map to onode_space to ease code reading. Signed-off-by: Igor Fedotov --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 33d1d998308..9157fcba19d 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -1183,7 +1183,7 @@ struct LruOnodeCacheShard : public BlueStore::OnodeCacheShard { *(o->cache_age_bin) -= 1; auto pinned = !o->pop_cache(); ceph_assert(!pinned); - o->c->onode_map._remove(o->oid); + o->c->onode_space._remove(o->oid); } } void move_pinned(OnodeCacheShard *to, BlueStore::Onode *o) override @@ -2912,9 +2912,9 @@ void BlueStore::ExtentMap::reshard( bool was_too_many_blobs_check = false; auto too_many_blobs_threshold = g_conf()->bluestore_debug_too_many_blobs_threshold; - auto& dumped_onodes = onode->c->onode_map.cache->dumped_onodes; - decltype(onode->c->onode_map.cache->dumped_onodes)::value_type* oid_slot = nullptr; - decltype(onode->c->onode_map.cache->dumped_onodes)::value_type* oldest_slot = nullptr; + auto& dumped_onodes = onode->c->onode_space.cache->dumped_onodes; + decltype(onode->c->onode_space.cache->dumped_onodes)::value_type* oid_slot = nullptr; + decltype(onode->c->onode_space.cache->dumped_onodes)::value_type* oldest_slot = nullptr; for (auto e = extent_map.lower_bound(dummy); e != extent_map.end(); ++e) { if (e->logical_offset >= needs_reshard_end) { @@ -3743,7 +3743,7 @@ void BlueStore::Onode::put() { } else { ocs->_unpin_and_rm(this); // remove will also decrement nref - c->onode_map._remove(oid); + c->onode_space._remove(oid); } } ocs->lock.unlock(); @@ -3990,7 +3990,7 @@ BlueStore::Collection::Collection(BlueStore *store_, OnodeCacheShard *oc, Buffer store(store_), cache(bc), exists(true), - onode_map(oc), + onode_space(oc), commit_queue(nullptr) { } @@ -4110,7 +4110,7 @@ BlueStore::OnodeRef BlueStore::Collection::get_onode( } } - OnodeRef o = onode_map.lookup(oid); + OnodeRef o = onode_space.lookup(oid); if (o) return o; @@ -4140,7 +4140,7 @@ BlueStore::OnodeRef BlueStore::Collection::get_onode( on = Onode::decode(this, oid, key, v); } o.reset(on); - return onode_map.add(oid, o); + return onode_space.add(oid, o); } void BlueStore::Collection::split_cache( @@ -4163,8 +4163,8 @@ void BlueStore::Collection::split_cache( bool is_pg = dest->cid.is_pg(&destpg); ceph_assert(is_pg); - auto p = onode_map.onode_map.begin(); - while (p != onode_map.onode_map.end()) { + auto p = onode_space.onode_map.begin(); + while (p != onode_space.onode_map.end()) { OnodeRef o = p->second; if (!p->second->oid.match(destbits, destpg.pgid.ps())) { // onode does not belong to this child @@ -4180,8 +4180,8 @@ void BlueStore::Collection::split_cache( OnodeRef o_pin = o; ceph_assert(o->pinned); - p = onode_map.onode_map.erase(p); - dest->onode_map.onode_map[o->oid] = o; + p = onode_space.onode_map.erase(p); + dest->onode_space.onode_map[o->oid] = o; if (o->cached) { get_onode_cache()->move_pinned(dest->get_onode_cache(), o.get()); } @@ -10669,7 +10669,7 @@ void BlueStore::_reap_collections() while (p != removed_colls.end()) { CollectionRef c = *p; dout(10) << __func__ << " " << c << " " << c->cid << dendl; - if (c->onode_map.map_any([&](Onode* o) { + if (c->onode_space.map_any([&](Onode* o) { ceph_assert(!o->exists); if (o->flushing_count.load()) { dout(10) << __func__ << " " << c << " " << c->cid << " " << o->oid @@ -10681,7 +10681,7 @@ void BlueStore::_reap_collections() ++p; continue; } - c->onode_map.clear(); + c->onode_space.clear(); p = removed_colls.erase(p); dout(10) << __func__ << " " << c << " " << c->cid << " done" << dendl; } @@ -17053,7 +17053,7 @@ int BlueStore::_rename(TransContext *txc, // this adjusts oldo->{oid,key}, and reset oldo to a fresh empty // Onode in the old slot - c->onode_map.rename(oldo, old_oid, new_oid, new_okey); + c->onode_space.rename(oldo, old_oid, new_oid, new_okey); r = 0; // hold a ref to new Onode in old name position, to ensure we don't drop @@ -17137,7 +17137,7 @@ int BlueStore::_remove_collection(TransContext *txc, const coll_t &cid, } size_t nonexistent_count = 0; ceph_assert((*c)->exists); - if ((*c)->onode_map.map_any([&](Onode* o) { + if ((*c)->onode_space.map_any([&](Onode* o) { if (o->exists) { dout(1) << __func__ << " " << o->oid << " " << o << " exists in onode_map" << dendl; @@ -17162,7 +17162,7 @@ int BlueStore::_remove_collection(TransContext *txc, const coll_t &cid, bool exists = (!next.is_max()); for (auto it = ls.begin(); !exists && it < ls.end(); ++it) { dout(10) << __func__ << " oid " << *it << dendl; - auto onode = (*c)->onode_map.lookup(*it); + auto onode = (*c)->onode_space.lookup(*it); exists = !onode || onode->exists; if (exists) { dout(1) << __func__ << " " << *it @@ -17228,7 +17228,7 @@ int BlueStore::_split_collection(TransContext *txc, ceph_assert(is_pg); // the destination should initially be empty. - ceph_assert(d->onode_map.empty()); + ceph_assert(d->onode_space.empty()); ceph_assert(d->shared_blob_set.empty()); ceph_assert(d->cnode.bits == bits); @@ -17619,12 +17619,12 @@ void BlueStore::_shutdown_cache() ceph_assert(i->empty()); } for (auto& p : coll_map) { - p.second->onode_map.clear(); + p.second->onode_space.clear(); if (!p.second->shared_blob_set.empty()) { derr << __func__ << " stray shared blobs on " << p.first << dendl; p.second->shared_blob_set.dump<0>(cct); } - ceph_assert(p.second->onode_map.empty()); + ceph_assert(p.second->onode_space.empty()); ceph_assert(p.second->shared_blob_set.empty()); } coll_map.clear(); diff --git a/src/os/bluestore/BlueStore.h b/src/os/bluestore/BlueStore.h index 345fbc39bbf..595809fdb92 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -1519,14 +1519,14 @@ public: // cache onodes on a per-collection basis to avoid lock // contention. - OnodeSpace onode_map; + OnodeSpace onode_space; //pool options pool_opts_t pool_opts; ContextQueue *commit_queue; OnodeCacheShard* get_onode_cache() const { - return onode_map.cache; + return onode_space.cache; } OnodeRef get_onode(const ghobject_t& oid, bool create, bool is_createop=false);