[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH] block: Swap request limit definitions
From: |
Max Reitz |
Subject: |
[Qemu-block] [PATCH] block: Swap request limit definitions |
Date: |
Sun, 12 Feb 2017 02:47:24 +0100 |
Defining BDRV_REQUEST_MAX_SECTORS based on BDRV_REQUEST_MAX_BYTES is
simpler than the other way around.
Signed-off-by: Max Reitz <address@hidden>
---
include/block/block.h | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/include/block/block.h b/include/block/block.h
index 4e81f2069b..101ef33f6b 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -114,9 +114,8 @@ typedef struct HDGeometry {
#define BDRV_SECTOR_SIZE (1ULL << BDRV_SECTOR_BITS)
#define BDRV_SECTOR_MASK ~(BDRV_SECTOR_SIZE - 1)
-#define BDRV_REQUEST_MAX_SECTORS MIN(SIZE_MAX >> BDRV_SECTOR_BITS, \
- INT_MAX >> BDRV_SECTOR_BITS)
-#define BDRV_REQUEST_MAX_BYTES (BDRV_REQUEST_MAX_SECTORS << BDRV_SECTOR_BITS)
+#define BDRV_REQUEST_MAX_BYTES MIN(SIZE_MAX, INT_MAX)
+#define BDRV_REQUEST_MAX_SECTORS (BDRV_REQUEST_MAX_BYTES >>
BDRV_SECTOR_BITS)
/*
* Allocation status flags
--
2.11.0
- [Qemu-block] [PATCH] block: Swap request limit definitions,
Max Reitz <=
- Re: [Qemu-block] [Qemu-devel] [PATCH] block: Swap request limit definitions, Fam Zheng, 2017/02/13
- Re: [Qemu-block] [PATCH] block: Swap request limit definitions, Alberto Garcia, 2017/02/13
- Re: [Qemu-block] [PATCH] block: Swap request limit definitions, Max Reitz, 2017/02/13
- Re: [Qemu-block] [PATCH] block: Swap request limit definitions, Alberto Garcia, 2017/02/14
- Re: [Qemu-block] [PATCH] block: Swap request limit definitions, Max Reitz, 2017/02/15
- Re: [Qemu-block] [PATCH] block: Swap request limit definitions, Kevin Wolf, 2017/02/15
- Re: [Qemu-block] [PATCH] block: Swap request limit definitions, Max Reitz, 2017/02/15
- Re: [Qemu-block] [PATCH] block: Swap request limit definitions, Kevin Wolf, 2017/02/15
- Re: [Qemu-block] [PATCH] block: Swap request limit definitions, Max Reitz, 2017/02/15