xfs: minor cleanup for xfs_get_blocks

Simplify the control flow a bit in preparation for O_ATOMIC-related
changes.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
This commit is contained in:
Christoph Hellwig 2018-03-13 23:15:32 -07:00 committed by Darrick J. Wong
parent f5c54717bf
commit 1d4352de51

View File

@ -1335,17 +1335,16 @@ xfs_get_blocks(
&nimaps, 0); &nimaps, 0);
if (error) if (error)
goto out_unlock; goto out_unlock;
if (!nimaps) {
if (nimaps) {
trace_xfs_get_blocks_found(ip, offset, size,
imap.br_state == XFS_EXT_UNWRITTEN ?
XFS_IO_UNWRITTEN : XFS_IO_OVERWRITE, &imap);
xfs_iunlock(ip, lockmode);
} else {
trace_xfs_get_blocks_notfound(ip, offset, size); trace_xfs_get_blocks_notfound(ip, offset, size);
goto out_unlock; goto out_unlock;
} }
trace_xfs_get_blocks_found(ip, offset, size,
imap.br_state == XFS_EXT_UNWRITTEN ?
XFS_IO_UNWRITTEN : XFS_IO_OVERWRITE, &imap);
xfs_iunlock(ip, lockmode);
/* trim mapping down to size requested */ /* trim mapping down to size requested */
xfs_map_trim_size(inode, iblock, bh_result, &imap, offset, size); xfs_map_trim_size(inode, iblock, bh_result, &imap, offset, size);