summaryrefslogtreecommitdiff
path: root/hw/9pfs/cofile.c
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2011-05-07 21:29:32 +0530
committerAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2011-08-22 09:44:18 +0530
commit4743d1f5d31c76ff60223dcf05f5358dc4605015 (patch)
tree9cfb083ec0898210b9cc8e4614c842613faeaf95 /hw/9pfs/cofile.c
parentc540ee51870e283e4ddc0ebf694419bfdeaef66f (diff)
downloadqemu-4743d1f5d31c76ff60223dcf05f5358dc4605015.tar.gz
hw/9pfs: Add yield support for fsync coroutine
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Diffstat (limited to 'hw/9pfs/cofile.c')
-rw-r--r--hw/9pfs/cofile.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/hw/9pfs/cofile.c b/hw/9pfs/cofile.c
index e552999666..26dd636776 100644
--- a/hw/9pfs/cofile.c
+++ b/hw/9pfs/cofile.c
@@ -97,3 +97,19 @@ int v9fs_co_close(V9fsState *s, V9fsFidState *fidp)
});
return err;
}
+
+int v9fs_co_fsync(V9fsState *s, V9fsFidState *fidp, int datasync)
+{
+ int fd;
+ int err;
+
+ fd = fidp->fs.fd;
+ v9fs_co_run_in_worker(
+ {
+ err = s->ops->fsync(&s->ctx, fd, datasync);
+ if (err < 0) {
+ err = -errno;
+ }
+ });
+ return err;
+}