Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5f9268ca authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Dave Chinner
Browse files

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: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
parent 62c5ac89
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -996,12 +996,15 @@ xfs_file_iomap_begin(
		return error;
	}

	if (flags & (IOMAP_WRITE | IOMAP_ZERO | IOMAP_REPORT)) {
		/* Trim the mapping to the nearest shared extent boundary. */
	error = xfs_reflink_trim_around_shared(ip, &imap, &shared, &trimmed);
		error = xfs_reflink_trim_around_shared(ip, &imap, &shared,
				&trimmed);
		if (error) {
			xfs_iunlock(ip, lockmode);
			return error;
		}
	}

	if ((flags & IOMAP_WRITE) && imap_needs_alloc(inode, &imap, nimaps)) {
		/*