Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3885314pxb; Tue, 26 Jan 2021 07:12:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJxK7NZgxpgfR3hQilbKjSw5/wKOY+rqYfbFGtwTNgfL+OhFhc2xvhRbeYKzNIH19sPib03y X-Received: by 2002:a17:906:705:: with SMTP id y5mr3765731ejb.83.1611673932749; Tue, 26 Jan 2021 07:12:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611673932; cv=none; d=google.com; s=arc-20160816; b=fqpawCQ/hv6dy16VO5Y7e7RZq4ENKQ2c5YSToLA1h7FAmJ8j6Yw6qmucm0OQVv/A2S 6uoNMKWNsnn1UTS2xMSZaQNBufHW3ajL17+A1AqPkCbuOYuDQ20q31CZONIcczwoFOCa Um+yxViYENyFKFu8mWJzzH/1GTPk6q0RoQ2B3803Yd/z5OgkaJ2gTxe67sTfkh8F+sbQ hzR/D1xpAqyqE52P2BI92JDcUPf1VXzkwpCEBQstI+QY3Ka96fJYVpZCm8oQhXkr8N2R ygsREKOo6sYn3Evfvm46tXRmJ5zsqE6GNBnQp0cvWXbgPnqapmfPl3herpOnvqLWBMvg t4rw== 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=Zy1yNACJwx6tY0xAylbc3LmDKE7IpoPxR60kvFb5LRI=; b=AQiOXra2l0sPzUOwwedd4N31EdMLJjoMwIOhzjmBeFmokfAO3KQMybcRTnSTA8UtJ5 s5jlxHJXlvufZYOTg7rRfDhNLLmfwh8b3nS4UBhsp58waYwCcbsDR0aQzC0y0WEan6el BAN2jOpWEnLjkw9m7Oaj/vBTsWbop5ZNyOmurbVpStAdxqOUh6dx4buXK8INgpRA0gaz dXjcOjfHNtkQl8nTjn+68LaJBY0CUHTI3Mbia9TPcZkJTymfOW2gZG1Pzc1eJTIhHPZT /c6tGqrygxjCYahLuslc0kb+JSLHW3deYdwELfysPtBTKXQV+JbQ8llUutaakC8oibro RgWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ocoLOdED; 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 yw7si7041568ejb.453.2021.01.26.07.11.47; Tue, 26 Jan 2021 07:12:12 -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=ocoLOdED; 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 S2406202AbhAZPJW (ORCPT + 99 others); Tue, 26 Jan 2021 10:09:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406191AbhAZPJN (ORCPT ); Tue, 26 Jan 2021 10:09:13 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 998B9C061A29; Tue, 26 Jan 2021 07:08:33 -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=Zy1yNACJwx6tY0xAylbc3LmDKE7IpoPxR60kvFb5LRI=; b=ocoLOdEDKDs0IuNFSP9sgoTODv 18PH5yYdILklt5Kcbk4RaNOumpH/dPygxlzzOi0F7kge6uR6vZPdKOW23YBL+UfRU3Hg53gGT+sdE L7Y2itAvM/yrtkW1Yulc5ANGTeem5ElQyw2MEJgaPcXb0rn6g2dRNjlXdsW0AdM00QuSgAQRTCF5i sG2hDmNa2gYg0o6VdGGNL4b7gjHoC3baCaLKFSmUBDtBto5EYLtmHVEA+eucEAVTT7YHamKlXI/RV cpzfxttXq3A3lFAC2B/WVmkxfelzhSzKudfS/jGmRwK27WhKvXoxcGP+EjBP96ON1vw/v2NYKF3Kb R3kKKz6w==; 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 1l4Pt5-005n5W-9A; Tue, 26 Jan 2021 15:04:44 +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 07/17] f2fs: use blkdev_issue_flush in __submit_flush_wait Date: Tue, 26 Jan 2021 15:52:37 +0100 Message-Id: <20210126145247.1964410-8-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 Use the blkdev_issue_flush helper instead of duplicating it. Signed-off-by: Christoph Hellwig --- fs/f2fs/data.c | 3 ++- fs/f2fs/f2fs.h | 1 - fs/f2fs/segment.c | 12 +----------- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 8cbf0315975228..0cf0c605992431 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -56,7 +56,8 @@ static inline struct bio *__f2fs_bio_alloc(gfp_t gfp_mask, return bio_alloc_bioset(gfp_mask, nr_iovecs, &f2fs_bioset); } -struct bio *f2fs_bio_alloc(struct f2fs_sb_info *sbi, int npages, bool noio) +static struct bio *f2fs_bio_alloc(struct f2fs_sb_info *sbi, int npages, + bool noio) { if (noio) { /* No failure on bio allocation */ diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index bb11759191dcc9..902bd3267c03e1 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -3424,7 +3424,6 @@ void f2fs_destroy_checkpoint_caches(void); */ int __init f2fs_init_bioset(void); void f2fs_destroy_bioset(void); -struct bio *f2fs_bio_alloc(struct f2fs_sb_info *sbi, int npages, bool noio); int f2fs_init_bio_entry_cache(void); void f2fs_destroy_bio_entry_cache(void); void f2fs_submit_bio(struct f2fs_sb_info *sbi, diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index deca74cb17dfd8..c495f170ee400b 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -566,17 +566,7 @@ void f2fs_balance_fs_bg(struct f2fs_sb_info *sbi, bool from_bg) static int __submit_flush_wait(struct f2fs_sb_info *sbi, struct block_device *bdev) { - struct bio *bio; - int ret; - - bio = f2fs_bio_alloc(sbi, 0, false); - if (!bio) - return -ENOMEM; - - bio->bi_opf = REQ_OP_WRITE | REQ_SYNC | REQ_PREFLUSH; - bio_set_dev(bio, bdev); - ret = submit_bio_wait(bio); - bio_put(bio); + int ret = blkdev_issue_flush(bdev); trace_f2fs_issue_flush(bdev, test_opt(sbi, NOBARRIER), test_opt(sbi, FLUSH_MERGE), ret); -- 2.29.2