diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2018-05-20 18:25:58 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-05-30 15:33:32 -0600 |
commit | dad08527525f9a8ac9c7f278864c65f94bc5e9b3 (patch) | |
tree | eae96bc2bcd34573bfdbe86c452a5294d5fa136d | |
parent | e292d7bc63c8f2adb3dfda27910e805f1b6557f9 (diff) | |
download | talos-op-linux-dad08527525f9a8ac9c7f278864c65f94bc5e9b3.tar.gz talos-op-linux-dad08527525f9a8ac9c7f278864c65f94bc5e9b3.zip |
block: Drop bioset_create()
All users have been converted to bioset_init(), kill off the
old API.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | block/bio.c | 61 | ||||
-rw-r--r-- | include/linux/bio.h | 6 |
2 files changed, 15 insertions, 52 deletions
diff --git a/block/bio.c b/block/bio.c index 0a4df92cd689..595663e0281a 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1908,22 +1908,26 @@ void bioset_exit(struct bio_set *bs) } EXPORT_SYMBOL(bioset_exit); -void bioset_free(struct bio_set *bs) -{ - bioset_exit(bs); - kfree(bs); -} -EXPORT_SYMBOL(bioset_free); - /** * bioset_init - Initialize a bio_set + * @bs: pool to initialize * @pool_size: Number of bio and bio_vecs to cache in the mempool * @front_pad: Number of bytes to allocate in front of the returned bio * @flags: Flags to modify behavior, currently %BIOSET_NEED_BVECS * and %BIOSET_NEED_RESCUER * - * Similar to bioset_create(), but initializes a passed-in bioset instead of - * separately allocating it. + * Description: + * Set up a bio_set to be used with @bio_alloc_bioset. Allows the caller + * to ask for a number of bytes to be allocated in front of the bio. + * Front pad allocation is useful for embedding the bio inside + * another structure, to avoid allocating extra data to go with the bio. + * Note that the bio must be embedded at the END of that structure always, + * or things will break badly. + * If %BIOSET_NEED_BVECS is set in @flags, a separate pool will be allocated + * for allocating iovecs. This pool is not needed e.g. for bio_clone_fast(). + * If %BIOSET_NEED_RESCUER is set, a workqueue is created which can be used to + * dispatch queued requests when the mempool runs out of space. + * */ int bioset_init(struct bio_set *bs, unsigned int pool_size, @@ -1963,45 +1967,6 @@ bad: } EXPORT_SYMBOL(bioset_init); -/** - * bioset_create - Create a bio_set - * @pool_size: Number of bio and bio_vecs to cache in the mempool - * @front_pad: Number of bytes to allocate in front of the returned bio - * @flags: Flags to modify behavior, currently %BIOSET_NEED_BVECS - * and %BIOSET_NEED_RESCUER - * - * Description: - * Set up a bio_set to be used with @bio_alloc_bioset. Allows the caller - * to ask for a number of bytes to be allocated in front of the bio. - * Front pad allocation is useful for embedding the bio inside - * another structure, to avoid allocating extra data to go with the bio. - * Note that the bio must be embedded at the END of that structure always, - * or things will break badly. - * If %BIOSET_NEED_BVECS is set in @flags, a separate pool will be allocated - * for allocating iovecs. This pool is not needed e.g. for bio_clone_fast(). - * If %BIOSET_NEED_RESCUER is set, a workqueue is created which can be used to - * dispatch queued requests when the mempool runs out of space. - * - */ -struct bio_set *bioset_create(unsigned int pool_size, - unsigned int front_pad, - int flags) -{ - struct bio_set *bs; - - bs = kzalloc(sizeof(*bs), GFP_KERNEL); - if (!bs) - return NULL; - - if (bioset_init(bs, pool_size, front_pad, flags)) { - kfree(bs); - return NULL; - } - - return bs; -} -EXPORT_SYMBOL(bioset_create); - #ifdef CONFIG_BLK_CGROUP /** diff --git a/include/linux/bio.h b/include/linux/bio.h index 5e472fcafa24..810a8bee8f85 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -410,14 +410,12 @@ static inline struct bio *bio_next_split(struct bio *bio, int sectors, return bio_split(bio, sectors, gfp, bs); } -extern int bioset_init(struct bio_set *, unsigned int, unsigned int, int flags); -extern void bioset_exit(struct bio_set *); -extern struct bio_set *bioset_create(unsigned int, unsigned int, int flags); enum { BIOSET_NEED_BVECS = BIT(0), BIOSET_NEED_RESCUER = BIT(1), }; -extern void bioset_free(struct bio_set *); +extern int bioset_init(struct bio_set *, unsigned int, unsigned int, int flags); +extern void bioset_exit(struct bio_set *); extern int biovec_init_pool(mempool_t *pool, int pool_entries); extern struct bio *bio_alloc_bioset(gfp_t, unsigned int, struct bio_set *); |