diff options
author | Christoph Hellwig <hch@lst.de> | 2016-10-20 00:53:32 -0400 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2016-10-20 00:53:32 -0400 |
commit | 5f9268ca53aca992106d74edde3e7cf6c1be60a0 (patch) | |
tree | d7bbd9ab08f2fde333d67cdc20dbb126ca0bf56e /fs | |
parent | 62c5ac89de7d5eecdbaa94ca3d554b0bd41578b1 (diff) |
xfs: don't bother looking at the refcount tree for reads
There is no need to trim an extent into a shared or non-shared one, or
report any flags for plain old reads.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/xfs/xfs_iomap.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c index d907eb9f8ef3..1dabf2eb136a 100644 --- a/fs/xfs/xfs_iomap.c +++ b/fs/xfs/xfs_iomap.c | |||
@@ -996,11 +996,14 @@ xfs_file_iomap_begin( | |||
996 | return error; | 996 | return error; |
997 | } | 997 | } |
998 | 998 | ||
999 | /* Trim the mapping to the nearest shared extent boundary. */ | 999 | if (flags & (IOMAP_WRITE | IOMAP_ZERO | IOMAP_REPORT)) { |
1000 | error = xfs_reflink_trim_around_shared(ip, &imap, &shared, &trimmed); | 1000 | /* Trim the mapping to the nearest shared extent boundary. */ |
1001 | if (error) { | 1001 | error = xfs_reflink_trim_around_shared(ip, &imap, &shared, |
1002 | xfs_iunlock(ip, lockmode); | 1002 | &trimmed); |
1003 | return error; | 1003 | if (error) { |
1004 | xfs_iunlock(ip, lockmode); | ||
1005 | return error; | ||
1006 | } | ||
1004 | } | 1007 | } |
1005 | 1008 | ||
1006 | if ((flags & IOMAP_WRITE) && imap_needs_alloc(inode, &imap, nimaps)) { | 1009 | if ((flags & IOMAP_WRITE) && imap_needs_alloc(inode, &imap, nimaps)) { |