]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
block: Use bioset_init() for fs_bio_set
authorKent Overstreet <kent.overstreet@gmail.com>
Wed, 9 May 2018 01:33:52 +0000 (21:33 -0400)
committerJens Axboe <axboe@kernel.dk>
Mon, 14 May 2018 19:16:06 +0000 (13:16 -0600)
Minor optimization - remove a pointer indirection when using fs_bio_set.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bio.c
block/blk-core.c
drivers/target/target_core_iblock.c
include/linux/bio.h

index ee182de97cadb68a65ecdd59500df573f0875a44..ca845e440526ddac76f592ff1958ad702b9c4393 100644 (file)
@@ -53,7 +53,7 @@ static struct biovec_slab bvec_slabs[BVEC_POOL_NR] __read_mostly = {
  * fs_bio_set is the bio_set containing bio and iovec memory pools used by
  * IO code that does not need private memory pools.
  */
-struct bio_set *fs_bio_set;
+struct bio_set fs_bio_set;
 EXPORT_SYMBOL(fs_bio_set);
 
 /*
@@ -2055,11 +2055,10 @@ static int __init init_bio(void)
        bio_integrity_init();
        biovec_init_slabs();
 
-       fs_bio_set = bioset_create(BIO_POOL_SIZE, 0, BIOSET_NEED_BVECS);
-       if (!fs_bio_set)
+       if (bioset_init(&fs_bio_set, BIO_POOL_SIZE, 0, BIOSET_NEED_BVECS))
                panic("bio: can't allocate bios\n");
 
-       if (bioset_integrity_create(fs_bio_set, BIO_POOL_SIZE))
+       if (bioset_integrity_create(&fs_bio_set, BIO_POOL_SIZE))
                panic("bio: can't create integrity pool\n");
 
        return 0;
index 341501c5e239d8c907da0b481e5cb7ffd1bc8146..b431558f39bcdf31d40c5754ed68efdfc47a6614 100644 (file)
@@ -3511,7 +3511,7 @@ int blk_rq_prep_clone(struct request *rq, struct request *rq_src,
        struct bio *bio, *bio_src;
 
        if (!bs)
-               bs = fs_bio_set;
+               bs = &fs_bio_set;
 
        __rq_for_each_bio(bio_src, rq_src) {
                bio = bio_clone_fast(bio_src, gfp_mask, bs);
index 60429011292a2c4c2fa4104a90414ae948f956a7..44cacd001aa651cf89605599b885cd8e8f14d4b5 100644 (file)
@@ -164,7 +164,7 @@ static int iblock_configure_device(struct se_device *dev)
                                goto out_blkdev_put;
                        }
                        pr_debug("IBLOCK setup BIP bs->bio_integrity_pool: %p\n",
-                                bs->bio_integrity_pool);
+                                &bs->bio_integrity_pool);
                }
                dev->dev_attrib.hw_pi_prot_type = dev->dev_attrib.pi_prot_type;
        }
index fa3cf94a50151a35ed47eab5dd7840446194f2c0..91b02520e2f8b8d680ce6997175ceb1e3f17df5f 100644 (file)
@@ -423,11 +423,11 @@ extern void __bio_clone_fast(struct bio *, struct bio *);
 extern struct bio *bio_clone_fast(struct bio *, gfp_t, struct bio_set *);
 extern struct bio *bio_clone_bioset(struct bio *, gfp_t, struct bio_set *bs);
 
-extern struct bio_set *fs_bio_set;
+extern struct bio_set fs_bio_set;
 
 static inline struct bio *bio_alloc(gfp_t gfp_mask, unsigned int nr_iovecs)
 {
-       return bio_alloc_bioset(gfp_mask, nr_iovecs, fs_bio_set);
+       return bio_alloc_bioset(gfp_mask, nr_iovecs, &fs_bio_set);
 }
 
 static inline struct bio *bio_kmalloc(gfp_t gfp_mask, unsigned int nr_iovecs)