Lines Matching refs:dd_idx

913 	int dd_idx;  in stripe_add_to_batch_list()  local
944 dd_idx = 0; in stripe_add_to_batch_list()
945 while (dd_idx == sh->pd_idx || dd_idx == sh->qd_idx) in stripe_add_to_batch_list()
946 dd_idx++; in stripe_add_to_batch_list()
947 if (head->dev[dd_idx].towrite->bi_opf != sh->dev[dd_idx].towrite->bi_opf || in stripe_add_to_batch_list()
948 bio_op(head->dev[dd_idx].towrite) != bio_op(sh->dev[dd_idx].towrite)) in stripe_add_to_batch_list()
2994 int previous, int *dd_idx, in raid5_compute_sector() argument
3023 *dd_idx = sector_div(stripe, data_disks); in raid5_compute_sector()
3037 if (*dd_idx >= pd_idx) in raid5_compute_sector()
3038 (*dd_idx)++; in raid5_compute_sector()
3042 if (*dd_idx >= pd_idx) in raid5_compute_sector()
3043 (*dd_idx)++; in raid5_compute_sector()
3047 *dd_idx = (pd_idx + 1 + *dd_idx) % raid_disks; in raid5_compute_sector()
3051 *dd_idx = (pd_idx + 1 + *dd_idx) % raid_disks; in raid5_compute_sector()
3055 (*dd_idx)++; in raid5_compute_sector()
3071 (*dd_idx)++; /* Q D D D P */ in raid5_compute_sector()
3073 } else if (*dd_idx >= pd_idx) in raid5_compute_sector()
3074 (*dd_idx) += 2; /* D D P Q D */ in raid5_compute_sector()
3080 (*dd_idx)++; /* Q D D D P */ in raid5_compute_sector()
3082 } else if (*dd_idx >= pd_idx) in raid5_compute_sector()
3083 (*dd_idx) += 2; /* D D P Q D */ in raid5_compute_sector()
3088 *dd_idx = (pd_idx + 2 + *dd_idx) % raid_disks; in raid5_compute_sector()
3093 *dd_idx = (pd_idx + 2 + *dd_idx) % raid_disks; in raid5_compute_sector()
3099 (*dd_idx) += 2; in raid5_compute_sector()
3113 (*dd_idx)++; /* Q D D D P */ in raid5_compute_sector()
3115 } else if (*dd_idx >= pd_idx) in raid5_compute_sector()
3116 (*dd_idx) += 2; /* D D P Q D */ in raid5_compute_sector()
3129 (*dd_idx)++; /* Q D D D P */ in raid5_compute_sector()
3131 } else if (*dd_idx >= pd_idx) in raid5_compute_sector()
3132 (*dd_idx) += 2; /* D D P Q D */ in raid5_compute_sector()
3140 *dd_idx = (pd_idx + 1 + *dd_idx) % raid_disks; in raid5_compute_sector()
3147 if (*dd_idx >= pd_idx) in raid5_compute_sector()
3148 (*dd_idx)++; in raid5_compute_sector()
3154 if (*dd_idx >= pd_idx) in raid5_compute_sector()
3155 (*dd_idx)++; in raid5_compute_sector()
3161 *dd_idx = (pd_idx + 1 + *dd_idx) % (raid_disks-1); in raid5_compute_sector()
3167 *dd_idx = (pd_idx + 1 + *dd_idx) % (raid_disks-1); in raid5_compute_sector()
3173 (*dd_idx)++; in raid5_compute_sector()
3208 int dummy1, dd_idx = i; in raid5_compute_blocknr() local
3306 if (check != sh->sector || dummy1 != dd_idx || sh2.pd_idx != sh->pd_idx in raid5_compute_blocknr()
3481 int dd_idx, int forwrite) in stripe_bio_overlaps() argument
3494 bip = &sh->dev[dd_idx].towrite; in stripe_bio_overlaps()
3496 bip = &sh->dev[dd_idx].toread; in stripe_bio_overlaps()
3523 (i == dd_idx || sh->dev[i].towrite)) { in stripe_bio_overlaps()
3541 int dd_idx, int forwrite, int previous) in __add_stripe_bio() argument
3548 bip = &sh->dev[dd_idx].towrite; in __add_stripe_bio()
3552 bip = &sh->dev[dd_idx].toread; in __add_stripe_bio()
3570 sector_t sector = sh->dev[dd_idx].sector; in __add_stripe_bio()
3571 for (bi=sh->dev[dd_idx].towrite; in __add_stripe_bio()
3572 sector < sh->dev[dd_idx].sector + RAID5_STRIPE_SECTORS(conf) && in __add_stripe_bio()
3574 bi = r5_next_bio(conf, bi, sh->dev[dd_idx].sector)) { in __add_stripe_bio()
3578 if (sector >= sh->dev[dd_idx].sector + RAID5_STRIPE_SECTORS(conf)) in __add_stripe_bio()
3579 if (!test_and_set_bit(R5_OVERWRITE, &sh->dev[dd_idx].flags)) in __add_stripe_bio()
3584 (*bip)->bi_iter.bi_sector, sh->sector, dd_idx, in __add_stripe_bio()
3585 sh->dev[dd_idx].sector); in __add_stripe_bio()
3619 int dd_idx, int forwrite, int previous) in add_stripe_bio() argument
3623 if (stripe_bio_overlaps(sh, bi, dd_idx, forwrite)) { in add_stripe_bio()
3624 set_bit(R5_Overlap, &sh->dev[dd_idx].flags); in add_stripe_bio()
3629 __add_stripe_bio(sh, bi, dd_idx, forwrite, previous); in add_stripe_bio()
3641 int dd_idx; in stripe_set_idx() local
3649 &dd_idx, sh); in stripe_set_idx()
4626 int dd_idx, j; in handle_stripe_expansion() local
4632 &dd_idx, NULL); in handle_stripe_expansion()
4642 test_bit(R5_Expanded, &sh2->dev[dd_idx].flags)) { in handle_stripe_expansion()
4650 tx = async_memcpy(sh2->dev[dd_idx].page, in handle_stripe_expansion()
4651 sh->dev[i].page, sh2->dev[dd_idx].offset, in handle_stripe_expansion()
4655 set_bit(R5_Expanded, &sh2->dev[dd_idx].flags); in handle_stripe_expansion()
4656 set_bit(R5_UPTODATE, &sh2->dev[dd_idx].flags); in handle_stripe_expansion()
5508 int bad_sectors, dd_idx; in raid5_read_one_chunk() local
5518 &dd_idx, NULL); in raid5_read_one_chunk()
5525 rdev = rcu_dereference(conf->disks[dd_idx].replacement); in raid5_read_one_chunk()
5528 rdev = rcu_dereference(conf->disks[dd_idx].rdev); in raid5_read_one_chunk()
5898 int dd_idx; in stripe_ahead_of_reshape() local
5900 for (dd_idx = 0; dd_idx < sh->disks; dd_idx++) { in stripe_ahead_of_reshape()
5901 if (dd_idx == sh->pd_idx) in stripe_ahead_of_reshape()
5904 min_sector = min(min_sector, sh->dev[dd_idx].sector); in stripe_ahead_of_reshape()
5905 max_sector = min(max_sector, sh->dev[dd_idx].sector); in stripe_ahead_of_reshape()
5924 int dd_idx; in add_all_stripe_bios() local
5929 for (dd_idx = 0; dd_idx < sh->disks; dd_idx++) { in add_all_stripe_bios()
5930 struct r5dev *dev = &sh->dev[dd_idx]; in add_all_stripe_bios()
5932 if (dd_idx == sh->pd_idx || dd_idx == sh->qd_idx) in add_all_stripe_bios()
5939 if (stripe_bio_overlaps(sh, bi, dd_idx, forwrite)) { in add_all_stripe_bios()
5949 for (dd_idx = 0; dd_idx < sh->disks; dd_idx++) { in add_all_stripe_bios()
5950 struct r5dev *dev = &sh->dev[dd_idx]; in add_all_stripe_bios()
5952 if (dd_idx == sh->pd_idx || dd_idx == sh->qd_idx) in add_all_stripe_bios()
5959 __add_stripe_bio(sh, bi, dd_idx, forwrite, previous); in add_all_stripe_bios()
5978 int seq, dd_idx; in make_stripe_request() local
6007 &dd_idx, NULL); in make_stripe_request()
6220 int dd_idx; in reshape_request() local
6406 1, &dd_idx, NULL); in reshape_request()
6410 1, &dd_idx, NULL); in reshape_request()
6581 int dd_idx; in retry_aligned_read() local
6589 0, &dd_idx, NULL); in retry_aligned_read()
6610 if (!add_stripe_bio(sh, raid_bio, dd_idx, 0, 0)) { in retry_aligned_read()
6617 set_bit(R5_ReadNoMerge, &sh->dev[dd_idx].flags); in retry_aligned_read()