aboutsummaryrefslogtreecommitdiff
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:09:24 +0530
committerAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2011-08-22 09:44:13 +0530
commitbed4352c4f041af65c522cb453aff468f49aebea (patch)
tree86bce64205f8feb6227cee10204a713188c84b26 /hw/9pfs/cofile.c
parent3cc19c0c607ca780c79dbf42b4781d110a64e342 (diff)
downloadqemu-bed4352c4f041af65c522cb453aff468f49aebea.zip
qemu-bed4352c4f041af65c522cb453aff468f49aebea.tar.gz
qemu-bed4352c4f041af65c522cb453aff468f49aebea.tar.bz2
hw/9pfs: Add yeild support for clunk related coroutine
This include lsetxattr, lremovexattr, closedir and close. 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 4b0d96c..e552999 100644
--- a/hw/9pfs/cofile.c
+++ b/hw/9pfs/cofile.c
@@ -81,3 +81,19 @@ int v9fs_co_open2(V9fsState *s, V9fsFidState *fidp, char *fullname, gid_t gid,
});
return err;
}
+
+int v9fs_co_close(V9fsState *s, V9fsFidState *fidp)
+{
+ int fd;
+ int err;
+
+ fd = fidp->fs.fd;
+ v9fs_co_run_in_worker(
+ {
+ err = s->ops->close(&s->ctx, fd);
+ if (err < 0) {
+ err = -errno;
+ }
+ });
+ return err;
+}