diff options
author | Ilya Loginov <isloginov@gmail.com> | 2009-11-26 03:16:19 -0500 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-11-26 03:16:19 -0500 |
commit | 2d4dc890b5c8fabd818a8586607e6843c4375e62 (patch) | |
tree | 9976ed7b0eed0056f8289aeb6a2b0abf8c940454 /fs/bio.c | |
parent | 3586e917f2c7df769d173c4ec99554cb40a911e5 (diff) |
block: add helpers to run flush_dcache_page() against a bio and a request's pages
Mtdblock driver doesn't call flush_dcache_page for pages in request. So,
this causes problems on architectures where the icache doesn't fill from
the dcache or with dcache aliases. The patch fixes this.
The ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE symbol was introduced to avoid
pointless empty cache-thrashing loops on architectures for which
flush_dcache_page() is a no-op. Every architecture was provided with this
flush pages on architectires where ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE is
equal 1 or do nothing otherwise.
See "fix mtd_blkdevs problem with caches on some architectures" discussion
on LKML for more information.
Signed-off-by: Ilya Loginov <isloginov@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Peter Horton <phorton@bitbox.co.uk>
Cc: "Ed L. Cashin" <ecashin@coraid.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'fs/bio.c')
-rw-r--r-- | fs/bio.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -1393,6 +1393,18 @@ void bio_check_pages_dirty(struct bio *bio) | |||
1393 | } | 1393 | } |
1394 | } | 1394 | } |
1395 | 1395 | ||
1396 | #if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE | ||
1397 | void bio_flush_dcache_pages(struct bio *bi) | ||
1398 | { | ||
1399 | int i; | ||
1400 | struct bio_vec *bvec; | ||
1401 | |||
1402 | bio_for_each_segment(bvec, bi, i) | ||
1403 | flush_dcache_page(bvec->bv_page); | ||
1404 | } | ||
1405 | EXPORT_SYMBOL(bio_flush_dcache_pages); | ||
1406 | #endif | ||
1407 | |||
1396 | /** | 1408 | /** |
1397 | * bio_endio - end I/O on a bio | 1409 | * bio_endio - end I/O on a bio |
1398 | * @bio: bio | 1410 | * @bio: bio |