aboutsummaryrefslogtreecommitdiff
path: root/hw/9pfs/cofs.c
diff options
context:
space:
mode:
authorVenkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>2011-08-08 23:58:39 +0530
committerAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2011-08-22 09:44:26 +0530
commit02ac7a34ff124b8d41dc1afadf622b07fa292b48 (patch)
tree825e01a93df09e9b425aebe9d919b6a74b3661ca /hw/9pfs/cofs.c
parentbaaa86d9f5d516d423d34af92e0c15b56e06ac4b (diff)
hw/9pfs: Add yield support for symlin coroutine
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Diffstat (limited to 'hw/9pfs/cofs.c')
-rw-r--r--hw/9pfs/cofs.c20
1 files changed, 20 insertions, 0 deletions
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;
+}