Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp26946pxb; Wed, 27 Jan 2021 00:48:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJyMJh7Cs3H11c3cgWw/jFEIwxG5LZvw4RlWlv1bjY769DLT2knaMuXZdQ3RB5KodZESWCRJ X-Received: by 2002:a17:906:94d3:: with SMTP id d19mr5756108ejy.383.1611737324679; Wed, 27 Jan 2021 00:48:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611737324; cv=none; d=google.com; s=arc-20160816; b=ALuh4jy99uht1cicXMeqn3MkQ+RNqEZbjuVqwbIjqEWnl8KadQpz5TqBjYhgfTw+LI 4Vxb+FjvKQ0xAESuCpbFmZRGFYYsbXIlAQ9l1DqILNib6nQH0oytvvyRssEHX8EoytOf 6LB18izHUipBZ1S5GFIVOXCpJAVRyqGE/9N6I8ThlqsbcHEjzmXFOnvTRN7F+7JruEeO FQGA4Yl4QUXQ7oike+JM3HCBPOPej7vbIlxEAd3YmC4kGizg4joGgBpqQLjPjS0bR3mo 10Lb2+qrpjv2PFkk8KGNduTxYqyx3XShVz5J+iaGXy4UVoAPiZIlpx3xwduDNf+P4+3G hCHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=vPU5Uuhi/mnJZA648+ZkaCWfuH8BWmnza0VsYmSMGLQ=; b=yC6afF6LuDDjcLw8FbABc0tBUTXkz6awDMx91XOrCb+kwKX9TlFFLkIQbj0E6A3Kla 7m4hcRwVSmqY3bPlisW8fDqJYbeJfMuoMYWI4hPDzWGQ2R9gvSo5aI1Sa6f8azhKfyIW r13eIlG2l0NUYbCjw9T9l6PnhDu4NKt/N8Y2Djng5Qal2iYbqv4bW2b092X2ByLcID/g Yj8toJq6BwEye1Un6TUUKI5+HFcF/oSxpmH4s6fxwK5VH0cK2V64pNb0b2dCqmUwulrv GH1N47lnVJ2WtTSG+3Y5dfpokinc0nkGhIaGM8ivg4tPL8MQRBqvTxkb5P6MiyUEiIoM JpiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Bec44/no"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l8si612360edt.265.2021.01.27.00.48.19; Wed, 27 Jan 2021 00:48:44 -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=@kernel.org header.s=k20201202 header.b="Bec44/no"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233416AbhA0HZj (ORCPT + 99 others); Wed, 27 Jan 2021 02:25:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:48704 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233735AbhA0HXm (ORCPT ); Wed, 27 Jan 2021 02:23:42 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3B9EF2074B; Wed, 27 Jan 2021 07:22:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611732179; bh=wys3sZM3KFLi7kSDIT+8OH9R8Mzfn9WfVwnN3287ktM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Bec44/no8t56Z502LgnlM+Qg3a7iRfwb8LyhJ+o5g82IaOznb97Gk8xlDwtFm7y0Q 4B+/tC5K9lGgUBiHyhE00pi36rFGRQbfNmoExpX38MvaaIEiIlo5Xpl02zb3d2+c9I 6QT/NDPMg5Mj36lJBF9f+RFUcTIY2MmljvRbc0DiIULgDdoXmR4KXliM+gH3VlyPk6 mHWoOAExmkNvS6m/z6G7b4ZdKBJLDixAbo/Wzlpm3cgdfJxA927Fy/aSbJhFzA/wq4 2ciHhZnN+TzrdwTTB4DOYnCFwWnsw1IL4QMJJGrVzDQalyZsi3zFFnOCUMa/DMqtOX AkooKL+eqRW2g== Received: by mail-lj1-f174.google.com with SMTP id 3so909613ljc.4; Tue, 26 Jan 2021 23:22:59 -0800 (PST) X-Gm-Message-State: AOAM531YWoDEJpp8cDQgEYHd2BYi206VyMREUIK+5Ba7zozGspXdzCHp c+jh1CywFVUWO0gArFcLfSpkGUIVPc6m/ZhnXsY= X-Received: by 2002:a2e:b8d3:: with SMTP id s19mr5116366ljp.97.1611732177533; Tue, 26 Jan 2021 23:22:57 -0800 (PST) MIME-Version: 1.0 References: <20210126145247.1964410-1-hch@lst.de> <20210126145247.1964410-14-hch@lst.de> In-Reply-To: <20210126145247.1964410-14-hch@lst.de> From: Song Liu Date: Tue, 26 Jan 2021 23:22:46 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 13/17] md: remove md_bio_alloc_sync To: Christoph Hellwig Cc: Jens Axboe , 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 , Linux-Fsdevel , linux-btrfs@vger.kernel.org, linux-nfs@vger.kernel.org, Linux-MM Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Tue, Jan 26, 2021 at 7:17 AM Christoph Hellwig wrote: > > 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 Acked-by: Song Liu > --- > 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 >