From 4743d1f5d31c76ff60223dcf05f5358dc4605015 Mon Sep 17 00:00:00 2001 From: "Aneesh Kumar K.V" Date: Sat, 7 May 2011 21:29:32 +0530 Subject: hw/9pfs: Add yield support for fsync coroutine Signed-off-by: Aneesh Kumar K.V --- hw/9pfs/cofile.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'hw/9pfs/cofile.c') 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; +} -- cgit v1.2.3