aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ext4_fs.h
diff options
context:
space:
mode:
authorAvantika Mathur <mathur@us.ibm.com>2008-01-28 23:58:27 -0500
committerTheodore Ts'o <tytso@mit.edu>2008-01-28 23:58:27 -0500
commitfd2d42912f9f09e5250cb3b024ee0625704e9cb7 (patch)
tree23e85123e8cc06d518fd7cff665f93429e19e4e2 /include/linux/ext4_fs.h
parentbba907433b85ba2adae1bb3b6fd29b4e5f35c468 (diff)
ext4: add ext4_group_t, and change all group variables to this type.
In many places variables for block group are of type int, which limits the maximum number of block groups to 2^31. Each block group can have up to 2^15 blocks, with a 4K block size, and the max filesystem size is limited to 2^31 * (2^15 * 2^12) = 2^58 -- or 256 PB This patch introduces a new type ext4_group_t, of type unsigned long, to represent block group numbers in ext4. All occurrences of block group variables are converted to type ext4_group_t. Signed-off-by: Avantika Mathur <mathur@us.ibm.com>
Diffstat (limited to 'include/linux/ext4_fs.h')
-rw-r--r--include/linux/ext4_fs.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/include/linux/ext4_fs.h b/include/linux/ext4_fs.h
index 5e2da0974d16..e1103c2a0d42 100644
--- a/include/linux/ext4_fs.h
+++ b/include/linux/ext4_fs.h
@@ -830,7 +830,7 @@ struct ext4_iloc
830{ 830{
831 struct buffer_head *bh; 831 struct buffer_head *bh;
832 unsigned long offset; 832 unsigned long offset;
833 unsigned long block_group; 833 ext4_group_t block_group;
834}; 834};
835 835
836static inline struct ext4_inode *ext4_raw_inode(struct ext4_iloc *iloc) 836static inline struct ext4_inode *ext4_raw_inode(struct ext4_iloc *iloc)
@@ -855,7 +855,7 @@ struct dir_private_info {
855 855
856/* calculate the first block number of the group */ 856/* calculate the first block number of the group */
857static inline ext4_fsblk_t 857static inline ext4_fsblk_t
858ext4_group_first_block_no(struct super_block *sb, unsigned long group_no) 858ext4_group_first_block_no(struct super_block *sb, ext4_group_t group_no)
859{ 859{
860 return group_no * (ext4_fsblk_t)EXT4_BLOCKS_PER_GROUP(sb) + 860 return group_no * (ext4_fsblk_t)EXT4_BLOCKS_PER_GROUP(sb) +
861 le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block); 861 le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block);
@@ -886,8 +886,9 @@ extern unsigned int ext4_block_group(struct super_block *sb,
886 ext4_fsblk_t blocknr); 886 ext4_fsblk_t blocknr);
887extern ext4_grpblk_t ext4_block_group_offset(struct super_block *sb, 887extern ext4_grpblk_t ext4_block_group_offset(struct super_block *sb,
888 ext4_fsblk_t blocknr); 888 ext4_fsblk_t blocknr);
889extern int ext4_bg_has_super(struct super_block *sb, int group); 889extern int ext4_bg_has_super(struct super_block *sb, ext4_group_t group);
890extern unsigned long ext4_bg_num_gdb(struct super_block *sb, int group); 890extern unsigned long ext4_bg_num_gdb(struct super_block *sb,
891 ext4_group_t group);
891extern ext4_fsblk_t ext4_new_block (handle_t *handle, struct inode *inode, 892extern ext4_fsblk_t ext4_new_block (handle_t *handle, struct inode *inode,
892 ext4_fsblk_t goal, int *errp); 893 ext4_fsblk_t goal, int *errp);
893extern ext4_fsblk_t ext4_new_blocks (handle_t *handle, struct inode *inode, 894extern ext4_fsblk_t ext4_new_blocks (handle_t *handle, struct inode *inode,
@@ -900,7 +901,7 @@ extern void ext4_free_blocks_sb (handle_t *handle, struct super_block *sb,
900extern ext4_fsblk_t ext4_count_free_blocks (struct super_block *); 901extern ext4_fsblk_t ext4_count_free_blocks (struct super_block *);
901extern void ext4_check_blocks_bitmap (struct super_block *); 902extern void ext4_check_blocks_bitmap (struct super_block *);
902extern struct ext4_group_desc * ext4_get_group_desc(struct super_block * sb, 903extern struct ext4_group_desc * ext4_get_group_desc(struct super_block * sb,
903 unsigned int block_group, 904 ext4_group_t block_group,
904 struct buffer_head ** bh); 905 struct buffer_head ** bh);
905extern int ext4_should_retry_alloc(struct super_block *sb, int *retries); 906extern int ext4_should_retry_alloc(struct super_block *sb, int *retries);
906extern void ext4_init_block_alloc_info(struct inode *); 907extern void ext4_init_block_alloc_info(struct inode *);