• Home
  • Raw
  • Download

Lines Matching refs:bi

227 	struct bio *bi = return_bi;  in return_io()  local
228 while (bi) { in return_io()
230 return_bi = bi->bi_next; in return_io()
231 bi->bi_next = NULL; in return_io()
232 bi->bi_iter.bi_size = 0; in return_io()
233 trace_block_bio_complete(bdev_get_queue(bi->bi_bdev), in return_io()
234 bi, 0); in return_io()
235 bio_endio(bi, 0); in return_io()
236 bi = return_bi; in return_io()
736 raid5_end_read_request(struct bio *bi, int error);
738 raid5_end_write_request(struct bio *bi, int error);
750 struct bio *bi, *rbi; in ops_run_io() local
770 bi = &sh->dev[i].req; in ops_run_io()
847 bio_reset(bi); in ops_run_io()
848 bi->bi_bdev = rdev->bdev; in ops_run_io()
849 bi->bi_rw = rw; in ops_run_io()
850 bi->bi_end_io = (rw & WRITE) in ops_run_io()
853 bi->bi_private = sh; in ops_run_io()
857 bi->bi_rw, i); in ops_run_io()
860 bi->bi_iter.bi_sector = (sh->sector in ops_run_io()
863 bi->bi_iter.bi_sector = (sh->sector in ops_run_io()
866 bi->bi_rw |= REQ_NOMERGE; in ops_run_io()
871 bi->bi_vcnt = 1; in ops_run_io()
872 bi->bi_io_vec[0].bv_len = STRIPE_SIZE; in ops_run_io()
873 bi->bi_io_vec[0].bv_offset = 0; in ops_run_io()
874 bi->bi_iter.bi_size = STRIPE_SIZE; in ops_run_io()
880 bi->bi_vcnt = 0; in ops_run_io()
885 trace_block_bio_remap(bdev_get_queue(bi->bi_bdev), in ops_run_io()
886 bi, disk_devt(conf->mddev->gendisk), in ops_run_io()
888 generic_make_request(bi); in ops_run_io()
938 bi->bi_rw, i, (unsigned long long)sh->sector); in ops_run_io()
1975 static void raid5_end_read_request(struct bio * bi, int error) in raid5_end_read_request() argument
1977 struct stripe_head *sh = bi->bi_private; in raid5_end_read_request()
1980 int uptodate = test_bit(BIO_UPTODATE, &bi->bi_flags); in raid5_end_read_request()
1986 if (bi == &sh->dev[i].req) in raid5_end_read_request()
2098 static void raid5_end_write_request(struct bio *bi, int error) in raid5_end_write_request() argument
2100 struct stripe_head *sh = bi->bi_private; in raid5_end_write_request()
2104 int uptodate = test_bit(BIO_UPTODATE, &bi->bi_flags); in raid5_end_write_request()
2110 if (bi == &sh->dev[i].req) { in raid5_end_write_request()
2114 if (bi == &sh->dev[i].rreq) { in raid5_end_write_request()
2634 static int add_stripe_bio(struct stripe_head *sh, struct bio *bi, int dd_idx, int forwrite) in add_stripe_bio() argument
2641 (unsigned long long)bi->bi_iter.bi_sector, in add_stripe_bio()
2659 while (*bip && (*bip)->bi_iter.bi_sector < bi->bi_iter.bi_sector) { in add_stripe_bio()
2660 if (bio_end_sector(*bip) > bi->bi_iter.bi_sector) in add_stripe_bio()
2664 if (*bip && (*bip)->bi_iter.bi_sector < bio_end_sector(bi)) in add_stripe_bio()
2667 BUG_ON(*bip && bi->bi_next && (*bip) != bi->bi_next); in add_stripe_bio()
2669 bi->bi_next = *bip; in add_stripe_bio()
2670 *bip = bi; in add_stripe_bio()
2671 raid5_inc_bi_active_stripes(bi); in add_stripe_bio()
2676 for (bi=sh->dev[dd_idx].towrite; in add_stripe_bio()
2678 bi && bi->bi_iter.bi_sector <= sector; in add_stripe_bio()
2679 bi = r5_next_bio(bi, sh->dev[dd_idx].sector)) { in add_stripe_bio()
2680 if (bio_end_sector(bi) >= sector) in add_stripe_bio()
2681 sector = bio_end_sector(bi); in add_stripe_bio()
2731 struct bio *bi; in handle_failed_stripe() local
2754 bi = sh->dev[i].towrite; in handle_failed_stripe()
2757 if (bi) in handle_failed_stripe()
2763 while (bi && bi->bi_iter.bi_sector < in handle_failed_stripe()
2765 struct bio *nextbi = r5_next_bio(bi, sh->dev[i].sector); in handle_failed_stripe()
2766 clear_bit(BIO_UPTODATE, &bi->bi_flags); in handle_failed_stripe()
2767 if (!raid5_dec_bi_active_stripes(bi)) { in handle_failed_stripe()
2769 bi->bi_next = *return_bi; in handle_failed_stripe()
2770 *return_bi = bi; in handle_failed_stripe()
2772 bi = nextbi; in handle_failed_stripe()
2779 bi = sh->dev[i].written; in handle_failed_stripe()
2786 if (bi) bitmap_end = 1; in handle_failed_stripe()
2787 while (bi && bi->bi_iter.bi_sector < in handle_failed_stripe()
2789 struct bio *bi2 = r5_next_bio(bi, sh->dev[i].sector); in handle_failed_stripe()
2790 clear_bit(BIO_UPTODATE, &bi->bi_flags); in handle_failed_stripe()
2791 if (!raid5_dec_bi_active_stripes(bi)) { in handle_failed_stripe()
2793 bi->bi_next = *return_bi; in handle_failed_stripe()
2794 *return_bi = bi; in handle_failed_stripe()
2796 bi = bi2; in handle_failed_stripe()
2806 bi = sh->dev[i].toread; in handle_failed_stripe()
2811 while (bi && bi->bi_iter.bi_sector < in handle_failed_stripe()
2814 r5_next_bio(bi, sh->dev[i].sector); in handle_failed_stripe()
2815 clear_bit(BIO_UPTODATE, &bi->bi_flags); in handle_failed_stripe()
2816 if (!raid5_dec_bi_active_stripes(bi)) { in handle_failed_stripe()
2817 bi->bi_next = *return_bi; in handle_failed_stripe()
2818 *return_bi = bi; in handle_failed_stripe()
2820 bi = nextbi; in handle_failed_stripe()
4160 static void add_bio_to_retry(struct bio *bi,struct r5conf *conf) in add_bio_to_retry() argument
4166 bi->bi_next = conf->retry_read_aligned_list; in add_bio_to_retry()
4167 conf->retry_read_aligned_list = bi; in add_bio_to_retry()
4175 struct bio *bi; in remove_bio_from_retry() local
4177 bi = conf->retry_read_aligned; in remove_bio_from_retry()
4178 if (bi) { in remove_bio_from_retry()
4180 return bi; in remove_bio_from_retry()
4182 bi = conf->retry_read_aligned_list; in remove_bio_from_retry()
4183 if(bi) { in remove_bio_from_retry()
4184 conf->retry_read_aligned_list = bi->bi_next; in remove_bio_from_retry()
4185 bi->bi_next = NULL; in remove_bio_from_retry()
4190 raid5_set_bi_stripes(bi, 1); /* biased count of active stripes */ in remove_bio_from_retry()
4193 return bi; in remove_bio_from_retry()
4202 static void raid5_align_endio(struct bio *bi, int error) in raid5_align_endio() argument
4204 struct bio* raid_bi = bi->bi_private; in raid5_align_endio()
4207 int uptodate = test_bit(BIO_UPTODATE, &bi->bi_flags); in raid5_align_endio()
4210 bio_put(bi); in raid5_align_endio()
4233 static int bio_fits_rdev(struct bio *bi) in bio_fits_rdev() argument
4235 struct request_queue *q = bdev_get_queue(bi->bi_bdev); in bio_fits_rdev()
4237 if (bio_sectors(bi) > queue_max_sectors(q)) in bio_fits_rdev()
4239 blk_recount_segments(q, bi); in bio_fits_rdev()
4240 if (bi->bi_phys_segments > queue_max_segments(q)) in bio_fits_rdev()
4498 static void make_discard_request(struct mddev *mddev, struct bio *bi) in make_discard_request() argument
4510 logical_sector = bi->bi_iter.bi_sector & ~((sector_t)STRIPE_SECTORS-1); in make_discard_request()
4511 last_sector = bi->bi_iter.bi_sector + (bi->bi_iter.bi_size>>9); in make_discard_request()
4513 bi->bi_next = NULL; in make_discard_request()
4514 bi->bi_phys_segments = 1; /* over-loaded to count active stripes */ in make_discard_request()
4557 sh->dev[d].towrite = bi; in make_discard_request()
4559 raid5_inc_bi_active_stripes(bi); in make_discard_request()
4581 remaining = raid5_dec_bi_active_stripes(bi); in make_discard_request()
4584 bio_endio(bi, 0); in make_discard_request()
4588 static void make_request(struct mddev *mddev, struct bio * bi) in make_request() argument
4595 const int rw = bio_data_dir(bi); in make_request()
4600 if (unlikely(bi->bi_rw & REQ_FLUSH)) { in make_request()
4601 md_flush_request(mddev, bi); in make_request()
4605 md_write_start(mddev, bi); in make_request()
4609 chunk_aligned_read(mddev,bi)) in make_request()
4612 if (unlikely(bi->bi_rw & REQ_DISCARD)) { in make_request()
4613 make_discard_request(mddev, bi); in make_request()
4617 logical_sector = bi->bi_iter.bi_sector & ~((sector_t)STRIPE_SECTORS-1); in make_request()
4618 last_sector = bio_end_sector(bi); in make_request()
4619 bi->bi_next = NULL; in make_request()
4620 bi->bi_phys_segments = 1; /* over-loaded to count active stripes */ in make_request()
4669 (bi->bi_rw&RWA_MASK), 0); in make_request()
4726 !add_stripe_bio(sh, bi, dd_idx, rw)) { in make_request()
4739 if ((bi->bi_rw & REQ_SYNC) && in make_request()
4745 clear_bit(BIO_UPTODATE, &bi->bi_flags); in make_request()
4751 remaining = raid5_dec_bi_active_stripes(bi); in make_request()
4757 trace_block_bio_complete(bdev_get_queue(bi->bi_bdev), in make_request()
4758 bi, 0); in make_request()
4759 bio_endio(bi, 0); in make_request()