From patchwork Sun May 20 22:25:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 10413687 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1C94D600F6 for ; Sun, 20 May 2018 22:27:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F3DFD205A9 for ; Sun, 20 May 2018 22:27:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E6D44286EC; Sun, 20 May 2018 22:27:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F230205A9 for ; Sun, 20 May 2018 22:27:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751707AbeETW1Y (ORCPT ); Sun, 20 May 2018 18:27:24 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:33000 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751902AbeETW0l (ORCPT ); Sun, 20 May 2018 18:26:41 -0400 Received: by mail-qk0-f193.google.com with SMTP id s12-v6so826065qke.0; Sun, 20 May 2018 15:26:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=y9RrHqFDKxsIgh8u2cy5nHB13FtUEa5bnZVJK3nbZsg=; b=gdRRaAHJe0DOqu8Y8Pl3pE9h65LBM4RGvsHeG9rPEach0g7L+zpRwHezfQl2XqcRAO 3FE/E4KJaDAb/ey/lBj0idT4zt/aLW7MJyMskNWXLLeTWvxDp2UzOCzOgtySNGjwnkgb KksuUE8ddG33DH6eXBAZYz4BCbWA0IlfQHyuTRD2UMhiYCG8AoyQMM1l/LLdx5G8cOE3 RvfSFvIP9xg2+Ee2IKYyq1pXxhEhlsZ9xmZb3YMh1dSFvzIxwZ2e3lyXF4O88CncSTTk 9HXaBarURnePHFkB7WOLiQgq9aGrgocHYZVQXvSclnSWeA2zXmQqaJbL18U3ltMhmzP4 07tQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=y9RrHqFDKxsIgh8u2cy5nHB13FtUEa5bnZVJK3nbZsg=; b=h+KPqEi8Mnjn+x0t1esOS4wJbTDjyDgDKT2k1JQzixTW6LD1jlyGeOtdmbKa51eq1A DJPloh8w4S5dbtIFmgud9pXjImzzIcIhdUp2y92PJNmaxICo+Y/RbzT98mmK0GSNVXih 9txtoOLNADYc4R6jL9uR6ub/dvcAmlomqbEoLW4G2SwFatwSHc9o+DxsEW2t8YFZAizP wG9qyWSnBxijhuj7B8X+HCP/3YekpnEMZTy0BojjcuJ9bo0P88L5OV3HhFc8aP4nDvBj eQkjP9E5YKoIAgZdAXSqzn5TWwCDCR9Z+KxEmzHeoLHM+7CvfQCQhQt762n8hlXcgN8j BMjg== X-Gm-Message-State: ALKqPwd+6+N0A5Gr2qj4p7JYxFD8yKnmz5JkiUORpQ6VAuHOTb5bT819 9TFib/s1rmsUD0jEs/Ccq/xCViFdQQ== X-Google-Smtp-Source: AB8JxZoqgiy081qnlq21uRiSCKrJw9uTx+sW2NbpM8695PPSuSH+Ig9Snapt8QZLSHrGXEgpJsxKZw== X-Received: by 2002:a37:a3c2:: with SMTP id m185-v6mr1451858qke.255.1526855200181; Sun, 20 May 2018 15:26:40 -0700 (PDT) Received: from localhost.localdomain (c-71-234-172-214.hsd1.vt.comcast.net. [71.234.172.214]) by smtp.gmail.com with ESMTPSA id v14-v6sm8773169qto.72.2018.05.20.15.26.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 May 2018 15:26:39 -0700 (PDT) From: Kent Overstreet 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 Subject: [PATCH 12/12] block: Drop bioset_create() Date: Sun, 20 May 2018 18:25:58 -0400 Message-Id: <20180520222558.7053-13-kent.overstreet@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180520222558.7053-1-kent.overstreet@gmail.com> References: <20180520222558.7053-1-kent.overstreet@gmail.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP All users have been converted to bioset_init() Signed-off-by: Kent Overstreet Reviewed-by: Christoph Hellwig --- 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 *);