Merge tag 'drm-next-2018-10-24' of git://anongit.freedesktop.org/drm/drm
[linux-2.6-block.git] / block / blk-lib.c
index bbd44666f2b516c758a0334a2e7b45ce3a291c84..76f867ea9a9b92fdfa921843a6a0ffe2c4297087 100644 (file)
@@ -10,8 +10,7 @@
 
 #include "blk.h"
 
-static struct bio *next_bio(struct bio *bio, unsigned int nr_pages,
-               gfp_t gfp)
+struct bio *blk_next_bio(struct bio *bio, unsigned int nr_pages, gfp_t gfp)
 {
        struct bio *new = bio_alloc(gfp, nr_pages);
 
@@ -63,7 +62,7 @@ int __blkdev_issue_discard(struct block_device *bdev, sector_t sector,
 
                end_sect = sector + req_sects;
 
-               bio = next_bio(bio, 0, gfp_mask);
+               bio = blk_next_bio(bio, 0, gfp_mask);
                bio->bi_iter.bi_sector = sector;
                bio_set_dev(bio, bdev);
                bio_set_op_attrs(bio, op, 0);
@@ -165,7 +164,7 @@ static int __blkdev_issue_write_same(struct block_device *bdev, sector_t sector,
        max_write_same_sectors = UINT_MAX >> 9;
 
        while (nr_sects) {
-               bio = next_bio(bio, 1, gfp_mask);
+               bio = blk_next_bio(bio, 1, gfp_mask);
                bio->bi_iter.bi_sector = sector;
                bio_set_dev(bio, bdev);
                bio->bi_vcnt = 1;
@@ -241,7 +240,7 @@ static int __blkdev_issue_write_zeroes(struct block_device *bdev,
                return -EOPNOTSUPP;
 
        while (nr_sects) {
-               bio = next_bio(bio, 0, gfp_mask);
+               bio = blk_next_bio(bio, 0, gfp_mask);
                bio->bi_iter.bi_sector = sector;
                bio_set_dev(bio, bdev);
                bio->bi_opf = REQ_OP_WRITE_ZEROES;
@@ -292,8 +291,8 @@ static int __blkdev_issue_zero_pages(struct block_device *bdev,
                return -EPERM;
 
        while (nr_sects != 0) {
-               bio = next_bio(bio, __blkdev_sectors_to_bio_pages(nr_sects),
-                              gfp_mask);
+               bio = blk_next_bio(bio, __blkdev_sectors_to_bio_pages(nr_sects),
+                                  gfp_mask);
                bio->bi_iter.bi_sector = sector;
                bio_set_dev(bio, bdev);
                bio_set_op_attrs(bio, REQ_OP_WRITE, 0);