• Home
  • Raw
  • Download

Lines Matching refs:bio

170 static void nvmet_bio_done(struct bio *bio)  in nvmet_bio_done()  argument
172 struct nvmet_req *req = bio->bi_private; in nvmet_bio_done()
174 nvmet_req_complete(req, blk_to_nvme_status(req, bio->bi_status)); in nvmet_bio_done()
175 nvmet_req_bio_put(req, bio); in nvmet_bio_done()
179 static int nvmet_bdev_alloc_bip(struct nvmet_req *req, struct bio *bio, in nvmet_bdev_alloc_bip() argument
193 bip = bio_integrity_alloc(bio, GFP_NOIO, in nvmet_bdev_alloc_bip()
200 bip->bip_iter.bi_size = bio_integrity_bytes(bi, bio_sectors(bio)); in nvmet_bdev_alloc_bip()
202 bip_set_seed(bip, bio->bi_iter.bi_sector >> in nvmet_bdev_alloc_bip()
208 rc = bio_integrity_add_page(bio, miter->page, len, in nvmet_bdev_alloc_bip()
225 static int nvmet_bdev_alloc_bip(struct nvmet_req *req, struct bio *bio, in nvmet_bdev_alloc_bip() argument
235 struct bio *bio; in nvmet_bdev_execute_rw() local
268 bio = &req->b.inline_bio; in nvmet_bdev_execute_rw()
269 bio_init(bio, req->inline_bvec, ARRAY_SIZE(req->inline_bvec)); in nvmet_bdev_execute_rw()
271 bio = bio_alloc(GFP_KERNEL, bio_max_segs(sg_cnt)); in nvmet_bdev_execute_rw()
273 bio_set_dev(bio, req->ns->bdev); in nvmet_bdev_execute_rw()
274 bio->bi_iter.bi_sector = sector; in nvmet_bdev_execute_rw()
275 bio->bi_private = req; in nvmet_bdev_execute_rw()
276 bio->bi_end_io = nvmet_bio_done; in nvmet_bdev_execute_rw()
277 bio->bi_opf = op; in nvmet_bdev_execute_rw()
285 while (bio_add_page(bio, sg_page(sg), sg->length, sg->offset) in nvmet_bdev_execute_rw()
287 struct bio *prev = bio; in nvmet_bdev_execute_rw()
290 rc = nvmet_bdev_alloc_bip(req, bio, in nvmet_bdev_execute_rw()
293 bio_io_error(bio); in nvmet_bdev_execute_rw()
298 bio = bio_alloc(GFP_KERNEL, bio_max_segs(sg_cnt)); in nvmet_bdev_execute_rw()
299 bio_set_dev(bio, req->ns->bdev); in nvmet_bdev_execute_rw()
300 bio->bi_iter.bi_sector = sector; in nvmet_bdev_execute_rw()
301 bio->bi_opf = op; in nvmet_bdev_execute_rw()
303 bio_chain(bio, prev); in nvmet_bdev_execute_rw()
312 rc = nvmet_bdev_alloc_bip(req, bio, &prot_miter); in nvmet_bdev_execute_rw()
314 bio_io_error(bio); in nvmet_bdev_execute_rw()
319 submit_bio(bio); in nvmet_bdev_execute_rw()
325 struct bio *bio = &req->b.inline_bio; in nvmet_bdev_execute_flush() local
330 bio_init(bio, req->inline_bvec, ARRAY_SIZE(req->inline_bvec)); in nvmet_bdev_execute_flush()
331 bio_set_dev(bio, req->ns->bdev); in nvmet_bdev_execute_flush()
332 bio->bi_private = req; in nvmet_bdev_execute_flush()
333 bio->bi_end_io = nvmet_bio_done; in nvmet_bdev_execute_flush()
334 bio->bi_opf = REQ_OP_WRITE | REQ_PREFLUSH; in nvmet_bdev_execute_flush()
336 submit_bio(bio); in nvmet_bdev_execute_flush()
347 struct nvme_dsm_range *range, struct bio **bio) in nvmet_bdev_discard_range() argument
355 GFP_KERNEL, 0, bio); in nvmet_bdev_discard_range()
366 struct bio *bio = NULL; in nvmet_bdev_execute_discard() local
376 status = nvmet_bdev_discard_range(req, &range, &bio); in nvmet_bdev_execute_discard()
381 if (bio) { in nvmet_bdev_execute_discard()
382 bio->bi_private = req; in nvmet_bdev_execute_discard()
383 bio->bi_end_io = nvmet_bio_done; in nvmet_bdev_execute_discard()
385 bio_io_error(bio); in nvmet_bdev_execute_discard()
387 submit_bio(bio); in nvmet_bdev_execute_discard()
414 struct bio *bio = NULL; in nvmet_bdev_execute_write_zeroes() local
427 GFP_KERNEL, &bio, 0); in nvmet_bdev_execute_write_zeroes()
428 if (bio) { in nvmet_bdev_execute_write_zeroes()
429 bio->bi_private = req; in nvmet_bdev_execute_write_zeroes()
430 bio->bi_end_io = nvmet_bio_done; in nvmet_bdev_execute_write_zeroes()
431 submit_bio(bio); in nvmet_bdev_execute_write_zeroes()