Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1262804pxu; Fri, 27 Nov 2020 03:39:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJxjlhoRN7ykwnUpVVv6/wTGwtLjzZ8IP+yXGNPdrEeb/70zKw9SrRFAZs+L/NtPuzvhd/bs X-Received: by 2002:a50:d6c6:: with SMTP id l6mr7221179edj.80.1606477162669; Fri, 27 Nov 2020 03:39:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606477162; cv=none; d=google.com; s=arc-20160816; b=FmSf9LWBLxHkcfIlAVoWPJlliIN2jGuWOTG6ZVEHuK4TpUGgBNT6dKCA8tB+xrCL/V sPAXY5FAkq8A9LpZthvi2Ozhrd7O9X9vG7yn5VdAAJ7dS5b+BTj3X2363RYMvNNm0J5S X/xulyRFPZJkZGMZ9yzPy5CimW61PZJEFF4fuq30V1iZtWSQ7uaX/2lWTUNI3DMSe2UG WKGjVRL739o12Msbk1Aky4/wfn6PnWmGtoejfsaCrV133qypNM/iqFGGhCrCA9Vd7b3a pVyoLFP+WD9ymFzqhOlq6a3wfD8nN4A7ULNcXc28z4DBz8toGXh3kxLXX+0/aCSKspJZ 7kXQ== 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=tjA09m7itrG6KiTOWiurOIArbqaxS/Z+QFnw6UOve+c=; b=UhVNfapxgbjKdEhNiFFWe3QCt4RHvmCbe8v9KGFjS4PM+4bAca2Kymv886j9Jyg0Zq VxTQxOUloi9Hyb4ufmvMM0iQz0pDS6dgH2oT9GUToiUeGjWhgeSFxR4WrM1MCDxvvevC ZAqqIPWPYZQSuEY/Kl5HskwepKIHlckditDVLD8kKUpIl7DQWTWIplN2QC+aCH6S38QT FigOkVbXlJT7dxt60HQTwcIrbESg5aNjzyTBkFrFe3iFwqgKBfz3UFtwmdQI4PZY/ssX vNMsyGr0JMFfAkT9PSa2O94asSANQWqkvTTqt7hg8zHfXw2+QggURkQNWi+lM8324dQq aoZA== 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 c26si4448652edv.182.2020.11.27.03.38.59; Fri, 27 Nov 2020 03:39:22 -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 S1727737AbgK0LeK (ORCPT + 99 others); Fri, 27 Nov 2020 06:34:10 -0500 Received: from mx2.suse.de ([195.135.220.15]:51624 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729274AbgK0LeK (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 5DE16ADD8; Fri, 27 Nov 2020 11:34:08 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id D8C941E132E; Fri, 27 Nov 2020 12:34:07 +0100 (CET) From: Jan Kara To: Ted Tso Cc: , Jan Kara Subject: [PATCH 12/12] ext4: Use sbi instead of EXT4_SB(sb) in ext4_update_super() Date: Fri, 27 Nov 2020 12:34:05 +0100 Message-Id: <20201127113405.26867-13-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 No behavioral change. Signed-off-by: Jan Kara --- 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 51670258ef84..3030a02304ef 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -5467,8 +5467,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); /* @@ -5485,21 +5485,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