[Qemu-devel] [PATCH] block: change variable names in BlockDriverState

Manos Pitsidianakis posted 1 patch 8 years, 5 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20170607224316.6952-1-el13635@mail.ntua.gr
Test FreeBSD passed
Test checkpatch passed
Test docker passed
Test s390x passed
There is a newer version of this series
include/block/block_int.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[Qemu-devel] [PATCH] block: change variable names in BlockDriverState
Posted by Manos Pitsidianakis 8 years, 5 months ago
Change the 'int count' parameter in bdrv_co_pwrite_zeros and
bdrv_co_pdiscard to 'int bytes', as they both refer to bytes.
This helps with code legibility.

Signed-off-by: Manos Pitsidianakis <el13635@mail.ntua.gr>
---
 include/block/block_int.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/block/block_int.h b/include/block/block_int.h
index cb78c4f..06e398b 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -162,9 +162,9 @@ struct BlockDriver {
      * will be called instead.
      */
     int coroutine_fn (*bdrv_co_pwrite_zeroes)(BlockDriverState *bs,
-        int64_t offset, int count, BdrvRequestFlags flags);
+        int64_t offset, int bytes, BdrvRequestFlags flags);
     int coroutine_fn (*bdrv_co_pdiscard)(BlockDriverState *bs,
-        int64_t offset, int count);
+        int64_t offset, int bytes);
 
     /*
      * Building block for bdrv_block_status[_above]. The driver should
-- 
2.11.0


Re: [Qemu-devel] [PATCH] block: change variable names in BlockDriverState
Posted by Stefan Hajnoczi 8 years, 5 months ago
On Thu, Jun 08, 2017 at 01:43:16AM +0300, Manos Pitsidianakis wrote:
> Change the 'int count' parameter in bdrv_co_pwrite_zeros and
> bdrv_co_pdiscard to 'int bytes', as they both refer to bytes.
> This helps with code legibility.
> 
> Signed-off-by: Manos Pitsidianakis <el13635@mail.ntua.gr>
> ---
>  include/block/block_int.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/block/block_int.h b/include/block/block_int.h
> index cb78c4f..06e398b 100644
> --- a/include/block/block_int.h
> +++ b/include/block/block_int.h
> @@ -162,9 +162,9 @@ struct BlockDriver {
>       * will be called instead.
>       */
>      int coroutine_fn (*bdrv_co_pwrite_zeroes)(BlockDriverState *bs,
> -        int64_t offset, int count, BdrvRequestFlags flags);
> +        int64_t offset, int bytes, BdrvRequestFlags flags);
>      int coroutine_fn (*bdrv_co_pdiscard)(BlockDriverState *bs,
> -        int64_t offset, int count);
> +        int64_t offset, int bytes);

Please also convert all the implementations of these function pointers.
For example, block/qcow2.c:qcow2_co_pwrite_zeroes().