Skip to contentSkip to conversation

block: Fix comment for bdrv_co_get_block_status

PATCH Applied Fam Zheng 4 participants 4 messages Nov 10, 2014 – Nov 11, 2014

lore
Share & tools
lore

Fam Zheng

author
#0 lore raw

PATCH 1/1 block: Fix comment for bdrv_co_get_block_status

It returns more information than binary, fix the comment.

---
 block.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
block.c +3 -3
index dacd881..42c914e 100644
@@ -3903,9 +3903,9 @@ typedef struct BdrvCoGetBlockStatusData {
 } BdrvCoGetBlockStatusData;
 
 /*
- * Returns true iff the specified sector is present in the disk image. Drivers
- * not implementing the functionality are assumed to not support backing files,
- * hence all their sectors are reported as allocated.
+ * Returns the status of the specified sectors. Drivers not implementing the
+ * functionality are assumed to not support backing files, hence all their
+ * sectors are reported as allocated.
  *
  * If 'sector_num' is beyond the end of the disk image the return value is 0
  * and 'pnum' is set to 0.
Signature · 1 line
1.9.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 14 lines · Fam Zheng

It returns more information than binary, fix the comment.

---
  block.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
block.c +0 -0
index dacd881..42c914e 100644
@@ -3903,9 +3903,9 @@ typedef struct BdrvCoGetBlockStatusData {
  } BdrvCoGetBlockStatusData;
 

block.c typedef struct BdrvCoGetBlockStatusData { · line 3911

Quoted 10 lines
block.c +3 -3
  /*
- * Returns true iff the specified sector is present in the disk image. Drivers
- * not implementing the functionality are assumed to not support backing files,
- * hence all their sectors are reported as allocated.
+ * Returns the status of the specified sectors. Drivers not implementing the
+ * functionality are assumed to not support backing files, hence all their
+ * sectors are reported as allocated.
   *
   * If 'sector_num' is beyond the end of the disk image the return value is 0
   * and 'pnum' is set to 0.

"status" is a bit broad, but pointing to "line 86 in include/block/block.h" for a further explanation will probably not be very stable.

Reviewed-by
#2 lore raw
Quoted 29 lines · Max Reitz
Quoted 13 lines · Fam Zheng

It returns more information than binary, fix the comment.

---
  block.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
block.c +0 -0
index dacd881..42c914e 100644
@@ -3903,9 +3903,9 @@ typedef struct BdrvCoGetBlockStatusData {
  } BdrvCoGetBlockStatusData;

block.c typedef struct BdrvCoGetBlockStatusData { · line 3910

Quoted 10 lines
block.c +3 -3
    /*
- * Returns true iff the specified sector is present in the disk image. Drivers
- * not implementing the functionality are assumed to not support backing files,
- * hence all their sectors are reported as allocated.
+ * Returns the status of the specified sectors. Drivers not implementing the
+ * functionality are assumed to not support backing files, hence all their
+ * sectors are reported as allocated.
   *
   * If 'sector_num' is beyond the end of the disk image the return value is 0
   * and 'pnum' is set to 0.

"status" is a bit broad, but pointing to "line 86 in include/block/block.h" for a further explanation will probably not be very stable.

Quoted 1 line

Could perhaps call it "allocation status", and squash in something like

include/block/block.h +3 -1
index 13e4537..5450610 100644
@@ -83,7 +83,9 @@ typedef enum {
 #define BDRV_SECTOR_SIZE   (1ULL << BDRV_SECTOR_BITS)
 #define BDRV_SECTOR_MASK   ~(BDRV_SECTOR_SIZE - 1)
 
-/* BDRV_BLOCK_DATA: data is read from bs->file or another file
+/*
+ * Allocation status flags
+ * BDRV_BLOCK_DATA: data is read from bs->file or another file
  * BDRV_BLOCK_ZERO: sectors read as zero
  * BDRV_BLOCK_OFFSET_VALID: sector stored in bs->file as raw data
  * BDRV_BLOCK_ALLOCATED: the content of the block is determined by this

Anyway, it's an improvement already, so

#3 lore raw
In reply to Fam Zheng
Quoted 1 line · Fam Zheng

It returns more information than binary, fix the comment.

Applied to -trivial, with the fixup suggested by Markus -- hope that's okay with you, Fam and Max... ;)

Thanks,

/mjt