diff options
| author | Alan Somers <asomers@FreeBSD.org> | 2019-06-14 18:14:51 +0000 |
|---|---|---|
| committer | Alan Somers <asomers@FreeBSD.org> | 2019-06-14 18:14:51 +0000 |
| commit | 8eecd9ce05ee9744ebf9ecd0c2d1d2431b9fe06c (patch) | |
| tree | aa8bc278baf42dc0e72fea5b381f80e5b2ddc437 /sys/fs/fuse/fuse_io.c | |
| parent | dff3a6b4109964418dd88e3aa0d931924b54d149 (diff) | |
Notes
Diffstat (limited to 'sys/fs/fuse/fuse_io.c')
| -rw-r--r-- | sys/fs/fuse/fuse_io.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/fs/fuse/fuse_io.c b/sys/fs/fuse/fuse_io.c index c373300953fa2..06cfb2a933ba1 100644 --- a/sys/fs/fuse/fuse_io.c +++ b/sys/fs/fuse/fuse_io.c @@ -565,11 +565,13 @@ fuse_write_biobackend(struct vnode *vp, struct uio *uio, daddr_t lbn; off_t filesize; int bcount; - int n, on, err = 0; + int n, on, seqcount, err = 0; bool last_page; const int biosize = fuse_iosize(vp); + seqcount = ioflag >> IO_SEQSHIFT; + KASSERT(uio->uio_rw == UIO_WRITE, ("fuse_write_biobackend mode")); if (vp->v_type != VREG) return (EIO); @@ -644,6 +646,7 @@ again: * with other readers */ err = fuse_vnode_setsize(vp, uio->uio_offset + n); + filesize = uio->uio_offset + n; fvdat->flag |= FN_SIZECHANGE; if (err) { brelse(bp); @@ -787,20 +790,22 @@ again: } else if (vm_page_count_severe() || buf_dirty_count_severe() || (ioflag & IO_ASYNC)) { - /* TODO: enable write clustering later */ + bp->b_flags |= B_CLUSTEROK; SDT_PROBE2(fusefs, , io, write_biobackend_issue, 3, bp); bawrite(bp); } else if (on == 0 && n == bcount) { if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERW) == 0) { + bp->b_flags |= B_CLUSTEROK; SDT_PROBE2(fusefs, , io, write_biobackend_issue, 4, bp); - bdwrite(bp); + cluster_write(vp, bp, filesize, seqcount, 0); } else { SDT_PROBE2(fusefs, , io, write_biobackend_issue, 5, bp); bawrite(bp); } } else if (ioflag & IO_DIRECT) { + bp->b_flags |= B_CLUSTEROK; SDT_PROBE2(fusefs, , io, write_biobackend_issue, 6, bp); bawrite(bp); } else { |
