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

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

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: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
parent f20ac7ab
Loading
Loading
Loading
Loading
+4 −10
Original line number Diff line number Diff line
@@ -1037,20 +1037,14 @@ xfs_file_iomap_begin(
			return error;

		trace_xfs_iomap_alloc(ip, offset, length, 0, &imap);
		xfs_bmbt_to_iomap(ip, iomap, &imap);
	} else if (nimaps) {
		xfs_iunlock(ip, XFS_ILOCK_EXCL);
		trace_xfs_iomap_found(ip, offset, length, 0, &imap);
		xfs_bmbt_to_iomap(ip, iomap, &imap);
	} else {
		ASSERT(nimaps);

		xfs_iunlock(ip, XFS_ILOCK_EXCL);
		trace_xfs_iomap_not_found(ip, offset, length, 0, &imap);
		iomap->blkno = IOMAP_NULL_BLOCK;
		iomap->type = IOMAP_HOLE;
		iomap->offset = offset;
		iomap->length = length;
		trace_xfs_iomap_found(ip, offset, length, 0, &imap);
	}

	xfs_bmbt_to_iomap(ip, iomap, &imap);
	return 0;
}

+0 −1
Original line number Diff line number Diff line
@@ -1298,7 +1298,6 @@ DEFINE_IOMAP_EVENT(xfs_get_blocks_alloc);
DEFINE_IOMAP_EVENT(xfs_get_blocks_map_direct);
DEFINE_IOMAP_EVENT(xfs_iomap_alloc);
DEFINE_IOMAP_EVENT(xfs_iomap_found);
DEFINE_IOMAP_EVENT(xfs_iomap_not_found);

DECLARE_EVENT_CLASS(xfs_simple_io_class,
	TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count),