Lines Matching refs:cur
203 struct btrfs_stripe_hash *cur; in btrfs_alloc_stripe_hash_table() local
233 cur = h + i; in btrfs_alloc_stripe_hash_table()
234 INIT_LIST_HEAD(&cur->hash_list); in btrfs_alloc_stripe_hash_table()
235 spin_lock_init(&cur->lock); in btrfs_alloc_stripe_hash_table()
236 init_waitqueue_head(&cur->wait); in btrfs_alloc_stripe_hash_table()
569 struct btrfs_raid_bio *cur) in rbio_can_merge() argument
572 test_bit(RBIO_RMW_LOCKED_BIT, &cur->flags)) in rbio_can_merge()
583 test_bit(RBIO_CACHE_BIT, &cur->flags)) in rbio_can_merge()
587 cur->bbio->raid_map[0]) in rbio_can_merge()
591 if (last->operation != cur->operation) in rbio_can_merge()
602 cur->operation == BTRFS_RBIO_PARITY_SCRUB) in rbio_can_merge()
657 struct btrfs_raid_bio *cur; in lock_stripe_add() local
667 list_for_each_entry(cur, &h->hash_list, hash_list) { in lock_stripe_add()
669 if (cur->bbio->raid_map[0] == rbio->bbio->raid_map[0]) { in lock_stripe_add()
670 spin_lock(&cur->bio_list_lock); in lock_stripe_add()
673 if (bio_list_empty(&cur->bio_list) && in lock_stripe_add()
674 list_empty(&cur->plug_list) && in lock_stripe_add()
675 test_bit(RBIO_CACHE_BIT, &cur->flags) && in lock_stripe_add()
676 !test_bit(RBIO_RMW_LOCKED_BIT, &cur->flags)) { in lock_stripe_add()
677 list_del_init(&cur->hash_list); in lock_stripe_add()
678 atomic_dec(&cur->refs); in lock_stripe_add()
680 steal_rbio(cur, rbio); in lock_stripe_add()
681 cache_drop = cur; in lock_stripe_add()
682 spin_unlock(&cur->bio_list_lock); in lock_stripe_add()
688 if (rbio_can_merge(cur, rbio)) { in lock_stripe_add()
689 merge_rbio(cur, rbio); in lock_stripe_add()
690 spin_unlock(&cur->bio_list_lock); in lock_stripe_add()
705 list_for_each_entry(pending, &cur->plug_list, in lock_stripe_add()
709 spin_unlock(&cur->bio_list_lock); in lock_stripe_add()
720 list_add_tail(&rbio->plug_list, &cur->plug_list); in lock_stripe_add()
721 spin_unlock(&cur->bio_list_lock); in lock_stripe_add()
856 struct bio *cur = bio_list_get(&rbio->bio_list); in rbio_orig_end_io() local
864 while (cur) { in rbio_orig_end_io()
865 next = cur->bi_next; in rbio_orig_end_io()
866 cur->bi_next = NULL; in rbio_orig_end_io()
868 set_bit(BIO_UPTODATE, &cur->bi_flags); in rbio_orig_end_io()
869 bio_endio(cur, err); in rbio_orig_end_io()
870 cur = next; in rbio_orig_end_io()
1674 struct btrfs_raid_bio *cur; in run_plug() local
1684 cur = list_entry(plug->rbio_list.next, in run_plug()
1686 list_del_init(&cur->plug_list); in run_plug()
1688 if (rbio_is_full(cur)) { in run_plug()
1690 full_stripe_write(cur); in run_plug()
1694 if (rbio_can_merge(last, cur)) { in run_plug()
1695 merge_rbio(last, cur); in run_plug()
1696 __free_raid_bio(cur); in run_plug()
1702 last = cur; in run_plug()