Lines Matching refs:raid_disks

130 static inline int raid6_next_disk(int disk, int raid_disks)  in raid6_next_disk()  argument
133 return (disk < raid_disks) ? disk : 0; in raid6_next_disk()
286 else if (injournal == conf->raid_disks - conf->max_degraded) { in do_release_stripe()
590 sh->disks = previous ? conf->previous_raid_disks : conf->raid_disks; in init_stripe()
715 if (conf->raid_disks >= conf->previous_raid_disks) in raid5_calc_degraded()
719 if (conf->raid_disks == conf->previous_raid_disks) in raid5_calc_degraded()
723 for (i = 0; i < conf->raid_disks; i++) { in raid5_calc_degraded()
737 if (conf->raid_disks <= conf->previous_raid_disks) in raid5_calc_degraded()
2424 int devs = max(conf->raid_disks, conf->previous_raid_disks); in grow_stripes()
2670 for (i = conf->raid_disks; i < newsize; i++) { in resize_stripes()
2678 for (i=conf->raid_disks; i < newsize; i++) in resize_stripes()
2974 mdname(mddev), mddev->degraded, conf->raid_disks); in raid5_error()
2977 mdname(mddev), conf->raid_disks - mddev->degraded); in raid5_error()
3007 int raid_disks = previous ? conf->previous_raid_disks in raid5_compute_sector() local
3008 : conf->raid_disks; in raid5_compute_sector()
3009 int data_disks = raid_disks - conf->max_degraded; in raid5_compute_sector()
3036 pd_idx = data_disks - sector_div(stripe2, raid_disks); in raid5_compute_sector()
3041 pd_idx = sector_div(stripe2, raid_disks); in raid5_compute_sector()
3046 pd_idx = data_disks - sector_div(stripe2, raid_disks); in raid5_compute_sector()
3047 *dd_idx = (pd_idx + 1 + *dd_idx) % raid_disks; in raid5_compute_sector()
3050 pd_idx = sector_div(stripe2, raid_disks); in raid5_compute_sector()
3051 *dd_idx = (pd_idx + 1 + *dd_idx) % raid_disks; in raid5_compute_sector()
3068 pd_idx = raid_disks - 1 - sector_div(stripe2, raid_disks); in raid5_compute_sector()
3070 if (pd_idx == raid_disks-1) { in raid5_compute_sector()
3077 pd_idx = sector_div(stripe2, raid_disks); in raid5_compute_sector()
3079 if (pd_idx == raid_disks-1) { in raid5_compute_sector()
3086 pd_idx = raid_disks - 1 - sector_div(stripe2, raid_disks); in raid5_compute_sector()
3087 qd_idx = (pd_idx + 1) % raid_disks; in raid5_compute_sector()
3088 *dd_idx = (pd_idx + 2 + *dd_idx) % raid_disks; in raid5_compute_sector()
3091 pd_idx = sector_div(stripe2, raid_disks); in raid5_compute_sector()
3092 qd_idx = (pd_idx + 1) % raid_disks; in raid5_compute_sector()
3093 *dd_idx = (pd_idx + 2 + *dd_idx) % raid_disks; in raid5_compute_sector()
3110 pd_idx = sector_div(stripe2, raid_disks); in raid5_compute_sector()
3112 if (pd_idx == raid_disks-1) { in raid5_compute_sector()
3126 pd_idx = raid_disks - 1 - sector_div(stripe2, raid_disks); in raid5_compute_sector()
3128 if (pd_idx == raid_disks-1) { in raid5_compute_sector()
3138 pd_idx = raid_disks - 1 - sector_div(stripe2, raid_disks); in raid5_compute_sector()
3139 qd_idx = (pd_idx + raid_disks - 1) % raid_disks; in raid5_compute_sector()
3140 *dd_idx = (pd_idx + 1 + *dd_idx) % raid_disks; in raid5_compute_sector()
3146 pd_idx = data_disks - sector_div(stripe2, raid_disks-1); in raid5_compute_sector()
3149 qd_idx = raid_disks - 1; in raid5_compute_sector()
3153 pd_idx = sector_div(stripe2, raid_disks-1); in raid5_compute_sector()
3156 qd_idx = raid_disks - 1; in raid5_compute_sector()
3160 pd_idx = data_disks - sector_div(stripe2, raid_disks-1); in raid5_compute_sector()
3161 *dd_idx = (pd_idx + 1 + *dd_idx) % (raid_disks-1); in raid5_compute_sector()
3162 qd_idx = raid_disks - 1; in raid5_compute_sector()
3166 pd_idx = sector_div(stripe2, raid_disks-1); in raid5_compute_sector()
3167 *dd_idx = (pd_idx + 1 + *dd_idx) % (raid_disks-1); in raid5_compute_sector()
3168 qd_idx = raid_disks - 1; in raid5_compute_sector()
3174 qd_idx = raid_disks - 1; in raid5_compute_sector()
3198 int raid_disks = sh->disks; in raid5_compute_blocknr() local
3199 int data_disks = raid_disks - conf->max_degraded; in raid5_compute_blocknr()
3229 i += raid_disks; in raid5_compute_blocknr()
3249 if (sh->pd_idx == raid_disks-1) in raid5_compute_blocknr()
3256 if (sh->pd_idx == raid_disks-1) in raid5_compute_blocknr()
3261 i += raid_disks; in raid5_compute_blocknr()
3277 i += raid_disks; in raid5_compute_blocknr()
3643 int disks = previous ? conf->previous_raid_disks : conf->raid_disks; in stripe_set_idx()
3790 for (i = 0; i < conf->raid_disks; i++) { in handle_failed_sync()
4657 for (j = 0; j < conf->raid_disks; j++) in handle_stripe_expansion()
4662 if (j == conf->raid_disks) { in handle_stripe_expansion()
5227 for (i = 0; i < conf->raid_disks; i++) in handle_stripe()
5291 for (i = conf->raid_disks; i--; ) { in handle_stripe()
5301 sh->disks = conf->raid_disks; in handle_stripe()
5809 (conf->raid_disks - conf->max_degraded); in make_discard_request()
5833 for (d = 0; d < conf->raid_disks; d++) { in make_discard_request()
5847 for (d = 0; d < conf->raid_disks; d++) { in make_discard_request()
5859 d < conf->raid_disks - conf->max_degraded; in make_discard_request()
6199 static sector_t raid5_size(struct mddev *mddev, sector_t sectors, int raid_disks);
6216 int raid_disks = conf->previous_raid_disks; in reshape_request() local
6217 int data_disks = raid_disks - conf->max_degraded; in reshape_request()
6218 int new_data_disks = conf->raid_disks - conf->max_degraded; in reshape_request()
6549 for (i = 0; i < conf->raid_disks; i++) { in raid5_sync_request()
7283 raid5_size(struct mddev *mddev, sector_t sectors, int raid_disks) in raid5_size() argument
7289 if (!raid_disks) in raid5_size()
7291 raid_disks = min(conf->raid_disks, conf->previous_raid_disks); in raid5_size()
7295 return sectors * (raid_disks - conf->max_degraded); in raid5_size()
7315 max(conf->raid_disks, in alloc_scratch_buffer()
7388 conf->scribble_disks = max(conf->raid_disks, in raid5_alloc_percpu()
7455 if (mddev->new_level == 6 && mddev->raid_disks < 4) { in setup_conf()
7457 mdname(mddev), mddev->raid_disks); in setup_conf()
7524 conf->raid_disks = mddev->raid_disks; in setup_conf()
7526 conf->previous_raid_disks = mddev->raid_disks; in setup_conf()
7528 conf->previous_raid_disks = mddev->raid_disks - mddev->delta_disks; in setup_conf()
7529 max_disks = max(conf->raid_disks, conf->previous_raid_disks); in setup_conf()
7655 conf->shrinker.seeks = DEFAULT_SEEKS * conf->raid_disks * 4; in setup_conf()
7684 static int only_parity(int raid_disk, int algo, int raid_disks, int max_degraded) in only_parity() argument
7692 if (raid_disk >= raid_disks - max_degraded) in only_parity()
7697 raid_disk == raid_disks - 1) in only_parity()
7704 if (raid_disk == raid_disks - 1) in only_parity()
7713 (conf->raid_disks - conf->max_degraded)); in raid5_set_io_opt()
7803 old_disks = mddev->raid_disks - mddev->delta_disks; in raid5_run()
7813 new_data_disks = mddev->raid_disks - max_degraded; in raid5_run()
7896 for (i = 0; i < conf->raid_disks && conf->previous_raid_disks; in raid5_run()
7936 conf->raid_disks, in raid5_run()
7955 mdname(mddev), mddev->degraded, conf->raid_disks); in raid5_run()
7980 mddev->raid_disks-mddev->degraded, mddev->raid_disks, in raid5_run()
8101 seq_printf (seq, " [%d/%d] [", conf->raid_disks, conf->raid_disks - mddev->degraded); in raid5_status()
8103 for (i = 0; i < conf->raid_disks; i++) { in raid5_status()
8122 conf->raid_disks, in print_raid5_conf()
8123 conf->raid_disks - conf->mddev->degraded); in print_raid5_conf()
8126 for (i = 0; i < conf->raid_disks; i++) { in print_raid5_conf()
8144 for (i = 0; i < conf->raid_disks; i++) { in raid5_spare_active()
8216 if (number >= conf->raid_disks && in raid5_remove_disk()
8233 number < conf->raid_disks) { in raid5_remove_disk()
8282 int last = conf->raid_disks - 1; in raid5_add_disk()
8370 newsize = raid5_size(mddev, sectors, mddev->raid_disks); in raid5_resize()
8435 if (mddev->raid_disks + mddev->delta_disks < min) in check_reshape()
8490 if (raid5_size(mddev, 0, conf->raid_disks + mddev->delta_disks) in raid5_start_reshape()
8500 conf->previous_raid_disks = conf->raid_disks; in raid5_start_reshape()
8501 conf->raid_disks += mddev->delta_disks; in raid5_start_reshape()
8561 mddev->raid_disks = conf->raid_disks; in raid5_start_reshape()
8576 mddev->raid_disks = conf->raid_disks = conf->previous_raid_disks; in raid5_start_reshape()
8606 conf->previous_raid_disks = conf->raid_disks; in end_reshape()
8639 for (d = conf->raid_disks ; in raid5_finish_reshape()
8640 d < conf->raid_disks - mddev->delta_disks; in raid5_finish_reshape()
8713 mddev->raid_disks += 1; in raid45_takeover_raid0()
8726 if (mddev->raid_disks != 2 || in raid5_takeover_raid1()
8782 mddev->raid_disks -= 1; in raid5_takeover_raid6()
8810 if (mddev->raid_disks == 2) { in raid5_check_reshape()
8900 if (mddev->raid_disks > 253) in raid6_takeover()
8902 if (mddev->raid_disks < 3) in raid6_takeover()
8930 mddev->raid_disks += 1; in raid6_takeover()