summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-12-17 07:30:04 -0700
committerJens Axboe <axboe@kernel.dk>2020-01-31 15:44:11 -0700
commit8ad401f812f242d737cfeb1e7f91df8c0c784043 (patch)
treedf5b62ab6a0588015523269b0c1ba0d65ff4a487
parent2d02caea1a1b4382ee712ab2777c132dd5a10a59 (diff)
xfs: don't do delayed allocations for uncached buffered writesbuffered-uncached
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>
-rw-r--r--fs/xfs/xfs_iomap.c7
1 files changed, 5 insertions, 2 deletions
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);