diff options
author | Christoph Hellwig <hch@lst.de> | 2016-08-16 18:44:52 -0400 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2016-08-16 18:44:52 -0400 |
commit | b95a21271b30544a9fb992269d79ed1e1978e023 (patch) | |
tree | f588bd7b73544d470b4f23389f36c1de5889cce1 /fs/xfs | |
parent | f20ac7ab17fcf7046bd9bc4166faf9580f713afd (diff) |
xfs: simplify xfs_file_iomap_begin
We'll never get nimap == 0 for a successful return from xfs_bmapi_read,
so don't try to handle it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/xfs_iomap.c | 14 | ||||
-rw-r--r-- | fs/xfs/xfs_trace.h | 1 |
2 files changed, 4 insertions, 11 deletions
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c index 2114d53df433..1cce760399a2 100644 --- a/fs/xfs/xfs_iomap.c +++ b/fs/xfs/xfs_iomap.c | |||
@@ -1037,20 +1037,14 @@ xfs_file_iomap_begin( | |||
1037 | return error; | 1037 | return error; |
1038 | 1038 | ||
1039 | trace_xfs_iomap_alloc(ip, offset, length, 0, &imap); | 1039 | trace_xfs_iomap_alloc(ip, offset, length, 0, &imap); |
1040 | xfs_bmbt_to_iomap(ip, iomap, &imap); | ||
1041 | } else if (nimaps) { | ||
1042 | xfs_iunlock(ip, XFS_ILOCK_EXCL); | ||
1043 | trace_xfs_iomap_found(ip, offset, length, 0, &imap); | ||
1044 | xfs_bmbt_to_iomap(ip, iomap, &imap); | ||
1045 | } else { | 1040 | } else { |
1041 | ASSERT(nimaps); | ||
1042 | |||
1046 | xfs_iunlock(ip, XFS_ILOCK_EXCL); | 1043 | xfs_iunlock(ip, XFS_ILOCK_EXCL); |
1047 | trace_xfs_iomap_not_found(ip, offset, length, 0, &imap); | 1044 | trace_xfs_iomap_found(ip, offset, length, 0, &imap); |
1048 | iomap->blkno = IOMAP_NULL_BLOCK; | ||
1049 | iomap->type = IOMAP_HOLE; | ||
1050 | iomap->offset = offset; | ||
1051 | iomap->length = length; | ||
1052 | } | 1045 | } |
1053 | 1046 | ||
1047 | xfs_bmbt_to_iomap(ip, iomap, &imap); | ||
1054 | return 0; | 1048 | return 0; |
1055 | } | 1049 | } |
1056 | 1050 | ||
diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h index 551b7e26980c..7e88bec3f359 100644 --- a/fs/xfs/xfs_trace.h +++ b/fs/xfs/xfs_trace.h | |||
@@ -1298,7 +1298,6 @@ DEFINE_IOMAP_EVENT(xfs_get_blocks_alloc); | |||
1298 | DEFINE_IOMAP_EVENT(xfs_get_blocks_map_direct); | 1298 | DEFINE_IOMAP_EVENT(xfs_get_blocks_map_direct); |
1299 | DEFINE_IOMAP_EVENT(xfs_iomap_alloc); | 1299 | DEFINE_IOMAP_EVENT(xfs_iomap_alloc); |
1300 | DEFINE_IOMAP_EVENT(xfs_iomap_found); | 1300 | DEFINE_IOMAP_EVENT(xfs_iomap_found); |
1301 | DEFINE_IOMAP_EVENT(xfs_iomap_not_found); | ||
1302 | 1301 | ||
1303 | DECLARE_EVENT_CLASS(xfs_simple_io_class, | 1302 | DECLARE_EVENT_CLASS(xfs_simple_io_class, |
1304 | TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), | 1303 | TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), |