Commit 78f44434 authored by Tomasz Zawadzki's avatar Tomasz Zawadzki
Browse files

lvol: report io_unit_size as block_size instead of page size



Bdev underneath lvs has a certain value set as block size,
then lvolstore inherits that as `io_unit_size`,
which ends up as block size for the lvol bdev presents.

Before this patch lvs on device with block size of 512,
would create lvol bdev with block size of 512.
Meanwhile reporting in bdev_lvol_get_lvstores(),
that block_size is 4k instead.

This was result of addition of io_unit_size and
forgetting to update the value here. Previously
only I/O of page_size was allowed.

This patch adjusts the value reported to
io_unit_size.

Alternatively it could have been removed,
or name changed to "io_unit_size".
Yet for API compatibility reason this name
remains.

Info on actual page size which is always 4k,
is not useful to bdev users. No need to add
another field for that.

Signed-off-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I19701c408c389f64e25c027c7bba789294bbed94
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3289


Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
parent 6726defc
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -1016,13 +1016,11 @@ static void
rpc_dump_lvol_store_info(struct spdk_json_write_ctx *w, struct lvol_store_bdev *lvs_bdev)
{
	struct spdk_blob_store *bs;
	uint64_t cluster_size, block_size;
	uint64_t cluster_size;
	char uuid[SPDK_UUID_STRING_LEN];

	bs = lvs_bdev->lvs->blobstore;
	cluster_size = spdk_bs_get_cluster_size(bs);
	/* Block size of lvols is always size of blob store page */
	block_size = spdk_bs_get_page_size(bs);

	spdk_json_write_object_begin(w);

@@ -1037,7 +1035,7 @@ rpc_dump_lvol_store_info(struct spdk_json_write_ctx *w, struct lvol_store_bdev *

	spdk_json_write_named_uint64(w, "free_clusters", spdk_bs_free_cluster_count(bs));

	spdk_json_write_named_uint64(w, "block_size", block_size);
	spdk_json_write_named_uint64(w, "block_size", spdk_bs_get_io_unit_size(bs));

	spdk_json_write_named_uint64(w, "cluster_size", cluster_size);

+1 −1
Original line number Diff line number Diff line
{
  "base_bdev": "Malloc0",
  "block_size": 4096,
  "block_size": 512,
  "cluster_size": 4194304,
  "free_clusters": 1,
  "name": "lvs0",