From: Venkateswararao Jujjuri Date: Mon, 8 Aug 2011 18:28:39 +0000 (+0530) Subject: hw/9pfs: Add yield support for symlin coroutine X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=02ac7a34ff124b8d41dc1afadf622b07fa292b48;p=qemu.git hw/9pfs: Add yield support for symlin coroutine Signed-off-by: Venkateswararao Jujjuri Signed-off-by: Aneesh Kumar K.V --- diff --git a/hw/9pfs/cofs.c b/hw/9pfs/cofs.c index 1f10632540..a78fccbe23 100644 --- a/hw/9pfs/cofs.c +++ b/hw/9pfs/cofs.c @@ -169,3 +169,23 @@ int v9fs_co_rename(V9fsState *s, V9fsString *oldpath, V9fsString *newpath) }); return err; } + +int v9fs_co_symlink(V9fsState *s, V9fsFidState *fidp, + const char *oldpath, const char *newpath, gid_t gid) +{ + int err; + FsCred cred; + + cred_init(&cred); + cred.fc_uid = fidp->uid; + cred.fc_gid = gid; + cred.fc_mode = 0777; + v9fs_co_run_in_worker( + { + err = s->ops->symlink(&s->ctx, oldpath, newpath, &cred); + if (err < 0) { + err = -errno; + } + }); + return err; +} diff --git a/hw/9pfs/virtio-9p-coth.h b/hw/9pfs/virtio-9p-coth.h index a3881f3770..e3949330c9 100644 --- a/hw/9pfs/virtio-9p-coth.h +++ b/hw/9pfs/virtio-9p-coth.h @@ -86,4 +86,6 @@ extern int v9fs_co_lremovexattr(V9fsState *, V9fsString *, V9fsString *); extern int v9fs_co_closedir(V9fsState *, V9fsFidState *); 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); #endif