Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3048666rwe; Mon, 29 Aug 2022 05:08:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR6egjaY+kz0RFGekpb3Hk6KD4sah32YJIf39hVERTI8R73exlNSzg7bK5zzkUBFehlL7dt6 X-Received: by 2002:a17:90b:1c0c:b0:1fb:6b2c:ca9f with SMTP id oc12-20020a17090b1c0c00b001fb6b2cca9fmr18673490pjb.90.1661774883821; Mon, 29 Aug 2022 05:08:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661774883; cv=none; d=google.com; s=arc-20160816; b=wxTSFavKsVMaSSZwQdIxpFw2Cowv54emWXTLxHu8g9jI0Hpk5K9smp/yQIGVUByHWm 1xu/akA+CLvKCAc9a0m7JQXeUQhY+forKsbWnv/YuvicWoG7EyKR29z2rjecnLWS8Ojr T2reVO9qLs53XPIgD38QnwNR1AiYQ7B9tpeOeEYjwuYvS4XKnn6L/0rkkz8bjr29Y2l2 t3GSR3NFRgrANDCKGeHsfqpJUsJ+dqm31WAgrfUOk5MaEU05lbCovUizUmRT9DKgQL9/ OB0ukgMkEN//oxWOw9tFy7RO05gEJAdBHz/JmK/PGjkT/lVMnvddM4PLRuZ/796v//7U bmxQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Zq16hDaBeSfS46ckkSR9vVMqzDVBzvBSMjhlcvadvKg=; b=DeLiYO5MAHY3Dx2Lk7eToG/Pu8vmsllNyXwh4e0ErJiaMjWNWkH9mZqejZ4jF1N0zj 3bl9uF1zu4w1xr8/F6QJtXRXMl5sJ88zL353xyCrpglTPUAG9dB/DzSCba0/1ZZdYfGX PlU4KyVL6PhLua1yTnBy4oik4jsT4i0xe3coELCivHosILRojpuaDd65BqlL8N0/+Xk9 Zcew605vvsapQgAaj6QcpJ0zVjfFEAgI1P/h3ggcs/GnSe6aFWZg6hzQEwTT4y4VIvH/ 2vY61+rAYZ8yxUeo/RzB+jGnVOwhjLebAkCa0Rw9egRV0M1eMTwf8bt7PsUceyFZ+ukE 3zxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mVqUQ8vx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 70-20020a630149000000b0042b9bfe6919si6048920pgb.91.2022.08.29.05.07.51; Mon, 29 Aug 2022 05:08:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mVqUQ8vx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230117AbiH2LGc (ORCPT + 99 others); Mon, 29 Aug 2022 07:06:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230280AbiH2LFx (ORCPT ); Mon, 29 Aug 2022 07:05:53 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5843A66A46; Mon, 29 Aug 2022 04:04:26 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id BAF29B80EFB; Mon, 29 Aug 2022 11:03:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 201BEC433C1; Mon, 29 Aug 2022 11:03:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661771011; bh=1X41frZTHQivlLsOnkoqvM+UV/1idMNbJM8zsDD4H5s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mVqUQ8vx1SYoiN++QOynZgVC7MWqqrOLhg/UkJYTFdyq2TTnJeZA5aLv2b8Nie3O7 vEw2Q7FuW8JWxL6F7NS5iXgErhYw5dHDaIGAyo4R3wIdvY2ZDzENrY6Q71Eg8FlIAm mbOvSaNnDcukGnmIeQ7/lfmPosyk/6rkP4D6Zukc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christoph Hellwig , Chaitanya Kulkarni , Jens Axboe , Amir Goldstein , "Darrick J. Wong" Subject: [PATCH 5.10 07/86] fs: remove __sync_filesystem Date: Mon, 29 Aug 2022 12:58:33 +0200 Message-Id: <20220829105756.833028102@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220829105756.500128871@linuxfoundation.org> References: <20220829105756.500128871@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christoph Hellwig commit 9a208ba5c9afa62c7b1e9c6f5e783066e84e2d3c upstream. [backported for dependency] There is no clear benefit in having this helper vs just open coding it. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20211019062530.2174626-2-hch@lst.de Signed-off-by: Jens Axboe Signed-off-by: Amir Goldstein Acked-by: Darrick J. Wong Signed-off-by: Greg Kroah-Hartman --- fs/sync.c | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-) --- a/fs/sync.c +++ b/fs/sync.c @@ -22,25 +22,6 @@ SYNC_FILE_RANGE_WAIT_AFTER) /* - * Do the filesystem syncing work. For simple filesystems - * writeback_inodes_sb(sb) just dirties buffers with inodes so we have to - * submit IO for these buffers via __sync_blockdev(). This also speeds up the - * wait == 1 case since in that case write_inode() functions do - * sync_dirty_buffer() and thus effectively write one block at a time. - */ -static int __sync_filesystem(struct super_block *sb, int wait) -{ - if (wait) - sync_inodes_sb(sb); - else - writeback_inodes_sb(sb, WB_REASON_SYNC); - - if (sb->s_op->sync_fs) - sb->s_op->sync_fs(sb, wait); - return __sync_blockdev(sb->s_bdev, wait); -} - -/* * Write out and wait upon all dirty data associated with this * superblock. Filesystem data as well as the underlying block * device. Takes the superblock lock. @@ -61,10 +42,25 @@ int sync_filesystem(struct super_block * if (sb_rdonly(sb)) return 0; - ret = __sync_filesystem(sb, 0); + /* + * Do the filesystem syncing work. For simple filesystems + * writeback_inodes_sb(sb) just dirties buffers with inodes so we have + * to submit I/O for these buffers via __sync_blockdev(). This also + * speeds up the wait == 1 case since in that case write_inode() + * methods call sync_dirty_buffer() and thus effectively write one block + * at a time. + */ + writeback_inodes_sb(sb, WB_REASON_SYNC); + if (sb->s_op->sync_fs) + sb->s_op->sync_fs(sb, 0); + ret = __sync_blockdev(sb->s_bdev, 0); if (ret < 0) return ret; - return __sync_filesystem(sb, 1); + + sync_inodes_sb(sb); + if (sb->s_op->sync_fs) + sb->s_op->sync_fs(sb, 1); + return __sync_blockdev(sb->s_bdev, 1); } EXPORT_SYMBOL(sync_filesystem);