blob: add do/while (false) to blob_request_submit_op_split_next

No functional change here, this only prepares this function for
some functional changes in the next patch.  By adding the
do/while loop here we reduce the amount of whitespace changes
in the next patch.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11387 (master)

(cherry picked from commit b6992a90d3)
Change-Id: I09d64fd1fb69ee232af1d298619c762e562fdc79
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12463
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Jim Harris 2022-02-02 16:39:14 +00:00 committed by Keith Lucas
parent 2806e612e8
commit d44e3ab32e

View File

@ -2552,40 +2552,42 @@ blob_request_submit_op_split_next(void *cb_arg, int bserrno)
return;
}
op_length = spdk_min(length, bs_num_io_units_to_cluster_boundary(blob,
offset));
do {
op_length = spdk_min(length, bs_num_io_units_to_cluster_boundary(blob,
offset));
/* Update length and payload for next operation */
ctx->io_units_remaining -= op_length;
ctx->io_unit_offset += op_length;
if (op_type == SPDK_BLOB_WRITE || op_type == SPDK_BLOB_READ) {
ctx->curr_payload += op_length * blob->bs->io_unit_size;
}
/* Update length and payload for next operation */
ctx->io_units_remaining -= op_length;
ctx->io_unit_offset += op_length;
if (op_type == SPDK_BLOB_WRITE || op_type == SPDK_BLOB_READ) {
ctx->curr_payload += op_length * blob->bs->io_unit_size;
}
switch (op_type) {
case SPDK_BLOB_READ:
spdk_blob_io_read(blob, ch, buf, offset, op_length,
blob_request_submit_op_split_next, ctx);
break;
case SPDK_BLOB_WRITE:
spdk_blob_io_write(blob, ch, buf, offset, op_length,
blob_request_submit_op_split_next, ctx);
break;
case SPDK_BLOB_UNMAP:
spdk_blob_io_unmap(blob, ch, offset, op_length,
blob_request_submit_op_split_next, ctx);
break;
case SPDK_BLOB_WRITE_ZEROES:
spdk_blob_io_write_zeroes(blob, ch, offset, op_length,
switch (op_type) {
case SPDK_BLOB_READ:
spdk_blob_io_read(blob, ch, buf, offset, op_length,
blob_request_submit_op_split_next, ctx);
break;
case SPDK_BLOB_READV:
case SPDK_BLOB_WRITEV:
SPDK_ERRLOG("readv/write not valid\n");
bs_sequence_finish(ctx->seq, -EINVAL);
free(ctx);
break;
}
break;
case SPDK_BLOB_WRITE:
spdk_blob_io_write(blob, ch, buf, offset, op_length,
blob_request_submit_op_split_next, ctx);
break;
case SPDK_BLOB_UNMAP:
spdk_blob_io_unmap(blob, ch, offset, op_length,
blob_request_submit_op_split_next, ctx);
break;
case SPDK_BLOB_WRITE_ZEROES:
spdk_blob_io_write_zeroes(blob, ch, offset, op_length,
blob_request_submit_op_split_next, ctx);
break;
case SPDK_BLOB_READV:
case SPDK_BLOB_WRITEV:
SPDK_ERRLOG("readv/write not valid\n");
bs_sequence_finish(ctx->seq, -EINVAL);
free(ctx);
break;
}
} while (false);
}
static void