Skip to contentSkip to conversation

ext4: FLEX_BG Kernel support v2.

PATCH In review Jose R. Santos 3 participants 4 messages Sep 21, 2007 ext4 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ext4: FLEX_BG Kernel support v2.

From: Jose R. Santos <[email protected]>

ext4: FLEX_BG Kernel support v2.

This feature relaxes check restrictions on where each block groups meta data is located within the storage media. This allows for the allocation of bitmaps or inode tables outside the block group boundaries in cases where bad blocks forces us to look for new blocks which the owning block group can not satisfy. This will also allow for new meta-data allocation schemes to improve performance and scalability.

--

 fs/ext4/super.c         |    9 +++++++--
 include/linux/ext4_fs.h |    4 +++-
 2 files changed, 10 insertions(+), 3 deletions(-)
fs/ext4/super.c +7 -2
index 4550b83..dbce81d 100644
@@ -1248,13 +1248,17 @@ static int ext4_check_descriptors (struct super_block * sb)
 	ext4_fsblk_t inode_table;
 	struct ext4_group_desc * gdp = NULL;
 	int desc_block = 0;
+	int flexbg_flag = 0;
 	int i;
 
+	if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_FLEX_BG))
+		flexbg_flag = 1;
+
 	ext4_debug ("Checking group descriptors");
 
 	for (i = 0; i < sbi->s_groups_count; i++)
 	{
-		if (i == sbi->s_groups_count - 1)
+		if (i == sbi->s_groups_count - 1 || flexbg_flag)
 			last_block = ext4_blocks_count(sbi->s_es) - 1;
 		else
 			last_block = first_block +
@@ -1291,7 +1295,8 @@ static int ext4_check_descriptors (struct super_block * sb)
 				    i, inode_table);
 			return 0;
 		}
-		first_block += EXT4_BLOCKS_PER_GROUP(sb);
+		if (!flexbg_flag)
+			first_block += EXT4_BLOCKS_PER_GROUP(sb);
 		gdp = (struct ext4_group_desc *)
 			((__u8 *)gdp + EXT4_DESC_SIZE(sb));
 	}
include/linux/ext4_fs.h +3 -1
index cdee7aa..d53e167 100644
@@ -702,13 +702,15 @@ static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino)
 #define EXT4_FEATURE_INCOMPAT_META_BG		0x0010
 #define EXT4_FEATURE_INCOMPAT_EXTENTS		0x0040 /* extents support */
 #define EXT4_FEATURE_INCOMPAT_64BIT		0x0080
+#define EXT4_FEATURE_INCOMPAT_FLEX_BG		0x0200
 
 #define EXT4_FEATURE_COMPAT_SUPP	EXT2_FEATURE_COMPAT_EXT_ATTR
 #define EXT4_FEATURE_INCOMPAT_SUPP	(EXT4_FEATURE_INCOMPAT_FILETYPE| \
 					 EXT4_FEATURE_INCOMPAT_RECOVER| \
 					 EXT4_FEATURE_INCOMPAT_META_BG| \
 					 EXT4_FEATURE_INCOMPAT_EXTENTS| \
-					 EXT4_FEATURE_INCOMPAT_64BIT)
+					 EXT4_FEATURE_INCOMPAT_64BIT| \
+					 EXT4_FEATURE_INCOMPAT_FLEX_BG)
 #define EXT4_FEATURE_RO_COMPAT_SUPP	(EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER| \
 					 EXT4_FEATURE_RO_COMPAT_LARGE_FILE| \
 					 EXT4_FEATURE_RO_COMPAT_DIR_NLINK | \
#1 lore raw

include/linux/ext4_fs.h static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino) · line 705

Quoted 10 lines · Jose R. Santos

From: Jose R. Santos <[email protected]>

ext4: FLEX_BG Kernel support v2.

include/linux/ext4_fs.h +1 -0
@@ -702,13 +702,15 @@ static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino)
 #define EXT4_FEATURE_INCOMPAT_META_BG		0x0010
 #define EXT4_FEATURE_INCOMPAT_EXTENTS		0x0040 /* extents support */
 #define EXT4_FEATURE_INCOMPAT_64BIT		0x0080
+#define EXT4_FEATURE_INCOMPAT_FLEX_BG		0x0200

Any reason why 0x100 is skipped ?

Thanks,
Badari

#2 lore raw
Quoted 14 lines · On Fri, 21 Sep 2007 13:29:27 -0700 Badari Pulavarty <[email protected]> wrote:

include/linux/ext4_fs.h static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino) · line 705

Quoted 10 lines · Jose R. Santos

From: Jose R. Santos <[email protected]>

ext4: FLEX_BG Kernel support v2.

include/linux/ext4_fs.h +1 -0
@@ -702,13 +702,15 @@ static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino)
 #define EXT4_FEATURE_INCOMPAT_META_BG		0x0010
 #define EXT4_FEATURE_INCOMPAT_EXTENTS		0x0040 /* extents support */
 #define EXT4_FEATURE_INCOMPAT_64BIT		0x0080
+#define EXT4_FEATURE_INCOMPAT_FLEX_BG		0x0200

Any reason why 0x100 is skipped ?

Quoted 3 lines

Thanks,
Badari

Because 0x0100 is reserved for EXT4_FEATURE_INCOMPAT_MMP in e2fsprogs.

-JRS

#3 lore raw
Quoted 15 lines · Jose R. Santos
Quoted 12 lines · On Fri, 21 Sep 2007 13:29:27 -0700 Badari Pulavarty <[email protected]> wrote:

include/linux/ext4_fs.h static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino) · line 705

Quoted 9 lines · Jose R. Santos

From: Jose R. Santos <[email protected]>

ext4: FLEX_BG Kernel support v2.

include/linux/ext4_fs.h +1 -0
@@ -702,13 +702,15 @@ static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino)
 #define EXT4_FEATURE_INCOMPAT_META_BG		0x0010
 #define EXT4_FEATURE_INCOMPAT_EXTENTS		0x0040 /* extents support */
 #define EXT4_FEATURE_INCOMPAT_64BIT		0x0080
+#define EXT4_FEATURE_INCOMPAT_FLEX_BG		0x0200

Any reason why 0x100 is skipped ?

Quoted 5 lines
Quoted 3 lines

Thanks,
Badari

Because 0x0100 is reserved for EXT4_FEATURE_INCOMPAT_MMP in e2fsprogs.

and we know that how? :) I'd at least put a comment into the kernel code so it doesn't get taken, later.

-Eric