summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Farnum <greg@inktank.com>2013-09-30 16:59:52 -0700
committerGreg Farnum <greg@inktank.com>2013-10-01 16:29:44 -0700
commit010ff3759efc650d766348ab988c302996b8fc50 (patch)
tree2f0d43c69c1a9bf102f0b8c576a11c62bb2a9d93
parent1ae8ef28e7c511ac754429c8c061513fdf1c22b6 (diff)
downloadceph-010ff3759efc650d766348ab988c302996b8fc50.tar.gz
ReplicatedPG: copy: specify the temp_oid in the caller
Signed-off-by: Greg Farnum <greg@inktank.com>
-rw-r--r--src/osd/ReplicatedPG.cc10
-rw-r--r--src/osd/ReplicatedPG.h10
2 files changed, 13 insertions, 7 deletions
diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc
index cfac7dd7db2..c3a572509bc 100644
--- a/src/osd/ReplicatedPG.cc
+++ b/src/osd/ReplicatedPG.cc
@@ -3764,7 +3764,9 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
result = -EINVAL;
break;
}
- result = start_copy(ctx, ctx->obc, src, src_oloc, src_version);
+ hobject_t temp_target = generate_temp_object();
+ result = start_copy(ctx, ctx->obc, src, src_oloc, src_version,
+ temp_target);
if (result < 0)
goto fail;
result = -EINPROGRESS;
@@ -4380,7 +4382,8 @@ struct C_Copyfrom : public Context {
};
int ReplicatedPG::start_copy(OpContext *ctx, ObjectContextRef obc,
- hobject_t src, object_locator_t oloc, version_t version)
+ hobject_t src, object_locator_t oloc, version_t version,
+ const hobject_t& temp_dest_oid)
{
const hobject_t& dest = ctx->obs->oi.soid;
dout(10) << __func__ << " " << dest << " ctx " << ctx
@@ -4395,7 +4398,7 @@ int ReplicatedPG::start_copy(OpContext *ctx, ObjectContextRef obc,
cancel_copy(cop);
}
- CopyOpRef cop(new CopyOp(ctx, obc, src, oloc, version));
+ CopyOpRef cop(new CopyOp(ctx, obc, src, oloc, version, temp_dest_oid));
copy_ops[dest] = cop;
ctx->copy_op = cop;
++obc->copyfrom_readside;
@@ -4466,7 +4469,6 @@ void ReplicatedPG::process_copy_chunk(hobject_t oid, tid_t tid, int r)
if (cop->temp_cursor.is_initial()) {
cop->temp_coll = get_temp_coll(&tctx->local_t);
- cop->temp_oid = generate_temp_object();
repop->ctx->new_temp_oid = cop->temp_oid;
}
diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h
index 5f0c97b3716..e4f6848d6c0 100644
--- a/src/osd/ReplicatedPG.h
+++ b/src/osd/ReplicatedPG.h
@@ -115,11 +115,13 @@ public:
hobject_t temp_oid;
object_copy_cursor_t temp_cursor;
- CopyOp(OpContext *c, ObjectContextRef _obc, hobject_t s, object_locator_t l, version_t v)
+ CopyOp(OpContext *c, ObjectContextRef _obc, hobject_t s, object_locator_t l,
+ version_t v, const hobject_t& dest)
: ctx(c), obc(_obc), src(s), oloc(l), version(v),
objecter_tid(0),
size(0),
- rval(-1)
+ rval(-1),
+ temp_oid(dest)
{}
};
typedef boost::shared_ptr<CopyOp> CopyOpRef;
@@ -723,7 +725,9 @@ protected:
// -- copyfrom --
map<hobject_t, CopyOpRef> copy_ops;
- int start_copy(OpContext *ctx, ObjectContextRef obc, 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,
+ const hobject_t& temp_dest_oid);
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);