All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Ted Tso <tytso@mit.edu>
Cc: <linux-ext4@vger.kernel.org>,
	harshad shirwadkar <harshadshirwadkar@gmail.com>,
	Jan Kara <jack@suse.cz>
Subject: [PATCH 5/8] ext4: Use sbi instead of EXT4_SB(sb) in ext4_update_super()
Date: Wed, 16 Dec 2020 11:18:41 +0100	[thread overview]
Message-ID: <20201216101844.22917-6-jack@suse.cz> (raw)
In-Reply-To: <20201216101844.22917-1-jack@suse.cz>

No behavioral change.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/ext4/super.c | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 3f6ea48e7b4b..502ae491d07d 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -5470,8 +5470,8 @@ static int ext4_load_journal(struct super_block *sb,
 static void ext4_update_super(struct super_block *sb)
 {
 	struct ext4_sb_info *sbi = EXT4_SB(sb);
-	struct ext4_super_block *es = EXT4_SB(sb)->s_es;
-	struct buffer_head *sbh = EXT4_SB(sb)->s_sbh;
+	struct ext4_super_block *es = sbi->s_es;
+	struct buffer_head *sbh = sbi->s_sbh;
 
 	lock_buffer(sbh);
 	/*
@@ -5488,21 +5488,20 @@ static void ext4_update_super(struct super_block *sb)
 		ext4_update_tstamp(es, s_wtime);
 	if (sb->s_bdev->bd_part)
 		es->s_kbytes_written =
-			cpu_to_le64(EXT4_SB(sb)->s_kbytes_written +
+			cpu_to_le64(sbi->s_kbytes_written +
 			    ((part_stat_read(sb->s_bdev->bd_part,
 					     sectors[STAT_WRITE]) -
-			      EXT4_SB(sb)->s_sectors_written_start) >> 1));
+			      sbi->s_sectors_written_start) >> 1));
 	else
-		es->s_kbytes_written =
-			cpu_to_le64(EXT4_SB(sb)->s_kbytes_written);
-	if (percpu_counter_initialized(&EXT4_SB(sb)->s_freeclusters_counter))
+		es->s_kbytes_written = cpu_to_le64(sbi->s_kbytes_written);
+	if (percpu_counter_initialized(&sbi->s_freeclusters_counter))
 		ext4_free_blocks_count_set(es,
-			EXT4_C2B(EXT4_SB(sb), percpu_counter_sum_positive(
-				&EXT4_SB(sb)->s_freeclusters_counter)));
-	if (percpu_counter_initialized(&EXT4_SB(sb)->s_freeinodes_counter))
+			EXT4_C2B(sbi, percpu_counter_sum_positive(
+				&sbi->s_freeclusters_counter)));
+	if (percpu_counter_initialized(&sbi->s_freeinodes_counter))
 		es->s_free_inodes_count =
 			cpu_to_le32(percpu_counter_sum_positive(
-				&EXT4_SB(sb)->s_freeinodes_counter));
+				&sbi->s_freeinodes_counter));
 	/* Copy error information to the on-disk superblock */
 	spin_lock(&sbi->s_error_lock);
 	if (sbi->s_add_error_count > 0) {
-- 
2.16.4


  parent reply	other threads:[~2020-12-16 10:20 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-16 10:18 [PATCH 0/8 v2 PARTIAL] ext4: Fix error handling Jan Kara
2020-12-16 10:18 ` [PATCH 1/8] ext4: Combine ext4_handle_error() and save_error_info() Jan Kara
2020-12-17 15:50   ` Theodore Y. Ts'o
2020-12-16 10:18 ` [PATCH 2/8] ext4: Drop sync argument of ext4_commit_super() Jan Kara
2020-12-17 15:51   ` Theodore Y. Ts'o
2020-12-16 10:18 ` [PATCH 3/8] ext4: Protect superblock modifications with a buffer lock Jan Kara
2020-12-17 15:56   ` Theodore Y. Ts'o
2020-12-16 10:18 ` [PATCH 4/8] ext4: Save error info to sb through journal if available Jan Kara
2020-12-17 15:58   ` Theodore Y. Ts'o
2020-12-16 10:18 ` Jan Kara [this message]
2020-12-17 15:59   ` [PATCH 5/8] ext4: Use sbi instead of EXT4_SB(sb) in ext4_update_super() Theodore Y. Ts'o
2020-12-16 10:18 ` [PATCH 6/8] ext4: Fix deadlock with fs freezing and EA inodes Jan Kara
2020-12-17 16:01   ` Theodore Y. Ts'o
2020-12-16 10:18 ` [PATCH 7/8] ext4: Fix superblock checksum failure when setting password salt Jan Kara
2020-12-17 16:02   ` Theodore Y. Ts'o
2020-12-16 10:18 ` [PATCH 8/8] ext4: Drop ext4_handle_dirty_super() Jan Kara
2020-12-17 16:08   ` Theodore Y. Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201216101844.22917-6-jack@suse.cz \
    --to=jack@suse.cz \
    --cc=harshadshirwadkar@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.