ReplicatedPG: copy: take an ObjectContextRef in start_copy and use that

Signed-off-by: Greg Farnum <greg@inktank.com>
This commit is contained in:
Greg Farnum 2013-09-30 16:27:39 -07:00
parent 6ed8b7ae56
commit 1ae8ef28e7
2 changed files with 6 additions and 6 deletions

View File

@ -3764,7 +3764,7 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
result = -EINVAL;
break;
}
result = start_copy(ctx, src, src_oloc, src_version);
result = start_copy(ctx, ctx->obc, src, src_oloc, src_version);
if (result < 0)
goto fail;
result = -EINPROGRESS;
@ -4379,7 +4379,7 @@ struct C_Copyfrom : public Context {
}
};
int ReplicatedPG::start_copy(OpContext *ctx,
int ReplicatedPG::start_copy(OpContext *ctx, ObjectContextRef obc,
hobject_t src, object_locator_t oloc, version_t version)
{
const hobject_t& dest = ctx->obs->oi.soid;
@ -4395,12 +4395,12 @@ int ReplicatedPG::start_copy(OpContext *ctx,
cancel_copy(cop);
}
CopyOpRef cop(new CopyOp(ctx, ctx->obc, src, oloc, version));
CopyOpRef cop(new CopyOp(ctx, obc, src, oloc, version));
copy_ops[dest] = cop;
ctx->copy_op = cop;
++ctx->obc->copyfrom_readside;
++obc->copyfrom_readside;
_copy_some(ctx->obc, cop);
_copy_some(obc, cop);
return 0;
}

View File

@ -723,7 +723,7 @@ protected:
// -- copyfrom --
map<hobject_t, CopyOpRef> copy_ops;
int start_copy(OpContext *ctx, hobject_t src, object_locator_t oloc, version_t version);
int start_copy(OpContext *ctx, ObjectContextRef obc, hobject_t src, object_locator_t oloc, version_t version);
void process_copy_chunk(hobject_t oid, tid_t tid, int r);
void _write_copy_chunk(CopyOpRef cop, ObjectStore::Transaction *t);
void _copy_some(ObjectContextRef obc, CopyOpRef cop);