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:
parent
c540ee5187
commit
4743d1f5d3
|
@ -97,3 +97,19 @@ int v9fs_co_close(V9fsState *s, V9fsFidState *fidp)
|
||||||
});
|
});
|
||||||
return err;
|
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;
|
||||||
|
}
|
||||||
|
|
|
@ -85,4 +85,5 @@ extern int v9fs_co_lsetxattr(V9fsState *, V9fsString *, V9fsString *,
|
||||||
extern int v9fs_co_lremovexattr(V9fsState *, V9fsString *, V9fsString *);
|
extern int v9fs_co_lremovexattr(V9fsState *, V9fsString *, V9fsString *);
|
||||||
extern int v9fs_co_closedir(V9fsState *, V9fsFidState *);
|
extern int v9fs_co_closedir(V9fsState *, V9fsFidState *);
|
||||||
extern int v9fs_co_close(V9fsState *, V9fsFidState *);
|
extern int v9fs_co_close(V9fsState *, V9fsFidState *);
|
||||||
|
extern int v9fs_co_fsync(V9fsState *, V9fsFidState *, int);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue