Message ID | 20191217143948.26380-7-axboe@kernel.dk (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Support for RWF_UNCACHED | expand |
On Tue, Dec 17, 2019 at 07:39:48AM -0700, Jens Axboe wrote: > This data is going to be written immediately, so don't bother trying > to do delayed allocation for it. > > Suggested-by: Dave Chinner <david@fromorbit.com> > Signed-off-by: Jens Axboe <axboe@kernel.dk> Looks reasonable once all the previous patches go in, Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> --D > --- > fs/xfs/xfs_iomap.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c > index 28e2d1f37267..d0cd4a05d59f 100644 > --- a/fs/xfs/xfs_iomap.c > +++ b/fs/xfs/xfs_iomap.c > @@ -847,8 +847,11 @@ xfs_buffered_write_iomap_begin( > int allocfork = XFS_DATA_FORK; > int error = 0; > > - /* we can't use delayed allocations when using extent size hints */ > - if (xfs_get_extsz_hint(ip)) > + /* > + * Don't do delayed allocations when using extent size hints, or > + * if we were asked to do uncached buffered writes. > + */ > + if (xfs_get_extsz_hint(ip) || (flags & IOMAP_UNCACHED)) > return xfs_direct_write_iomap_begin(inode, offset, count, > flags, iomap, srcmap); > > -- > 2.24.1 >
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c index 28e2d1f37267..d0cd4a05d59f 100644 --- a/fs/xfs/xfs_iomap.c +++ b/fs/xfs/xfs_iomap.c @@ -847,8 +847,11 @@ xfs_buffered_write_iomap_begin( int allocfork = XFS_DATA_FORK; int error = 0; - /* we can't use delayed allocations when using extent size hints */ - if (xfs_get_extsz_hint(ip)) + /* + * Don't do delayed allocations when using extent size hints, or + * if we were asked to do uncached buffered writes. + */ + if (xfs_get_extsz_hint(ip) || (flags & IOMAP_UNCACHED)) return xfs_direct_write_iomap_begin(inode, offset, count, flags, iomap, srcmap);
This data is going to be written immediately, so don't bother trying to do delayed allocation for it. Suggested-by: Dave Chinner <david@fromorbit.com> Signed-off-by: Jens Axboe <axboe@kernel.dk> --- fs/xfs/xfs_iomap.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)