summaryrefslogtreecommitdiffstats
path: root/hw/virtio-9p-local.c
diff options
context:
space:
mode:
authorVenkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>2010-10-22 10:08:45 -0700
committerVenkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>2010-12-02 16:06:47 -0800
commit49594973fb38283e8c469892fe5eac2942d9bd25 (patch)
tree7e2fabba2094a660c801dcc3340cab5224a90f57 /hw/virtio-9p-local.c
parent6a8657528d94fa1be78d1be0821a01a251fa2de9 (diff)
downloadhqemu-49594973fb38283e8c469892fe5eac2942d9bd25.zip
hqemu-49594973fb38283e8c469892fe5eac2942d9bd25.tar.gz
[virtio-9p] Add datasync to server side TFSYNC/RFSYNC for dotl
SYNOPSIS size[4] Tfsync tag[2] fid[4] datasync[4] size[4] Rfsync tag[2] DESCRIPTION The Tfsync transaction transfers ("flushes") all modified in-core data of file identified by fid to the disk device (or other permanent storage device) where that file resides. If datasync flag is specified data will be fleshed but does not flush modified metadata unless that metadata is needed in order to allow a subsequent data retrieval to be correctly handled. Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Diffstat (limited to 'hw/virtio-9p-local.c')
-rw-r--r--hw/virtio-9p-local.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/hw/virtio-9p-local.c b/hw/virtio-9p-local.c
index 0d52020..656bfb3 100644
--- a/hw/virtio-9p-local.c
+++ b/hw/virtio-9p-local.c
@@ -490,9 +490,13 @@ static int local_remove(FsContext *ctx, const char *path)
return remove(rpath(ctx, path));
}
-static int local_fsync(FsContext *ctx, int fd)
+static int local_fsync(FsContext *ctx, int fd, int datasync)
{
- return fsync(fd);
+ if (datasync) {
+ return qemu_fdatasync(fd);
+ } else {
+ return fsync(fd);
+ }
}
static int local_statfs(FsContext *s, const char *path, struct statfs *stbuf)
OpenPOWER on IntegriCloud