lib/blob: simplify loading snapshot completion

Refactor blob loading when snapshot is present.
All paths now go through _spdk_blob_load_final().

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ifc927de6800501cdf62dba8d73e950af2a46d568
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/479143
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Tomasz Zawadzki 2020-01-02 09:11:03 -05:00
parent 42432d49dd
commit 44502e4293

View File

@ -938,25 +938,17 @@ _spdk_blob_load_snapshot_cpl(void *cb_arg, struct spdk_blob *snapshot, int bserr
struct spdk_blob_load_ctx *ctx = cb_arg;
struct spdk_blob *blob = ctx->blob;
if (bserrno != 0) {
goto error;
if (bserrno == 0) {
blob->back_bs_dev = spdk_bs_create_blob_bs_dev(snapshot);
if (blob->back_bs_dev == NULL) {
bserrno = -ENOMEM;
}
}
blob->back_bs_dev = spdk_bs_create_blob_bs_dev(snapshot);
if (blob->back_bs_dev == NULL) {
bserrno = -ENOMEM;
goto error;
if (bserrno != 0) {
SPDK_ERRLOG("Snapshot fail\n");
}
_spdk_blob_load_final(ctx, bserrno);
return;
error:
SPDK_ERRLOG("Snapshot fail\n");
ctx->cb_fn(ctx->seq, ctx->cb_arg, bserrno);
spdk_free(ctx->pages);
free(ctx);
}
static void