Define the soid just before using it to avoid a redundant
definition if an error happens and function prepare_transaction
returns directly.
Signed-off-by: Enming Zhang <enming.zhang@umcloud.com>
{
assert(!ctx->ops->empty());
- const hobject_t& soid = ctx->obs->oi.soid;
-
// valid snap context?
if (!ctx->snapc.is_valid()) {
dout(10) << " invalid snapc " << ctx->snapc << dendl;
}
}
+ const hobject_t& soid = ctx->obs->oi.soid;
// clone, if necessary
if (soid.snap == CEPH_NOSNAP)
make_writeable(ctx);