diff options
| author | David Chinner <dgc@sgi.com> | 2007-02-10 02:37:46 -0500 |
|---|---|---|
| committer | Tim Shimmin <tes@sgi.com> | 2007-02-10 02:37:46 -0500 |
| commit | e7ff6aed8761b2c86cd9ab7083e512de2b8cfa48 (patch) | |
| tree | 7a3e7e8ba879bbd72f55cbada44ebe542b179087 | |
| parent | 6be145bfb1ce93b2dbb854fee66fbb8d04916339 (diff) | |
[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>
| -rw-r--r-- | fs/xfs/linux-2.6/xfs_lrw.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c index 0b5c9b6774c8..ff8d64eba9f8 100644 --- a/fs/xfs/linux-2.6/xfs_lrw.c +++ b/fs/xfs/linux-2.6/xfs_lrw.c | |||
| @@ -137,7 +137,6 @@ xfs_iozero( | |||
| 137 | unsigned bytes; | 137 | unsigned bytes; |
| 138 | struct page *page; | 138 | struct page *page; |
| 139 | struct address_space *mapping; | 139 | struct address_space *mapping; |
| 140 | char *kaddr; | ||
| 141 | int status; | 140 | int status; |
| 142 | 141 | ||
| 143 | mapping = ip->i_mapping; | 142 | mapping = ip->i_mapping; |
| @@ -155,15 +154,13 @@ xfs_iozero( | |||
| 155 | if (!page) | 154 | if (!page) |
| 156 | break; | 155 | break; |
| 157 | 156 | ||
| 158 | kaddr = kmap(page); | ||
| 159 | status = mapping->a_ops->prepare_write(NULL, page, offset, | 157 | status = mapping->a_ops->prepare_write(NULL, page, offset, |
| 160 | offset + bytes); | 158 | offset + bytes); |
| 161 | if (status) { | 159 | if (status) |
| 162 | goto unlock; | 160 | goto unlock; |
| 163 | } | ||
| 164 | 161 | ||
| 165 | memset((void *) (kaddr + offset), 0, bytes); | 162 | memclear_highpage_flush(page, offset, bytes); |
| 166 | flush_dcache_page(page); | 163 | |
| 167 | status = mapping->a_ops->commit_write(NULL, page, offset, | 164 | status = mapping->a_ops->commit_write(NULL, page, offset, |
| 168 | offset + bytes); | 165 | offset + bytes); |
| 169 | if (!status) { | 166 | if (!status) { |
| @@ -172,7 +169,6 @@ xfs_iozero( | |||
| 172 | } | 169 | } |
| 173 | 170 | ||
| 174 | unlock: | 171 | unlock: |
| 175 | kunmap(page); | ||
| 176 | unlock_page(page); | 172 | unlock_page(page); |
| 177 | page_cache_release(page); | 173 | page_cache_release(page); |
| 178 | if (status) | 174 | if (status) |
