Lines Matching refs:bio

2937 static void end_bio_bh_io_sync(struct bio *bio, int err)  in end_bio_bh_io_sync()  argument
2939 struct buffer_head *bh = bio->bi_private; in end_bio_bh_io_sync()
2942 set_bit(BIO_EOPNOTSUPP, &bio->bi_flags); in end_bio_bh_io_sync()
2945 if (unlikely (test_bit(BIO_QUIET,&bio->bi_flags))) in end_bio_bh_io_sync()
2948 bh->b_end_io(bh, test_bit(BIO_UPTODATE, &bio->bi_flags)); in end_bio_bh_io_sync()
2949 bio_put(bio); in end_bio_bh_io_sync()
2964 void guard_bio_eod(int rw, struct bio *bio) in guard_bio_eod() argument
2967 struct bio_vec *bvec = &bio->bi_io_vec[bio->bi_vcnt - 1]; in guard_bio_eod()
2970 maxsector = i_size_read(bio->bi_bdev->bd_inode) >> 9; in guard_bio_eod()
2979 if (unlikely(bio->bi_iter.bi_sector >= maxsector)) in guard_bio_eod()
2982 maxsector -= bio->bi_iter.bi_sector; in guard_bio_eod()
2983 if (likely((bio->bi_iter.bi_size >> 9) <= maxsector)) in guard_bio_eod()
2987 truncated_bytes = bio->bi_iter.bi_size - (maxsector << 9); in guard_bio_eod()
2990 bio->bi_iter.bi_size -= truncated_bytes; in guard_bio_eod()
3002 struct bio *bio; in _submit_bh() local
3021 bio = bio_alloc(GFP_NOIO, 1); in _submit_bh()
3023 bio->bi_iter.bi_sector = bh->b_blocknr * (bh->b_size >> 9); in _submit_bh()
3024 bio->bi_bdev = bh->b_bdev; in _submit_bh()
3025 bio->bi_io_vec[0].bv_page = bh->b_page; in _submit_bh()
3026 bio->bi_io_vec[0].bv_len = bh->b_size; in _submit_bh()
3027 bio->bi_io_vec[0].bv_offset = bh_offset(bh); in _submit_bh()
3029 bio->bi_vcnt = 1; in _submit_bh()
3030 bio->bi_iter.bi_size = bh->b_size; in _submit_bh()
3032 bio->bi_end_io = end_bio_bh_io_sync; in _submit_bh()
3033 bio->bi_private = bh; in _submit_bh()
3034 bio->bi_flags |= bio_flags; in _submit_bh()
3037 guard_bio_eod(rw, bio); in _submit_bh()
3044 bio_get(bio); in _submit_bh()
3045 submit_bio(rw, bio); in _submit_bh()
3047 if (bio_flagged(bio, BIO_EOPNOTSUPP)) in _submit_bh()
3050 bio_put(bio); in _submit_bh()