Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3894907pxb; Tue, 26 Jan 2021 07:23:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJzNZ/kjXxlzVAhFlXYaWmct7xk38v/FjL7fDDFNFYiVAa8jP3/FKGvFd/hETfmhFz0N1ngJ X-Received: by 2002:a17:906:eca7:: with SMTP id qh7mr3804405ejb.437.1611674630255; Tue, 26 Jan 2021 07:23:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611674630; cv=none; d=google.com; s=arc-20160816; b=k8uKKqEB1oXwlD68Z+P1D2a5QtEQ51DdBZZWyH2pkVMgV3yznkqSiJTALQNiD4d6h5 AV6w8lGgsc6xOAFumpny1s3t0CP5mPbgdDQSYfQhVFX9wQPhKN6yMHx76n86ehuBNyd0 o4YD0LsbtcGyPQfF/074d438fjg54fAjXyn4eYDgvG2kGBA0pnYKfR7ghDk4OQC8eYYB 0J6mCXP9zpBdhJuQ2eqbut7/7hRybEZFHpSEgUrua2pCWcC1NE35LIv1lO4G5TpnIbof hqjm+kV7cb8T/2FUFFCcC9lIUOIOFFUyudczi3rNuLHBGtaCht281QT+2KYsg7iupQ9d q/9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=hT6VVHBE+h6JAvE1DToGRa2iclpKhRp2E4jpRU5fhfg=; b=yPr+gF71RhR2CSJQRBuvz8ejoQeH9e32EGYvI0vZk+6ZeJutsY11VzCooZ6akMeJYp RpMabXtFgL/d1EDWgoEtR9T6bLWwb5yd3idvd41pVPnEP967uk/09K/rHd31rpOCVeOv V8y9QItv98v/zO90cJUck5NgKk8jtEVWl9yfYW+SoQIAXww4LVEO272GCBy8j7or8jyU jgW2htng2eftnT+aeJT/PUhBf8mGuGaPg/OKv/00f2XRky+dsY04p6SlDEKRqRHn+9+c sX/tpptDc8owNcOZ5ZJQRObZXovxUi8bqyV0kypK6KKk9ohjvKM7uyddwnnAUp5KDYFX 1Fkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="a5C/DS8x"; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ko3si3808755ejc.321.2021.01.26.07.23.15; Tue, 26 Jan 2021 07:23:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="a5C/DS8x"; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406179AbhAZPVa (ORCPT + 99 others); Tue, 26 Jan 2021 10:21:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406317AbhAZPVP (ORCPT ); Tue, 26 Jan 2021 10:21:15 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7210FC0698C2; Tue, 26 Jan 2021 07:20:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=hT6VVHBE+h6JAvE1DToGRa2iclpKhRp2E4jpRU5fhfg=; b=a5C/DS8xF1Qgcw0TbOpCyVosGS Zrj/lJFI88P49DOf+/Bv7oVHux9xqSc90dqCb+MgQFhiF1iNvcTKtNotsaqaT9GZ5O2lfHYWPU8f9 MWSyAVCn+XzTVBXvoQFlhs6Nk75UUNAvCFZY8DGZ+OF3VElW6b7AOCAZODHM1g0BPGh6KHJ7SLPKZ ldxaH+8wFBz/F2aTXvOIhpfh3/7iT/Vec2zTOjOdaNV8EKhaGb4msUb18JCH4H9nVObBYh45mZ/t7 Mt7fD5vi0lda03mpky5eT1QtbuYJV5pgTQU/Q9GheLbpEAbrqXTRFm9yHPYEgOqLWBKQ/o7X2nMXc I/Ys90sw==; Received: from [2001:4bb8:191:e347:5918:ac86:61cb:8801] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1l4Q39-005o7b-JG; Tue, 26 Jan 2021 15:15:32 +0000 From: Christoph Hellwig To: Jens Axboe , Song Liu Cc: Jaegeuk Kim , Chao Yu , Philipp Reisner , Lars Ellenberg , Coly Li , Mike Snitzer , Josef Bacik , David Sterba , Damien Le Moal , Naohiro Aota , Andrew Morton , Ryusuke Konishi , linux-nilfs@vger.kernel.org, dm-devel@redhat.com, linux-f2fs-devel@lists.sourceforge.net, linux-block@vger.kernel.org, drbd-dev@lists.linbit.com, linux-bcache@vger.kernel.org, linux-raid@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-nfs@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 13/17] md: remove md_bio_alloc_sync Date: Tue, 26 Jan 2021 15:52:43 +0100 Message-Id: <20210126145247.1964410-14-hch@lst.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210126145247.1964410-1-hch@lst.de> References: <20210126145247.1964410-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org md_bio_alloc_sync is never called with a NULL mddev, and ->sync_set is initialized in md_run, so it always must be initialized as well. Just open code the remaining call to bio_alloc_bioset. Signed-off-by: Christoph Hellwig --- drivers/md/md.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index 6a27f52007c871..399c81bddc1ae1 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -340,14 +340,6 @@ static int start_readonly; */ static bool create_on_open = true; -static struct bio *md_bio_alloc_sync(struct mddev *mddev) -{ - if (!mddev || !bioset_initialized(&mddev->sync_set)) - return bio_alloc(GFP_NOIO, 1); - - return bio_alloc_bioset(GFP_NOIO, 1, &mddev->sync_set); -} - /* * We have a system wide 'event count' that is incremented * on any 'interesting' event, and readers of /proc/mdstat @@ -989,7 +981,7 @@ void md_super_write(struct mddev *mddev, struct md_rdev *rdev, if (test_bit(Faulty, &rdev->flags)) return; - bio = md_bio_alloc_sync(mddev); + bio = bio_alloc_bioset(GFP_NOIO, 1, &mddev->sync_set); atomic_inc(&rdev->nr_pending); -- 2.29.2