Commit dad08527525f9a8ac9c7f278864c65f94bc5e9b3
Committed by
Jens Axboe
1 parent
e292d7bc63
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>
Showing 2 changed files with 15 additions and 52 deletions Side-by-side Diff
block/bio.c
... | ... | @@ -1908,22 +1908,26 @@ |
1908 | 1908 | } |
1909 | 1909 | EXPORT_SYMBOL(bioset_exit); |
1910 | 1910 | |
1911 | -void bioset_free(struct bio_set *bs) | |
1912 | -{ | |
1913 | - bioset_exit(bs); | |
1914 | - kfree(bs); | |
1915 | -} | |
1916 | -EXPORT_SYMBOL(bioset_free); | |
1917 | - | |
1918 | 1911 | /** |
1919 | 1912 | * bioset_init - Initialize a bio_set |
1913 | + * @bs: pool to initialize | |
1920 | 1914 | * @pool_size: Number of bio and bio_vecs to cache in the mempool |
1921 | 1915 | * @front_pad: Number of bytes to allocate in front of the returned bio |
1922 | 1916 | * @flags: Flags to modify behavior, currently %BIOSET_NEED_BVECS |
1923 | 1917 | * and %BIOSET_NEED_RESCUER |
1924 | 1918 | * |
1925 | - * Similar to bioset_create(), but initializes a passed-in bioset instead of | |
1926 | - * separately allocating it. | |
1919 | + * Description: | |
1920 | + * Set up a bio_set to be used with @bio_alloc_bioset. Allows the caller | |
1921 | + * to ask for a number of bytes to be allocated in front of the bio. | |
1922 | + * Front pad allocation is useful for embedding the bio inside | |
1923 | + * another structure, to avoid allocating extra data to go with the bio. | |
1924 | + * Note that the bio must be embedded at the END of that structure always, | |
1925 | + * or things will break badly. | |
1926 | + * If %BIOSET_NEED_BVECS is set in @flags, a separate pool will be allocated | |
1927 | + * for allocating iovecs. This pool is not needed e.g. for bio_clone_fast(). | |
1928 | + * If %BIOSET_NEED_RESCUER is set, a workqueue is created which can be used to | |
1929 | + * dispatch queued requests when the mempool runs out of space. | |
1930 | + * | |
1927 | 1931 | */ |
1928 | 1932 | int bioset_init(struct bio_set *bs, |
1929 | 1933 | unsigned int pool_size, |
... | ... | @@ -1962,45 +1966,6 @@ |
1962 | 1966 | return -ENOMEM; |
1963 | 1967 | } |
1964 | 1968 | EXPORT_SYMBOL(bioset_init); |
1965 | - | |
1966 | -/** | |
1967 | - * bioset_create - Create a bio_set | |
1968 | - * @pool_size: Number of bio and bio_vecs to cache in the mempool | |
1969 | - * @front_pad: Number of bytes to allocate in front of the returned bio | |
1970 | - * @flags: Flags to modify behavior, currently %BIOSET_NEED_BVECS | |
1971 | - * and %BIOSET_NEED_RESCUER | |
1972 | - * | |
1973 | - * Description: | |
1974 | - * Set up a bio_set to be used with @bio_alloc_bioset. Allows the caller | |
1975 | - * to ask for a number of bytes to be allocated in front of the bio. | |
1976 | - * Front pad allocation is useful for embedding the bio inside | |
1977 | - * another structure, to avoid allocating extra data to go with the bio. | |
1978 | - * Note that the bio must be embedded at the END of that structure always, | |
1979 | - * or things will break badly. | |
1980 | - * If %BIOSET_NEED_BVECS is set in @flags, a separate pool will be allocated | |
1981 | - * for allocating iovecs. This pool is not needed e.g. for bio_clone_fast(). | |
1982 | - * If %BIOSET_NEED_RESCUER is set, a workqueue is created which can be used to | |
1983 | - * dispatch queued requests when the mempool runs out of space. | |
1984 | - * | |
1985 | - */ | |
1986 | -struct bio_set *bioset_create(unsigned int pool_size, | |
1987 | - unsigned int front_pad, | |
1988 | - int flags) | |
1989 | -{ | |
1990 | - struct bio_set *bs; | |
1991 | - | |
1992 | - bs = kzalloc(sizeof(*bs), GFP_KERNEL); | |
1993 | - if (!bs) | |
1994 | - return NULL; | |
1995 | - | |
1996 | - if (bioset_init(bs, pool_size, front_pad, flags)) { | |
1997 | - kfree(bs); | |
1998 | - return NULL; | |
1999 | - } | |
2000 | - | |
2001 | - return bs; | |
2002 | -} | |
2003 | -EXPORT_SYMBOL(bioset_create); | |
2004 | 1969 | |
2005 | 1970 | #ifdef CONFIG_BLK_CGROUP |
2006 | 1971 |
include/linux/bio.h
... | ... | @@ -410,14 +410,12 @@ |
410 | 410 | return bio_split(bio, sectors, gfp, bs); |
411 | 411 | } |
412 | 412 | |
413 | -extern int bioset_init(struct bio_set *, unsigned int, unsigned int, int flags); | |
414 | -extern void bioset_exit(struct bio_set *); | |
415 | -extern struct bio_set *bioset_create(unsigned int, unsigned int, int flags); | |
416 | 413 | enum { |
417 | 414 | BIOSET_NEED_BVECS = BIT(0), |
418 | 415 | BIOSET_NEED_RESCUER = BIT(1), |
419 | 416 | }; |
420 | -extern void bioset_free(struct bio_set *); | |
417 | +extern int bioset_init(struct bio_set *, unsigned int, unsigned int, int flags); | |
418 | +extern void bioset_exit(struct bio_set *); | |
421 | 419 | extern int biovec_init_pool(mempool_t *pool, int pool_entries); |
422 | 420 | |
423 | 421 | extern struct bio *bio_alloc_bioset(gfp_t, unsigned int, struct bio_set *); |