From patchwork Wed Jul 12 18:00:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaohua Li X-Patchwork-Id: 9837213 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 B74B8603F3 for ; Wed, 12 Jul 2017 18:01:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACF0528654 for ; Wed, 12 Jul 2017 18:01:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A1B7328662; Wed, 12 Jul 2017 18:01:28 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham 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 175862865E for ; Wed, 12 Jul 2017 18:01:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751150AbdGLSB1 (ORCPT ); Wed, 12 Jul 2017 14:01:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:52716 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751060AbdGLSB1 (ORCPT ); Wed, 12 Jul 2017 14:01:27 -0400 Received: from shli-virt.localdomain (unknown [199.201.64.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0EBBD22C95; Wed, 12 Jul 2017 18:01:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0EBBD22C95 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=shli@fb.com From: Shaohua Li To: linux-block@vger.kernel.org Cc: axboe@fb.com, Shaohua Li , Christoph Hellwig Subject: [PATCH 1/2] block: delete bio_uninit in blockdev Date: Wed, 12 Jul 2017 11:00:52 -0700 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Shaohua Li This is to partially revert commit 9ae3b3f52c62 (block: provide bio_uninit() free freeing integrity/task associations). With commit b222dd2 (block: call bio_uninit in bio_endio) and 7c20f11(bio-integrity: stop abusing bi_end_io), integrity/cgroup info is freed in bio_endio. We don't need to call bio_unit in other places Cc: Christoph Hellwig Signed-off-by: Shaohua Li --- block/bio.c | 8 +------- fs/block_dev.c | 4 +--- include/linux/bio.h | 1 - 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/block/bio.c b/block/bio.c index 9a63597..ce078fb 100644 --- a/block/bio.c +++ b/block/bio.c @@ -240,11 +240,10 @@ struct bio_vec *bvec_alloc(gfp_t gfp_mask, int nr, unsigned long *idx, return bvl; } -void bio_uninit(struct bio *bio) +static void bio_uninit(struct bio *bio) { bio_disassociate_task(bio); } -EXPORT_SYMBOL(bio_uninit); static void bio_free(struct bio *bio) { @@ -269,11 +268,6 @@ static void bio_free(struct bio *bio) } } -/* - * Users of this function have their own bio allocation. Subsequently, - * they must remember to pair any call to bio_init() with bio_uninit() - * when IO has completed, or when the bio is released. - */ void bio_init(struct bio *bio, struct bio_vec *table, unsigned short max_vecs) { diff --git a/fs/block_dev.c b/fs/block_dev.c index 9941dc8..673536e 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -264,9 +264,7 @@ __blkdev_direct_IO_simple(struct kiocb *iocb, struct iov_iter *iter, kfree(vecs); if (unlikely(bio.bi_status)) - ret = blk_status_to_errno(bio.bi_status); - - bio_uninit(&bio); + return blk_status_to_errno(bio.bi_status); return ret; } diff --git a/include/linux/bio.h b/include/linux/bio.h index 7b1cf4b..8a56a50 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -444,7 +444,6 @@ extern void bio_advance(struct bio *, unsigned); extern void bio_init(struct bio *bio, struct bio_vec *table, unsigned short max_vecs); -extern void bio_uninit(struct bio *); extern void bio_reset(struct bio *); void bio_chain(struct bio *, struct bio *);