Lines Matching refs:bio
35 struct bio *bio; member
341 static void nilfs_end_bio_write(struct bio *bio, int err) in nilfs_end_bio_write() argument
343 const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); in nilfs_end_bio_write()
344 struct nilfs_segment_buffer *segbuf = bio->bi_private; in nilfs_end_bio_write()
347 set_bit(BIO_EOPNOTSUPP, &bio->bi_flags); in nilfs_end_bio_write()
354 bio_put(bio); in nilfs_end_bio_write()
361 struct bio *bio = wi->bio; in nilfs_segbuf_submit_bio() local
369 bio_put(bio); in nilfs_segbuf_submit_bio()
375 bio->bi_end_io = nilfs_end_bio_write; in nilfs_segbuf_submit_bio()
376 bio->bi_private = segbuf; in nilfs_segbuf_submit_bio()
377 bio_get(bio); in nilfs_segbuf_submit_bio()
378 submit_bio(mode, bio); in nilfs_segbuf_submit_bio()
380 if (bio_flagged(bio, BIO_EOPNOTSUPP)) { in nilfs_segbuf_submit_bio()
381 bio_put(bio); in nilfs_segbuf_submit_bio()
385 bio_put(bio); in nilfs_segbuf_submit_bio()
387 wi->bio = NULL; in nilfs_segbuf_submit_bio()
394 wi->bio = NULL; in nilfs_segbuf_submit_bio()
407 static struct bio *nilfs_alloc_seg_bio(struct the_nilfs *nilfs, sector_t start, in nilfs_alloc_seg_bio()
410 struct bio *bio; in nilfs_alloc_seg_bio() local
412 bio = bio_alloc(GFP_NOIO, nr_vecs); in nilfs_alloc_seg_bio()
413 if (bio == NULL) { in nilfs_alloc_seg_bio()
414 while (!bio && (nr_vecs >>= 1)) in nilfs_alloc_seg_bio()
415 bio = bio_alloc(GFP_NOIO, nr_vecs); in nilfs_alloc_seg_bio()
417 if (likely(bio)) { in nilfs_alloc_seg_bio()
418 bio->bi_bdev = nilfs->ns_bdev; in nilfs_alloc_seg_bio()
419 bio->bi_iter.bi_sector = in nilfs_alloc_seg_bio()
422 return bio; in nilfs_alloc_seg_bio()
428 wi->bio = NULL; in nilfs_segbuf_prepare_write()
444 if (!wi->bio) { in nilfs_segbuf_submit_bh()
445 wi->bio = nilfs_alloc_seg_bio(wi->nilfs, wi->blocknr + wi->end, in nilfs_segbuf_submit_bh()
447 if (unlikely(!wi->bio)) in nilfs_segbuf_submit_bh()
451 len = bio_add_page(wi->bio, bh->b_page, bh->b_size, bh_offset(bh)); in nilfs_segbuf_submit_bh()
498 if (wi.bio) { in nilfs_segbuf_write()