[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: David Chinner <dgc@sgi.com>
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Tim Shimmin <tes@sgi.com>
This commit is contained in:
David Chinner
2007-02-10 18:37:46 +11:00
committed by Tim Shimmin
parent 6be145bfb1
commit e7ff6aed87
+3 -7
View File
@@ -137,7 +137,6 @@ xfs_iozero(
unsigned bytes; unsigned bytes;
struct page *page; struct page *page;
struct address_space *mapping; struct address_space *mapping;
char *kaddr;
int status; int status;
mapping = ip->i_mapping; mapping = ip->i_mapping;
@@ -155,15 +154,13 @@ xfs_iozero(
if (!page) if (!page)
break; break;
kaddr = kmap(page);
status = mapping->a_ops->prepare_write(NULL, page, offset, status = mapping->a_ops->prepare_write(NULL, page, offset,
offset + bytes); offset + bytes);
if (status) { if (status)
goto unlock; goto unlock;
}
memset((void *) (kaddr + offset), 0, bytes); memclear_highpage_flush(page, offset, bytes);
flush_dcache_page(page);
status = mapping->a_ops->commit_write(NULL, page, offset, status = mapping->a_ops->commit_write(NULL, page, offset,
offset + bytes); offset + bytes);
if (!status) { if (!status) {
@@ -172,7 +169,6 @@ xfs_iozero(
} }
unlock: unlock:
kunmap(page);
unlock_page(page); unlock_page(page);
page_cache_release(page); page_cache_release(page);
if (status) if (status)