Lines Matching refs:sh

158 ops_run_partial_parity(struct stripe_head *sh, struct raid5_percpu *percpu,  in ops_run_partial_parity()  argument
161 int disks = sh->disks; in ops_run_partial_parity()
163 int count = 0, pd_idx = sh->pd_idx, i; in ops_run_partial_parity()
166 pr_debug("%s: stripe %llu\n", __func__, (unsigned long long)sh->sector); in ops_run_partial_parity()
174 if (sh->reconstruct_state == reconstruct_state_prexor_drain_run) { in ops_run_partial_parity()
180 srcs[count++] = sh->dev[pd_idx].page; in ops_run_partial_parity()
181 } else if (sh->reconstruct_state == reconstruct_state_drain_run) { in ops_run_partial_parity()
184 struct r5dev *dev = &sh->dev[i]; in ops_run_partial_parity()
193 NULL, sh, (void *) (srcs + sh->disks + 2)); in ops_run_partial_parity()
196 tx = async_memcpy(sh->ppl_page, srcs[0], 0, 0, PAGE_SIZE, in ops_run_partial_parity()
199 tx = async_xor(sh->ppl_page, srcs, 0, count, PAGE_SIZE, in ops_run_partial_parity()
233 struct stripe_head *sh) in ppl_new_iounit() argument
267 static int ppl_log_stripe(struct ppl_log *log, struct stripe_head *sh) in ppl_log_stripe() argument
275 struct r5conf *conf = sh->raid_conf; in ppl_log_stripe()
277 pr_debug("%s: stripe: %llu\n", __func__, (unsigned long long)sh->sector); in ppl_log_stripe()
289 io = ppl_new_iounit(log, sh); in ppl_log_stripe()
299 for (i = 0; i < sh->disks; i++) { in ppl_log_stripe()
300 struct r5dev *dev = &sh->dev[i]; in ppl_log_stripe()
302 if (i != sh->pd_idx && test_bit(R5_Wantwrite, &dev->flags)) { in ppl_log_stripe()
328 if ((sh->sector == sh_last->sector + RAID5_STRIPE_SECTORS(conf)) && in ppl_log_stripe()
339 e->parity_disk = cpu_to_le32(sh->pd_idx); in ppl_log_stripe()
346 if (!test_bit(STRIPE_FULL_WRITE, &sh->state)) { in ppl_log_stripe()
350 page_address(sh->ppl_page), in ppl_log_stripe()
354 list_add_tail(&sh->log_list, &io->stripe_list); in ppl_log_stripe()
356 sh->ppl_io = io; in ppl_log_stripe()
361 int ppl_write_stripe(struct r5conf *conf, struct stripe_head *sh) in ppl_write_stripe() argument
364 struct ppl_io_unit *io = sh->ppl_io; in ppl_write_stripe()
367 if (io || test_bit(STRIPE_SYNCING, &sh->state) || !sh->ppl_page || in ppl_write_stripe()
368 !test_bit(R5_Wantwrite, &sh->dev[sh->pd_idx].flags) || in ppl_write_stripe()
369 !test_bit(R5_Insync, &sh->dev[sh->pd_idx].flags)) { in ppl_write_stripe()
370 clear_bit(STRIPE_LOG_TRAPPED, &sh->state); in ppl_write_stripe()
374 log = &ppl_conf->child_logs[sh->pd_idx]; in ppl_write_stripe()
383 set_bit(STRIPE_LOG_TRAPPED, &sh->state); in ppl_write_stripe()
384 clear_bit(STRIPE_DELAYED, &sh->state); in ppl_write_stripe()
385 atomic_inc(&sh->count); in ppl_write_stripe()
387 if (ppl_log_stripe(log, sh)) { in ppl_write_stripe()
389 list_add_tail(&sh->log_list, &ppl_conf->no_mem_stripes); in ppl_write_stripe()
403 struct stripe_head *sh, *next; in ppl_log_endio() local
410 list_for_each_entry_safe(sh, next, &io->stripe_list, log_list) { in ppl_log_endio()
411 list_del_init(&sh->log_list); in ppl_log_endio()
413 set_bit(STRIPE_HANDLE, &sh->state); in ppl_log_endio()
414 raid5_release_stripe(sh); in ppl_log_endio()
434 struct stripe_head *sh; in ppl_submit_iounit() local
478 list_for_each_entry(sh, &io->stripe_list, log_list) { in ppl_submit_iounit()
479 for (i = 0; i < sh->disks; i++) { in ppl_submit_iounit()
480 struct r5dev *dev = &sh->dev[i]; in ppl_submit_iounit()
489 if (test_bit(STRIPE_FULL_WRITE, &sh->state)) in ppl_submit_iounit()
492 if (!bio_add_page(bio, sh->ppl_page, PAGE_SIZE, 0)) { in ppl_submit_iounit()
499 bio_add_page(bio, sh->ppl_page, PAGE_SIZE, 0); in ppl_submit_iounit()
566 struct stripe_head *sh; in ppl_io_unit_finished() local
568 sh = list_first_entry(&ppl_conf->no_mem_stripes, in ppl_io_unit_finished()
570 list_del_init(&sh->log_list); in ppl_io_unit_finished()
571 set_bit(STRIPE_HANDLE, &sh->state); in ppl_io_unit_finished()
572 raid5_release_stripe(sh); in ppl_io_unit_finished()
692 void ppl_stripe_write_finished(struct stripe_head *sh) in ppl_stripe_write_finished() argument
696 io = sh->ppl_io; in ppl_stripe_write_finished()
697 sh->ppl_io = NULL; in ppl_stripe_write_finished()
846 struct stripe_head sh; in ppl_recover_entry() local
936 0, &disk, &sh); in ppl_recover_entry()
937 BUG_ON(sh.pd_idx != le32_to_cpu(e->parity_disk)); in ppl_recover_entry()
941 conf->disks[sh.pd_idx].rdev, 1); in ppl_recover_entry()