From: Jens Axboe Date: Tue, 17 Dec 2019 14:30:04 +0000 (-0700) Subject: xfs: don't do delayed allocations for uncached buffered writes X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=refs%2Fheads%2Fbuffered-uncached;p=linux-2.6-block.git xfs: don't do delayed allocations for uncached buffered writes This data is going to be written immediately, so don't bother trying to do delayed allocation for it. Suggested-by: Dave Chinner Signed-off-by: Jens Axboe --- diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c index bb590a267a7f..1916240e2d05 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);