Skip to contentSkip to conversation

block: change variable names in BlockDriverState

PATCH Superseded Manos Pitsidianakis 2 participants 2 messages Jun 7, 2017 – Jun 8, 2017

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: change variable names in BlockDriverState

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.

---
 include/block/block_int.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/block/block_int.h +2 -2
index cb78c4f..06e398b 100644
@@ -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
Signature · 1 line
2.11.0
#1 lore raw
Quoted 14 lines · Manos Pitsidianakis

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.

---
 include/block/block_int.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/block/block_int.h +0 -0
index cb78c4f..06e398b 100644

include/block/block_int.h struct BlockDriver { · line 167

Quoted 8 lines
include/block/block_int.h +2 -2
@@ -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().