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

bdev/compress: Populate params structure on load



On init, we pass reducelib the address of our params structure
so that the volume size is updated accordingly.  On load however,
there was nothing to set the volume size so any load of a previously
created compress volume would result in a 0 length bdev.

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


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 6dc095c4
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1214,6 +1214,7 @@ vbdev_compress_claim(struct vbdev_compress *comp_bdev)

	comp_bdev->comp_bdev.blocklen = comp_bdev->base_bdev->blocklen;
	comp_bdev->comp_bdev.blockcnt = comp_bdev->params.vol_size / comp_bdev->comp_bdev.blocklen;
	assert(comp_bdev->comp_bdev.blockcnt > 0);

	/* This is the context that is passed to us when the bdev
	 * layer calls in so we'll save our comp_bdev node here.
@@ -1312,7 +1313,10 @@ vbdev_reduce_load_cb(void *cb_arg, struct spdk_reduce_vol *vol, int reduce_errno
		return;
	}

	/* Update information following volume load. */
	meta_ctx->vol = vol;
	memcpy(&meta_ctx->params, spdk_reduce_vol_get_params(vol),
	       sizeof(struct spdk_reduce_vol_params));
	vbdev_compress_claim(meta_ctx);
	spdk_bdev_module_examine_done(&compress_if);
}
+2 −0
Original line number Diff line number Diff line
@@ -146,6 +146,8 @@ DEFINE_STUB_V(spdk_reduce_vol_unload, (struct spdk_reduce_vol *vol,
				       spdk_reduce_vol_op_complete cb_fn, void *cb_arg));
DEFINE_STUB_V(spdk_reduce_vol_load, (struct spdk_reduce_backing_dev *backing_dev,
				     spdk_reduce_vol_op_with_handle_complete cb_fn, void *cb_arg));
DEFINE_STUB(spdk_reduce_vol_get_params, const struct spdk_reduce_vol_params *,
	    (struct spdk_reduce_vol *vol), NULL);

/* DPDK stubs */
DEFINE_STUB(rte_socket_id, unsigned, (void), 0);