Commit dad08527 authored by Kent Overstreet's avatar Kent Overstreet Committed by Jens Axboe

block: Drop bioset_create()

All users have been converted to bioset_init(), kill off the
old API.
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent e292d7bc
...@@ -1908,22 +1908,26 @@ void bioset_exit(struct bio_set *bs) ...@@ -1908,22 +1908,26 @@ void bioset_exit(struct bio_set *bs)
} }
EXPORT_SYMBOL(bioset_exit); 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 * bioset_init - Initialize a bio_set
* @bs: pool to initialize
* @pool_size: Number of bio and bio_vecs to cache in the mempool * @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 * @front_pad: Number of bytes to allocate in front of the returned bio
* @flags: Flags to modify behavior, currently %BIOSET_NEED_BVECS * @flags: Flags to modify behavior, currently %BIOSET_NEED_BVECS
* and %BIOSET_NEED_RESCUER * and %BIOSET_NEED_RESCUER
* *
* Similar to bioset_create(), but initializes a passed-in bioset instead of * Description:
* separately allocating it. * 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, int bioset_init(struct bio_set *bs,
unsigned int pool_size, unsigned int pool_size,
...@@ -1963,45 +1967,6 @@ int bioset_init(struct bio_set *bs, ...@@ -1963,45 +1967,6 @@ int bioset_init(struct bio_set *bs,
} }
EXPORT_SYMBOL(bioset_init); 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 #ifdef CONFIG_BLK_CGROUP
/** /**
......
...@@ -410,14 +410,12 @@ static inline struct bio *bio_next_split(struct bio *bio, int sectors, ...@@ -410,14 +410,12 @@ static inline struct bio *bio_next_split(struct bio *bio, int sectors,
return bio_split(bio, sectors, gfp, bs); 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 { enum {
BIOSET_NEED_BVECS = BIT(0), BIOSET_NEED_BVECS = BIT(0),
BIOSET_NEED_RESCUER = BIT(1), 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 int biovec_init_pool(mempool_t *pool, int pool_entries);
extern struct bio *bio_alloc_bioset(gfp_t, unsigned int, struct bio_set *); extern struct bio *bio_alloc_bioset(gfp_t, unsigned int, struct bio_set *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment