bdev/lvol: remove optional flag for lvol_name in construct call

lvol_name is not an optional argument when creating a lvol bdev.
Also removing unnecessary if block.

Change-Id: I7d5790d648bce7f02bfed34bd714162d3ccb10ab
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461861
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Karol Latecki 2019-07-15 11:46:26 +02:00 committed by Darek Stojaczyk
parent 75711828a9
commit 0965d63d3a

View File

@ -346,7 +346,7 @@ free_rpc_construct_lvol_bdev(struct rpc_construct_lvol_bdev *req)
static const struct spdk_json_object_decoder rpc_construct_lvol_bdev_decoders[] = {
{"uuid", offsetof(struct rpc_construct_lvol_bdev, uuid), spdk_json_decode_string, true},
{"lvs_name", offsetof(struct rpc_construct_lvol_bdev, lvs_name), spdk_json_decode_string, true},
{"lvol_name", offsetof(struct rpc_construct_lvol_bdev, lvol_name), spdk_json_decode_string, true},
{"lvol_name", offsetof(struct rpc_construct_lvol_bdev, lvol_name), spdk_json_decode_string},
{"size", offsetof(struct rpc_construct_lvol_bdev, size), spdk_json_decode_uint64},
{"thin_provision", offsetof(struct rpc_construct_lvol_bdev, thin_provision), spdk_json_decode_bool, true},
{"clear_method", offsetof(struct rpc_construct_lvol_bdev, clear_method), spdk_json_decode_string, true},
@ -400,12 +400,6 @@ spdk_rpc_construct_lvol_bdev(struct spdk_jsonrpc_request *request,
goto invalid;
}
if (req.lvol_name == NULL) {
SPDK_INFOLOG(SPDK_LOG_LVOL_RPC, "no bdev name\n");
rc = -EINVAL;
goto invalid;
}
if (req.clear_method != NULL) {
if (!strcasecmp(req.clear_method, "none")) {
clear_method = LVOL_CLEAR_WITH_NONE;