Lines Matching defs:bio
17 #include <linux/bio.h>
190 iomap_read_end_io(struct bio *bio)
192 int error = blk_status_to_errno(bio->bi_status);
196 bio_for_each_segment_all(bvec, bio, iter_all)
198 bio_put(bio);
204 struct bio *bio;
271 if (ctx->bio && bio_end_sector(ctx->bio) == sector) {
272 if (__bio_try_merge_page(ctx->bio, page, plen, poff,
278 if (!is_contig || bio_full(ctx->bio, plen)) {
283 if (ctx->bio)
284 submit_bio(ctx->bio);
288 ctx->bio = bio_alloc(gfp, min(BIO_MAX_PAGES, nr_vecs));
294 if (!ctx->bio)
295 ctx->bio = bio_alloc(orig_gfp, 1);
296 ctx->bio->bi_opf = REQ_OP_READ;
298 ctx->bio->bi_opf |= REQ_RAHEAD;
299 ctx->bio->bi_iter.bi_sector = sector;
300 bio_set_dev(ctx->bio, iomap->bdev);
301 ctx->bio->bi_end_io = iomap_read_end_io;
304 bio_add_page(ctx->bio, page, plen, poff);
336 if (ctx.bio) {
337 submit_bio(ctx.bio);
415 if (ctx.bio)
416 submit_bio(ctx.bio);
540 struct bio bio;
542 bio_init(&bio, &bvec, 1);
543 bio.bi_opf = REQ_OP_READ;
544 bio.bi_iter.bi_sector = iomap_sector(iomap, block_start);
545 bio_set_dev(&bio, iomap->bdev);
546 __bio_add_page(&bio, page, plen, poff);
547 return submit_bio_wait(&bio);
1068 struct bio *bio = &ioend->io_inline_bio;
1069 struct bio *last = ioend->io_bio, *next;
1070 u64 start = bio->bi_iter.bi_sector;
1072 bool quiet = bio_flagged(bio, BIO_QUIET);
1074 for (bio = &ioend->io_inline_bio; bio; bio = next) {
1079 * For the last bio, bi_private points to the ioend, so we
1082 if (bio == last)
1085 next = bio->bi_private;
1087 /* walk each page on bio, ending page IO on them */
1088 bio_for_each_segment_all(bv, bio, iter_all)
1091 bio_put(bio);
1179 static void iomap_writepage_end_bio(struct bio *bio)
1181 struct iomap_ioend *ioend = bio->bi_private;
1183 iomap_finish_ioend(ioend, blk_status_to_errno(bio->bi_status));
1187 * Submit the final bio for an ioend.
1191 * and unlocked them. In this situation, we need to fail the bio instead of
1224 struct bio *bio;
1226 bio = bio_alloc_bioset(GFP_NOFS, BIO_MAX_PAGES, &iomap_ioend_bioset);
1227 bio_set_dev(bio, wpc->iomap.bdev);
1228 bio->bi_iter.bi_sector = sector;
1229 bio->bi_opf = REQ_OP_WRITE | wbc_to_write_flags(wbc);
1230 bio->bi_write_hint = inode->i_write_hint;
1231 wbc_init_bio(wbc, bio);
1233 ioend = container_of(bio, struct iomap_ioend, io_inline_bio);
1241 ioend->io_bio = bio;
1246 * Allocate a new bio, and chain the old bio to the new one.
1252 static struct bio *
1253 iomap_chain_bio(struct bio *prev)
1255 struct bio *new;