Commit aa3fdd01 authored by paul luse's avatar paul luse Committed by Jim Harris
Browse files

bdev/compress: insert vol unload into base bdev hotremove path



Change-Id: I0c23746fb210a8c209e98276fe0830185ee81407
Signed-off-by: default avatarpaul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447372


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent dd54dff7
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -766,6 +766,20 @@ _comp_reduce_unmap(struct spdk_reduce_backing_dev *dev,
	}
}


/* Called by reduceLib after performing unload vol actions following base bdev hotremove */
static void
bdev_hotremove_vol_unload_cb(void *cb_arg, int reduce_errno)
{
	struct vbdev_compress *comp_bdev = (struct vbdev_compress *)cb_arg;

	if (reduce_errno) {
		SPDK_ERRLOG("error %d\n", reduce_errno);
	}

	spdk_bdev_unregister(&comp_bdev->comp_bdev, NULL, NULL);
}

/* Called when the underlying base bdev goes away. */
static void
vbdev_compress_base_bdev_hotremove_cb(void *ctx)
@@ -775,7 +789,8 @@ vbdev_compress_base_bdev_hotremove_cb(void *ctx)

	TAILQ_FOREACH_SAFE(comp_bdev, &g_vbdev_comp, link, tmp) {
		if (bdev_find == comp_bdev->base_bdev) {
			spdk_bdev_unregister(&comp_bdev->comp_bdev, NULL, NULL);
			/* Tell reducelib that we're done with this volume. */
			spdk_reduce_vol_unload(comp_bdev->vol, bdev_hotremove_vol_unload_cb, comp_bdev);
		}
	}
}