diff options
Diffstat (limited to 'drivers/block/rnbd/rnbd-srv-dev.c')
-rw-r--r-- | drivers/block/rnbd/rnbd-srv-dev.c | 36 |
1 files changed, 3 insertions, 33 deletions
diff --git a/drivers/block/rnbd/rnbd-srv-dev.c b/drivers/block/rnbd/rnbd-srv-dev.c index 5eddfd29ab64..49c62b506c9b 100644 --- a/drivers/block/rnbd/rnbd-srv-dev.c +++ b/drivers/block/rnbd/rnbd-srv-dev.c @@ -45,7 +45,7 @@ void rnbd_dev_close(struct rnbd_dev *dev) kfree(dev); } -static void rnbd_dev_bi_end_io(struct bio *bio) +void rnbd_dev_bi_end_io(struct bio *bio) { struct rnbd_dev_blk_io *io = bio->bi_private; @@ -63,8 +63,8 @@ static void rnbd_dev_bi_end_io(struct bio *bio) * Map the kernel address into a bio suitable for io to a block * device. Returns an error pointer in case of error. */ -static struct bio *rnbd_bio_map_kern(void *data, struct bio_set *bs, - unsigned int len, gfp_t gfp_mask) +struct bio *rnbd_bio_map_kern(void *data, struct bio_set *bs, + unsigned int len, gfp_t gfp_mask) { unsigned long kaddr = (unsigned long)data; unsigned long end = (kaddr + len + PAGE_SIZE - 1) >> PAGE_SHIFT; @@ -102,33 +102,3 @@ static struct bio *rnbd_bio_map_kern(void *data, struct bio_set *bs, bio->bi_end_io = bio_put; return bio; } - -int rnbd_dev_submit_io(struct rnbd_dev *dev, sector_t sector, void *data, - size_t len, u32 bi_size, enum rnbd_io_flags flags, - short prio, void *priv) -{ - struct rnbd_dev_blk_io *io; - struct bio *bio; - - /* Generate bio with pages pointing to the rdma buffer */ - bio = rnbd_bio_map_kern(data, dev->ibd_bio_set, len, GFP_KERNEL); - if (IS_ERR(bio)) - return PTR_ERR(bio); - - io = container_of(bio, struct rnbd_dev_blk_io, bio); - - io->dev = dev; - io->priv = priv; - - bio->bi_end_io = rnbd_dev_bi_end_io; - bio->bi_private = io; - bio->bi_opf = rnbd_to_bio_flags(flags); - bio->bi_iter.bi_sector = sector; - bio->bi_iter.bi_size = bi_size; - bio_set_prio(bio, prio); - bio_set_dev(bio, dev->bdev); - - submit_bio(bio); - - return 0; -} |