aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/ext4.h
diff options
context:
space:
mode:
authorJose R. Santos <jrs@us.ibm.com>2008-07-11 19:27:31 -0400
committerTheodore Ts'o <tytso@mit.edu>2008-07-11 19:27:31 -0400
commit772cb7c83ba256a11c7bf99a11bef3858d23767c (patch)
treea42b97e5cbd870a76b2646c2dcb658a92c53f637 /fs/ext4/ext4.h
parent736603ab297506f4396cb5af592004499950fcfd (diff)
ext4: New inode allocation for FLEX_BG meta-data groups.
This patch mostly controls the way inode are allocated in order to make ialloc aware of flex_bg block group grouping. It achieves this by bypassing the Orlov allocator when block group meta-data are packed toghether through mke2fs. Since the impact on the block allocator is minimal, this patch should have little or no effect on other block allocation algorithms. By controlling the inode allocation, it can basically control where the initial search for new block begins and thus indirectly manipulate the block allocator. This allocator favors data and meta-data locality so the disk will gradually be filled from block group zero upward. This helps improve performance by reducing seek time. Since the group of inode tables within one flex_bg are treated as one giant inode table, uninitialized block groups would not need to partially initialize as many inode table as with Orlov which would help fsck time as the filesystem usage goes up. Signed-off-by: Jose R. Santos <jrs@us.ibm.com> Signed-off-by: Valerie Clement <valerie.clement@bull.net> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r--fs/ext4/ext4.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 109c7d4c19ad..0bfeae18f1a2 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -170,6 +170,15 @@ struct ext4_group_desc
170 __u32 bg_reserved2[3]; 170 __u32 bg_reserved2[3];
171}; 171};
172 172
173/*
174 * Structure of a flex block group info
175 */
176
177struct flex_groups {
178 __u32 free_inodes;
179 __u32 free_blocks;
180};
181
173#define EXT4_BG_INODE_UNINIT 0x0001 /* Inode table/bitmap not in use */ 182#define EXT4_BG_INODE_UNINIT 0x0001 /* Inode table/bitmap not in use */
174#define EXT4_BG_BLOCK_UNINIT 0x0002 /* Block bitmap not in use */ 183#define EXT4_BG_BLOCK_UNINIT 0x0002 /* Block bitmap not in use */
175#define EXT4_BG_INODE_ZEROED 0x0004 /* On-disk itable initialized to zero */ 184#define EXT4_BG_INODE_ZEROED 0x0004 /* On-disk itable initialized to zero */
@@ -647,7 +656,10 @@ struct ext4_super_block {
647 __le16 s_mmp_interval; /* # seconds to wait in MMP checking */ 656 __le16 s_mmp_interval; /* # seconds to wait in MMP checking */
648 __le64 s_mmp_block; /* Block for multi-mount protection */ 657 __le64 s_mmp_block; /* Block for multi-mount protection */
649 __le32 s_raid_stripe_width; /* blocks on all data disks (N*stride)*/ 658 __le32 s_raid_stripe_width; /* blocks on all data disks (N*stride)*/
650 __u32 s_reserved[163]; /* Padding to the end of the block */ 659 __u8 s_log_groups_per_flex; /* FLEX_BG group size */
660 __u8 s_reserved_char_pad2;
661 __le16 s_reserved_pad;
662 __u32 s_reserved[162]; /* Padding to the end of the block */
651}; 663};
652 664
653#ifdef __KERNEL__ 665#ifdef __KERNEL__
@@ -1160,6 +1172,17 @@ struct ext4_group_info *ext4_get_group_info(struct super_block *sb,
1160} 1172}
1161 1173
1162 1174
1175static inline ext4_group_t ext4_flex_group(struct ext4_sb_info *sbi,
1176 ext4_group_t block_group)
1177{
1178 return block_group >> sbi->s_log_groups_per_flex;
1179}
1180
1181static inline unsigned int ext4_flex_bg_size(struct ext4_sb_info *sbi)
1182{
1183 return 1 << sbi->s_log_groups_per_flex;
1184}
1185
1163#define ext4_std_error(sb, errno) \ 1186#define ext4_std_error(sb, errno) \
1164do { \ 1187do { \
1165 if ((errno)) \ 1188 if ((errno)) \