Patchwork [-V3,8/8] hw/9pfs: Skip file system sync if we have specified cache=none option

login
register
mail settings
Submitter Aneesh Kumar K.V
Date March 5, 2011, 5:52 p.m.
Message ID <1299347533-17047-8-git-send-email-aneesh.kumar@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/85547/
State New
Headers show

Comments

Aneesh Kumar K.V - March 5, 2011, 5:52 p.m.
cache=none results in skipping the host page cache. So we can ignore
the tsyncfs request.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
 hw/9pfs/virtio-9p.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

Patch

diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c
index 75df1a1..dceefd5 100644
--- a/hw/9pfs/virtio-9p.c
+++ b/hw/9pfs/virtio-9p.c
@@ -331,7 +331,10 @@  static int v9fs_do_lremovexattr(V9fsState *s, V9fsString *path,
 
 static int v9fs_do_syncfs(V9fsState *s, int fd)
 {
-    return s->ops->syncfs(&s->ctx, fd);
+    if (!(s->ctx.open_flags & O_SYNC)) {
+        return s->ops->syncfs(&s->ctx, fd);
+    }
+    return 0;
 }
 
 static void v9fs_string_init(V9fsString *str)