diff options
Diffstat (limited to 'fs/ext2/ialloc.c')
| -rw-r--r-- | fs/ext2/ialloc.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/ext2/ialloc.c b/fs/ext2/ialloc.c index fdf63e9c6e7c..bf21b57cf98c 100644 --- a/fs/ext2/ialloc.c +++ b/fs/ext2/ialloc.c @@ -169,9 +169,10 @@ static void ext2_preread_inode(struct inode *inode) unsigned long block_group; unsigned long offset; unsigned long block; + unsigned int ino = inode->i_ino; struct ext2_group_desc * gdp; - block_group = (inode->i_ino - 1) / EXT2_INODES_PER_GROUP(inode->i_sb); + block_group = (ino - 1) / EXT2_INODES_PER_GROUP(inode->i_sb); gdp = ext2_get_group_desc(inode->i_sb, block_group, NULL); if (gdp == NULL) return; @@ -179,7 +180,7 @@ static void ext2_preread_inode(struct inode *inode) /* * Figure out the offset within the block group inode table */ - offset = ((inode->i_ino - 1) % EXT2_INODES_PER_GROUP(inode->i_sb)) * + offset = ((ino - 1) % EXT2_INODES_PER_GROUP(inode->i_sb)) * EXT2_INODE_SIZE(inode->i_sb); block = le32_to_cpu(gdp->bg_inode_table) + (offset >> EXT2_BLOCK_SIZE_BITS(inode->i_sb)); @@ -381,7 +382,7 @@ static int find_group_other(struct super_block *sb, struct inode *parent) * * So add our directory's i_ino into the starting point for the hash. */ - group = (group + parent->i_ino) % ngroups; + group = (group + (unsigned int)parent->i_ino) % ngroups; /* * Use a quadratic hash to find a group with a free inode and some @@ -589,7 +590,7 @@ got: goto fail_free_drop; mark_inode_dirty(inode); - ext2_debug("allocating inode %lu\n", inode->i_ino); + ext2_debug("allocating inode %llu\n", inode->i_ino); ext2_preread_inode(inode); return inode; |
