Commit 7a867c4f authored by Mateusz Kozlowski's avatar Mateusz Kozlowski Committed by Jim Harris
Browse files

lib/ftl: Pass ftl conf to write_config rpc function



Changed write_config to use the ftl configuration file instead of
allow_open_bands directly. This allows for easier expansion of saved
fields.

Signed-off-by: default avatarMateusz Kozlowski <mateusz.kozlowski@intel.com>
Change-Id: Ie1d480983636f26840dba9a3a6c93b2883903bdb
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460519


Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: default avatarWojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent a039d024
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -150,12 +150,12 @@ struct spdk_ftl_attrs {
	size_t					lbk_size;
	/* Write buffer cache */
	struct spdk_bdev_desc			*cache_bdev_desc;
	/* Allow partial recovery after dirty shutdown */
	bool					allow_open_bands;
	/* Number of chunks per parallel unit in the underlying device (including any offline ones) */
	size_t					num_chunks;
	/* Number of sectors per chunk */
	size_t					chunk_size;
	/* Device specific configuration */
	struct spdk_ftl_conf			conf;
};

struct ftl_module_init_opts {
+1 −1
Original line number Diff line number Diff line
@@ -441,7 +441,7 @@ bdev_ftl_write_config_json(struct spdk_bdev *bdev, struct spdk_json_write_ctx *w
	spdk_json_write_named_object_begin(w, "params");
	spdk_json_write_named_string(w, "name", ftl_bdev->bdev.name);

	spdk_json_write_named_bool(w, "allow_open_bands", attrs.allow_open_bands);
	spdk_json_write_named_bool(w, "allow_open_bands", attrs.conf.allow_open_bands);

	spdk_uuid_fmt_lower(uuid, sizeof(uuid), &attrs.uuid);
	spdk_json_write_named_string(w, "uuid", uuid);
+1 −1
Original line number Diff line number Diff line
@@ -1872,9 +1872,9 @@ spdk_ftl_dev_get_attrs(const struct spdk_ftl_dev *dev, struct spdk_ftl_attrs *at
	attrs->lbk_size = FTL_BLOCK_SIZE;
	attrs->range = dev->range;
	attrs->cache_bdev_desc = dev->nv_cache.bdev_desc;
	attrs->allow_open_bands = dev->conf.allow_open_bands;
	attrs->num_chunks = dev->geo.num_chk;
	attrs->chunk_size = dev->geo.clba;
	attrs->conf = dev->conf;
}

static void