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: Mateusz Kozlowski <mateusz.kozlowski@intel.com> Change-Id: Ie1d480983636f26840dba9a3a6c93b2883903bdb Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460519 Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com> Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
a039d024ff
commit
7a867c4fdb
@ -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 {
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user