bdev/lvol: vbdev_lvol_destroy(): no need to del alias

The lvol's destructor vbdev_lvol_unregister() will do this work
at the end.

Change-Id: I8231978f8336883df16ecc7ecff9a0919f698a1d
Signed-off-by: wuzhouhui <wuzhouhui@kingsoft.com>
Reviewed-on: https://review.gerrithub.io/422195
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
wuzhouhui 2018-08-14 15:17:22 +08:00 committed by Changpeng Liu
parent 476b1b0fc9
commit 57a5c6020b

View File

@ -583,7 +583,6 @@ void
vbdev_lvol_destroy(struct spdk_lvol *lvol, spdk_lvol_op_complete cb_fn, void *cb_arg)
{
struct vbdev_lvol_destroy_ctx *ctx;
char *alias;
assert(lvol != NULL);
assert(cb_fn != NULL);
@ -606,17 +605,6 @@ vbdev_lvol_destroy(struct spdk_lvol *lvol, spdk_lvol_op_complete cb_fn, void *cb
ctx->cb_fn = cb_fn;
ctx->cb_arg = cb_arg;
alias = spdk_sprintf_alloc("%s/%s", lvol->lvol_store->name, lvol->name);
if (alias != NULL) {
spdk_bdev_alias_del(lvol->bdev, alias);
free(alias);
} else {
SPDK_ERRLOG("Cannot alloc memory for alias\n");
cb_fn(cb_arg, -ENOMEM);
free(ctx);
return;
}
spdk_bdev_unregister(lvol->bdev, _vbdev_lvol_destroy_cb, ctx);
}