aio/rpc: make filename an obligatory argument

Filename should not be an optional argument.
Making it obligatory removes the need for further checks as it
should then be checked in json decode.

Change-Id: Ia779c2623db8d5cdde3983507e3b2b3cfb7e971f
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460958
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
Karol Latecki 2019-07-09 12:47:13 +02:00 committed by Changpeng Liu
parent 37c04b7be8
commit c4a1c90a4c

View File

@ -52,7 +52,7 @@ free_rpc_construct_aio(struct rpc_construct_aio *req)
static const struct spdk_json_object_decoder rpc_construct_aio_decoders[] = {
{"name", offsetof(struct rpc_construct_aio, name), spdk_json_decode_string},
{"filename", offsetof(struct rpc_construct_aio, filename), spdk_json_decode_string, true},
{"filename", offsetof(struct rpc_construct_aio, filename), spdk_json_decode_string},
{"block_size", offsetof(struct rpc_construct_aio, block_size), spdk_json_decode_uint32, true},
};
@ -72,11 +72,6 @@ spdk_rpc_construct_aio_bdev(struct spdk_jsonrpc_request *request,
goto invalid;
}
if (req.filename == NULL) {
rc = -EINVAL;
goto invalid;
}
rc = create_aio_bdev(req.name, req.filename, req.block_size);
if (rc) {
goto invalid;