mirror of
https://github.com/ceph/ceph
synced 2025-01-21 02:31:19 +00:00
ReplicatedPG: copy: take an ObjectContextRef in start_copy and use that
Signed-off-by: Greg Farnum <greg@inktank.com>
This commit is contained in:
parent
6ed8b7ae56
commit
1ae8ef28e7
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user