Skip to contentSkip to conversation

BIG_BG: larger inode bitmaps

RFC PATCH In review Valerie Clement 1 participant 1 message Nov 24, 2006 ext4 file system

lore
Share & tools
lore
#0 lore raw

RFC PATCH 3/4 BIG_BG: larger inode bitmaps

This patch does the same thing for the inodes, so that the inode bitmaps can be also stored on several blocks.

 ialloc.c |   62 ++++++++++++++++++++++++++++++++++++++++----------------------
 inode.c  |    7 +++++--
 2 files changed, 45 insertions(+), 24 deletions(-)
fs/ext4/inode.c +5 -2
Index: linux-2.6.19-rc6/fs/ext4/inode.c
===================================================================
@@ -2498,7 +2498,6 @@ static int __ext4_get_inode_loc(struct i
 				EXT4_INODE_SIZE(inode->i_sb);
 			inode_offset = ((inode->i_ino - 1) %
 					EXT4_INODES_PER_GROUP(inode->i_sb));
-			start = inode_offset & ~(inodes_per_buffer - 1);
 
 			/* Is the inode bitmap in cache? */
 			desc = ext4_get_group_desc(inode->i_sb,
@@ -2507,7 +2506,9 @@ static int __ext4_get_inode_loc(struct i
 				goto make_io;
 
 			bitmap_bh = sb_getblk(inode->i_sb,
-				ext4_inode_bitmap(inode->i_sb, desc));
+				ext4_inode_bitmap(inode->i_sb, desc)
+				+ (inode_offset >>
+				   EXT4_BITS_PER_BLOCK_BITS(inode->i_sb)));
 			if (!bitmap_bh)
 				goto make_io;
 
@@ -2520,6 +2521,8 @@ static int __ext4_get_inode_loc(struct i
 				brelse(bitmap_bh);
 				goto make_io;
 			}
+			inode_offset &= (EXT4_BITS_PER_BLOCK(inode->i_sb) - 1);
+			start = inode_offset & ~(inodes_per_buffer - 1);
 			for (i = start; i < start + inodes_per_buffer; i++) {
 				if (i == inode_offset)
 					continue;
fs/ext4/ialloc.c +40 -22

144 lines not on this page · raw message