summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-03-01 17:12:12 -0500
committerDarrick J. Wong <darrick.wong@oracle.com>2018-03-01 17:12:12 -0500
commitaf5b5afe9ac68406892fa343fafba4ea988c3c69 (patch)
treebfd9ffb0fa066942f78042d1b647d62c3f9f80e0 /fs
parent172ed391f6e40f799273e005405041b57c343cf7 (diff)
xfs: don't start out with the exclusive ilock for direct I/O
There is no reason to take the ilock exclusively at the start of xfs_file_iomap_begin for direct I/O, given that it will be demoted just before calling xfs_iomap_write_direct anyway. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/xfs_iomap.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index 4e771e0f1170..ee01859b77a5 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -965,13 +965,11 @@ static inline bool needs_cow_for_zeroing(struct xfs_bmbt_irec *imap, int nimaps)
965static inline bool need_excl_ilock(struct xfs_inode *ip, unsigned flags) 965static inline bool need_excl_ilock(struct xfs_inode *ip, unsigned flags)
966{ 966{
967 /* 967 /*
968 * COW writes will allocate delalloc space, so we need to make sure 968 * COW writes may allocate delalloc space or convert unwritten COW
969 * to take the lock exclusively here. 969 * extents, so we need to make sure to take the lock exclusively here.
970 */ 970 */
971 if (xfs_is_reflink_inode(ip) && (flags & (IOMAP_WRITE | IOMAP_ZERO))) 971 if (xfs_is_reflink_inode(ip) && (flags & (IOMAP_WRITE | IOMAP_ZERO)))
972 return true; 972 return true;
973 if ((flags & IOMAP_DIRECT) && (flags & IOMAP_WRITE))
974 return true;
975 return false; 973 return false;
976} 974}
977 975