diff options
author | Eric Sandeen <sandeen@redhat.com> | 2009-08-25 22:36:45 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2009-08-25 22:36:45 -0400 |
commit | a36b44988cef1fc007535107013571fa691a2d7f (patch) | |
tree | b9d659b8ac2a1068f6fbc08ac093902333512c70 /fs/ext4/ext4.h | |
parent | 1927805e6599d8602d2c0af6a0155c85acc0b214 (diff) |
ext4: use ext4_grpblk_t more extensively
unsigned short is potentially too small to track blocks within
a group; today it is safe due to restrictions in e2fsprogs but
we have _lo / _hi bits for group blocks with the intent to go
up to 32 bits, so clean this up now.
There are many more places where we use unsigned/int/unsigned int
to contain a group block but this should at least fix all the
short types.
I added a few comments to the struct ext4_group_info definition
as well.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r-- | fs/ext4/ext4.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 02b22885eb02..41a76e163b99 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -1577,15 +1577,18 @@ static inline void ext4_update_i_disksize(struct inode *inode, loff_t newsize) struct ext4_group_info { unsigned long bb_state; struct rb_root bb_free_root; - unsigned short bb_first_free; - unsigned short bb_free; - unsigned short bb_fragments; + ext4_grpblk_t bb_first_free; /* first free block */ + ext4_grpblk_t bb_free; /* total free blocks */ + ext4_grpblk_t bb_fragments; /* nr of freespace fragments */ struct list_head bb_prealloc_list; #ifdef DOUBLE_CHECK void *bb_bitmap; #endif struct rw_semaphore alloc_sem; - unsigned short bb_counters[]; + ext4_grpblk_t bb_counters[]; /* Nr of free power-of-two-block + * regions, index is order. + * bb_counters[3] = 5 means + * 5 free 8-block regions. */ }; #define EXT4_GROUP_INFO_NEED_INIT_BIT 0 |