raid10.c (e2b06d71bd3f50ac7098b3f2492ea95470b713db) | raid10.c (dc3b17cc8bf21307c7e076e7c778d5db756f7871) |
---|---|
1/* 2 * raid10.c : Multiple Devices driver for Linux 3 * 4 * Copyright (C) 2000-2004 Neil Brown 5 * 6 * RAID-10 support for md. 7 * 8 * Base on code in raid1.c. See raid1.c for further copyright information. --- 846 unchanged lines hidden (view full) --- 855 for (i = 0; 856 (i < conf->geo.raid_disks || i < conf->prev.raid_disks) 857 && ret == 0; 858 i++) { 859 struct md_rdev *rdev = rcu_dereference(conf->mirrors[i].rdev); 860 if (rdev && !test_bit(Faulty, &rdev->flags)) { 861 struct request_queue *q = bdev_get_queue(rdev->bdev); 862 | 1/* 2 * raid10.c : Multiple Devices driver for Linux 3 * 4 * Copyright (C) 2000-2004 Neil Brown 5 * 6 * RAID-10 support for md. 7 * 8 * Base on code in raid1.c. See raid1.c for further copyright information. --- 846 unchanged lines hidden (view full) --- 855 for (i = 0; 856 (i < conf->geo.raid_disks || i < conf->prev.raid_disks) 857 && ret == 0; 858 i++) { 859 struct md_rdev *rdev = rcu_dereference(conf->mirrors[i].rdev); 860 if (rdev && !test_bit(Faulty, &rdev->flags)) { 861 struct request_queue *q = bdev_get_queue(rdev->bdev); 862 |
863 ret |= bdi_congested(&q->backing_dev_info, bits); | 863 ret |= bdi_congested(q->backing_dev_info, bits); |
864 } 865 } 866 rcu_read_unlock(); 867 return ret; 868} 869 870static void flush_pending_writes(struct r10conf *conf) 871{ --- 2964 unchanged lines hidden (view full) --- 3836 int stripe = conf->geo.raid_disks * 3837 ((mddev->chunk_sectors << 9) / PAGE_SIZE); 3838 3839 /* Calculate max read-ahead size. 3840 * We need to readahead at least twice a whole stripe.... 3841 * maybe... 3842 */ 3843 stripe /= conf->geo.near_copies; | 864 } 865 } 866 rcu_read_unlock(); 867 return ret; 868} 869 870static void flush_pending_writes(struct r10conf *conf) 871{ --- 2964 unchanged lines hidden (view full) --- 3836 int stripe = conf->geo.raid_disks * 3837 ((mddev->chunk_sectors << 9) / PAGE_SIZE); 3838 3839 /* Calculate max read-ahead size. 3840 * We need to readahead at least twice a whole stripe.... 3841 * maybe... 3842 */ 3843 stripe /= conf->geo.near_copies; |
3844 if (mddev->queue->backing_dev_info.ra_pages < 2 * stripe) 3845 mddev->queue->backing_dev_info.ra_pages = 2 * stripe; | 3844 if (mddev->queue->backing_dev_info->ra_pages < 2 * stripe) 3845 mddev->queue->backing_dev_info->ra_pages = 2 * stripe; |
3846 } 3847 3848 if (md_integrity_register(mddev)) 3849 goto out_free_conf; 3850 3851 if (conf->reshape_progress != MaxSector) { 3852 unsigned long before_length, after_length; 3853 --- 784 unchanged lines hidden (view full) --- 4638 4639 /* read-ahead size must cover two whole stripes, which is 4640 * 2 * (datadisks) * chunksize where 'n' is the number of raid devices 4641 */ 4642 if (conf->mddev->queue) { 4643 int stripe = conf->geo.raid_disks * 4644 ((conf->mddev->chunk_sectors << 9) / PAGE_SIZE); 4645 stripe /= conf->geo.near_copies; | 3846 } 3847 3848 if (md_integrity_register(mddev)) 3849 goto out_free_conf; 3850 3851 if (conf->reshape_progress != MaxSector) { 3852 unsigned long before_length, after_length; 3853 --- 784 unchanged lines hidden (view full) --- 4638 4639 /* read-ahead size must cover two whole stripes, which is 4640 * 2 * (datadisks) * chunksize where 'n' is the number of raid devices 4641 */ 4642 if (conf->mddev->queue) { 4643 int stripe = conf->geo.raid_disks * 4644 ((conf->mddev->chunk_sectors << 9) / PAGE_SIZE); 4645 stripe /= conf->geo.near_copies; |
4646 if (conf->mddev->queue->backing_dev_info.ra_pages < 2 * stripe) 4647 conf->mddev->queue->backing_dev_info.ra_pages = 2 * stripe; | 4646 if (conf->mddev->queue->backing_dev_info->ra_pages < 2 * stripe) 4647 conf->mddev->queue->backing_dev_info->ra_pages = 2 * stripe; |
4648 } 4649 conf->fullsync = 0; 4650} 4651 4652static int handle_reshape_read_error(struct mddev *mddev, 4653 struct r10bio *r10_bio) 4654{ 4655 /* Use sync reads to get the blocks from somewhere else */ --- 184 unchanged lines hidden --- | 4648 } 4649 conf->fullsync = 0; 4650} 4651 4652static int handle_reshape_read_error(struct mddev *mddev, 4653 struct r10bio *r10_bio) 4654{ 4655 /* Use sync reads to get the blocks from somewhere else */ --- 184 unchanged lines hidden --- |