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

Commit e7ff6aed authored by David Chinner's avatar David Chinner Committed by Tim Shimmin
Browse files

[XFS] Don't use kmap in xfs_iozero.



kmap() is inefficient and does not scale well. kmap_atomic() is a better
choice. Use the generic wrapper function instead of open coding the
kmap-memset-dcache flush-kunmap stuff.

SGI-PV: 960904
SGI-Modid: xfs-linux-melb:xfs-kern:28041a

Signed-off-by: default avatarDavid Chinner <dgc@sgi.com>
Signed-off-by: default avatarChristoph Hellwig <hch@infradead.org>
Signed-off-by: default avatarTim Shimmin <tes@sgi.com>
parent 6be145bf
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -137,7 +137,6 @@ xfs_iozero(
	unsigned		bytes;
	struct page		*page;
	struct address_space	*mapping;
	char			*kaddr;
	int			status;

	mapping = ip->i_mapping;
@@ -155,15 +154,13 @@ xfs_iozero(
		if (!page)
			break;

		kaddr = kmap(page);
		status = mapping->a_ops->prepare_write(NULL, page, offset,
							offset + bytes);
		if (status) {
		if (status)
			goto unlock;
		}

		memset((void *) (kaddr + offset), 0, bytes);
		flush_dcache_page(page);
		memclear_highpage_flush(page, offset, bytes);

		status = mapping->a_ops->commit_write(NULL, page, offset,
							offset + bytes);
		if (!status) {
@@ -172,7 +169,6 @@ xfs_iozero(
		}

unlock:
		kunmap(page);
		unlock_page(page);
		page_cache_release(page);
		if (status)