diff options
author | bapt <bapt@FreeBSD.org> | 2013-01-08 12:21:50 +0000 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2013-01-08 12:21:50 +0000 |
commit | afe1d4e213e502872a2b8ec74459a88132ba221d (patch) | |
tree | 6b6bb4724c4c9619441499447b08ceb916a6f8d9 /sys/fs/fuse | |
parent | 301464d55957cef5f142eab32bfd569f7572814d (diff) | |
download | FreeBSD-src-afe1d4e213e502872a2b8ec74459a88132ba221d.zip FreeBSD-src-afe1d4e213e502872a2b8ec74459a88132ba221d.tar.gz |
Add support for IO_APPEND flag in fuse
This make open(..., O_APPEND) actually works on fuse filesystem.
Reviewed by: attilio
Diffstat (limited to 'sys/fs/fuse')
-rw-r--r-- | sys/fs/fuse/fuse_io.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/fs/fuse/fuse_io.c b/sys/fs/fuse/fuse_io.c index 5b71a6b..e576568 100644 --- a/sys/fs/fuse/fuse_io.c +++ b/sys/fs/fuse/fuse_io.c @@ -113,7 +113,7 @@ fuse_write_directbackend(struct vnode *vp, struct uio *uio, struct ucred *cred, struct fuse_filehandle *fufh); static int fuse_write_biobackend(struct vnode *vp, struct uio *uio, - struct ucred *cred, struct fuse_filehandle *fufh); + struct ucred *cred, struct fuse_filehandle *fufh, int ioflag); int fuse_io_dispatch(struct vnode *vp, struct uio *uio, int ioflag, @@ -162,7 +162,7 @@ fuse_io_dispatch(struct vnode *vp, struct uio *uio, int ioflag, } else { FS_DEBUG("buffered write of vnode %ju\n", (uintmax_t)VTOILLU(vp)); - err = fuse_write_biobackend(vp, uio, cred, fufh); + err = fuse_write_biobackend(vp, uio, cred, fufh, ioflag); } break; default: @@ -371,7 +371,7 @@ fuse_write_directbackend(struct vnode *vp, struct uio *uio, static int fuse_write_biobackend(struct vnode *vp, struct uio *uio, - struct ucred *cred, struct fuse_filehandle *fufh) + struct ucred *cred, struct fuse_filehandle *fufh, int ioflag) { struct fuse_vnode_data *fvdat = VTOFUD(vp); struct buf *bp; @@ -390,6 +390,8 @@ fuse_write_biobackend(struct vnode *vp, struct uio *uio, return (EINVAL); if (uio->uio_resid == 0) return (0); + if (ioflag & IO_APPEND) + uio_setoffset(uio, fvdat->filesize); /* * Find all of this file's B_NEEDCOMMIT buffers. If our writes |