qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 2/4] block: use fdatasync instead of fsync


From: Christoph Hellwig
Subject: [Qemu-devel] [PATCH 2/4] block: use fdatasync instead of fsync
Date: Mon, 31 Aug 2009 22:17:09 +0200
User-agent: Mutt/1.3.28i

If we are flushing the caches for our image files we only care about the
data (including the metadata required for accessing it) but not things
like timestamp updates.  So use fdatasync instead of fsync to implement
the flush operations.


Signed-off-by: Christoph Hellwig <address@hidden>

Index: qemu/block/cow.c
===================================================================
--- qemu.orig/block/cow.c       2009-06-07 16:18:21.942938914 -0300
+++ qemu/block/cow.c    2009-08-31 16:49:55.509043084 -0300
@@ -258,7 +258,7 @@ static int cow_create(const char *filena
 static void cow_flush(BlockDriverState *bs)
 {
     BDRVCowState *s = bs->opaque;
-    fsync(s->fd);
+    fdatasync(s->fd);
 }
 
 static QEMUOptionParameter cow_create_options[] = {
Index: qemu/block/raw-posix.c
===================================================================
--- qemu.orig/block/raw-posix.c 2009-08-29 14:17:23.039370199 -0300
+++ qemu/block/raw-posix.c      2009-08-31 16:49:55.513071598 -0300
@@ -723,7 +723,7 @@ static int raw_create(const char *filena
 static void raw_flush(BlockDriverState *bs)
 {
     BDRVRawState *s = bs->opaque;
-    fsync(s->fd);
+    fdatasync(s->fd);
 }
 
 




reply via email to

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