Commit c4a1c90a authored by Karol Latecki's avatar Karol Latecki Committed by Changpeng Liu
Browse files

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: default avatarKarol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460958


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarVitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
parent 37c04b7b
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -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;