[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201118153947.3394530-51-saranyamohan@google.com>
Date: Wed, 18 Nov 2020 07:39:36 -0800
From: Saranya Muruganandam <saranyamohan@...gle.com>
To: linux-ext4@...r.kernel.org, tytso@....edu
Cc: adilger.kernel@...ger.ca, Wang Shilong <wshilong@....com>,
jenkins <devops@...mcloud.com>, Maloo <maloo@...mcloud.com>,
Andreas Dilger <adilger@...mcloud.com>,
Saranya Muruganandam <saranyamohan@...gle.com>
Subject: [RFC PATCH v3 50/61] e2fsck: move ext2fs_get_avg_group to rw_bitmaps.c
From: Wang Shilong <wshilong@....com>
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 <wshilong@....com>
Change-Id: Ia7d372b7b5aadcbf5d94916f6f67363a2a9f0bfa
Reviewed-on: https://review.whamcloud.com/40060
Tested-by: jenkins <devops@...mcloud.com>
Tested-by: Maloo <maloo@...mcloud.com>
Reviewed-by: Andreas Dilger <adilger@...mcloud.com>
Signed-off-by: Saranya Muruganandam <saranyamohan@...gle.com>
---
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
Powered by blists - more mailing lists