All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chen Gang <gang.chen.5i5j@gmail.com>
To: Theodore Ts'o <tytso@mit.edu>, Andreas Dilger <adilger.kernel@dilger.ca>
Cc: linux-ext4@vger.kernel.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH] fs/ext4/super.c: Let 'counters' switched by SMP
Date: Tue, 15 Jul 2014 09:05:29 +0800	[thread overview]
Message-ID: <53C47E59.8030502@gmail.com> (raw)

When SMP is disabled, 'struct percpu_counter' has no 'counters' member,
so need skip it when in !SMP.

The related git commit:

  "feab139 ext4: rearrange initialization to fix EXT4FS_DEBUG".

The related error (with allmodconfig under score):

    CC [M]  fs/ext4/super.o
  fs/ext4/super.c: In function 'ext4_commit_super':
  fs/ext4/super.c:4546:41: error: 'struct percpu_counter' has no member named 'counters'
    if (EXT4_SB(sb)->s_freeclusters_counter.counters)
                                           ^
  fs/ext4/super.c:4550:39: error: 'struct percpu_counter' has no member named 'counters'
    if (EXT4_SB(sb)->s_freeinodes_counter.counters)
                                         ^

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
---
 fs/ext4/super.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 30767cd..3cd4fe1 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -4543,11 +4543,15 @@ static int ext4_commit_super(struct super_block *sb, int sync)
 	else
 		es->s_kbytes_written =
 			cpu_to_le64(EXT4_SB(sb)->s_kbytes_written);
+#ifdef CONFIG_SMP
 	if (EXT4_SB(sb)->s_freeclusters_counter.counters)
+#endif
 		ext4_free_blocks_count_set(es,
 			EXT4_C2B(EXT4_SB(sb), percpu_counter_sum_positive(
 				&EXT4_SB(sb)->s_freeclusters_counter)));
+#ifdef CONFIG_SMP
 	if (EXT4_SB(sb)->s_freeinodes_counter.counters)
+#endif
 		es->s_free_inodes_count =
 			cpu_to_le32(percpu_counter_sum_positive(
 				&EXT4_SB(sb)->s_freeinodes_counter));
-- 
1.9.2.459.g68773ac

             reply	other threads:[~2014-07-15  1:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-15  1:05 Chen Gang [this message]
2014-07-15  9:31 ` [PATCH] fs/ext4/super.c: Let 'counters' switched by SMP Theodore Ts'o
2014-07-15 10:06   ` Chen Gang
2014-07-21 17:40   ` Olof Johansson
2014-07-21 19:11     ` Theodore Ts'o
2014-07-23 22:55       ` David Rientjes

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=53C47E59.8030502@gmail.com \
    --to=gang.chen.5i5j@gmail.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@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.