提交 5f9268ca 编写于 作者: C Christoph Hellwig 提交者: Dave Chinner

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: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: NBrian Foster <bfoster@redhat.com>
Signed-off-by: NDave Chinner <david@fromorbit.com>
上级 62c5ac89
......@@ -996,11 +996,14 @@ xfs_file_iomap_begin(
return error;
}
/* Trim the mapping to the nearest shared extent boundary. */
error = xfs_reflink_trim_around_shared(ip, &imap, &shared, &trimmed);
if (error) {
xfs_iunlock(ip, lockmode);
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);
if (error) {
xfs_iunlock(ip, lockmode);
return error;
}
}
if ((flags & IOMAP_WRITE) && imap_needs_alloc(inode, &imap, nimaps)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册