Commit 99a1020f authored by Jim Harris's avatar Jim Harris
Browse files

blob: move data_ro check into rw_iov function



This keeps the top level functions as simple pass-throughs
which will simplify some future commits.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I6578a1440d0404f600c055a5e37f28468b633d6f

Reviewed-on: https://review.gerrithub.io/390899


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent c127a236
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -1303,6 +1303,11 @@ _spdk_blob_request_submit_rw_iov(struct spdk_blob *blob, struct spdk_io_channel

	assert(blob != NULL);

	if (!read && blob->data_ro) {
		cb_fn(cb_arg, -EPERM);
		return;
	}

	if (length == 0) {
		cb_fn(cb_arg, 0);
		return;
@@ -2939,10 +2944,6 @@ void spdk_bs_io_writev_blob(struct spdk_blob *blob, struct spdk_io_channel *chan
			    struct iovec *iov, int iovcnt, uint64_t offset, uint64_t length,
			    spdk_blob_op_complete cb_fn, void *cb_arg)
{
	if (blob->data_ro) {
		cb_fn(cb_arg, -EPERM);
		return;
	}
	_spdk_blob_request_submit_rw_iov(blob, channel, iov, iovcnt, offset, length, cb_fn, cb_arg, false);
}