qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v2 2/2] block/raw-posix: use seek_hole ahead of fiem


From: Tony Breeds
Subject: [Qemu-devel] [PATCH v2 2/2] block/raw-posix: use seek_hole ahead of fiemap
Date: Fri, 26 Sep 2014 09:14:12 +1000

try_fiemap() uses FIEMAP_FLAG_SYNC which has a significant performance
impact.

Prefer seek_hole() over fiemap() to avoid this impact where possible.
seek_hole is more widely used and, arguably, has potential to be
optimised in the kernel.

Reported-By: Michael Steffens <address@hidden>
Signed-off-by: Tony Breeds <address@hidden>
Cc: Kevin Wolf <address@hidden>
Cc: Markus Armbruster <address@hidden>
Cc: Stefan Hajnoczi <address@hidden>
Cc: Max Reitz <address@hidden>
Cc: Pádraig Brady <address@hidden>
Cc: Eric Blake <address@hidden>
---
Changes since v1:
 - split in to 2 patches
 - tried to make the commit messages better

 block/raw-posix.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/block/raw-posix.c b/block/raw-posix.c
index b8203e9..b438c54 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -1561,9 +1561,9 @@ static int64_t coroutine_fn 
raw_co_get_block_status(BlockDriverState *bs,
 
     start = sector_num * BDRV_SECTOR_SIZE;
 
-    ret = try_fiemap(bs, start, &data, &hole, nb_sectors, pnum);
+    ret = try_seek_hole(bs, start, &data, &hole, pnum);
     if (ret < 0) {
-        ret = try_seek_hole(bs, start, &data, &hole, pnum);
+        ret = try_fiemap(bs, start, &data, &hole, nb_sectors, pnum);
         if (ret < 0) {
             /* Assume everything is allocated. */
             data = 0;
-- 
1.9.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]