Lines Matching refs:dd_idx

920 	int dd_idx;  in stripe_add_to_batch_list()  local
951 dd_idx = 0; in stripe_add_to_batch_list()
952 while (dd_idx == sh->pd_idx || dd_idx == sh->qd_idx) in stripe_add_to_batch_list()
953 dd_idx++; in stripe_add_to_batch_list()
954 if (head->dev[dd_idx].towrite->bi_opf != sh->dev[dd_idx].towrite->bi_opf || in stripe_add_to_batch_list()
955 bio_op(head->dev[dd_idx].towrite) != bio_op(sh->dev[dd_idx].towrite)) in stripe_add_to_batch_list()
3001 int previous, int *dd_idx, in raid5_compute_sector() argument
3030 *dd_idx = sector_div(stripe, data_disks); in raid5_compute_sector()
3044 if (*dd_idx >= pd_idx) in raid5_compute_sector()
3045 (*dd_idx)++; in raid5_compute_sector()
3049 if (*dd_idx >= pd_idx) in raid5_compute_sector()
3050 (*dd_idx)++; in raid5_compute_sector()
3054 *dd_idx = (pd_idx + 1 + *dd_idx) % raid_disks; in raid5_compute_sector()
3058 *dd_idx = (pd_idx + 1 + *dd_idx) % raid_disks; in raid5_compute_sector()
3062 (*dd_idx)++; in raid5_compute_sector()
3078 (*dd_idx)++; /* Q D D D P */ in raid5_compute_sector()
3080 } else if (*dd_idx >= pd_idx) in raid5_compute_sector()
3081 (*dd_idx) += 2; /* D D P Q D */ in raid5_compute_sector()
3087 (*dd_idx)++; /* Q D D D P */ in raid5_compute_sector()
3089 } else if (*dd_idx >= pd_idx) in raid5_compute_sector()
3090 (*dd_idx) += 2; /* D D P Q D */ in raid5_compute_sector()
3095 *dd_idx = (pd_idx + 2 + *dd_idx) % raid_disks; in raid5_compute_sector()
3100 *dd_idx = (pd_idx + 2 + *dd_idx) % raid_disks; in raid5_compute_sector()
3106 (*dd_idx) += 2; in raid5_compute_sector()
3120 (*dd_idx)++; /* Q D D D P */ in raid5_compute_sector()
3122 } else if (*dd_idx >= pd_idx) in raid5_compute_sector()
3123 (*dd_idx) += 2; /* D D P Q D */ in raid5_compute_sector()
3136 (*dd_idx)++; /* Q D D D P */ in raid5_compute_sector()
3138 } else if (*dd_idx >= pd_idx) in raid5_compute_sector()
3139 (*dd_idx) += 2; /* D D P Q D */ in raid5_compute_sector()
3147 *dd_idx = (pd_idx + 1 + *dd_idx) % raid_disks; in raid5_compute_sector()
3154 if (*dd_idx >= pd_idx) in raid5_compute_sector()
3155 (*dd_idx)++; in raid5_compute_sector()
3161 if (*dd_idx >= pd_idx) in raid5_compute_sector()
3162 (*dd_idx)++; in raid5_compute_sector()
3168 *dd_idx = (pd_idx + 1 + *dd_idx) % (raid_disks-1); in raid5_compute_sector()
3174 *dd_idx = (pd_idx + 1 + *dd_idx) % (raid_disks-1); in raid5_compute_sector()
3180 (*dd_idx)++; in raid5_compute_sector()
3215 int dummy1, dd_idx = i; in raid5_compute_blocknr() local
3313 if (check != sh->sector || dummy1 != dd_idx || sh2.pd_idx != sh->pd_idx in raid5_compute_blocknr()
3488 int dd_idx, int forwrite) in stripe_bio_overlaps() argument
3501 bip = &sh->dev[dd_idx].towrite; in stripe_bio_overlaps()
3503 bip = &sh->dev[dd_idx].toread; in stripe_bio_overlaps()
3530 (i == dd_idx || sh->dev[i].towrite)) { in stripe_bio_overlaps()
3548 int dd_idx, int forwrite, int previous) in __add_stripe_bio() argument
3555 bip = &sh->dev[dd_idx].towrite; in __add_stripe_bio()
3559 bip = &sh->dev[dd_idx].toread; in __add_stripe_bio()
3577 sector_t sector = sh->dev[dd_idx].sector; in __add_stripe_bio()
3578 for (bi=sh->dev[dd_idx].towrite; in __add_stripe_bio()
3579 sector < sh->dev[dd_idx].sector + RAID5_STRIPE_SECTORS(conf) && in __add_stripe_bio()
3581 bi = r5_next_bio(conf, bi, sh->dev[dd_idx].sector)) { in __add_stripe_bio()
3585 if (sector >= sh->dev[dd_idx].sector + RAID5_STRIPE_SECTORS(conf)) in __add_stripe_bio()
3586 if (!test_and_set_bit(R5_OVERWRITE, &sh->dev[dd_idx].flags)) in __add_stripe_bio()
3591 (*bip)->bi_iter.bi_sector, sh->sector, dd_idx, in __add_stripe_bio()
3592 sh->dev[dd_idx].sector); in __add_stripe_bio()
3626 int dd_idx, int forwrite, int previous) in add_stripe_bio() argument
3630 if (stripe_bio_overlaps(sh, bi, dd_idx, forwrite)) { in add_stripe_bio()
3631 set_bit(R5_Overlap, &sh->dev[dd_idx].flags); in add_stripe_bio()
3636 __add_stripe_bio(sh, bi, dd_idx, forwrite, previous); in add_stripe_bio()
3648 int dd_idx; in stripe_set_idx() local
3656 &dd_idx, sh); in stripe_set_idx()
4633 int dd_idx, j; in handle_stripe_expansion() local
4639 &dd_idx, NULL); in handle_stripe_expansion()
4649 test_bit(R5_Expanded, &sh2->dev[dd_idx].flags)) { in handle_stripe_expansion()
4657 tx = async_memcpy(sh2->dev[dd_idx].page, in handle_stripe_expansion()
4658 sh->dev[i].page, sh2->dev[dd_idx].offset, in handle_stripe_expansion()
4662 set_bit(R5_Expanded, &sh2->dev[dd_idx].flags); in handle_stripe_expansion()
4663 set_bit(R5_UPTODATE, &sh2->dev[dd_idx].flags); in handle_stripe_expansion()
5506 int bad_sectors, dd_idx; in raid5_read_one_chunk() local
5515 &dd_idx, NULL); in raid5_read_one_chunk()
5522 rdev = rcu_dereference(conf->disks[dd_idx].replacement); in raid5_read_one_chunk()
5525 rdev = rcu_dereference(conf->disks[dd_idx].rdev); in raid5_read_one_chunk()
5892 int dd_idx; in stripe_ahead_of_reshape() local
5894 for (dd_idx = 0; dd_idx < sh->disks; dd_idx++) { in stripe_ahead_of_reshape()
5895 if (dd_idx == sh->pd_idx) in stripe_ahead_of_reshape()
5898 min_sector = min(min_sector, sh->dev[dd_idx].sector); in stripe_ahead_of_reshape()
5899 max_sector = min(max_sector, sh->dev[dd_idx].sector); in stripe_ahead_of_reshape()
5918 int dd_idx; in add_all_stripe_bios() local
5923 for (dd_idx = 0; dd_idx < sh->disks; dd_idx++) { in add_all_stripe_bios()
5924 struct r5dev *dev = &sh->dev[dd_idx]; in add_all_stripe_bios()
5926 if (dd_idx == sh->pd_idx || dd_idx == sh->qd_idx) in add_all_stripe_bios()
5933 if (stripe_bio_overlaps(sh, bi, dd_idx, forwrite)) { in add_all_stripe_bios()
5943 for (dd_idx = 0; dd_idx < sh->disks; dd_idx++) { in add_all_stripe_bios()
5944 struct r5dev *dev = &sh->dev[dd_idx]; in add_all_stripe_bios()
5946 if (dd_idx == sh->pd_idx || dd_idx == sh->qd_idx) in add_all_stripe_bios()
5953 __add_stripe_bio(sh, bi, dd_idx, forwrite, previous); in add_all_stripe_bios()
5985 int seq, dd_idx; in make_stripe_request() local
6015 &dd_idx, NULL); in make_stripe_request()
6108 int dd_idx; in raid5_bio_lowest_chunk_sector() local
6115 sector = raid5_compute_sector(conf, r_sector, 0, &dd_idx, &sh); in raid5_bio_lowest_chunk_sector()
6123 dd_idx++; in raid5_bio_lowest_chunk_sector()
6124 while (dd_idx == sh.pd_idx || dd_idx == sh.qd_idx) in raid5_bio_lowest_chunk_sector()
6125 dd_idx++; in raid5_bio_lowest_chunk_sector()
6126 if (dd_idx >= raid_disks) in raid5_bio_lowest_chunk_sector()
6280 int dd_idx; in reshape_request() local
6466 1, &dd_idx, NULL); in reshape_request()
6470 1, &dd_idx, NULL); in reshape_request()
6641 int dd_idx; in retry_aligned_read() local
6649 0, &dd_idx, NULL); in retry_aligned_read()
6670 if (!add_stripe_bio(sh, raid_bio, dd_idx, 0, 0)) { in retry_aligned_read()
6677 set_bit(R5_ReadNoMerge, &sh->dev[dd_idx].flags); in retry_aligned_read()