aboutsummaryrefslogtreecommitdiff
path: root/block/blkdebug.c
diff options
context:
space:
mode:
authorManos Pitsidianakis <el13635@mail.ntua.gr>2017-06-09 13:18:08 +0300
committerMax Reitz <mreitz@redhat.com>2017-06-26 14:54:46 +0200
commitf5a5ca796932d04cb2a1cb9382a55f72795b3e06 (patch)
tree4a34a4deddf9ab05de27ea83df28bcc03498fdc4 /block/blkdebug.c
parentc5f1ad429cdf26023cf331075a7d327708e3db6d (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/blkdebug.c')
-rw-r--r--block/blkdebug.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/block/blkdebug.c b/block/blkdebug.c
index 0618fc71c6..6431962d7e 100644
--- a/block/blkdebug.c
+++ b/block/blkdebug.c
@@ -575,7 +575,7 @@ static int blkdebug_co_flush(BlockDriverState *bs)
}
static int coroutine_fn blkdebug_co_pwrite_zeroes(BlockDriverState *bs,
- int64_t offset, int count,
+ int64_t offset, int bytes,
BdrvRequestFlags flags)
{
uint32_t align = MAX(bs->bl.request_alignment,
@@ -586,29 +586,29 @@ static int coroutine_fn blkdebug_co_pwrite_zeroes(BlockDriverState *bs,
* preferred alignment (so that we test the fallback to writes on
* unaligned portions), and check that the block layer never hands
* us anything unaligned that crosses an alignment boundary. */
- if (count < align) {
+ if (bytes < align) {
assert(QEMU_IS_ALIGNED(offset, align) ||
- QEMU_IS_ALIGNED(offset + count, align) ||
+ QEMU_IS_ALIGNED(offset + bytes, align) ||
DIV_ROUND_UP(offset, align) ==
- DIV_ROUND_UP(offset + count, align));
+ DIV_ROUND_UP(offset + bytes, align));
return -ENOTSUP;
}
assert(QEMU_IS_ALIGNED(offset, align));
- assert(QEMU_IS_ALIGNED(count, align));
+ assert(QEMU_IS_ALIGNED(bytes, align));
if (bs->bl.max_pwrite_zeroes) {
- assert(count <= bs->bl.max_pwrite_zeroes);
+ assert(bytes <= bs->bl.max_pwrite_zeroes);
}
- err = rule_check(bs, offset, count);
+ err = rule_check(bs, offset, bytes);
if (err) {
return err;
}
- return bdrv_co_pwrite_zeroes(bs->file, offset, count, flags);
+ return bdrv_co_pwrite_zeroes(bs->file, offset, bytes, flags);
}
static int coroutine_fn blkdebug_co_pdiscard(BlockDriverState *bs,
- int64_t offset, int count)
+ int64_t offset, int bytes)
{
uint32_t align = bs->bl.pdiscard_alignment;
int err;
@@ -616,29 +616,29 @@ static int coroutine_fn blkdebug_co_pdiscard(BlockDriverState *bs,
/* Only pass through requests that are larger than requested
* minimum alignment, and ensure that unaligned requests do not
* cross optimum discard boundaries. */
- if (count < bs->bl.request_alignment) {
+ if (bytes < bs->bl.request_alignment) {
assert(QEMU_IS_ALIGNED(offset, align) ||
- QEMU_IS_ALIGNED(offset + count, align) ||
+ QEMU_IS_ALIGNED(offset + bytes, align) ||
DIV_ROUND_UP(offset, align) ==
- DIV_ROUND_UP(offset + count, align));
+ DIV_ROUND_UP(offset + bytes, align));
return -ENOTSUP;
}
assert(QEMU_IS_ALIGNED(offset, bs->bl.request_alignment));
- assert(QEMU_IS_ALIGNED(count, bs->bl.request_alignment));
- if (align && count >= align) {
+ assert(QEMU_IS_ALIGNED(bytes, bs->bl.request_alignment));
+ if (align && bytes >= align) {
assert(QEMU_IS_ALIGNED(offset, align));
- assert(QEMU_IS_ALIGNED(count, align));
+ assert(QEMU_IS_ALIGNED(bytes, align));
}
if (bs->bl.max_pdiscard) {
- assert(count <= bs->bl.max_pdiscard);
+ assert(bytes <= bs->bl.max_pdiscard);
}
- err = rule_check(bs, offset, count);
+ err = rule_check(bs, offset, bytes);
if (err) {
return err;
}
- return bdrv_co_pdiscard(bs->file->bs, offset, count);
+ return bdrv_co_pdiscard(bs->file->bs, offset, bytes);
}
static void blkdebug_close(BlockDriverState *bs)