Lines Matching full:disks
126 if (sh->qd_idx == sh->disks - 1) in raid6_d0()
137 /* When walking through the disks in a raid5, starting at raid6_d0,
138 * We need to map each disk to a 'slot', where the data disks are slot
232 for (i = sh->disks; i--; ) in do_release_stripe()
501 init_stripe_shared_pages(struct stripe_head *sh, struct r5conf *conf, int disks) in init_stripe_shared_pages() argument
510 nr_pages = (disks + cnt - 1) / cnt; in init_stripe_shared_pages()
591 sh->disks = previous ? conf->previous_raid_disks : conf->raid_disks; in init_stripe()
596 for (i = sh->disks; i--; ) { in init_stripe()
698 struct md_rdev *rdev = READ_ONCE(conf->disks[i].rdev); in raid5_calc_degraded()
701 rdev = READ_ONCE(conf->disks[i].replacement); in raid5_calc_degraded()
723 struct md_rdev *rdev = READ_ONCE(conf->disks[i].rdev); in raid5_calc_degraded()
726 rdev = READ_ONCE(conf->disks[i].replacement); in raid5_calc_degraded()
876 BUG_ON(sh->overwrite_disks > (sh->disks - sh->raid_conf->max_degraded)); in is_full_stripe_write()
877 return sh->overwrite_disks == (sh->disks - sh->raid_conf->max_degraded); in is_full_stripe_write()
1142 int i, disks = sh->disks; in ops_run_io() local
1155 for (i = disks; i--; ) { in ops_run_io()
1185 rdev = conf->disks[i].rdev; in ops_run_io()
1186 rrdev = conf->disks[i].replacement; in ops_run_io()
1443 for (i = sh->disks; i--; ) { in ops_complete_biofill()
1482 for (i = sh->disks; i--; ) { in ops_run_biofill()
1546 return (void *) (to_addr_page(percpu, i) + sh->disks + 2); in to_addr_conv()
1555 return (unsigned int *) (to_addr_conv(sh, percpu, 0) + sh->disks + 2); in to_addr_offs()
1561 int disks = sh->disks; in ops_run_compute5() local
1579 for (i = disks; i--; ) { in ops_run_compute5()
1601 * @srcs - (struct page *) array of size sh->disks
1615 int disks = sh->disks; in set_syndrome_sources() local
1616 int syndrome_disks = sh->ddf_layout ? disks : (disks - 2); in set_syndrome_sources()
1621 for (i = 0; i < disks; i++) in set_syndrome_sources()
1649 i = raid6_next_disk(i, disks); in set_syndrome_sources()
1658 int disks = sh->disks; in ops_run_compute6_1() local
1702 for (i = disks; i-- ; ) { in ops_run_compute6_1()
1722 int i, count, disks = sh->disks; in ops_run_compute6_2() local
1723 int syndrome_disks = sh->ddf_layout ? disks : disks-2; in ops_run_compute6_2()
1745 for (i = 0; i < disks ; i++) { in ops_run_compute6_2()
1761 i = raid6_next_disk(i, disks); in ops_run_compute6_2()
1773 /* Q disk is one of the missing disks */ in ops_run_compute6_2()
1795 for (i = disks; i-- ; ) { in ops_run_compute6_2()
1858 int disks = sh->disks; in ops_run_prexor5() local
1872 for (i = disks; i--; ) { in ops_run_prexor5()
1922 int disks = sh->disks; in ops_run_biodrain() local
1929 for (i = disks; i--; ) { in ops_run_biodrain()
1993 int disks = sh->disks; in ops_complete_reconstruct() local
2002 for (i = disks; i--; ) { in ops_complete_reconstruct()
2008 for (i = disks; i--; ) { in ops_complete_reconstruct()
2041 int disks = sh->disks; in ops_run_reconstruct5() local
2057 for (i = 0; i < sh->disks; i++) { in ops_run_reconstruct5()
2063 if (i >= sh->disks) { in ops_run_reconstruct5()
2080 for (i = disks; i--; ) { in ops_run_reconstruct5()
2091 for (i = disks; i--; ) { in ops_run_reconstruct5()
2150 for (i = 0; i < sh->disks; i++) { in ops_run_reconstruct6()
2156 if (i >= sh->disks) { in ops_run_reconstruct6()
2212 int disks = sh->disks; in ops_run_check_p() local
2233 for (i = disks; i--; ) { in ops_run_check_p()
2276 int overlap_clear = 0, i, disks = sh->disks; in raid_run_ops() local
2337 for (i = disks; i--; ) { in raid_run_ops()
2357 int disks, struct r5conf *conf) in alloc_stripe() argument
2381 if (init_stripe_shared_pages(sh, conf, disks)) { in alloc_stripe()
2445 * @num: total number of disks in the array
2529 * 3/ reallocate conf->disks to be suitable bigger. If this fails, in resize_stripes()
2618 * conf->disks and the scribble region in resize_stripes()
2623 ndisks[i] = conf->disks[i]; in resize_stripes()
2637 kfree(conf->disks); in resize_stripes()
2638 conf->disks = ndisks; in resize_stripes()
2721 int disks = sh->disks, i; in raid5_end_read_request() local
2725 for (i=0 ; i<disks; i++) in raid5_end_read_request()
2732 if (i == disks) { in raid5_end_read_request()
2742 rdev = conf->disks[i].replacement; in raid5_end_read_request()
2744 rdev = conf->disks[i].rdev; in raid5_end_read_request()
2849 int disks = sh->disks, i; in raid5_end_write_request() local
2853 for (i = 0 ; i < disks; i++) { in raid5_end_write_request()
2855 rdev = conf->disks[i].rdev; in raid5_end_write_request()
2859 rdev = conf->disks[i].replacement; in raid5_end_write_request()
2867 rdev = conf->disks[i].rdev; in raid5_end_write_request()
2874 if (i == disks) { in raid5_end_write_request()
3162 int raid_disks = sh->disks; in raid5_compute_blocknr()
3292 * like to flush data in journal to RAID disks first, so complex rmw
3312 * In journal failure, we try to flush all cached data to raid disks
3339 int i, pd_idx = sh->pd_idx, qd_idx = sh->qd_idx, disks = sh->disks; in schedule_reconstruction() local
3352 for (i = disks; i--; ) { in schedule_reconstruction()
3381 if (s->locked + conf->max_degraded == disks) in schedule_reconstruction()
3391 for (i = disks; i--; ) { in schedule_reconstruction()
3485 for (i = 0; i < sh->disks; i++) { in stripe_bio_overlaps()
3607 int disks = previous ? conf->previous_raid_disks : conf->raid_disks; in stripe_set_idx() local
3610 stripe * (disks - conf->max_degraded) in stripe_set_idx()
3618 struct stripe_head_state *s, int disks) in handle_failed_stripe() argument
3622 for (i = disks; i--; ) { in handle_failed_stripe()
3627 struct md_rdev *rdev = conf->disks[i].rdev; in handle_failed_stripe()
3754 struct md_rdev *rdev = conf->disks[i].rdev; in handle_failed_sync()
3762 rdev = conf->disks[i].replacement; in handle_failed_sync()
3783 rdev = sh->raid_conf->disks[disk_idx].replacement; in want_replace()
3794 int disk_idx, int disks) in need_this_block() argument
3901 int disk_idx, int disks) in fetch_block() argument
3906 if (need_this_block(sh, s, disk_idx, disks)) { in fetch_block()
3923 if ((s->uptodate == disks - 1) && in fetch_block()
3946 } else if (s->uptodate == disks-2 && s->failed >= 2) { in fetch_block()
3951 for (other = disks; other--; ) { in fetch_block()
3988 int disks) in handle_stripe_fill() argument
4002 * disks first, this avoids handling complex rmw of write in handle_stripe_fill()
4012 for (i = disks; i--; ) in handle_stripe_fill()
4013 if (fetch_block(sh, s, i, disks)) in handle_stripe_fill()
4028 struct stripe_head *sh, int disks) in handle_stripe_clean_event() argument
4036 for (i = disks; i--; ) in handle_stripe_clean_event()
4145 int disks) in handle_stripe_dirtying() argument
4167 } else for (i = disks; i--; ) { in handle_stripe_dirtying()
4179 rmw += 2*disks; /* cannot read it */ in handle_stripe_dirtying()
4190 rcw += 2*disks; in handle_stripe_dirtying()
4202 for (i = disks; i--; ) { in handle_stripe_dirtying()
4232 for (i = disks; i--; ) { in handle_stripe_dirtying()
4257 for (i = disks; i--; ) { in handle_stripe_dirtying()
4285 if (rcw > disks && rmw > disks && in handle_stripe_dirtying()
4307 struct stripe_head_state *s, int disks) in handle_parity_checks5() argument
4318 BUG_ON(s->uptodate != disks); in handle_parity_checks5()
4338 BUG_ON(s->uptodate != disks); in handle_parity_checks5()
4401 int disks) in handle_parity_checks6() argument
4586 for (i = 0; i < sh->disks; i++) in handle_stripe_expansion()
4652 int disks = sh->disks; in analyse_stripe() local
4666 for (i=disks; i--; ) { in analyse_stripe()
4708 rdev = conf->disks[i].replacement; in analyse_stripe()
4719 rdev = conf->disks[i].rdev; in analyse_stripe()
4765 struct md_rdev *rdev2 = conf->disks[i].rdev; in analyse_stripe()
4778 struct md_rdev *rdev2 = conf->disks[i].rdev; in analyse_stripe()
4787 struct md_rdev *rdev2 = conf->disks[i].replacement; in analyse_stripe()
4809 rdev = conf->disks[i].replacement; in analyse_stripe()
4912 for (i = 0; i < sh->disks; i++) { in break_stripe_batch_list()
4926 for (i = 0; i < head_sh->disks; i++) in break_stripe_batch_list()
4939 int disks = sh->disks; in handle_stripe() local
5023 * the stripe if there is data need write to raid disks in handle_stripe()
5031 handle_failed_stripe(conf, sh, &s, disks); in handle_stripe()
5054 for (i = disks; i--; ) { in handle_stripe()
5097 handle_stripe_clean_event(conf, sh, disks); in handle_stripe()
5100 r5c_handle_cached_data_endio(conf, sh, disks); in handle_stripe()
5109 || (s.syncing && (s.uptodate + s.compute < disks)) in handle_stripe()
5112 handle_stripe_fill(sh, &s, disks); in handle_stripe()
5133 handle_stripe_dirtying(conf, sh, &s, disks); in handle_stripe()
5140 disks); in handle_stripe()
5153 disks); in handle_stripe()
5170 handle_parity_checks6(conf, sh, &s, disks); in handle_stripe()
5172 handle_parity_checks5(conf, sh, &s, disks); in handle_stripe()
5253 sh->disks = conf->raid_disks; in handle_stripe()
5283 for (i = disks; i--; ) { in handle_stripe()
5288 rdev = conf->disks[i].rdev; in handle_stripe()
5295 rdev = conf->disks[i].rdev; in handle_stripe()
5301 rdev = conf->disks[i].replacement; in handle_stripe()
5304 rdev = conf->disks[i].rdev; in handle_stripe()
5466 rdev = conf->disks[dd_idx].replacement; in raid5_read_one_chunk()
5469 rdev = conf->disks[dd_idx].rdev; in raid5_read_one_chunk()
5826 for (dd_idx = 0; dd_idx < sh->disks; dd_idx++) { in stripe_ahead_of_reshape()
5854 for (dd_idx = 0; dd_idx < sh->disks; dd_idx++) { in add_all_stripe_bios()
5879 for (dd_idx = 0; dd_idx < sh->disks; dd_idx++) { in add_all_stripe_bios()
6038 * If the bio covers multiple data disks, find sector within the bio that has
6385 for (j=sh->disks; j--;) { in reshape_request()
6563 struct md_rdev *rdev = conf->disks[i].rdev; in raid5_sync_request()
7358 if (conf->disks[i].extra_page) in free_conf()
7359 put_page(conf->disks[i].extra_page); in free_conf()
7360 kfree(conf->disks); in free_conf()
7535 conf->disks = kcalloc(max_disks, sizeof(struct disk_info), in setup_conf()
7538 if (!conf->disks) in setup_conf()
7542 conf->disks[i].extra_page = alloc_page(GFP_KERNEL); in setup_conf()
7543 if (!conf->disks[i].extra_page) in setup_conf()
7593 disk = conf->disks + raid_disk; in setup_conf()
7755 * disks are used to calculate parity); the disk is broken; The stripe in raid5_set_limits()
7860 * be a multiple of the largest chunk size times new data disks. in raid5_run()
7944 rdev = conf->disks[i].rdev; in raid5_run()
7947 if (conf->disks[i].replacement && in raid5_run()
8077 struct md_rdev *rdev = READ_ONCE(conf->disks[i].rdev); in raid5_status()
8099 rdev = conf->disks[i].rdev; in print_raid5_conf()
8116 rdev = conf->disks[i].rdev; in raid5_spare_active()
8117 replacement = conf->disks[i].replacement; in raid5_spare_active()
8178 p = conf->disks + number; in raid5_remove_disk()
8276 conf->disks[rdev->saved_raid_disk].rdev == NULL) in raid5_add_disk()
8280 p = conf->disks + disk; in raid5_add_disk()
8294 p = conf->disks + disk; in raid5_add_disk()
8438 if (conf->disks[i].replacement) in raid5_start_reshape()
8459 pr_warn("md/raid:%s: array size must be reduced before number of disks\n", in raid5_start_reshape()
8588 rdev = conf->disks[d].rdev; in raid5_finish_reshape()
8591 rdev = conf->disks[d].replacement; in raid5_finish_reshape()