linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kent Overstreet <kent.overstreet@gmail.com>
To: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
	axboe@kernel.dk, hch@infradead.org, colyli@suse.de,
	snitzer@redhat.com, darrick.wong@oracle.com, clm@fb.com,
	bacik@fb.com, linux-xfs@vger.kernel.org,
	drbd-dev@lists.linbit.com, linux-btrfs@vger.kernel.org,
	linux-raid@vger.kernel.org, neilb@suse.com
Cc: Kent Overstreet <kent.overstreet@gmail.com>
Subject: [PATCH 12/12] block: Drop bioset_create()
Date: Sun, 20 May 2018 18:25:58 -0400	[thread overview]
Message-ID: <20180520222558.7053-13-kent.overstreet@gmail.com> (raw)
In-Reply-To: <20180520222558.7053-1-kent.overstreet@gmail.com>

All users have been converted to bioset_init()

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
---
 block/bio.c         | 61 ++++++++++-----------------------------------
 include/linux/bio.h |  6 ++---
 2 files changed, 15 insertions(+), 52 deletions(-)

diff --git a/block/bio.c b/block/bio.c
index 0a4df92cd6..595663e028 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 @@ int bioset_init(struct bio_set *bs,
 }
 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 5e472fcafa..810a8bee8f 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 *);
-- 
2.17.0


  parent reply	other threads:[~2018-05-20 22:26 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-20 22:25 [PATCH 00/13] convert block layer to bioset_init()/mempool_init() Kent Overstreet
2018-05-20 22:25 ` [PATCH 01/12] block: convert bounce, q->bio_split " Kent Overstreet
2018-05-22 10:08   ` Christoph Hellwig
2018-05-20 22:25 ` [PATCH 02/12] drbd: convert " Kent Overstreet
2018-05-20 22:25 ` [PATCH 03/12] pktcdvd: " Kent Overstreet
2018-05-20 22:25 ` [PATCH 04/12] lightnvm: " Kent Overstreet
2018-05-22 10:10   ` Javier Gonzalez
2018-05-20 22:25 ` [PATCH 05/12] bcache: " Kent Overstreet
2018-05-21  3:58   ` Coly Li
2018-05-20 22:25 ` [PATCH 06/12] md: " Kent Overstreet
2018-06-01 10:51   ` Arnd Bergmann
2018-05-20 22:25 ` [PATCH 07/12] dm: " Kent Overstreet
2018-05-30 19:27   ` Mike Snitzer
2018-05-20 22:25 ` [PATCH 08/12] target: " Kent Overstreet
2018-05-22 10:09   ` Christoph Hellwig
2018-05-20 22:25 ` [PATCH 09/12] fs: convert block_dev.c to bioset_init() Kent Overstreet
2018-05-22 10:09   ` Christoph Hellwig
2018-05-20 22:25 ` [PATCH 10/12] btrfs: convert to bioset_init()/mempool_init() Kent Overstreet
2018-05-30 21:30   ` Chris Mason
2018-05-20 22:25 ` [PATCH 11/12] xfs: " Kent Overstreet
2018-05-21 18:39   ` Darrick J. Wong
2018-05-22 10:10   ` Christoph Hellwig
2018-05-20 22:25 ` Kent Overstreet [this message]
2018-05-22 10:10   ` [PATCH 12/12] block: Drop bioset_create() Christoph Hellwig
2018-05-20 23:08 ` [PATCH 00/13] convert block layer to bioset_init()/mempool_init() NeilBrown
2018-05-20 23:11   ` Kent Overstreet
2018-05-21 14:03 ` Mike Snitzer
2018-05-21 14:19   ` Jens Axboe
2018-05-21 14:31     ` Mike Snitzer
2018-05-21 14:36       ` Jens Axboe
2018-05-21 14:47         ` Mike Snitzer
2018-05-21 14:52           ` Jens Axboe
2018-05-21 15:04             ` Mike Snitzer
2018-05-21 15:09               ` Jens Axboe
2018-05-21 15:18                 ` Mike Snitzer
2018-05-21 15:36                   ` Jens Axboe
2018-05-21 16:09                     ` Mike Snitzer
2018-05-21 16:20                       ` Jens Axboe
     [not found]                         ` <20180530133629.GC5157@redhat.com>
2018-05-30 18:55                           ` Jens Axboe
2018-05-30 19:34                             ` Kent Overstreet
2018-05-30 19:36                               ` Jens Axboe
2018-05-30 19:37                             ` Mike Snitzer
2018-05-30 19:38                               ` Jens Axboe
2018-05-21 17:37                       ` Kent Overstreet
2018-05-21 18:24                         ` Mike Snitzer
2018-05-21 23:38                           ` Kent Overstreet
2018-05-22  6:41                             ` Christoph Hellwig
2018-05-21 15:12     ` David Sterba
2018-05-21 15:18       ` Jens Axboe
2018-05-21 14:20 ` Jens Axboe
2018-05-30 22:24 ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180520222558.7053-13-kent.overstreet@gmail.com \
    --to=kent.overstreet@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=bacik@fb.com \
    --cc=clm@fb.com \
    --cc=colyli@suse.de \
    --cc=darrick.wong@oracle.com \
    --cc=drbd-dev@lists.linbit.com \
    --cc=hch@infradead.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=neilb@suse.com \
    --cc=snitzer@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).