aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/ext4.h
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2009-08-25 22:36:45 -0400
committerTheodore Ts'o <tytso@mit.edu>2009-08-25 22:36:45 -0400
commita36b44988cef1fc007535107013571fa691a2d7f (patch)
treeb9d659b8ac2a1068f6fbc08ac093902333512c70 /fs/ext4/ext4.h
parent1927805e6599d8602d2c0af6a0155c85acc0b214 (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.h11
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)
1577struct ext4_group_info { 1577struct ext4_group_info {
1578 unsigned long bb_state; 1578 unsigned long bb_state;
1579 struct rb_root bb_free_root; 1579 struct rb_root bb_free_root;
1580 unsigned short bb_first_free; 1580 ext4_grpblk_t bb_first_free; /* first free block */
1581 unsigned short bb_free; 1581 ext4_grpblk_t bb_free; /* total free blocks */
1582 unsigned short bb_fragments; 1582 ext4_grpblk_t bb_fragments; /* nr of freespace fragments */
1583 struct list_head bb_prealloc_list; 1583 struct list_head bb_prealloc_list;
1584#ifdef DOUBLE_CHECK 1584#ifdef DOUBLE_CHECK
1585 void *bb_bitmap; 1585 void *bb_bitmap;
1586#endif 1586#endif
1587 struct rw_semaphore alloc_sem; 1587 struct rw_semaphore alloc_sem;
1588 unsigned short bb_counters[]; 1588 ext4_grpblk_t bb_counters[]; /* Nr of free power-of-two-block
1589 * regions, index is order.
1590 * bb_counters[3] = 5 means
1591 * 5 free 8-block regions. */
1589}; 1592};
1590 1593
1591#define EXT4_GROUP_INFO_NEED_INIT_BIT 0 1594#define EXT4_GROUP_INFO_NEED_INIT_BIT 0