lkml.org 
[lkml]   [2006]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 8/8] block: convert md to use blk_kmap helpers
Date
From
Convert direct uses of kmap/unmap to blk_kmap/unmap in md.  This
combined with the previous bio helper change fixes PIO cache coherency
bugs on architectures with aliased caches.

Signed-off-by: Tejun Heo <htejun@gmail.com>

---
drivers/md/raid1.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
c781a8f9320246a13cdc62610b314dcd3678266d
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index a06ff91..6a940a1 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -714,13 +714,19 @@ static struct page **alloc_behind_pages(
goto do_sync_io;

bio_for_each_segment(bvec, bio, i) {
+ void *src, *dst;
+
pages[i] = alloc_page(GFP_NOIO);
if (unlikely(!pages[i]))
goto do_sync_io;
- memcpy(kmap(pages[i]) + bvec->bv_offset,
- kmap(bvec->bv_page) + bvec->bv_offset, bvec->bv_len);
+
+ src = blk_kmap(bvec->bv_page, DMA_TO_DEVICE) + bvec->bv_offset;
+ dst = kmap(pages[i]) + bvec->bv_offset;
+
+ memcpy(dst, src, bvec->bv_len);
+
+ blk_kunmap(bvec->bv_page, DMA_TO_DEVICE);
kunmap(pages[i]);
- kunmap(bvec->bv_page);
}

return pages;
--
1.0.6

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-01-13 16:30    [from the cache]
©2003-2011 Jasper Spaans