Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp415089pxb; Wed, 18 Nov 2020 07:44:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJzhH4/xf/5ue+gV321cL2yyTypHPDKS5D6SINoiu2rzEQIj1+UxXW2lDG00jrPhVzZOFHCh X-Received: by 2002:a17:906:4116:: with SMTP id j22mr24009204ejk.373.1605714256662; Wed, 18 Nov 2020 07:44:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605714256; cv=none; d=google.com; s=arc-20160816; b=SVSPYjSD7BYKruW7YYe8N5NUrpXjrwBmnW4xkFJrLxPBMNd4yFBkgmiO3kzFmQgJHL BpDAlK+A5+gz/899zCCqT8ngjaXghUb1RF0etmegXPAtFuFlrE4Duue5an9d7HviHQ27 jGt3L2bnZqEbpYpNhM9maUUjqnAKxzB4T0+25dueuXqbVLSZPpMLKD3voO49qw2ItlS+ g68aa+Crv9KXNDbw5YvcWh87t/+NcJwvAWDfXIek/WGvq/wztioVVAZdAqozv4p+mTOa Z1+gLL+ufra+V8qAuOo2KgRpHqNO01S1xlYFP2wFe0+9syNXTcPwNajUMVsupUOZNVl3 Peiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:sender:dkim-signature; bh=uaDW3e45uHJQl6bXyNwdqfI0txtMN4R0imzv8FDVqaE=; b=fPKNtwHKNV+WpWeu0/a1cL527p/V+NjOHa+8X7JmjpCA1gRv9gELqNPXrhZW+gu9tv hIhyH/3KaEuruv5BYSMlE+W81vEQbahmdTszyVzGqQFVkSQDH8bTVo8IDmMy2NrDm0V7 B/Ri/AfWsb0fY5MmowkTDvjo/RlJsXCl3YzSILk86YWLos80ZUtT8P/27Gl3oF4l8qgx j+pfdBf9zlXZrwjlpgAYVfmjO3cmGVEo4tcIi/j0Hu36SaXSO3yNj2geBNE407ilsbWA nocg3jzS43GMBfJBi4K5Dj+DMOKecmQ3x8jHOsz/gghyvP5TDuWdJTAwMoRwNpJWt8ZM biNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=SZ3nQjcF; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v3si14381989eje.479.2020.11.18.07.43.53; Wed, 18 Nov 2020 07:44:16 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=SZ3nQjcF; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727618AbgKRPmB (ORCPT + 99 others); Wed, 18 Nov 2020 10:42:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727608AbgKRPmA (ORCPT ); Wed, 18 Nov 2020 10:42:00 -0500 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 820EFC0613D4 for ; Wed, 18 Nov 2020 07:42:00 -0800 (PST) Received: by mail-yb1-xb4a.google.com with SMTP id u37so2943100ybi.15 for ; Wed, 18 Nov 2020 07:42:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=uaDW3e45uHJQl6bXyNwdqfI0txtMN4R0imzv8FDVqaE=; b=SZ3nQjcFUO1GhfYRA8oGh7U5oXDMKJLyQLT+8/KawAuY0VhJ0vkfBiN8U5ZxsM/6nP 3WgkzPmSVmpOQ2LhD9HeOracNyKrCGgzE/JxswH8DTUv1ahuPt/pUEtN7IOsx3PeyCR3 KAkDIdG1tOHNZ4WFfpEtV7bIC2hfkB0B/u+ITtCmKIQVAdbgwlRvenKZy/sjVDCMwzss 82AfWyqdNnOm3tT8oZo1tKyJlStL06MbdslxV8h0/JKMOPyN28QPsnz5slTWs4JxkTUx EpFNDbdFNN4hcd/eaU7okWaUeyV2t+IxjTZ4bDW+3TRWydnUo9deEQMN2ZUuCyojs+BK pESw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=uaDW3e45uHJQl6bXyNwdqfI0txtMN4R0imzv8FDVqaE=; b=UDZuOKh3wwEcASxp8Zl8AiIYJe5nfY4HE+FqK8CPYG1PM1hycgdgq4CKUlIXH5XBrY /5Z7NcrpIal688aR2wRgLbtPluwYh+fbm7YmzpwzqzCJuaJd9Y5jbuCVEeGfyAdpo+Ei pqh4puraQvIlKaeCMhTmM8lL+nyY8uMtIwTvM1EquCYgzBUq6ZO7ss864df+QelQH2h1 7GHJ3tDOChrgBdi5JVrDKCcWu2lDR9KSz/hiEHFyloMc6MRdKObOhgH/h2D0MmaDsTxe PvLf9C4ry6ek4kJMXbVK3ab26V/AQbYjqyjZEYW6xIa3qng58aUKgyljHlP66xINWw9H 42qw== X-Gm-Message-State: AOAM533Y0v1lP5LS17IzVH0BDR6a1ph7Igfq8ed4q0R+jTp7Ge/Oe1Ds 1J7q6CJsD9iaZm16q3fl8Z3erB1hE8kKuxrcWZWy1rPBl4VV9Walj6NhNkbt6zcbguTgYX7rOBm ZzsfwEo1Pm/gkat4Qq+2qsSkZ23LrWoxYk9V1OgGOm344GcqUCF2Yae/m25DM3yW22F6/+htvUO AB0BYi+II= Sender: "saranyamohan via sendgmr" X-Received: from saranyamohan.svl.corp.google.com ([100.116.76.178]) (user=saranyamohan job=sendgmr) by 2002:a25:2e0d:: with SMTP id u13mr7449724ybu.247.1605714119662; Wed, 18 Nov 2020 07:41:59 -0800 (PST) Date: Wed, 18 Nov 2020 07:39:36 -0800 In-Reply-To: <20201118153947.3394530-1-saranyamohan@google.com> Message-Id: <20201118153947.3394530-51-saranyamohan@google.com> Mime-Version: 1.0 References: <20201118153947.3394530-1-saranyamohan@google.com> X-Mailer: git-send-email 2.29.2.299.gdc1121823c-goog Subject: [RFC PATCH v3 50/61] e2fsck: move ext2fs_get_avg_group to rw_bitmaps.c From: Saranya Muruganandam To: linux-ext4@vger.kernel.org, tytso@mit.edu Cc: adilger.kernel@dilger.ca, Wang Shilong , jenkins , Maloo , Andreas Dilger , Saranya Muruganandam Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Wang Shilong A bounch of ext2fs_get_avg_group() unused warning messages are annoying, move it to rw_bitmaps.c to make gcc happy. Signed-off-by: Wang Shilong Change-Id: Ia7d372b7b5aadcbf5d94916f6f67363a2a9f0bfa Reviewed-on: https://review.whamcloud.com/40060 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Signed-off-by: Saranya Muruganandam --- lib/ext2fs/ext2fs.h | 29 +---------------------------- lib/ext2fs/rw_bitmaps.c | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/lib/ext2fs/ext2fs.h b/lib/ext2fs/ext2fs.h index 83f2af07..616c9412 100644 --- a/lib/ext2fs/ext2fs.h +++ b/lib/ext2fs/ext2fs.h @@ -2122,34 +2122,7 @@ ext2fs_const_inode(const struct ext2_inode_large * large_inode) return (const struct ext2_inode *) large_inode; } -static dgrp_t ext2fs_get_avg_group(ext2_filsys fs) -{ -#ifdef CONFIG_PFSCK - dgrp_t average_group; - unsigned flexbg_size; - - if (fs->fs_num_threads <= 1) - return fs->group_desc_count; - - average_group = fs->group_desc_count / fs->fs_num_threads; - if (average_group <= 1) - return 1; - - if (ext2fs_has_feature_flex_bg(fs->super)) { - int times = 1; - - flexbg_size = 1 << fs->super->s_log_groups_per_flex; - if (average_group % flexbg_size) { - times = average_group / flexbg_size; - average_group = times * flexbg_size; - } - } - - return average_group; -#else - return fs->group_desc_count; -#endif -} +dgrp_t ext2fs_get_avg_group(ext2_filsys fs); #undef _INLINE_ #endif diff --git a/lib/ext2fs/rw_bitmaps.c b/lib/ext2fs/rw_bitmaps.c index 960a6913..95de9b1c 100644 --- a/lib/ext2fs/rw_bitmaps.c +++ b/lib/ext2fs/rw_bitmaps.c @@ -515,6 +515,31 @@ struct read_bitmaps_thread_info { io_channel rbt_io; }; +dgrp_t ext2fs_get_avg_group(ext2_filsys fs) +{ + dgrp_t average_group; + unsigned flexbg_size; + + if (fs->fs_num_threads <= 1) + return fs->group_desc_count; + + average_group = fs->group_desc_count / fs->fs_num_threads; + if (average_group <= 1) + return 1; + + if (ext2fs_has_feature_flex_bg(fs->super)) { + int times = 1; + + flexbg_size = 1 << fs->super->s_log_groups_per_flex; + if (average_group % flexbg_size) { + times = average_group / flexbg_size; + average_group = times * flexbg_size; + } + } + + return average_group; +} + static void* read_bitmaps_thread(void *data) { struct read_bitmaps_thread_info *rbt = data; -- 2.29.2.299.gdc1121823c-goog