Lines Matching defs:bio
236 static void btree_node_read_endio(struct bio *bio)
238 struct closure *cl = bio->bi_private;
247 struct bio *bio;
253 bio = bch_bbio_alloc(b->c);
254 bio->bi_iter.bi_size = KEY_SIZE(&b->key) << 9;
255 bio->bi_end_io = btree_node_read_endio;
256 bio->bi_private = &cl;
257 bio->bi_opf = REQ_OP_READ | REQ_META;
259 bch_bio_map(bio, b->keys.set[0].data);
261 bch_submit_bbio(bio, b->c, &b->key, 0);
264 if (bio->bi_status)
267 bch_bbio_free(bio, b->c);
308 bch_bbio_free(b->bio, b->c);
309 b->bio = NULL;
322 bio_free_pages(b->bio);
326 static void btree_node_write_endio(struct bio *bio)
328 struct closure *cl = bio->bi_private;
331 if (bio->bi_status)
334 bch_bbio_count_io_errors(b->c, bio, bio->bi_status, "writing btree");
347 BUG_ON(b->bio);
348 b->bio = bch_bbio_alloc(b->c);
350 b->bio->bi_end_io = btree_node_write_endio;
351 b->bio->bi_private = cl;
352 b->bio->bi_iter.bi_size = roundup(set_bytes(i), block_bytes(b->c->cache));
353 b->bio->bi_opf = REQ_OP_WRITE | REQ_META | REQ_FUA;
354 bch_bio_map(b->bio, i);
375 if (!bch_bio_alloc_pages(b->bio, __GFP_NOWARN|GFP_NOWAIT)) {
380 bio_for_each_segment_all(bv, b->bio, iter_all) {
385 bch_submit_bbio(b->bio, b->c, &k.key, 0);
390 * No problem for multipage bvec since the bio is
393 b->bio->bi_vcnt = 0;
394 bch_bio_map(b->bio, i);
396 bch_submit_bbio(b->bio, b->c, &k.key, 0);