hw/9pfs: Add yield support for fsync coroutine

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
This commit is contained in:
Aneesh Kumar K.V 2011-05-07 21:29:32 +05:30
parent c540ee5187
commit 4743d1f5d3
2 changed files with 17 additions and 0 deletions

View File

@ -97,3 +97,19 @@ int v9fs_co_close(V9fsState *s, V9fsFidState *fidp)
});
return err;
}
int v9fs_co_fsync(V9fsState *s, V9fsFidState *fidp, int datasync)
{
int fd;
int err;
fd = fidp->fs.fd;
v9fs_co_run_in_worker(
{
err = s->ops->fsync(&s->ctx, fd, datasync);
if (err < 0) {
err = -errno;
}
});
return err;
}

View File

@ -85,4 +85,5 @@ extern int v9fs_co_lsetxattr(V9fsState *, V9fsString *, V9fsString *,
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);
#endif