Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bluestore: avoid unnecessary copy with coll_t #12576

Merged
merged 1 commit into from Dec 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/os/bluestore/BlueStore.cc
Expand Up @@ -6993,7 +6993,7 @@ void BlueStore::_txc_add_transaction(TransContext *txc, Transaction *t)
switch (op->op) {
case Transaction::OP_RMCOLL:
{
coll_t cid = i.get_cid(op->cid);
const coll_t &cid = i.get_cid(op->cid);
r = _remove_collection(txc, cid, &c);
if (!r)
continue;
Expand All @@ -7003,7 +7003,7 @@ void BlueStore::_txc_add_transaction(TransContext *txc, Transaction *t)
case Transaction::OP_MKCOLL:
{
assert(!c);
coll_t cid = i.get_cid(op->cid);
const coll_t &cid = i.get_cid(op->cid);
r = _create_collection(txc, cid, op->split_bits, &c);
if (!r)
continue;
Expand Down Expand Up @@ -8836,7 +8836,7 @@ int BlueStore::_rename(TransContext *txc,

int BlueStore::_create_collection(
TransContext *txc,
coll_t cid,
const coll_t &cid,
unsigned bits,
CollectionRef *c)
{
Expand Down Expand Up @@ -8867,7 +8867,7 @@ int BlueStore::_create_collection(
return r;
}

int BlueStore::_remove_collection(TransContext *txc, coll_t cid,
int BlueStore::_remove_collection(TransContext *txc, const coll_t &cid,
CollectionRef *c)
{
dout(15) << __func__ << " " << cid << dendl;
Expand Down
7 changes: 4 additions & 3 deletions src/os/bluestore/BlueStore.h
Expand Up @@ -2157,9 +2157,10 @@ class BlueStore : public ObjectStore,
OnodeRef& oldo,
OnodeRef& newo,
const ghobject_t& new_oid);
int _create_collection(TransContext *txc, coll_t cid, unsigned bits,
CollectionRef *c);
int _remove_collection(TransContext *txc, coll_t cid, CollectionRef *c);
int _create_collection(TransContext *txc, const coll_t &cid,
unsigned bits, CollectionRef *c);
int _remove_collection(TransContext *txc, const coll_t &cid,
CollectionRef *c);
int _split_collection(TransContext *txc,
CollectionRef& c,
CollectionRef& d,
Expand Down