aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/mballoc.c
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/mballoc.c
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/mballoc.c')
-rw-r--r--fs/ext4/mballoc.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 081eaf7fce89..3086b3c65adc 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -623,13 +623,13 @@ static int __mb_check_buddy(struct ext4_buddy *e4b, char *file,
623 623
624/* FIXME!! need more doc */ 624/* FIXME!! need more doc */
625static void ext4_mb_mark_free_simple(struct super_block *sb, 625static void ext4_mb_mark_free_simple(struct super_block *sb,
626 void *buddy, unsigned first, int len, 626 void *buddy, ext4_grpblk_t first, ext4_grpblk_t len,
627 struct ext4_group_info *grp) 627 struct ext4_group_info *grp)
628{ 628{
629 struct ext4_sb_info *sbi = EXT4_SB(sb); 629 struct ext4_sb_info *sbi = EXT4_SB(sb);
630 unsigned short min; 630 ext4_grpblk_t min;
631 unsigned short max; 631 ext4_grpblk_t max;
632 unsigned short chunk; 632 ext4_grpblk_t chunk;
633 unsigned short border; 633 unsigned short border;
634 634
635 BUG_ON(len > EXT4_BLOCKS_PER_GROUP(sb)); 635 BUG_ON(len > EXT4_BLOCKS_PER_GROUP(sb));
@@ -663,10 +663,10 @@ void ext4_mb_generate_buddy(struct super_block *sb,
663 void *buddy, void *bitmap, ext4_group_t group) 663 void *buddy, void *bitmap, ext4_group_t group)
664{ 664{
665 struct ext4_group_info *grp = ext4_get_group_info(sb, group); 665 struct ext4_group_info *grp = ext4_get_group_info(sb, group);
666 unsigned short max = EXT4_BLOCKS_PER_GROUP(sb); 666 ext4_grpblk_t max = EXT4_BLOCKS_PER_GROUP(sb);
667 unsigned short i = 0; 667 ext4_grpblk_t i = 0;
668 unsigned short first; 668 ext4_grpblk_t first;
669 unsigned short len; 669 ext4_grpblk_t len;
670 unsigned free = 0; 670 unsigned free = 0;
671 unsigned fragments = 0; 671 unsigned fragments = 0;
672 unsigned long long period = get_cycles(); 672 unsigned long long period = get_cycles();
@@ -2325,7 +2325,7 @@ static int ext4_mb_seq_groups_show(struct seq_file *seq, void *v)
2325 struct ext4_buddy e4b; 2325 struct ext4_buddy e4b;
2326 struct sg { 2326 struct sg {
2327 struct ext4_group_info info; 2327 struct ext4_group_info info;
2328 unsigned short counters[16]; 2328 ext4_grpblk_t counters[16];
2329 } sg; 2329 } sg;
2330 2330
2331 group--; 2331 group--;