diff options
author | Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com> | 2011-08-08 23:44:24 +0530 |
---|---|---|
committer | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2011-08-08 23:44:24 +0530 |
commit | d0884642b827ec90a7e66d34f5cf1caa1a031990 (patch) | |
tree | 3ece7878714192c9400a2d05d2ee70311e624a53 /hw/9pfs/codir.c | |
parent | 1b733fed7fe407169523cbdb73d97bb335a7f02c (diff) | |
download | qemu-d0884642b827ec90a7e66d34f5cf1caa1a031990.zip qemu-d0884642b827ec90a7e66d34f5cf1caa1a031990.tar.gz qemu-d0884642b827ec90a7e66d34f5cf1caa1a031990.tar.bz2 |
hw/9pfs: Add yield support for mkdir 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/codir.c')
-rw-r--r-- | hw/9pfs/codir.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/hw/9pfs/codir.c b/hw/9pfs/codir.c index 47b10df..28f2ad7 100644 --- a/hw/9pfs/codir.c +++ b/hw/9pfs/codir.c @@ -64,3 +64,22 @@ void v9fs_co_rewinddir(V9fsState *s, V9fsFidState *fidp) s->ops->rewinddir(&s->ctx, fidp->fs.dir); }); } + +int v9fs_co_mkdir(V9fsState *s, char *name, mode_t mode, uid_t uid, gid_t gid) +{ + int err; + FsCred cred; + + cred_init(&cred); + cred.fc_mode = mode; + cred.fc_uid = uid; + cred.fc_gid = gid; + v9fs_co_run_in_worker( + { + err = s->ops->mkdir(&s->ctx, name, &cred); + if (err < 0) { + err = -errno; + } + }); + return err; +} |