Lines Matching refs:dd_idx
923 int dd_idx; in stripe_add_to_batch_list() local
954 dd_idx = 0; in stripe_add_to_batch_list()
955 while (dd_idx == sh->pd_idx || dd_idx == sh->qd_idx) in stripe_add_to_batch_list()
956 dd_idx++; in stripe_add_to_batch_list()
957 if (head->dev[dd_idx].towrite->bi_opf != sh->dev[dd_idx].towrite->bi_opf || in stripe_add_to_batch_list()
958 bio_op(head->dev[dd_idx].towrite) != bio_op(sh->dev[dd_idx].towrite)) in stripe_add_to_batch_list()
2947 int previous, int *dd_idx, in raid5_compute_sector() argument
2976 *dd_idx = sector_div(stripe, data_disks); in raid5_compute_sector()
2990 if (*dd_idx >= pd_idx) in raid5_compute_sector()
2991 (*dd_idx)++; in raid5_compute_sector()
2995 if (*dd_idx >= pd_idx) in raid5_compute_sector()
2996 (*dd_idx)++; in raid5_compute_sector()
3000 *dd_idx = (pd_idx + 1 + *dd_idx) % raid_disks; in raid5_compute_sector()
3004 *dd_idx = (pd_idx + 1 + *dd_idx) % raid_disks; in raid5_compute_sector()
3008 (*dd_idx)++; in raid5_compute_sector()
3024 (*dd_idx)++; /* Q D D D P */ in raid5_compute_sector()
3026 } else if (*dd_idx >= pd_idx) in raid5_compute_sector()
3027 (*dd_idx) += 2; /* D D P Q D */ in raid5_compute_sector()
3033 (*dd_idx)++; /* Q D D D P */ in raid5_compute_sector()
3035 } else if (*dd_idx >= pd_idx) in raid5_compute_sector()
3036 (*dd_idx) += 2; /* D D P Q D */ in raid5_compute_sector()
3041 *dd_idx = (pd_idx + 2 + *dd_idx) % raid_disks; in raid5_compute_sector()
3046 *dd_idx = (pd_idx + 2 + *dd_idx) % raid_disks; in raid5_compute_sector()
3052 (*dd_idx) += 2; in raid5_compute_sector()
3066 (*dd_idx)++; /* Q D D D P */ in raid5_compute_sector()
3068 } else if (*dd_idx >= pd_idx) in raid5_compute_sector()
3069 (*dd_idx) += 2; /* D D P Q D */ in raid5_compute_sector()
3082 (*dd_idx)++; /* Q D D D P */ in raid5_compute_sector()
3084 } else if (*dd_idx >= pd_idx) in raid5_compute_sector()
3085 (*dd_idx) += 2; /* D D P Q D */ in raid5_compute_sector()
3093 *dd_idx = (pd_idx + 1 + *dd_idx) % raid_disks; in raid5_compute_sector()
3100 if (*dd_idx >= pd_idx) in raid5_compute_sector()
3101 (*dd_idx)++; in raid5_compute_sector()
3107 if (*dd_idx >= pd_idx) in raid5_compute_sector()
3108 (*dd_idx)++; in raid5_compute_sector()
3114 *dd_idx = (pd_idx + 1 + *dd_idx) % (raid_disks-1); in raid5_compute_sector()
3120 *dd_idx = (pd_idx + 1 + *dd_idx) % (raid_disks-1); in raid5_compute_sector()
3126 (*dd_idx)++; in raid5_compute_sector()
3161 int dummy1, dd_idx = i; in raid5_compute_blocknr() local
3259 if (check != sh->sector || dummy1 != dd_idx || sh2.pd_idx != sh->pd_idx in raid5_compute_blocknr()
3434 int dd_idx, int forwrite) in stripe_bio_overlaps() argument
3447 bip = &sh->dev[dd_idx].towrite; in stripe_bio_overlaps()
3449 bip = &sh->dev[dd_idx].toread; in stripe_bio_overlaps()
3476 (i == dd_idx || sh->dev[i].towrite)) { in stripe_bio_overlaps()
3494 int dd_idx, int forwrite, int previous) in __add_stripe_bio() argument
3501 bip = &sh->dev[dd_idx].towrite; in __add_stripe_bio()
3505 bip = &sh->dev[dd_idx].toread; in __add_stripe_bio()
3523 sector_t sector = sh->dev[dd_idx].sector; in __add_stripe_bio()
3524 for (bi=sh->dev[dd_idx].towrite; in __add_stripe_bio()
3525 sector < sh->dev[dd_idx].sector + RAID5_STRIPE_SECTORS(conf) && in __add_stripe_bio()
3527 bi = r5_next_bio(conf, bi, sh->dev[dd_idx].sector)) { in __add_stripe_bio()
3531 if (sector >= sh->dev[dd_idx].sector + RAID5_STRIPE_SECTORS(conf)) in __add_stripe_bio()
3532 if (!test_and_set_bit(R5_OVERWRITE, &sh->dev[dd_idx].flags)) in __add_stripe_bio()
3537 (*bip)->bi_iter.bi_sector, sh->sector, dd_idx, in __add_stripe_bio()
3538 sh->dev[dd_idx].sector); in __add_stripe_bio()
3552 int dd_idx, int forwrite, int previous) in add_stripe_bio() argument
3556 if (stripe_bio_overlaps(sh, bi, dd_idx, forwrite)) { in add_stripe_bio()
3557 set_bit(R5_Overlap, &sh->dev[dd_idx].flags); in add_stripe_bio()
3562 __add_stripe_bio(sh, bi, dd_idx, forwrite, previous); in add_stripe_bio()
3574 int dd_idx; in stripe_set_idx() local
3582 &dd_idx, sh); in stripe_set_idx()
4552 int dd_idx, j; in handle_stripe_expansion() local
4558 &dd_idx, NULL); in handle_stripe_expansion()
4568 test_bit(R5_Expanded, &sh2->dev[dd_idx].flags)) { in handle_stripe_expansion()
4576 tx = async_memcpy(sh2->dev[dd_idx].page, in handle_stripe_expansion()
4577 sh->dev[i].page, sh2->dev[dd_idx].offset, in handle_stripe_expansion()
4581 set_bit(R5_Expanded, &sh2->dev[dd_idx].flags); in handle_stripe_expansion()
4582 set_bit(R5_UPTODATE, &sh2->dev[dd_idx].flags); in handle_stripe_expansion()
5422 int dd_idx; in raid5_read_one_chunk() local
5431 &dd_idx, NULL); in raid5_read_one_chunk()
5437 rdev = conf->disks[dd_idx].replacement; in raid5_read_one_chunk()
5440 rdev = conf->disks[dd_idx].rdev; in raid5_read_one_chunk()
5791 int dd_idx; in stripe_ahead_of_reshape() local
5793 for (dd_idx = 0; dd_idx < sh->disks; dd_idx++) { in stripe_ahead_of_reshape()
5794 if (dd_idx == sh->pd_idx || dd_idx == sh->qd_idx) in stripe_ahead_of_reshape()
5797 min_sector = min(min_sector, sh->dev[dd_idx].sector); in stripe_ahead_of_reshape()
5798 max_sector = max(max_sector, sh->dev[dd_idx].sector); in stripe_ahead_of_reshape()
5817 int dd_idx; in add_all_stripe_bios() local
5821 for (dd_idx = 0; dd_idx < sh->disks; dd_idx++) { in add_all_stripe_bios()
5822 struct r5dev *dev = &sh->dev[dd_idx]; in add_all_stripe_bios()
5824 if (dd_idx == sh->pd_idx || dd_idx == sh->qd_idx) in add_all_stripe_bios()
5831 if (stripe_bio_overlaps(sh, bi, dd_idx, forwrite)) { in add_all_stripe_bios()
5846 for (dd_idx = 0; dd_idx < sh->disks; dd_idx++) { in add_all_stripe_bios()
5847 struct r5dev *dev = &sh->dev[dd_idx]; in add_all_stripe_bios()
5849 if (dd_idx == sh->pd_idx || dd_idx == sh->qd_idx) in add_all_stripe_bios()
5856 __add_stripe_bio(sh, bi, dd_idx, forwrite, previous); in add_all_stripe_bios()
5911 int dd_idx; in raid5_bitmap_sector() local
5918 start = raid5_compute_sector(conf, start, 0, &dd_idx, NULL); in raid5_bitmap_sector()
5919 end = raid5_compute_sector(conf, end, 0, &dd_idx, NULL); in raid5_bitmap_sector()
5937 prev_start = raid5_compute_sector(conf, prev_start, 1, &dd_idx, NULL); in raid5_bitmap_sector()
5938 prev_end = raid5_compute_sector(conf, prev_end, 1, &dd_idx, NULL); in raid5_bitmap_sector()
5959 int seq, dd_idx; in make_stripe_request() local
5971 &dd_idx, NULL); in make_stripe_request()
6061 int dd_idx; in raid5_bio_lowest_chunk_sector() local
6068 sector = raid5_compute_sector(conf, r_sector, 0, &dd_idx, &sh); in raid5_bio_lowest_chunk_sector()
6076 dd_idx++; in raid5_bio_lowest_chunk_sector()
6077 while (dd_idx == sh.pd_idx || dd_idx == sh.qd_idx) in raid5_bio_lowest_chunk_sector()
6078 dd_idx++; in raid5_bio_lowest_chunk_sector()
6079 if (dd_idx >= raid_disks) in raid5_bio_lowest_chunk_sector()
6254 int dd_idx; in reshape_request() local
6446 1, &dd_idx, NULL); in reshape_request()
6450 1, &dd_idx, NULL); in reshape_request()
6619 int dd_idx; in retry_aligned_read() local
6627 0, &dd_idx, NULL); in retry_aligned_read()
6648 if (!add_stripe_bio(sh, raid_bio, dd_idx, 0, 0)) { in retry_aligned_read()
6661 set_bit(R5_ReadNoMerge, &sh->dev[dd_idx].flags); in retry_aligned_read()