Lines Matching refs:pd_idx

141 	if (idx == sh->pd_idx)  in raid6_idx_to_slot()
274 WARN_ON(test_bit(R5_InJournal, &sh->dev[sh->pd_idx].flags)); in do_release_stripe()
870 while (dd_idx == sh->pd_idx || dd_idx == sh->qd_idx) in stripe_add_to_batch_list()
1567 if (i == sh->qd_idx || i == sh->pd_idx || in set_syndrome_sources()
1798 int count = 0, pd_idx = sh->pd_idx, i; in ops_run_prexor5() local
1802 unsigned int off_dest = off_srcs[count] = sh->dev[pd_idx].offset; in ops_run_prexor5()
1803 struct page *xor_dest = xor_srcs[count++] = sh->dev[pd_idx].page; in ops_run_prexor5()
1931 int pd_idx = sh->pd_idx; in ops_complete_reconstruct() local
1948 if (dev->written || i == pd_idx || i == qd_idx) { in ops_complete_reconstruct()
1982 int count, pd_idx = sh->pd_idx, i; in ops_run_reconstruct5() local
1995 if (pd_idx == i) in ops_run_reconstruct5()
2002 set_bit(R5_Discard, &sh->dev[pd_idx].flags); in ops_run_reconstruct5()
2015 off_dest = off_srcs[count] = sh->dev[pd_idx].offset; in ops_run_reconstruct5()
2016 xor_dest = xor_srcs[count++] = sh->dev[pd_idx].page; in ops_run_reconstruct5()
2026 xor_dest = sh->dev[pd_idx].page; in ops_run_reconstruct5()
2027 off_dest = sh->dev[pd_idx].offset; in ops_run_reconstruct5()
2030 if (i != pd_idx) { in ops_run_reconstruct5()
2088 if (sh->pd_idx == i || sh->qd_idx == i) in ops_run_reconstruct6()
2095 set_bit(R5_Discard, &sh->dev[sh->pd_idx].flags); in ops_run_reconstruct6()
2150 int pd_idx = sh->pd_idx; in ops_run_check_p() local
2166 xor_dest = sh->dev[pd_idx].page; in ops_run_check_p()
2167 off_dest = sh->dev[pd_idx].offset; in ops_run_check_p()
2171 if (i == pd_idx || i == qd_idx) in ops_run_check_p()
2770 if (sh->qd_idx >= 0 && sh->pd_idx == i) in raid5_end_read_request()
2922 int pd_idx, qd_idx; in raid5_compute_sector() local
2950 pd_idx = qd_idx = -1; in raid5_compute_sector()
2953 pd_idx = data_disks; in raid5_compute_sector()
2958 pd_idx = data_disks - sector_div(stripe2, raid_disks); in raid5_compute_sector()
2959 if (*dd_idx >= pd_idx) in raid5_compute_sector()
2963 pd_idx = sector_div(stripe2, raid_disks); in raid5_compute_sector()
2964 if (*dd_idx >= pd_idx) in raid5_compute_sector()
2968 pd_idx = data_disks - sector_div(stripe2, raid_disks); in raid5_compute_sector()
2969 *dd_idx = (pd_idx + 1 + *dd_idx) % raid_disks; in raid5_compute_sector()
2972 pd_idx = sector_div(stripe2, raid_disks); in raid5_compute_sector()
2973 *dd_idx = (pd_idx + 1 + *dd_idx) % raid_disks; in raid5_compute_sector()
2976 pd_idx = 0; in raid5_compute_sector()
2980 pd_idx = data_disks; in raid5_compute_sector()
2990 pd_idx = raid_disks - 1 - sector_div(stripe2, raid_disks); in raid5_compute_sector()
2991 qd_idx = pd_idx + 1; in raid5_compute_sector()
2992 if (pd_idx == raid_disks-1) { in raid5_compute_sector()
2995 } else if (*dd_idx >= pd_idx) in raid5_compute_sector()
2999 pd_idx = sector_div(stripe2, raid_disks); in raid5_compute_sector()
3000 qd_idx = pd_idx + 1; in raid5_compute_sector()
3001 if (pd_idx == raid_disks-1) { in raid5_compute_sector()
3004 } else if (*dd_idx >= pd_idx) in raid5_compute_sector()
3008 pd_idx = raid_disks - 1 - sector_div(stripe2, raid_disks); in raid5_compute_sector()
3009 qd_idx = (pd_idx + 1) % raid_disks; in raid5_compute_sector()
3010 *dd_idx = (pd_idx + 2 + *dd_idx) % raid_disks; in raid5_compute_sector()
3013 pd_idx = sector_div(stripe2, raid_disks); in raid5_compute_sector()
3014 qd_idx = (pd_idx + 1) % raid_disks; in raid5_compute_sector()
3015 *dd_idx = (pd_idx + 2 + *dd_idx) % raid_disks; in raid5_compute_sector()
3019 pd_idx = 0; in raid5_compute_sector()
3024 pd_idx = data_disks; in raid5_compute_sector()
3032 pd_idx = sector_div(stripe2, raid_disks); in raid5_compute_sector()
3033 qd_idx = pd_idx + 1; in raid5_compute_sector()
3034 if (pd_idx == raid_disks-1) { in raid5_compute_sector()
3037 } else if (*dd_idx >= pd_idx) in raid5_compute_sector()
3048 pd_idx = raid_disks - 1 - sector_div(stripe2, raid_disks); in raid5_compute_sector()
3049 qd_idx = pd_idx + 1; in raid5_compute_sector()
3050 if (pd_idx == raid_disks-1) { in raid5_compute_sector()
3053 } else if (*dd_idx >= pd_idx) in raid5_compute_sector()
3060 pd_idx = raid_disks - 1 - sector_div(stripe2, raid_disks); in raid5_compute_sector()
3061 qd_idx = (pd_idx + raid_disks - 1) % raid_disks; in raid5_compute_sector()
3062 *dd_idx = (pd_idx + 1 + *dd_idx) % raid_disks; in raid5_compute_sector()
3068 pd_idx = data_disks - sector_div(stripe2, raid_disks-1); in raid5_compute_sector()
3069 if (*dd_idx >= pd_idx) in raid5_compute_sector()
3075 pd_idx = sector_div(stripe2, raid_disks-1); in raid5_compute_sector()
3076 if (*dd_idx >= pd_idx) in raid5_compute_sector()
3082 pd_idx = data_disks - sector_div(stripe2, raid_disks-1); in raid5_compute_sector()
3083 *dd_idx = (pd_idx + 1 + *dd_idx) % (raid_disks-1); in raid5_compute_sector()
3088 pd_idx = sector_div(stripe2, raid_disks-1); in raid5_compute_sector()
3089 *dd_idx = (pd_idx + 1 + *dd_idx) % (raid_disks-1); in raid5_compute_sector()
3094 pd_idx = 0; in raid5_compute_sector()
3106 sh->pd_idx = pd_idx; in raid5_compute_sector()
3137 if (i == sh->pd_idx) in raid5_compute_blocknr()
3145 if (i > sh->pd_idx) in raid5_compute_blocknr()
3150 if (i < sh->pd_idx) in raid5_compute_blocknr()
3152 i -= (sh->pd_idx + 1); in raid5_compute_blocknr()
3171 if (sh->pd_idx == raid_disks-1) in raid5_compute_blocknr()
3173 else if (i > sh->pd_idx) in raid5_compute_blocknr()
3178 if (sh->pd_idx == raid_disks-1) in raid5_compute_blocknr()
3182 if (i < sh->pd_idx) in raid5_compute_blocknr()
3184 i -= (sh->pd_idx + 2); in raid5_compute_blocknr()
3194 if (sh->pd_idx == 0) in raid5_compute_blocknr()
3198 if (i < sh->pd_idx) in raid5_compute_blocknr()
3200 i -= (sh->pd_idx + 1); in raid5_compute_blocknr()
3205 if (i > sh->pd_idx) in raid5_compute_blocknr()
3210 if (i < sh->pd_idx) in raid5_compute_blocknr()
3212 i -= (sh->pd_idx + 1); in raid5_compute_blocknr()
3228 if (check != sh->sector || dummy1 != dd_idx || sh2.pd_idx != sh->pd_idx in raid5_compute_blocknr()
3297 int i, pd_idx = sh->pd_idx, qd_idx = sh->qd_idx, disks = sh->disks; in schedule_reconstruction() local
3343 BUG_ON(!(test_bit(R5_UPTODATE, &sh->dev[pd_idx].flags) || in schedule_reconstruction()
3344 test_bit(R5_Wantcompute, &sh->dev[pd_idx].flags))); in schedule_reconstruction()
3351 if (i == pd_idx || i == qd_idx) in schedule_reconstruction()
3378 set_bit(R5_LOCKED, &sh->dev[pd_idx].flags); in schedule_reconstruction()
3379 clear_bit(R5_UPTODATE, &sh->dev[pd_idx].flags); in schedule_reconstruction()
3394 test_bit(R5_Insync, &sh->dev[pd_idx].flags)) in schedule_reconstruction()
3452 if (i != sh->pd_idx && in add_stripe_bio()
3672 if (test_and_clear_bit(R5_Overlap, &sh->dev[sh->pd_idx].flags)) in handle_failed_sync()
3798 s->failed_num[i] == sh->pd_idx || in need_this_block()
3820 if (s->failed_num[i] != sh->pd_idx && in need_this_block()
3860 ((sh->qd_idx >= 0 && sh->pd_idx == disk_idx) || in fetch_block()
4022 test_bit(R5_Discard, &sh->dev[sh->pd_idx].flags)) { in handle_stripe_clean_event()
4024 clear_bit(R5_Discard, &sh->dev[sh->pd_idx].flags); in handle_stripe_clean_event()
4025 clear_bit(R5_UPTODATE, &sh->dev[sh->pd_idx].flags); in handle_stripe_clean_event()
4107 i == sh->pd_idx || i == sh->qd_idx || in handle_stripe_dirtying()
4119 i != sh->pd_idx && i != sh->qd_idx && in handle_stripe_dirtying()
4143 !test_bit(R5_LOCKED, &sh->dev[sh->pd_idx].flags)) { in handle_stripe_dirtying()
4172 i == sh->pd_idx || i == sh->qd_idx || in handle_stripe_dirtying()
4197 i != sh->pd_idx && i != sh->qd_idx && in handle_stripe_dirtying()
4257 clear_bit(R5_UPTODATE, &sh->dev[sh->pd_idx].flags); in handle_parity_checks5()
4266 dev = &sh->dev[sh->pd_idx]; in handle_parity_checks5()
4318 &sh->dev[sh->pd_idx].flags); in handle_parity_checks5()
4319 sh->ops.target = sh->pd_idx; in handle_parity_checks5()
4339 int pd_idx = sh->pd_idx; in handle_parity_checks6() local
4379 clear_bit(R5_UPTODATE, &sh->dev[pd_idx].flags); in handle_parity_checks6()
4418 dev = &sh->dev[pd_idx]; in handle_parity_checks6()
4488 &sh->dev[pd_idx].flags); in handle_parity_checks6()
4489 *target = pd_idx; in handle_parity_checks6()
4523 if (i != sh->pd_idx && i != sh->qd_idx) { in handle_stripe_expansion()
4555 if (j != sh2->pd_idx && in handle_stripe_expansion()
4929 atomic_read(&sh->count), sh->pd_idx, sh->qd_idx, in handle_stripe()
4994 BUG_ON(!test_bit(R5_UPTODATE, &sh->dev[sh->pd_idx].flags) && in handle_stripe()
4995 !test_bit(R5_Discard, &sh->dev[sh->pd_idx].flags)); in handle_stripe()
5002 (i == sh->pd_idx || i == sh->qd_idx || in handle_stripe()
5012 ((i == sh->pd_idx || i == sh->qd_idx) && in handle_stripe()
5025 pdev = &sh->dev[sh->pd_idx]; in handle_stripe()
5026 s.p_failed = (s.failed >= 1 && s.failed_num[0] == sh->pd_idx) in handle_stripe()
5027 || (s.failed >= 2 && s.failed_num[1] == sh->pd_idx); in handle_stripe()
5140 if (test_and_clear_bit(R5_Overlap, &sh->dev[sh->pd_idx].flags)) in handle_stripe()
5715 set_bit(R5_Overlap, &sh->dev[sh->pd_idx].flags); in make_discard_request()
5721 clear_bit(R5_Overlap, &sh->dev[sh->pd_idx].flags); in make_discard_request()
5724 if (d == sh->pd_idx || d == sh->qd_idx) in make_discard_request()
5738 if (d == sh->pd_idx || d == sh->qd_idx) in make_discard_request()
6116 if (j == sh->pd_idx) in reshape_request()