diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2017-06-09 13:18:08 +0300 |
---|---|---|
committer | Max Reitz <mreitz@redhat.com> | 2017-06-26 14:54:46 +0200 |
commit | f5a5ca796932d04cb2a1cb9382a55f72795b3e06 (patch) | |
tree | 4a34a4deddf9ab05de27ea83df28bcc03498fdc4 /block/iscsi.c | |
parent | c5f1ad429cdf26023cf331075a7d327708e3db6d (diff) |
block: change variable names in BlockDriverState
Change the 'int count' parameter in *pwrite_zeros, *pdiscard related
functions (and some others) to 'int bytes', as they both refer to bytes.
This helps with code legibility.
Signed-off-by: Manos Pitsidianakis <el13635@mail.ntua.gr>
Message-id: 20170609101808.13506-1-el13635@mail.ntua.gr
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block/iscsi.c')
-rw-r--r-- | block/iscsi.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/block/iscsi.c b/block/iscsi.c index b5f7a228b9..54067e2620 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -1116,14 +1116,14 @@ iscsi_getlength(BlockDriverState *bs) } static int -coroutine_fn iscsi_co_pdiscard(BlockDriverState *bs, int64_t offset, int count) +coroutine_fn iscsi_co_pdiscard(BlockDriverState *bs, int64_t offset, int bytes) { IscsiLun *iscsilun = bs->opaque; struct IscsiTask iTask; struct unmap_list list; int r = 0; - if (!is_byte_request_lun_aligned(offset, count, iscsilun)) { + if (!is_byte_request_lun_aligned(offset, bytes, iscsilun)) { return -ENOTSUP; } @@ -1133,7 +1133,7 @@ coroutine_fn iscsi_co_pdiscard(BlockDriverState *bs, int64_t offset, int count) } list.lba = offset / iscsilun->block_size; - list.num = count / iscsilun->block_size; + list.num = bytes / iscsilun->block_size; iscsi_co_init_iscsitask(iscsilun, &iTask); qemu_mutex_lock(&iscsilun->mutex); @@ -1174,7 +1174,7 @@ retry: } iscsi_allocmap_set_invalid(iscsilun, offset >> BDRV_SECTOR_BITS, - count >> BDRV_SECTOR_BITS); + bytes >> BDRV_SECTOR_BITS); out_unlock: qemu_mutex_unlock(&iscsilun->mutex); @@ -1183,7 +1183,7 @@ out_unlock: static int coroutine_fn iscsi_co_pwrite_zeroes(BlockDriverState *bs, int64_t offset, - int count, BdrvRequestFlags flags) + int bytes, BdrvRequestFlags flags) { IscsiLun *iscsilun = bs->opaque; struct IscsiTask iTask; @@ -1192,7 +1192,7 @@ coroutine_fn iscsi_co_pwrite_zeroes(BlockDriverState *bs, int64_t offset, bool use_16_for_ws = iscsilun->use_16_for_rw; int r = 0; - if (!is_byte_request_lun_aligned(offset, count, iscsilun)) { + if (!is_byte_request_lun_aligned(offset, bytes, iscsilun)) { return -ENOTSUP; } @@ -1215,7 +1215,7 @@ coroutine_fn iscsi_co_pwrite_zeroes(BlockDriverState *bs, int64_t offset, } lba = offset / iscsilun->block_size; - nb_blocks = count / iscsilun->block_size; + nb_blocks = bytes / iscsilun->block_size; if (iscsilun->zeroblock == NULL) { iscsilun->zeroblock = g_try_malloc0(iscsilun->block_size); @@ -1273,17 +1273,17 @@ retry: if (iTask.status != SCSI_STATUS_GOOD) { iscsi_allocmap_set_invalid(iscsilun, offset >> BDRV_SECTOR_BITS, - count >> BDRV_SECTOR_BITS); + bytes >> BDRV_SECTOR_BITS); r = iTask.err_code; goto out_unlock; } if (flags & BDRV_REQ_MAY_UNMAP) { iscsi_allocmap_set_invalid(iscsilun, offset >> BDRV_SECTOR_BITS, - count >> BDRV_SECTOR_BITS); + bytes >> BDRV_SECTOR_BITS); } else { iscsi_allocmap_set_allocated(iscsilun, offset >> BDRV_SECTOR_BITS, - count >> BDRV_SECTOR_BITS); + bytes >> BDRV_SECTOR_BITS); } out_unlock: |