lvol: add a wrapper function for calling spdk_bs_init

Purpose: Make the max_channel_ops initialization
in the single place, and we only need to call
spdk_lvol_bs_opts_init instead of spdk_bs_opts_init

Change-Id: If1dd0b30e982a26ab2801a0dd99dd82633e02c74
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/393722
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Ziye Yang 2018-01-05 11:16:37 +08:00 committed by Jim Harris
parent 9c44fad7e7
commit e4150a5540

View File

@ -368,6 +368,13 @@ _spdk_lvs_load_cb(void *cb_arg, struct spdk_blob_store *bs, int lvolerrno)
spdk_bs_get_super(bs, _spdk_lvs_open_super, req);
}
static void
spdk_lvs_bs_opts_init(struct spdk_bs_opts *opts)
{
spdk_bs_opts_init(opts);
opts->max_channel_ops = SPDK_LVOL_BLOB_OPTS_CHANNEL_OPS;
}
void
spdk_lvs_load(struct spdk_bs_dev *bs_dev, spdk_lvs_op_with_handle_complete cb_fn, void *cb_arg)
{
@ -393,8 +400,7 @@ spdk_lvs_load(struct spdk_bs_dev *bs_dev, spdk_lvs_op_with_handle_complete cb_fn
req->cb_arg = cb_arg;
req->bs_dev = bs_dev;
spdk_bs_opts_init(&opts);
opts.max_channel_ops = SPDK_LVOL_BLOB_OPTS_CHANNEL_OPS;
spdk_lvs_bs_opts_init(&opts);
strncpy(opts.bstype.bstype, "LVOLSTORE", SPDK_BLOBSTORE_TYPE_LENGTH);
spdk_bs_load(bs_dev, &opts, _spdk_lvs_load_cb, req);
@ -535,7 +541,7 @@ static void
_spdk_setup_lvs_opts(struct spdk_bs_opts *bs_opts, struct spdk_lvs_opts *o)
{
assert(o != NULL);
spdk_bs_opts_init(bs_opts);
spdk_lvs_bs_opts_init(bs_opts);
bs_opts->cluster_sz = o->cluster_sz;
}