Skip to content

Commit 404615d

Browse files
committed
ext2: Drop fragment support
Ext2 has fields in superblock reserved for subblock allocation support. However that never landed. Drop the many years dead code. Reported-by: [email protected] Signed-off-by: Jan Kara <[email protected]>
1 parent d6a95db commit 404615d

File tree

2 files changed

+4
-31
lines changed

2 files changed

+4
-31
lines changed

fs/ext2/ext2.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,7 @@ struct mb_cache;
7070
* second extended-fs super-block data in memory
7171
*/
7272
struct ext2_sb_info {
73-
unsigned long s_frag_size; /* Size of a fragment in bytes */
74-
unsigned long s_frags_per_block;/* Number of fragments per block */
7573
unsigned long s_inodes_per_block;/* Number of inodes per block */
76-
unsigned long s_frags_per_group;/* Number of fragments in a group */
7774
unsigned long s_blocks_per_group;/* Number of blocks in a group */
7875
unsigned long s_inodes_per_group;/* Number of inodes in a group */
7976
unsigned long s_itb_per_group; /* Number of inode table blocks per group */
@@ -188,15 +185,6 @@ static inline struct ext2_sb_info *EXT2_SB(struct super_block *sb)
188185
#define EXT2_INODE_SIZE(s) (EXT2_SB(s)->s_inode_size)
189186
#define EXT2_FIRST_INO(s) (EXT2_SB(s)->s_first_ino)
190187

191-
/*
192-
* Macro-instructions used to manage fragments
193-
*/
194-
#define EXT2_MIN_FRAG_SIZE 1024
195-
#define EXT2_MAX_FRAG_SIZE 4096
196-
#define EXT2_MIN_FRAG_LOG_SIZE 10
197-
#define EXT2_FRAG_SIZE(s) (EXT2_SB(s)->s_frag_size)
198-
#define EXT2_FRAGS_PER_BLOCK(s) (EXT2_SB(s)->s_frags_per_block)
199-
200188
/*
201189
* Structure of a blocks group descriptor
202190
*/

fs/ext2/super.c

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -668,10 +668,9 @@ static int ext2_setup_super (struct super_block * sb,
668668
es->s_max_mnt_count = cpu_to_le16(EXT2_DFL_MAX_MNT_COUNT);
669669
le16_add_cpu(&es->s_mnt_count, 1);
670670
if (test_opt (sb, DEBUG))
671-
ext2_msg(sb, KERN_INFO, "%s, %s, bs=%lu, fs=%lu, gc=%lu, "
671+
ext2_msg(sb, KERN_INFO, "%s, %s, bs=%lu, gc=%lu, "
672672
"bpg=%lu, ipg=%lu, mo=%04lx]",
673673
EXT2FS_VERSION, EXT2FS_DATE, sb->s_blocksize,
674-
sbi->s_frag_size,
675674
sbi->s_groups_count,
676675
EXT2_BLOCKS_PER_GROUP(sb),
677676
EXT2_INODES_PER_GROUP(sb),
@@ -1012,14 +1011,7 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
10121011
}
10131012
}
10141013

1015-
sbi->s_frag_size = EXT2_MIN_FRAG_SIZE <<
1016-
le32_to_cpu(es->s_log_frag_size);
1017-
if (sbi->s_frag_size == 0)
1018-
goto cantfind_ext2;
1019-
sbi->s_frags_per_block = sb->s_blocksize / sbi->s_frag_size;
1020-
10211014
sbi->s_blocks_per_group = le32_to_cpu(es->s_blocks_per_group);
1022-
sbi->s_frags_per_group = le32_to_cpu(es->s_frags_per_group);
10231015
sbi->s_inodes_per_group = le32_to_cpu(es->s_inodes_per_group);
10241016

10251017
sbi->s_inodes_per_block = sb->s_blocksize / EXT2_INODE_SIZE(sb);
@@ -1045,11 +1037,10 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
10451037
goto failed_mount;
10461038
}
10471039

1048-
if (sb->s_blocksize != sbi->s_frag_size) {
1040+
if (es->s_log_frag_size != es->s_log_block_size) {
10491041
ext2_msg(sb, KERN_ERR,
1050-
"error: fragsize %lu != blocksize %lu"
1051-
"(not supported yet)",
1052-
sbi->s_frag_size, sb->s_blocksize);
1042+
"error: fragsize log %u != blocksize log %u",
1043+
le32_to_cpu(es->s_log_frag_size), sb->s_blocksize_bits);
10531044
goto failed_mount;
10541045
}
10551046

@@ -1066,12 +1057,6 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
10661057
sbi->s_blocks_per_group, sbi->s_inodes_per_group + 3);
10671058
goto failed_mount;
10681059
}
1069-
if (sbi->s_frags_per_group > sb->s_blocksize * 8) {
1070-
ext2_msg(sb, KERN_ERR,
1071-
"error: #fragments per group too big: %lu",
1072-
sbi->s_frags_per_group);
1073-
goto failed_mount;
1074-
}
10751060
if (sbi->s_inodes_per_group < sbi->s_inodes_per_block ||
10761061
sbi->s_inodes_per_group > sb->s_blocksize * 8) {
10771062
ext2_msg(sb, KERN_ERR,

0 commit comments

Comments
 (0)