From: Venkateswararao Jujjuri Date: Mon, 8 Aug 2011 18:31:22 +0000 (+0530) Subject: hw/9pfs: Add yield support for link coroutine X-Git-Tag: v1.0-rc0~395^2~8 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=c6c069b0c5fdfc748008d8a4879f3d41c1d32702;p=users%2Fdwmw2%2Fqemu.git hw/9pfs: Add yield support for link coroutine Signed-off-by: Venkateswararao Jujjuri Signed-off-by: Aneesh Kumar K.V --- diff --git a/hw/9pfs/cofile.c b/hw/9pfs/cofile.c index 26dd636776..52eec2a662 100644 --- a/hw/9pfs/cofile.c +++ b/hw/9pfs/cofile.c @@ -113,3 +113,17 @@ int v9fs_co_fsync(V9fsState *s, V9fsFidState *fidp, int datasync) }); return err; } + +int v9fs_co_link(V9fsState *s, V9fsString *oldpath, V9fsString *newpath) +{ + int err; + + v9fs_co_run_in_worker( + { + err = s->ops->link(&s->ctx, oldpath->data, newpath->data); + if (err < 0) { + err = -errno; + } + }); + return err; +} diff --git a/hw/9pfs/virtio-9p-coth.h b/hw/9pfs/virtio-9p-coth.h index e3949330c9..17ffd76f36 100644 --- a/hw/9pfs/virtio-9p-coth.h +++ b/hw/9pfs/virtio-9p-coth.h @@ -88,4 +88,5 @@ extern int v9fs_co_close(V9fsState *, V9fsFidState *); extern int v9fs_co_fsync(V9fsState *, V9fsFidState *, int); extern int v9fs_co_symlink(V9fsState *, V9fsFidState *, const char *, const char *, gid_t); +extern int v9fs_co_link(V9fsState *, V9fsString *, V9fsString *); #endif