[RFC PATCH v3 50/61] e2fsck: move ext2fs_get_avg_group to rw_bitmaps.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Wang Shilong <wshilong@xxxxxxx>

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@xxxxxxx>
Change-Id: Ia7d372b7b5aadcbf5d94916f6f67363a2a9f0bfa
Reviewed-on: https://review.whamcloud.com/40060
Tested-by: jenkins <devops@xxxxxxxxxxxxx>
Tested-by: Maloo <maloo@xxxxxxxxxxxxx>
Reviewed-by: Andreas Dilger <adilger@xxxxxxxxxxxxx>
Signed-off-by: Saranya Muruganandam <saranyamohan@xxxxxxxxxx>
---
 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





[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux