Skip to content

Commit

Permalink
Merge pull request #11192 from xiexingguo/xxg-wip-bluestore-0922
Browse files Browse the repository at this point in the history
os/bluestore: a few cleanups

Reviewed-by: Sage Weil <sage@redhat.com>
  • Loading branch information
liewegas committed Sep 22, 2016
2 parents ff7fda4 + fcaeb67 commit ed24107
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 21 deletions.
22 changes: 2 additions & 20 deletions src/os/bluestore/BlueStore.cc
Expand Up @@ -1208,24 +1208,6 @@ void BlueStore::SharedBlob::put()
}
}


// SharedBlobSet

#undef dout_prefix
#define dout_prefix *_dout << "bluestore.sharedblobset(" << this << ") "

BlueStore::SharedBlobRef BlueStore::SharedBlobSet::lookup(uint64_t sbid)
{
std::lock_guard<std::mutex> l(lock);
dummy.sbid = sbid;
auto p = uset.find(dummy);
if (p == uset.end()) {
return nullptr;
}
return &*p;
}


// Blob

#undef dout_prefix
Expand Down Expand Up @@ -2128,7 +2110,7 @@ BlueStore::OnodeRef BlueStore::Collection::get_onode(
on = new Onode(&onode_map, this, oid, key);
} else {
// loaded
assert(r >=0 );
assert(r >= 0);
on = new Onode(&onode_map, this, oid, key);
on->exists = true;
bufferlist::iterator p = v.begin();
Expand Down Expand Up @@ -2220,8 +2202,8 @@ BlueStore::~BlueStore()
{
for (auto f : finishers) {
delete f;
f = NULL;
}
finishers.clear();

g_ceph_context->_conf->remove_observer(this);
_shutdown_logger();
Expand Down
10 changes: 9 additions & 1 deletion src/os/bluestore/BlueStore.h
Expand Up @@ -357,7 +357,15 @@ class BlueStore : public ObjectStore,
assert(n > 0);
}

SharedBlobRef lookup(uint64_t sbid);
SharedBlobRef lookup(uint64_t sbid) {
std::lock_guard<std::mutex> l(lock);
dummy.sbid = sbid;
auto p = uset.find(dummy);
if (p == uset.end()) {
return nullptr;
}
return &*p;
}

void add(SharedBlob *sb) {
std::lock_guard<std::mutex> l(lock);
Expand Down

0 comments on commit ed24107

Please sign in to comment.