Lines Matching refs:test_bit
246 test_bit(STRIPE_BIOFILL_RUN, &sh->state) || in stripe_operations_active()
247 test_bit(STRIPE_COMPUTE_RUN, &sh->state); in stripe_operations_active()
298 if (test_bit(STRIPE_HANDLE, &sh->state)) { in do_release_stripe()
299 if (test_bit(STRIPE_DELAYED, &sh->state) && in do_release_stripe()
300 !test_bit(STRIPE_PREREAD_ACTIVE, &sh->state)) in do_release_stripe()
302 else if (test_bit(STRIPE_BIT_DELAY, &sh->state) && in do_release_stripe()
323 if (!test_bit(STRIPE_EXPANDING, &sh->state)) in do_release_stripe()
527 BUG_ON(test_bit(STRIPE_HANDLE, &sh->state)); in init_stripe()
545 test_bit(R5_LOCKED, &dev->flags)) { in init_stripe()
549 test_bit(R5_LOCKED, &dev->flags)); in init_stripe()
598 if (rdev && test_bit(Faulty, &rdev->flags)) in calc_degraded()
600 if (!rdev || test_bit(Faulty, &rdev->flags)) in calc_degraded()
602 else if (test_bit(In_sync, &rdev->flags)) in calc_degraded()
624 if (rdev && test_bit(Faulty, &rdev->flags)) in calc_degraded()
626 if (!rdev || test_bit(Faulty, &rdev->flags)) in calc_degraded()
628 else if (test_bit(In_sync, &rdev->flags)) in calc_degraded()
675 if (!test_bit(R5_INACTIVE_BLOCKED, &conf->cache_state)) { in get_active_stripe()
678 !test_bit(R5_DID_ALLOC, &conf->cache_state)) in get_active_stripe()
692 || !test_bit(R5_INACTIVE_BLOCKED, in get_active_stripe()
704 if (!test_bit(STRIPE_HANDLE, &sh->state)) in get_active_stripe()
707 !test_bit(STRIPE_EXPANDING, &sh->state)); in get_active_stripe()
751 return test_bit(STRIPE_BATCH_READY, &sh->state) && in stripe_can_batch()
752 !test_bit(STRIPE_BITMAP_PENDING, &sh->state) && in stripe_can_batch()
778 if (!test_bit(STRIPE_HANDLE, &head->state)) in stripe_add_to_batch_list()
781 !test_bit(STRIPE_EXPANDING, &head->state)); in stripe_add_to_batch_list()
843 if (test_bit(STRIPE_BIT_DELAY, &sh->batch_head->state) && in stripe_add_to_batch_list()
903 if (test_bit(R5_Discard, &sh->dev[i].flags)) in ops_run_io()
935 if (test_bit(R5_ReadRepl, &head_sh->dev[i].flags) && rrdev) in ops_run_io()
940 if (rdev && test_bit(Faulty, &rdev->flags)) in ops_run_io()
944 if (rrdev && test_bit(Faulty, &rrdev->flags)) in ops_run_io()
955 test_bit(WriteErrorSeen, &rdev->flags)) { in ops_run_io()
1014 if (test_bit(R5_ReadNoMerge, &head_sh->dev[i].flags)) in ops_run_io()
1017 if (test_bit(R5_SkipCopy, &sh->dev[i].flags)) in ops_run_io()
1018 WARN_ON(test_bit(R5_UPTODATE, &sh->dev[i].flags)); in ops_run_io()
1066 if (test_bit(R5_SkipCopy, &sh->dev[i].flags)) in ops_run_io()
1067 WARN_ON(test_bit(R5_UPTODATE, &sh->dev[i].flags)); in ops_run_io()
1221 if (test_bit(R5_Wantfill, &dev->flags)) { in ops_run_biofill()
1250 BUG_ON(!test_bit(R5_Wantcompute, &tgt->flags)); in mark_target_uptodate()
1308 BUG_ON(!test_bit(R5_Wantcompute, &tgt->flags)); in ops_run_compute5()
1357 test_bit(R5_Wantdrain, &dev->flags)) || in set_syndrome_sources()
1394 BUG_ON(!test_bit(R5_Wantcompute, &tgt->flags)); in ops_run_compute6_1()
1444 BUG_ON(!test_bit(R5_Wantcompute, &tgt->flags)); in ops_run_compute6_2()
1445 BUG_ON(!test_bit(R5_Wantcompute, &tgt2->flags)); in ops_run_compute6_2()
1560 if (test_bit(R5_Wantdrain, &dev->flags)) in ops_run_prexor5()
1667 fua |= test_bit(R5_WantFUA, &sh->dev[i].flags); in ops_complete_reconstruct()
1668 sync |= test_bit(R5_SyncIO, &sh->dev[i].flags); in ops_complete_reconstruct()
1669 discard |= test_bit(R5_Discard, &sh->dev[i].flags); in ops_complete_reconstruct()
1676 if (!discard && !test_bit(R5_SkipCopy, &dev->flags)) in ops_complete_reconstruct()
1719 if (!test_bit(R5_Discard, &sh->dev[i].flags)) in ops_run_reconstruct5()
1801 if (!test_bit(R5_Discard, &sh->dev[i].flags)) in ops_run_reconstruct6()
1923 if (test_bit(STRIPE_OP_BIOFILL, &ops_request)) { in raid_run_ops()
1928 if (test_bit(STRIPE_OP_COMPUTE_BLK, &ops_request)) { in raid_run_ops()
1938 if (tx && !test_bit(STRIPE_OP_RECONSTRUCT, &ops_request)) in raid_run_ops()
1942 if (test_bit(STRIPE_OP_PREXOR, &ops_request)) { in raid_run_ops()
1949 if (test_bit(STRIPE_OP_BIODRAIN, &ops_request)) { in raid_run_ops()
1954 if (test_bit(STRIPE_OP_RECONSTRUCT, &ops_request)) { in raid_run_ops()
1961 if (test_bit(STRIPE_OP_CHECK, &ops_request)) { in raid_run_ops()
2291 int uptodate = test_bit(BIO_UPTODATE, &bi->bi_flags); in raid5_end_read_request()
2307 if (test_bit(R5_ReadRepl, &sh->dev[i].flags)) in raid5_end_read_request()
2323 if (test_bit(R5_ReadError, &sh->dev[i].flags)) { in raid5_end_read_request()
2338 } else if (test_bit(R5_ReadNoMerge, &sh->dev[i].flags)) in raid5_end_read_request()
2350 if (test_bit(R5_ReadRepl, &sh->dev[i].flags)) in raid5_end_read_request()
2367 } else if (test_bit(R5_ReWrite, &sh->dev[i].flags)) { in raid5_end_read_request()
2384 if (set_bad && test_bit(In_sync, &rdev->flags) in raid5_end_read_request()
2385 && !test_bit(R5_ReadNoMerge, &sh->dev[i].flags)) in raid5_end_read_request()
2388 if (test_bit(R5_ReadNoMerge, &sh->dev[i].flags)) { in raid5_end_read_request()
2397 && test_bit(In_sync, &rdev->flags) in raid5_end_read_request()
2415 int uptodate = test_bit(BIO_UPTODATE, &bi->bi_flags); in raid5_end_write_request()
2465 if (test_bit(R5_ReadError, &sh->dev[i].flags)) in raid5_end_write_request()
2898 BUG_ON(!(test_bit(R5_UPTODATE, &sh->dev[pd_idx].flags) || in schedule_reconstruction()
2899 test_bit(R5_Wantcompute, &sh->dev[pd_idx].flags))); in schedule_reconstruction()
2901 (!(test_bit(R5_UPTODATE, &sh->dev[qd_idx].flags) || in schedule_reconstruction()
2902 test_bit(R5_Wantcompute, &sh->dev[qd_idx].flags)))); in schedule_reconstruction()
2910 (test_bit(R5_UPTODATE, &dev->flags) || in schedule_reconstruction()
2911 test_bit(R5_Wantcompute, &dev->flags))) { in schedule_reconstruction()
3083 if (test_bit(R5_ReadError, &sh->dev[i].flags)) { in handle_failed_stripe()
3087 if (rdev && test_bit(In_sync, &rdev->flags)) in handle_failed_stripe()
3132 WARN_ON(test_bit(R5_UPTODATE, &sh->dev[i].flags)); in handle_failed_stripe()
3152 if (!test_bit(R5_Wantfill, &sh->dev[i].flags) && in handle_failed_stripe()
3153 (!test_bit(R5_Insync, &sh->dev[i].flags) || in handle_failed_stripe()
3154 test_bit(R5_ReadError, &sh->dev[i].flags))) { in handle_failed_stripe()
3207 if (test_bit(MD_RECOVERY_RECOVER, &conf->mddev->recovery)) { in handle_failed_sync()
3214 && !test_bit(Faulty, &rdev->flags) in handle_failed_sync()
3215 && !test_bit(In_sync, &rdev->flags) in handle_failed_sync()
3221 && !test_bit(Faulty, &rdev->flags) in handle_failed_sync()
3222 && !test_bit(In_sync, &rdev->flags) in handle_failed_sync()
3241 && !test_bit(Faulty, &rdev->flags) in want_replace()
3242 && !test_bit(In_sync, &rdev->flags) in want_replace()
3266 if (test_bit(R5_LOCKED, &dev->flags) || in need_this_block()
3267 test_bit(R5_UPTODATE, &dev->flags)) in need_this_block()
3274 (dev->towrite && !test_bit(R5_OVERWRITE, &dev->flags))) in need_this_block()
3303 if (test_bit(R5_Insync, &dev->flags) && in need_this_block()
3304 !test_bit(STRIPE_PREREAD_ACTIVE, &sh->state)) in need_this_block()
3314 !test_bit(R5_UPTODATE, &fdev[i]->flags) && in need_this_block()
3315 !test_bit(R5_OVERWRITE, &fdev[i]->flags)) in need_this_block()
3339 !test_bit(R5_UPTODATE, &fdev[i]->flags) && in need_this_block()
3340 !test_bit(R5_OVERWRITE, &fdev[i]->flags)) in need_this_block()
3357 BUG_ON(test_bit(R5_Wantcompute, &dev->flags)); in fetch_block()
3358 BUG_ON(test_bit(R5_Wantread, &dev->flags)); in fetch_block()
3390 if (!test_bit(R5_UPTODATE, in fetch_block()
3407 } else if (test_bit(R5_Insync, &dev->flags)) { in fetch_block()
3432 if (!test_bit(STRIPE_COMPUTE_RUN, &sh->state) && !sh->check_state && in handle_stripe_fill()
3459 if (!test_bit(R5_LOCKED, &dev->flags) && in handle_stripe_clean_event()
3460 (test_bit(R5_UPTODATE, &dev->flags) || in handle_stripe_clean_event()
3461 test_bit(R5_Discard, &dev->flags) || in handle_stripe_clean_event()
3462 test_bit(R5_SkipCopy, &dev->flags))) { in handle_stripe_clean_event()
3469 WARN_ON(test_bit(R5_UPTODATE, &dev->flags)); in handle_stripe_clean_event()
3489 !test_bit(STRIPE_DEGRADED, &sh->state), in handle_stripe_clean_event()
3502 } else if (test_bit(R5_Discard, &dev->flags)) in handle_stripe_clean_event()
3504 WARN_ON(test_bit(R5_SkipCopy, &dev->flags)); in handle_stripe_clean_event()
3508 test_bit(R5_Discard, &sh->dev[sh->pd_idx].flags)) { in handle_stripe_clean_event()
3536 if (test_bit(STRIPE_SYNC_REQUESTED, &sh->state)) in handle_stripe_clean_event()
3578 !test_bit(R5_LOCKED, &dev->flags) && in handle_stripe_dirtying()
3579 !(test_bit(R5_UPTODATE, &dev->flags) || in handle_stripe_dirtying()
3580 test_bit(R5_Wantcompute, &dev->flags))) { in handle_stripe_dirtying()
3581 if (test_bit(R5_Insync, &dev->flags)) in handle_stripe_dirtying()
3587 if (!test_bit(R5_OVERWRITE, &dev->flags) && in handle_stripe_dirtying()
3589 !test_bit(R5_LOCKED, &dev->flags) && in handle_stripe_dirtying()
3590 !(test_bit(R5_UPTODATE, &dev->flags) || in handle_stripe_dirtying()
3591 test_bit(R5_Wantcompute, &dev->flags))) { in handle_stripe_dirtying()
3592 if (test_bit(R5_Insync, &dev->flags)) in handle_stripe_dirtying()
3610 !test_bit(R5_LOCKED, &dev->flags) && in handle_stripe_dirtying()
3611 !(test_bit(R5_UPTODATE, &dev->flags) || in handle_stripe_dirtying()
3612 test_bit(R5_Wantcompute, &dev->flags)) && in handle_stripe_dirtying()
3613 test_bit(R5_Insync, &dev->flags)) { in handle_stripe_dirtying()
3614 if (test_bit(STRIPE_PREREAD_ACTIVE, in handle_stripe_dirtying()
3634 if (!test_bit(R5_OVERWRITE, &dev->flags) && in handle_stripe_dirtying()
3636 !test_bit(R5_LOCKED, &dev->flags) && in handle_stripe_dirtying()
3637 !(test_bit(R5_UPTODATE, &dev->flags) || in handle_stripe_dirtying()
3638 test_bit(R5_Wantcompute, &dev->flags))) { in handle_stripe_dirtying()
3640 if (test_bit(R5_Insync, &dev->flags) && in handle_stripe_dirtying()
3641 test_bit(STRIPE_PREREAD_ACTIVE, in handle_stripe_dirtying()
3658 rcw, qread, test_bit(STRIPE_DELAYED, &sh->state)); in handle_stripe_dirtying()
3662 !test_bit(STRIPE_PREREAD_ACTIVE, &sh->state)) in handle_stripe_dirtying()
3675 if ((s->req_compute || !test_bit(STRIPE_COMPUTE_RUN, &sh->state)) && in handle_stripe_dirtying()
3677 !test_bit(STRIPE_BIT_DELAY, &sh->state))) in handle_stripe_dirtying()
3708 if (test_bit(STRIPE_INSYNC, &sh->state)) in handle_parity_checks5()
3712 BUG_ON(!test_bit(R5_UPTODATE, &dev->flags)); in handle_parity_checks5()
3744 if (test_bit(MD_RECOVERY_CHECK, &conf->mddev->recovery)) in handle_parity_checks5()
3832 if (test_bit(STRIPE_INSYNC, &sh->state)) in handle_parity_checks6()
3896 if (test_bit(MD_RECOVERY_CHECK, &conf->mddev->recovery)) in handle_parity_checks6()
3959 if (!test_bit(STRIPE_EXPANDING, &sh2->state) || in handle_stripe_expansion()
3960 test_bit(R5_Expanded, &sh2->dev[dd_idx].flags)) { in handle_stripe_expansion()
3977 !test_bit(R5_Expanded, &sh2->dev[j].flags)) in handle_stripe_expansion()
4014 s->expanding = test_bit(STRIPE_EXPAND_SOURCE, &sh->state) && !sh->batch_head; in analyse_stripe()
4015 s->expanded = test_bit(STRIPE_EXPAND_READY, &sh->state) && !sh->batch_head; in analyse_stripe()
4037 if (test_bit(R5_UPTODATE, &dev->flags) && dev->toread && in analyse_stripe()
4038 !test_bit(STRIPE_BIOFILL_RUN, &sh->state)) in analyse_stripe()
4042 if (test_bit(R5_LOCKED, &dev->flags)) in analyse_stripe()
4044 if (test_bit(R5_UPTODATE, &dev->flags)) in analyse_stripe()
4046 if (test_bit(R5_Wantcompute, &dev->flags)) { in analyse_stripe()
4051 if (test_bit(R5_Wantfill, &dev->flags)) in analyse_stripe()
4057 if (!test_bit(R5_OVERWRITE, &dev->flags)) in analyse_stripe()
4066 if (rdev && !test_bit(Faulty, &rdev->flags) && in analyse_stripe()
4077 if (rdev && test_bit(Faulty, &rdev->flags)) in analyse_stripe()
4083 && (test_bit(Blocked, &rdev->flags) in analyse_stripe()
4097 if (!test_bit(WriteErrorSeen, &rdev->flags) && in analyse_stripe()
4098 test_bit(R5_UPTODATE, &dev->flags)) { in analyse_stripe()
4105 } else if (test_bit(In_sync, &rdev->flags)) in analyse_stripe()
4110 else if (test_bit(R5_UPTODATE, &dev->flags) && in analyse_stripe()
4111 test_bit(R5_Expanded, &dev->flags)) in analyse_stripe()
4118 if (test_bit(R5_WriteError, &dev->flags)) { in analyse_stripe()
4125 if (rdev2 && !test_bit(Faulty, &rdev2->flags)) { in analyse_stripe()
4131 if (test_bit(R5_MadeGood, &dev->flags)) { in analyse_stripe()
4136 if (rdev2 && !test_bit(Faulty, &rdev2->flags)) { in analyse_stripe()
4142 if (test_bit(R5_MadeGoodRepl, &dev->flags)) { in analyse_stripe()
4145 if (rdev2 && !test_bit(Faulty, &rdev2->flags)) { in analyse_stripe()
4151 if (!test_bit(R5_Insync, &dev->flags)) { in analyse_stripe()
4156 if (test_bit(R5_ReadError, &dev->flags)) in analyse_stripe()
4158 if (!test_bit(R5_Insync, &dev->flags)) { in analyse_stripe()
4162 if (rdev && !test_bit(Faulty, &rdev->flags)) in analyse_stripe()
4166 if (test_bit(STRIPE_SYNCING, &sh->state)) { in analyse_stripe()
4177 test_bit(MD_RECOVERY_REQUESTED, &(conf->mddev->recovery))) in analyse_stripe()
4307 if (test_bit(STRIPE_SYNC_REQUESTED, &sh->state) && !sh->batch_head) { in handle_stripe()
4310 if (!test_bit(STRIPE_DISCARD, &sh->state) && in handle_stripe()
4344 if (s.to_fill && !test_bit(STRIPE_BIOFILL_RUN, &sh->state)) { in handle_stripe()
4379 BUG_ON(!test_bit(R5_UPTODATE, &sh->dev[sh->pd_idx].flags) && in handle_stripe()
4380 !test_bit(R5_Discard, &sh->dev[sh->pd_idx].flags)); in handle_stripe()
4382 !test_bit(R5_UPTODATE, &sh->dev[sh->qd_idx].flags) && in handle_stripe()
4383 !test_bit(R5_Discard, &sh->dev[sh->qd_idx].flags)); in handle_stripe()
4386 if (test_bit(R5_LOCKED, &dev->flags) && in handle_stripe()
4395 if (!test_bit(R5_Insync, &dev->flags) || in handle_stripe()
4418 (s.p_failed || ((test_bit(R5_Insync, &pdev->flags) in handle_stripe()
4419 && !test_bit(R5_LOCKED, &pdev->flags) in handle_stripe()
4420 && (test_bit(R5_UPTODATE, &pdev->flags) || in handle_stripe()
4421 test_bit(R5_Discard, &pdev->flags))))) && in handle_stripe()
4422 (s.q_failed || ((test_bit(R5_Insync, &qdev->flags) in handle_stripe()
4423 && !test_bit(R5_LOCKED, &qdev->flags) in handle_stripe()
4424 && (test_bit(R5_UPTODATE, &qdev->flags) || in handle_stripe()
4425 test_bit(R5_Discard, &qdev->flags)))))) in handle_stripe()
4455 !test_bit(STRIPE_COMPUTE_RUN, &sh->state) && in handle_stripe()
4456 !test_bit(STRIPE_INSYNC, &sh->state))) { in handle_stripe()
4464 && !test_bit(STRIPE_COMPUTE_RUN, &sh->state) in handle_stripe()
4465 && !test_bit(STRIPE_REPLACED, &sh->state)) { in handle_stripe()
4468 if (test_bit(R5_NeedReplace, &sh->dev[i].flags)) { in handle_stripe()
4469 WARN_ON(!test_bit(R5_UPTODATE, &sh->dev[i].flags)); in handle_stripe()
4479 !test_bit(STRIPE_COMPUTE_RUN, &sh->state) && in handle_stripe()
4480 test_bit(STRIPE_INSYNC, &sh->state)) { in handle_stripe()
4493 if (test_bit(R5_ReadError, &dev->flags) in handle_stripe()
4494 && !test_bit(R5_LOCKED, &dev->flags) in handle_stripe()
4495 && test_bit(R5_UPTODATE, &dev->flags) in handle_stripe()
4497 if (!test_bit(R5_ReWrite, &dev->flags)) { in handle_stripe()
4515 if (sh_src && test_bit(STRIPE_EXPAND_SOURCE, &sh_src->state)) { in handle_stripe()
4539 if (s.expanded && test_bit(STRIPE_EXPANDING, &sh->state) && in handle_stripe()
4553 !test_bit(STRIPE_COMPUTE_RUN, &sh->state)) in handle_stripe()
4663 if (test_bit(R5_INACTIVE_BLOCKED, &conf->cache_state)) in raid5_congested()
4765 int uptodate = test_bit(BIO_UPTODATE, &bi->bi_flags); in raid5_align_endio()
4844 if (!rdev || test_bit(Faulty, &rdev->flags) || in chunk_aligned_read()
4848 (test_bit(Faulty, &rdev->flags) || in chunk_aligned_read()
4849 !(test_bit(In_sync, &rdev->flags) || in chunk_aligned_read()
4938 else if (!test_bit(STRIPE_IO_STARTED, &sh->state)) { in __get_priority_stripe()
5092 if (test_bit(STRIPE_SYNCING, &sh->state)) { in make_discard_request()
5287 if (test_bit(STRIPE_EXPANDING, &sh->state) || in make_request()
5449 || test_bit(MD_RECOVERY_INTR, &mddev->recovery)); in reshape_request()
5458 test_bit(MD_RECOVERY_INTR, &mddev->recovery)); in reshape_request()
5459 if (test_bit(MD_RECOVERY_INTR, &mddev->recovery)) in reshape_request()
5544 || test_bit(MD_RECOVERY_INTR, &mddev->recovery)); in reshape_request()
5553 !test_bit(MD_CHANGE_DEVS, &mddev->flags) in reshape_request()
5554 || test_bit(MD_RECOVERY_INTR, &mddev->recovery)); in reshape_request()
5555 if (test_bit(MD_RECOVERY_INTR, &mddev->recovery)) in reshape_request()
5579 if (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery)) { in sync_request()
5597 if (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery)) in sync_request()
5611 test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) { in sync_request()
5616 if (!test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery) && in sync_request()
5644 if (rdev == NULL || test_bit(Faulty, &rdev->flags)) in sync_request()
6535 if (test_bit(Replacement, &rdev->flags)) { in setup_conf()
6545 if (test_bit(In_sync, &rdev->flags)) { in setup_conf()
6793 if (test_bit(In_sync, &rdev->flags)) { in run()
7001 test_bit(In_sync, &conf->disks[i].rdev->flags) ? "U" : "_"); in status()
7024 i, !test_bit(Faulty, &tmp->rdev->flags), in print_raid5_conf()
7041 && !test_bit(Faulty, &tmp->replacement->flags) in raid5_spare_active()
7059 && !test_bit(Faulty, &tmp->rdev->flags) in raid5_spare_active()
7092 if (test_bit(In_sync, &rdev->flags) || in raid5_remove_disk()
7100 if (!test_bit(Faulty, &rdev->flags) && in raid5_remove_disk()
7176 if (test_bit(WantReplacement, &p->rdev->flags) && in raid5_add_disk()
7295 if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) in raid5_start_reshape()
7305 if (!test_bit(In_sync, &rdev->flags) in raid5_start_reshape()
7306 && !test_bit(Faulty, &rdev->flags)) in raid5_start_reshape()
7366 !test_bit(Faulty, &rdev->flags)) { in raid5_start_reshape()
7378 && !test_bit(Faulty, &rdev->flags)) { in raid5_start_reshape()
7432 if (!test_bit(MD_RECOVERY_INTR, &conf->mddev->recovery)) { in end_reshape()
7464 if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery)) { in raid5_finish_reshape()