Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1261595pxu; Fri, 27 Nov 2020 03:37:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJzZhstcyV9mvx5CIUe3dtn0W5EdFuwDgDSFz9U64lI6MmLNL8it6ZFbA+sd2cRjh4oIfALw X-Received: by 2002:a17:906:578b:: with SMTP id k11mr7303610ejq.330.1606477054678; Fri, 27 Nov 2020 03:37:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606477054; cv=none; d=google.com; s=arc-20160816; b=UW1gHLhesDHlyZiRLNJP/7iVc9ck+MDoda/7D67QXIVJ0ycNj9XikYAY87xayLJ5RT HicMV8zZMyiozXSty4bD1xqtcv2FIh5j0D84uBalOSRMyDjtzaX2e1Ph+omD36kucqdc 35sg8cTDb58PdWMCC3frYd/AkFuA5WAbWTwdpMh38ccqWDkMnw8ynf99LmNLsp+JPHSy 85UM3Z+AaXH1CcUdcgRwUJxQmgAnAwcaF6+vKv4JruvLPfAQSjGffOUDcC4US4afoWps CrBxW+/jxBLqX4rXUSjHp1ZU3aNJE7eB2pXvWAP4k7UmRx2Nmz2Hg78xYAuMPNxmMYAr WMzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=ZdB9LlwxqQz7dHn171J9BJbXL72w/Pw1fFMZRi3hAmc=; b=FlEHnJuzoyIdlz0q02DvZpAkiEaQAYTTf8xrp4a87FTFbvGAD1lub0HlLfScPrDKoc Aey/tGl2jAWh/rOkslKX8CRl0+fBSlG2WfPGMGHhbO41SvoyKaKSYxGEaKK3QHFZY7gp 0J9UH7BMUy88t1P9TUIfjx0zO1lF8naAo+WFwBWVZc9SyB9/R62EMcuOmsfNVfoDKnZt 4e02MlzAtvNqjEfldiO8k0dLl99GZgLm7D/TwORYQ3IHqhXV/BtdgFdH4BBC/Fga38Ps zWYIJKd2ew3TT2pCZ5Zzdu2aWQkQK4r4iARXuxzzE3Z3Um0z3YIvy2/pkLsxuPdA5ZVd eUhg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-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 l2si1958598ede.232.2020.11.27.03.37.11; Fri, 27 Nov 2020 03:37:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729330AbgK0LeL (ORCPT + 99 others); Fri, 27 Nov 2020 06:34:11 -0500 Received: from mx2.suse.de ([195.135.220.15]:51620 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729256AbgK0LeK (ORCPT ); Fri, 27 Nov 2020 06:34:10 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 58FC1ADCD; Fri, 27 Nov 2020 11:34:08 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id CC8341E1328; Fri, 27 Nov 2020 12:34:07 +0100 (CET) From: Jan Kara To: Ted Tso Cc: , Jan Kara Subject: [PATCH 09/12] ext4: Drop sync argument of ext4_commit_super() Date: Fri, 27 Nov 2020 12:34:02 +0100 Message-Id: <20201127113405.26867-10-jack@suse.cz> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20201127113405.26867-1-jack@suse.cz> References: <20201127113405.26867-1-jack@suse.cz> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Everybody passes 1 as sync argument of ext4_commit_super(). Just drop it. Signed-off-by: Jan Kara --- fs/ext4/super.c | 47 ++++++++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 73a09b73fc11..aae12ea1466a 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -65,7 +65,7 @@ static struct ratelimit_state ext4_mount_msg_ratelimit; static int ext4_load_journal(struct super_block *, struct ext4_super_block *, unsigned long journal_devnum); static int ext4_show_options(struct seq_file *seq, struct dentry *root); -static int ext4_commit_super(struct super_block *sb, int sync); +static int ext4_commit_super(struct super_block *sb); static int ext4_mark_recovery_complete(struct super_block *sb, struct ext4_super_block *es); static int ext4_clear_journal_err(struct super_block *sb, @@ -621,7 +621,7 @@ static void save_error_info(struct super_block *sb, int error, { __save_error_info(sb, error, ino, block, func, line); if (!bdev_read_only(sb->s_bdev)) - ext4_commit_super(sb, 1); + ext4_commit_super(sb); } /* Deal with the reporting of failure conditions on a filesystem such as @@ -686,7 +686,7 @@ static void flush_stashed_error_work(struct work_struct *work) struct ext4_sb_info *sbi = container_of(work, struct ext4_sb_info, s_error_work); - ext4_commit_super(sbi->s_sb, 1); + ext4_commit_super(sbi->s_sb); } #define ext4_error_ratelimit(sb) \ @@ -1151,7 +1151,7 @@ static void ext4_put_super(struct super_block *sb) es->s_state = cpu_to_le16(sbi->s_mount_state); } if (!sb_rdonly(sb)) - ext4_commit_super(sb, 1); + ext4_commit_super(sb); rcu_read_lock(); group_desc = rcu_dereference(sbi->s_group_desc); @@ -2641,7 +2641,7 @@ static int ext4_setup_super(struct super_block *sb, struct ext4_super_block *es, if (sbi->s_journal) ext4_set_feature_journal_needs_recovery(sb); - err = ext4_commit_super(sb, 1); + err = ext4_commit_super(sb); done: if (test_opt(sb, DEBUG)) printk(KERN_INFO "[EXT4 FS bs=%lu, gc=%u, " @@ -4862,7 +4862,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) if (DUMMY_ENCRYPTION_ENABLED(sbi) && !sb_rdonly(sb) && !ext4_has_feature_encrypt(sb)) { ext4_set_feature_encrypt(sb); - ext4_commit_super(sb, 1); + ext4_commit_super(sb); } /* @@ -5415,7 +5415,7 @@ static int ext4_load_journal(struct super_block *sb, es->s_journal_dev = cpu_to_le32(journal_devnum); /* Make sure we flush the recovery flag to disk. */ - ext4_commit_super(sb, 1); + ext4_commit_super(sb); } return 0; @@ -5425,7 +5425,7 @@ static int ext4_load_journal(struct super_block *sb, return err; } -static int ext4_commit_super(struct super_block *sb, int sync) +static int ext4_commit_super(struct super_block *sb) { struct ext4_sb_info *sbi = EXT4_SB(sb); struct ext4_super_block *es = EXT4_SB(sb)->s_es; @@ -5502,8 +5502,7 @@ static int ext4_commit_super(struct super_block *sb, int sync) BUFFER_TRACE(sbh, "marking dirty"); ext4_superblock_csum_set(sb); - if (sync) - lock_buffer(sbh); + lock_buffer(sbh); if (buffer_write_io_error(sbh) || !buffer_uptodate(sbh)) { /* * Oh, dear. A previous attempt to write the @@ -5519,16 +5518,14 @@ static int ext4_commit_super(struct super_block *sb, int sync) set_buffer_uptodate(sbh); } mark_buffer_dirty(sbh); - if (sync) { - unlock_buffer(sbh); - error = __sync_dirty_buffer(sbh, - REQ_SYNC | (test_opt(sb, BARRIER) ? REQ_FUA : 0)); - if (buffer_write_io_error(sbh)) { - ext4_msg(sb, KERN_ERR, "I/O error while writing " - "superblock"); - clear_buffer_write_io_error(sbh); - set_buffer_uptodate(sbh); - } + unlock_buffer(sbh); + error = __sync_dirty_buffer(sbh, + REQ_SYNC | (test_opt(sb, BARRIER) ? REQ_FUA : 0)); + if (buffer_write_io_error(sbh)) { + ext4_msg(sb, KERN_ERR, "I/O error while writing " + "superblock"); + clear_buffer_write_io_error(sbh); + set_buffer_uptodate(sbh); } return error; } @@ -5559,7 +5556,7 @@ static int ext4_mark_recovery_complete(struct super_block *sb, if (ext4_has_feature_journal_needs_recovery(sb) && sb_rdonly(sb)) { ext4_clear_feature_journal_needs_recovery(sb); - ext4_commit_super(sb, 1); + ext4_commit_super(sb); } out: jbd2_journal_unlock_updates(journal); @@ -5601,7 +5598,7 @@ static int ext4_clear_journal_err(struct super_block *sb, EXT4_SB(sb)->s_mount_state |= EXT4_ERROR_FS; es->s_state |= cpu_to_le16(EXT4_ERROR_FS); - ext4_commit_super(sb, 1); + ext4_commit_super(sb); jbd2_journal_clear_err(journal); jbd2_journal_update_sb_errno(journal); @@ -5703,7 +5700,7 @@ static int ext4_freeze(struct super_block *sb) ext4_clear_feature_journal_needs_recovery(sb); } - error = ext4_commit_super(sb, 1); + error = ext4_commit_super(sb); out: if (journal) /* we rely on upper layer to stop further updates */ @@ -5725,7 +5722,7 @@ static int ext4_unfreeze(struct super_block *sb) ext4_set_feature_journal_needs_recovery(sb); } - ext4_commit_super(sb, 1); + ext4_commit_super(sb); return 0; } @@ -5985,7 +5982,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) } if (sbi->s_journal == NULL && !(old_sb_flags & SB_RDONLY)) { - err = ext4_commit_super(sb, 1); + err = ext4_commit_super(sb); if (err) goto restore_opts; } -- 2.16.4