break;
case Transaction::OP_TOUCH:
{
- coll_t cid = i.get_cid(op->cid);
+ const coll_t &_cid = i.get_cid(op->cid);
const ghobject_t &oid = i.get_oid(op->oid);
- _kludge_temp_object_collection(cid, oid);
+ const coll_t &cid = !_need_temp_object_collection(_cid, oid) ?
+ _cid : _cid.get_temp();
tracepoint(objectstore, touch_enter, osr_name);
if (_check_replay_guard(cid, oid, spos) > 0)
r = _touch(cid, oid);
case Transaction::OP_WRITE:
{
- coll_t cid = i.get_cid(op->cid);
+ const coll_t &_cid = i.get_cid(op->cid);
const ghobject_t &oid = i.get_oid(op->oid);
- _kludge_temp_object_collection(cid, oid);
+ const coll_t &cid = !_need_temp_object_collection(_cid, oid) ?
+ _cid : _cid.get_temp();
uint64_t off = op->off;
uint64_t len = op->len;
uint32_t fadvise_flags = i.get_fadvise_flags();
case Transaction::OP_ZERO:
{
- coll_t cid = i.get_cid(op->cid);
+ const coll_t &_cid = i.get_cid(op->cid);
const ghobject_t &oid = i.get_oid(op->oid);
- _kludge_temp_object_collection(cid, oid);
+ const coll_t &cid = !_need_temp_object_collection(_cid, oid) ?
+ _cid : _cid.get_temp();
uint64_t off = op->off;
uint64_t len = op->len;
tracepoint(objectstore, zero_enter, osr_name, off, len);
case Transaction::OP_TRUNCATE:
{
- coll_t cid = i.get_cid(op->cid);
+ const coll_t &_cid = i.get_cid(op->cid);
const ghobject_t &oid = i.get_oid(op->oid);
- _kludge_temp_object_collection(cid, oid);
+ const coll_t &cid = !_need_temp_object_collection(_cid, oid) ?
+ _cid : _cid.get_temp();
uint64_t off = op->off;
tracepoint(objectstore, truncate_enter, osr_name, off);
if (_check_replay_guard(cid, oid, spos) > 0)
case Transaction::OP_REMOVE:
{
- coll_t cid = i.get_cid(op->cid);
+ const coll_t &_cid = i.get_cid(op->cid);
const ghobject_t &oid = i.get_oid(op->oid);
- _kludge_temp_object_collection(cid, oid);
+ const coll_t &cid = !_need_temp_object_collection(_cid, oid) ?
+ _cid : _cid.get_temp();
tracepoint(objectstore, remove_enter, osr_name);
if (_check_replay_guard(cid, oid, spos) > 0)
r = _remove(cid, oid, spos);
case Transaction::OP_SETATTR:
{
- coll_t cid = i.get_cid(op->cid);
+ const coll_t &_cid = i.get_cid(op->cid);
const ghobject_t &oid = i.get_oid(op->oid);
- _kludge_temp_object_collection(cid, oid);
+ const coll_t &cid = !_need_temp_object_collection(_cid, oid) ?
+ _cid : _cid.get_temp();
string name = i.decode_string();
bufferlist bl;
i.decode_bl(bl);
case Transaction::OP_SETATTRS:
{
- coll_t cid = i.get_cid(op->cid);
+ const coll_t &_cid = i.get_cid(op->cid);
const ghobject_t &oid = i.get_oid(op->oid);
- _kludge_temp_object_collection(cid, oid);
+ const coll_t &cid = !_need_temp_object_collection(_cid, oid) ?
+ _cid : _cid.get_temp();
map<string, bufferptr> aset;
i.decode_attrset(aset);
tracepoint(objectstore, setattrs_enter, osr_name);
case Transaction::OP_RMATTR:
{
- coll_t cid = i.get_cid(op->cid);
+ const coll_t &_cid = i.get_cid(op->cid);
const ghobject_t &oid = i.get_oid(op->oid);
- _kludge_temp_object_collection(cid, oid);
+ const coll_t &cid = !_need_temp_object_collection(_cid, oid) ?
+ _cid : _cid.get_temp();
string name = i.decode_string();
tracepoint(objectstore, rmattr_enter, osr_name);
if (_check_replay_guard(cid, oid, spos) > 0)
case Transaction::OP_RMATTRS:
{
- coll_t cid = i.get_cid(op->cid);
+ const coll_t &_cid = i.get_cid(op->cid);
const ghobject_t &oid = i.get_oid(op->oid);
- _kludge_temp_object_collection(cid, oid);
+ const coll_t &cid = !_need_temp_object_collection(_cid, oid) ?
+ _cid : _cid.get_temp();
tracepoint(objectstore, rmattrs_enter, osr_name);
if (_check_replay_guard(cid, oid, spos) > 0)
r = _rmattrs(cid, oid, spos);
case Transaction::OP_CLONE:
{
- coll_t cid = i.get_cid(op->cid);
+ const coll_t &_cid = i.get_cid(op->cid);
const ghobject_t &oid = i.get_oid(op->oid);
- _kludge_temp_object_collection(cid, oid);
+ const coll_t &cid = !_need_temp_object_collection(_cid, oid) ?
+ _cid : _cid.get_temp();
const ghobject_t &noid = i.get_oid(op->dest_oid);
tracepoint(objectstore, clone_enter, osr_name);
r = _clone(cid, oid, noid, spos);
case Transaction::OP_CLONERANGE:
{
- coll_t cid = i.get_cid(op->cid);
+ const coll_t &_cid = i.get_cid(op->cid);
const ghobject_t &oid = i.get_oid(op->oid);
- coll_t ncid = cid;
const ghobject_t &noid = i.get_oid(op->dest_oid);
- _kludge_temp_object_collection(cid, oid);
- _kludge_temp_object_collection(ncid, noid);
+ const coll_t &cid = !_need_temp_object_collection(_cid, oid) ?
+ _cid : _cid.get_temp();
+ const coll_t &ncid = !_need_temp_object_collection(_cid, noid) ?
+ _cid : _cid.get_temp();
uint64_t off = op->off;
uint64_t len = op->len;
tracepoint(objectstore, clone_range_enter, osr_name, len);
case Transaction::OP_CLONERANGE2:
{
- coll_t cid = i.get_cid(op->cid);
+ const coll_t &_cid = i.get_cid(op->cid);
const ghobject_t &oid = i.get_oid(op->oid);
- coll_t ncid = cid;
const ghobject_t &noid = i.get_oid(op->dest_oid);
- _kludge_temp_object_collection(cid, oid);
- _kludge_temp_object_collection(ncid, noid);
+ const coll_t &cid = !_need_temp_object_collection(_cid, oid) ?
+ _cid : _cid.get_temp();
+ const coll_t &ncid = !_need_temp_object_collection(_cid, noid) ?
+ _cid : _cid.get_temp();
uint64_t srcoff = op->off;
uint64_t len = op->len;
uint64_t dstoff = op->dest_off;
case Transaction::OP_MKCOLL:
{
- coll_t cid = i.get_cid(op->cid);
+ const coll_t &cid = i.get_cid(op->cid);
tracepoint(objectstore, mkcoll_enter, osr_name);
if (_check_replay_guard(cid, spos) > 0)
r = _create_collection(cid, spos);
case Transaction::OP_COLL_HINT:
{
- coll_t cid = i.get_cid(op->cid);
+ const coll_t &cid = i.get_cid(op->cid);
uint32_t type = op->hint_type;
bufferlist hint;
i.decode_bl(hint);
case Transaction::OP_RMCOLL:
{
- coll_t cid = i.get_cid(op->cid);
+ const coll_t &cid = i.get_cid(op->cid);
tracepoint(objectstore, rmcoll_enter, osr_name);
if (_check_replay_guard(cid, spos) > 0)
r = _destroy_collection(cid);
case Transaction::OP_COLL_ADD:
{
- coll_t ocid = i.get_cid(op->cid);
- coll_t ncid = i.get_cid(op->dest_cid);
+ const coll_t &ocid = i.get_cid(op->cid);
+ const coll_t &ncid = i.get_cid(op->dest_cid);
const ghobject_t &oid = i.get_oid(op->oid);
assert(oid.hobj.pool >= -1);
// always followed by OP_COLL_REMOVE
Transaction::Op *op2 = i.decode_op();
- coll_t ocid2 = i.get_cid(op2->cid);
+ const coll_t &ocid2 = i.get_cid(op2->cid);
const ghobject_t &oid2 = i.get_oid(op2->oid);
assert(op2->op == Transaction::OP_COLL_REMOVE);
assert(ocid2 == ocid);
case Transaction::OP_COLL_MOVE:
{
// WARNING: this is deprecated and buggy; only here to replay old journals.
- coll_t ocid = i.get_cid(op->cid);
- coll_t ncid = i.get_cid(op->dest_cid);
+ const coll_t &ocid = i.get_cid(op->cid);
+ const coll_t &ncid = i.get_cid(op->dest_cid);
const ghobject_t &oid = i.get_oid(op->oid);
tracepoint(objectstore, coll_move_enter);
r = _collection_add(ocid, ncid, oid, spos);
case Transaction::OP_COLL_MOVE_RENAME:
{
- coll_t oldcid = i.get_cid(op->cid);
+ const coll_t &_oldcid = i.get_cid(op->cid);
const ghobject_t &oldoid = i.get_oid(op->oid);
- coll_t newcid = i.get_cid(op->dest_cid);
+ const coll_t &_newcid = i.get_cid(op->dest_cid);
const ghobject_t &newoid = i.get_oid(op->dest_oid);
- _kludge_temp_object_collection(oldcid, oldoid);
- _kludge_temp_object_collection(newcid, newoid);
+ const coll_t &oldcid = !_need_temp_object_collection(_oldcid, oldoid) ?
+ _oldcid : _oldcid.get_temp();
+ const coll_t &newcid = !_need_temp_object_collection(_newcid, newoid) ?
+ _oldcid : _newcid.get_temp();
tracepoint(objectstore, coll_move_rename_enter);
r = _collection_move_rename(oldcid, oldoid, newcid, newoid, spos);
tracepoint(objectstore, coll_move_rename_exit, r);
case Transaction::OP_TRY_RENAME:
{
- coll_t oldcid = i.get_cid(op->cid);
- coll_t newcid = oldcid;
+ const coll_t &_cid = i.get_cid(op->cid);
const ghobject_t &oldoid = i.get_oid(op->oid);
const ghobject_t &newoid = i.get_oid(op->dest_oid);
- _kludge_temp_object_collection(oldcid, oldoid);
- _kludge_temp_object_collection(newcid, newoid);
+ const coll_t &oldcid = !_need_temp_object_collection(_cid, oldoid) ?
+ _cid : _cid.get_temp();
+ const coll_t &newcid = !_need_temp_object_collection(_cid, newoid) ?
+ _cid : _cid.get_temp();
tracepoint(objectstore, coll_try_rename_enter);
r = _collection_move_rename(oldcid, oldoid, newcid, newoid, spos, true);
tracepoint(objectstore, coll_try_rename_exit, r);
case Transaction::OP_OMAP_CLEAR:
{
- coll_t cid = i.get_cid(op->cid);
+ const coll_t &_cid = i.get_cid(op->cid);
const ghobject_t &oid = i.get_oid(op->oid);
- _kludge_temp_object_collection(cid, oid);
+ const coll_t &cid = !_need_temp_object_collection(_cid, oid) ?
+ _cid : _cid.get_temp();
tracepoint(objectstore, omap_clear_enter, osr_name);
r = _omap_clear(cid, oid, spos);
tracepoint(objectstore, omap_clear_exit, r);
break;
case Transaction::OP_OMAP_SETKEYS:
{
- coll_t cid = i.get_cid(op->cid);
+ const coll_t &_cid = i.get_cid(op->cid);
const ghobject_t &oid = i.get_oid(op->oid);
- _kludge_temp_object_collection(cid, oid);
+ const coll_t &cid = !_need_temp_object_collection(_cid, oid) ?
+ _cid : _cid.get_temp();
map<string, bufferlist> aset;
i.decode_attrset(aset);
tracepoint(objectstore, omap_setkeys_enter, osr_name);
break;
case Transaction::OP_OMAP_RMKEYS:
{
- coll_t cid = i.get_cid(op->cid);
+ const coll_t &_cid = i.get_cid(op->cid);
const ghobject_t &oid = i.get_oid(op->oid);
- _kludge_temp_object_collection(cid, oid);
+ const coll_t &cid = !_need_temp_object_collection(_cid, oid) ?
+ _cid : _cid.get_temp();
set<string> keys;
i.decode_keyset(keys);
tracepoint(objectstore, omap_rmkeys_enter, osr_name);
break;
case Transaction::OP_OMAP_RMKEYRANGE:
{
- coll_t cid = i.get_cid(op->cid);
+ const coll_t &_cid = i.get_cid(op->cid);
const ghobject_t &oid = i.get_oid(op->oid);
- _kludge_temp_object_collection(cid, oid);
+ const coll_t &cid = !_need_temp_object_collection(_cid, oid) ?
+ _cid : _cid.get_temp();
string first, last;
first = i.decode_string();
last = i.decode_string();
break;
case Transaction::OP_OMAP_SETHEADER:
{
- coll_t cid = i.get_cid(op->cid);
+ const coll_t &_cid = i.get_cid(op->cid);
const ghobject_t &oid = i.get_oid(op->oid);
- _kludge_temp_object_collection(cid, oid);
+ const coll_t &cid = !_need_temp_object_collection(_cid, oid) ?
+ _cid : _cid.get_temp();
bufferlist bl;
i.decode_bl(bl);
tracepoint(objectstore, omap_setheader_enter, osr_name);
case Transaction::OP_SETALLOCHINT:
{
- coll_t cid = i.get_cid(op->cid);
+ const coll_t &_cid = i.get_cid(op->cid);
const ghobject_t &oid = i.get_oid(op->oid);
- _kludge_temp_object_collection(cid, oid);
+ const coll_t &cid = !_need_temp_object_collection(_cid, oid) ?
+ _cid : _cid.get_temp();
uint64_t expected_object_size = op->expected_object_size;
uint64_t expected_write_size = op->expected_write_size;
tracepoint(objectstore, setallochint_enter, osr_name);