[PATCH] md: enable bypassing cache for reads
authorRaz Ben-Jehuda(caro) <raziebe@gmail.com>
Sun, 10 Dec 2006 10:20:48 +0000 (02:20 -0800)
committerLinus Torvalds <torvalds@woody.osdl.org>
Sun, 10 Dec 2006 17:57:20 +0000 (09:57 -0800)
Call the chunk_aligned_read where appropriate.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/md/raid5.c

index 2ac2e56a1a40ec508b8d7f6ec6c2d449d7777861..2e676e33744c53218d5f53909598fd686db142bc 100644 (file)
@@ -2808,6 +2808,11 @@ static int make_request(request_queue_t *q, struct bio * bi)
        disk_stat_inc(mddev->gendisk, ios[rw]);
        disk_stat_add(mddev->gendisk, sectors[rw], bio_sectors(bi));
 
+       if (bio_data_dir(bi) == READ &&
+            mddev->reshape_position == MaxSector &&
+            chunk_aligned_read(q,bi))
+               return 0;
+
        logical_sector = bi->bi_sector & ~((sector_t)STRIPE_SECTORS-1);
        last_sector = bi->bi_sector + (bi->bi_size>>9);
        bi->bi_next = NULL;