[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 003/100] block: Simplify use of BDRV_BLOCK_RAW
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 003/100] block: Simplify use of BDRV_BLOCK_RAW |
Date: |
Fri, 7 Jul 2017 19:07:18 +0200 |
From: Eric Blake <address@hidden>
The lone caller that cares about a return of BDRV_BLOCK_RAW
(namely, io.c:bdrv_co_get_block_status) completely replaces the
return value, so there is no point in passing BDRV_BLOCK_DATA.
Signed-off-by: Eric Blake <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: John Snow <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/commit.c | 2 +-
block/mirror.c | 2 +-
block/raw-format.c | 2 +-
block/vpc.c | 2 +-
include/block/block.h | 6 +++---
5 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/block/commit.c b/block/commit.c
index 8c09c3d..524bd54 100644
--- a/block/commit.c
+++ b/block/commit.c
@@ -253,7 +253,7 @@ static int64_t coroutine_fn
bdrv_commit_top_get_block_status(
{
*pnum = nb_sectors;
*file = bs->backing->bs;
- return BDRV_BLOCK_RAW | BDRV_BLOCK_OFFSET_VALID | BDRV_BLOCK_DATA |
+ return BDRV_BLOCK_RAW | BDRV_BLOCK_OFFSET_VALID |
(sector_num << BDRV_SECTOR_BITS);
}
diff --git a/block/mirror.c b/block/mirror.c
index 68744a1..61a862d 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -1058,7 +1058,7 @@ static int64_t coroutine_fn
bdrv_mirror_top_get_block_status(
{
*pnum = nb_sectors;
*file = bs->backing->bs;
- return BDRV_BLOCK_RAW | BDRV_BLOCK_OFFSET_VALID | BDRV_BLOCK_DATA |
+ return BDRV_BLOCK_RAW | BDRV_BLOCK_OFFSET_VALID |
(sector_num << BDRV_SECTOR_BITS);
}
diff --git a/block/raw-format.c b/block/raw-format.c
index 0d185fe..1ea8c2d 100644
--- a/block/raw-format.c
+++ b/block/raw-format.c
@@ -259,7 +259,7 @@ static int64_t coroutine_fn
raw_co_get_block_status(BlockDriverState *bs,
*pnum = nb_sectors;
*file = bs->file->bs;
sector_num += s->offset / BDRV_SECTOR_SIZE;
- return BDRV_BLOCK_RAW | BDRV_BLOCK_OFFSET_VALID | BDRV_BLOCK_DATA |
+ return BDRV_BLOCK_RAW | BDRV_BLOCK_OFFSET_VALID |
(sector_num << BDRV_SECTOR_BITS);
}
diff --git a/block/vpc.c b/block/vpc.c
index 4240ba9..b313c68 100644
--- a/block/vpc.c
+++ b/block/vpc.c
@@ -701,7 +701,7 @@ static int64_t coroutine_fn
vpc_co_get_block_status(BlockDriverState *bs,
if (be32_to_cpu(footer->type) == VHD_FIXED) {
*pnum = nb_sectors;
*file = bs->file->bs;
- return BDRV_BLOCK_RAW | BDRV_BLOCK_OFFSET_VALID | BDRV_BLOCK_DATA |
+ return BDRV_BLOCK_RAW | BDRV_BLOCK_OFFSET_VALID |
(sector_num << BDRV_SECTOR_BITS);
}
diff --git a/include/block/block.h b/include/block/block.h
index 4c149ad..afe1b61 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -132,9 +132,9 @@ typedef struct HDGeometry {
* BDRV_BLOCK_EOF: the returned pnum covers through end of file for this layer
*
* Internal flag:
- * BDRV_BLOCK_RAW: used internally to indicate that the request was
- * answered by a passthrough driver such as raw and that the
- * block layer should recompute the answer from bs->file.
+ * BDRV_BLOCK_RAW: for use by passthrough drivers, such as raw, to request
+ * that the block layer recompute the answer from the returned
+ * BDS; must be accompanied by just BDRV_BLOCK_OFFSET_VALID.
*
* If BDRV_BLOCK_OFFSET_VALID is set, bits 9-62 (BDRV_BLOCK_OFFSET_MASK)
* represent the offset in the returned BDS that is allocated for the
--
1.8.3.1
- [Qemu-block] [PULL 000/100] Block layer patches, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 003/100] block: Simplify use of BDRV_BLOCK_RAW,
Kevin Wolf <=
- [Qemu-block] [PULL 004/100] blkdebug: Support .bdrv_co_get_block_status, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 002/100] block: Guarantee that *file is set on bdrv_get_block_status(), Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 001/100] qemu-io: Don't die on second open, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 005/100] vvfat: fix qemu-img map and qemu-img convert, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 007/100] vvfat: fix typos, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 008/100] vvfat: rename useless enumeration values, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 010/100] vvfat: fix field names in FAT12/FAT16 and FAT32 boot sectors, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 011/100] vvfat: always create . and .. entries at first and in that order, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 012/100] vvfat: correctly create long names for non-ASCII filenames, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 009/100] vvfat: introduce offset_to_bootsector, offset_to_fat and offset_to_root_dir, Kevin Wolf, 2017/07/07