All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block: Swap request limit definitions
@ 2017-02-12  1:47 Max Reitz
  2017-02-13  5:52 ` Fam Zheng
  2017-02-13  8:39 ` [Qemu-devel] [Qemu-block] " Alberto Garcia
  0 siblings, 2 replies; 10+ messages in thread
From: Max Reitz @ 2017-02-12  1:47 UTC (permalink / raw)
  To: qemu-block; +Cc: qemu-devel, Max Reitz, Kevin Wolf

Defining BDRV_REQUEST_MAX_SECTORS based on BDRV_REQUEST_MAX_BYTES is
simpler than the other way around.

Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-02-15 17:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-12  1:47 [Qemu-devel] [PATCH] block: Swap request limit definitions Max Reitz
2017-02-13  5:52 ` Fam Zheng
2017-02-13  8:39 ` [Qemu-devel] [Qemu-block] " Alberto Garcia
2017-02-13 17:13   ` Max Reitz
2017-02-14  9:52     ` Alberto Garcia
2017-02-15 13:42       ` Max Reitz
2017-02-15 16:44         ` Kevin Wolf
2017-02-15 16:48           ` Max Reitz
2017-02-15 17:10             ` Kevin Wolf
2017-02-15 17:15               ` Max Reitz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.