From patchwork Tue Jul 15 01:05:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Gang X-Patchwork-Id: 369817 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 499C8140142 for ; Tue, 15 Jul 2014 11:05:49 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753448AbaGOBFf (ORCPT ); Mon, 14 Jul 2014 21:05:35 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:62213 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753241AbaGOBFe (ORCPT ); Mon, 14 Jul 2014 21:05:34 -0400 Received: by mail-pa0-f48.google.com with SMTP id et14so838686pad.21 for ; Mon, 14 Jul 2014 18:05:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; bh=gAQA2i7BU1n4ITJaLEa4UEbYI0Di8ah/3RBJfpEweq8=; b=ZFMvmNcA4UxdkkpmghAlC2T7HNoqjHyWlveC0vQ2cgIL5tN2ApnOipd2EhqzRUr+91 yenCy+GxNWx/YvZJDAqVyp67rbQqQ9KwSFBfQvMWgukRn6m7v3rQvzJAkZjy/8fJNze8 PDoKO6PW1h0WQ9aUMyGJAaNWmJ2Bd9gljCnP3y6MXcZC2F03XNsRxibGoktIVxctKwMO zane9b1swY2GbL/AWf4aMHecYqF0qJnvXGz2JnhqJnBYwbuvY6VP9pJ0SZ4AnqQiJR+L QAPJooODF4pXgq9x3JWUEfWzQvdUUpOeGibES3qk1TIGFZ573RE+6it6sPPXCgchwO1/ Bfdg== X-Received: by 10.66.161.69 with SMTP id xq5mr19517023pab.62.1405386333884; Mon, 14 Jul 2014 18:05:33 -0700 (PDT) Received: from [192.168.1.23] ([124.127.118.42]) by mx.google.com with ESMTPSA id o10sm4546816pdm.29.2014.07.14.18.05.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 14 Jul 2014 18:05:33 -0700 (PDT) Message-ID: <53C47E59.8030502@gmail.com> Date: Tue, 15 Jul 2014 09:05:29 +0800 From: Chen Gang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Theodore Ts'o , Andreas Dilger CC: linux-ext4@vger.kernel.org, "linux-kernel@vger.kernel.org" Subject: [PATCH] fs/ext4/super.c: Let 'counters' switched by SMP Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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 --- 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));