diff options
author | Theodore Ts'o <tytso@mit.edu> | 2009-01-05 22:18:16 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2009-01-05 22:18:16 -0500 |
commit | a9df9a49102f3578909cba7bd33784eb3b9caaa4 (patch) | |
tree | 1d383d422bf7185e8e87c1bcfc80f9beb3074cf8 /fs | |
parent | cde6436004ad9cd8cab5a874b6fa8b01f1da91bf (diff) |
ext4: Make ext4_group_t be an unsigned int
Nearly all places in the ext3/4 code which uses "unsigned long" is
probably a bug, since on 32-bit systems a ulong a 32-bits, which means
we are wasting stack space on 64-bit systems.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext4/balloc.c | 10 | ||||
-rw-r--r-- | fs/ext4/ext4.h | 2 | ||||
-rw-r--r-- | fs/ext4/ext4_i.h | 2 | ||||
-rw-r--r-- | fs/ext4/ialloc.c | 8 | ||||
-rw-r--r-- | fs/ext4/mballoc.c | 58 | ||||
-rw-r--r-- | fs/ext4/resize.c | 4 | ||||
-rw-r--r-- | fs/ext4/super.c | 14 |
7 files changed, 49 insertions, 49 deletions
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c index 0cb1c4572f54..a711898923f0 100644 --- a/fs/ext4/balloc.c +++ b/fs/ext4/balloc.c | |||
@@ -100,7 +100,7 @@ unsigned ext4_init_block_bitmap(struct super_block *sb, struct buffer_head *bh, | |||
100 | * essentially implementing a per-group read-only flag. */ | 100 | * essentially implementing a per-group read-only flag. */ |
101 | if (!ext4_group_desc_csum_verify(sbi, block_group, gdp)) { | 101 | if (!ext4_group_desc_csum_verify(sbi, block_group, gdp)) { |
102 | ext4_error(sb, __func__, | 102 | ext4_error(sb, __func__, |
103 | "Checksum bad for group %lu", block_group); | 103 | "Checksum bad for group %u", block_group); |
104 | gdp->bg_free_blocks_count = 0; | 104 | gdp->bg_free_blocks_count = 0; |
105 | gdp->bg_free_inodes_count = 0; | 105 | gdp->bg_free_inodes_count = 0; |
106 | gdp->bg_itable_unused = 0; | 106 | gdp->bg_itable_unused = 0; |
@@ -213,7 +213,7 @@ struct ext4_group_desc * ext4_get_group_desc(struct super_block *sb, | |||
213 | if (block_group >= sbi->s_groups_count) { | 213 | if (block_group >= sbi->s_groups_count) { |
214 | ext4_error(sb, "ext4_get_group_desc", | 214 | ext4_error(sb, "ext4_get_group_desc", |
215 | "block_group >= groups_count - " | 215 | "block_group >= groups_count - " |
216 | "block_group = %lu, groups_count = %lu", | 216 | "block_group = %u, groups_count = %u", |
217 | block_group, sbi->s_groups_count); | 217 | block_group, sbi->s_groups_count); |
218 | 218 | ||
219 | return NULL; | 219 | return NULL; |
@@ -225,7 +225,7 @@ struct ext4_group_desc * ext4_get_group_desc(struct super_block *sb, | |||
225 | if (!sbi->s_group_desc[group_desc]) { | 225 | if (!sbi->s_group_desc[group_desc]) { |
226 | ext4_error(sb, "ext4_get_group_desc", | 226 | ext4_error(sb, "ext4_get_group_desc", |
227 | "Group descriptor not loaded - " | 227 | "Group descriptor not loaded - " |
228 | "block_group = %lu, group_desc = %lu, desc = %lu", | 228 | "block_group = %u, group_desc = %lu, desc = %lu", |
229 | block_group, group_desc, offset); | 229 | block_group, group_desc, offset); |
230 | return NULL; | 230 | return NULL; |
231 | } | 231 | } |
@@ -315,7 +315,7 @@ ext4_read_block_bitmap(struct super_block *sb, ext4_group_t block_group) | |||
315 | if (unlikely(!bh)) { | 315 | if (unlikely(!bh)) { |
316 | ext4_error(sb, __func__, | 316 | ext4_error(sb, __func__, |
317 | "Cannot read block bitmap - " | 317 | "Cannot read block bitmap - " |
318 | "block_group = %lu, block_bitmap = %llu", | 318 | "block_group = %u, block_bitmap = %llu", |
319 | block_group, bitmap_blk); | 319 | block_group, bitmap_blk); |
320 | return NULL; | 320 | return NULL; |
321 | } | 321 | } |
@@ -337,7 +337,7 @@ ext4_read_block_bitmap(struct super_block *sb, ext4_group_t block_group) | |||
337 | put_bh(bh); | 337 | put_bh(bh); |
338 | ext4_error(sb, __func__, | 338 | ext4_error(sb, __func__, |
339 | "Cannot read block bitmap - " | 339 | "Cannot read block bitmap - " |
340 | "block_group = %lu, block_bitmap = %llu", | 340 | "block_group = %u, block_bitmap = %llu", |
341 | block_group, bitmap_blk); | 341 | block_group, bitmap_blk); |
342 | return NULL; | 342 | return NULL; |
343 | } | 343 | } |
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 9ba9fd6d14da..e9aacecfbf41 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
@@ -965,7 +965,7 @@ ext4_group_first_block_no(struct super_block *sb, ext4_group_t group_no) | |||
965 | #define ERR_BAD_DX_DIR -75000 | 965 | #define ERR_BAD_DX_DIR -75000 |
966 | 966 | ||
967 | void ext4_get_group_no_and_offset(struct super_block *sb, ext4_fsblk_t blocknr, | 967 | void ext4_get_group_no_and_offset(struct super_block *sb, ext4_fsblk_t blocknr, |
968 | unsigned long *blockgrpp, ext4_grpblk_t *offsetp); | 968 | ext4_group_t *blockgrpp, ext4_grpblk_t *offsetp); |
969 | 969 | ||
970 | extern struct proc_dir_entry *ext4_proc_root; | 970 | extern struct proc_dir_entry *ext4_proc_root; |
971 | 971 | ||
diff --git a/fs/ext4/ext4_i.h b/fs/ext4/ext4_i.h index acc0b726d8ab..0a9ebe580195 100644 --- a/fs/ext4/ext4_i.h +++ b/fs/ext4/ext4_i.h | |||
@@ -31,7 +31,7 @@ typedef unsigned long long ext4_fsblk_t; | |||
31 | typedef __u32 ext4_lblk_t; | 31 | typedef __u32 ext4_lblk_t; |
32 | 32 | ||
33 | /* data type for block group number */ | 33 | /* data type for block group number */ |
34 | typedef unsigned long ext4_group_t; | 34 | typedef unsigned int ext4_group_t; |
35 | 35 | ||
36 | #define rsv_start rsv_window._rsv_start | 36 | #define rsv_start rsv_window._rsv_start |
37 | #define rsv_end rsv_window._rsv_end | 37 | #define rsv_end rsv_window._rsv_end |
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index 4794d2ce6130..cac3617ec780 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c | |||
@@ -74,7 +74,7 @@ unsigned ext4_init_inode_bitmap(struct super_block *sb, struct buffer_head *bh, | |||
74 | /* If checksum is bad mark all blocks and inodes use to prevent | 74 | /* If checksum is bad mark all blocks and inodes use to prevent |
75 | * allocation, essentially implementing a per-group read-only flag. */ | 75 | * allocation, essentially implementing a per-group read-only flag. */ |
76 | if (!ext4_group_desc_csum_verify(sbi, block_group, gdp)) { | 76 | if (!ext4_group_desc_csum_verify(sbi, block_group, gdp)) { |
77 | ext4_error(sb, __func__, "Checksum bad for group %lu", | 77 | ext4_error(sb, __func__, "Checksum bad for group %u", |
78 | block_group); | 78 | block_group); |
79 | gdp->bg_free_blocks_count = 0; | 79 | gdp->bg_free_blocks_count = 0; |
80 | gdp->bg_free_inodes_count = 0; | 80 | gdp->bg_free_inodes_count = 0; |
@@ -111,7 +111,7 @@ ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group) | |||
111 | if (unlikely(!bh)) { | 111 | if (unlikely(!bh)) { |
112 | ext4_error(sb, __func__, | 112 | ext4_error(sb, __func__, |
113 | "Cannot read inode bitmap - " | 113 | "Cannot read inode bitmap - " |
114 | "block_group = %lu, inode_bitmap = %llu", | 114 | "block_group = %u, inode_bitmap = %llu", |
115 | block_group, bitmap_blk); | 115 | block_group, bitmap_blk); |
116 | return NULL; | 116 | return NULL; |
117 | } | 117 | } |
@@ -133,7 +133,7 @@ ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group) | |||
133 | put_bh(bh); | 133 | put_bh(bh); |
134 | ext4_error(sb, __func__, | 134 | ext4_error(sb, __func__, |
135 | "Cannot read inode bitmap - " | 135 | "Cannot read inode bitmap - " |
136 | "block_group = %lu, inode_bitmap = %llu", | 136 | "block_group = %u, inode_bitmap = %llu", |
137 | block_group, bitmap_blk); | 137 | block_group, bitmap_blk); |
138 | return NULL; | 138 | return NULL; |
139 | } | 139 | } |
@@ -690,7 +690,7 @@ got: | |||
690 | ino > EXT4_INODES_PER_GROUP(sb)) { | 690 | ino > EXT4_INODES_PER_GROUP(sb)) { |
691 | ext4_error(sb, __func__, | 691 | ext4_error(sb, __func__, |
692 | "reserved inode or inode > inodes count - " | 692 | "reserved inode or inode > inodes count - " |
693 | "block_group = %lu, inode=%lu", group, | 693 | "block_group = %u, inode=%lu", group, |
694 | ino + group * EXT4_INODES_PER_GROUP(sb)); | 694 | ino + group * EXT4_INODES_PER_GROUP(sb)); |
695 | err = -EIO; | 695 | err = -EIO; |
696 | goto fail; | 696 | goto fail; |
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 6dea637b020a..6cfe68a7e070 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c | |||
@@ -447,7 +447,7 @@ static void mb_free_blocks_double(struct inode *inode, struct ext4_buddy *e4b, | |||
447 | le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block); | 447 | le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block); |
448 | 448 | ||
449 | ext4_error(sb, __func__, "double-free of inode" | 449 | ext4_error(sb, __func__, "double-free of inode" |
450 | " %lu's block %llu(bit %u in group %lu)", | 450 | " %lu's block %llu(bit %u in group %u)", |
451 | inode ? inode->i_ino : 0, blocknr, | 451 | inode ? inode->i_ino : 0, blocknr, |
452 | first + i, e4b->bd_group); | 452 | first + i, e4b->bd_group); |
453 | } | 453 | } |
@@ -477,7 +477,7 @@ static void mb_cmp_bitmaps(struct ext4_buddy *e4b, void *bitmap) | |||
477 | b2 = (unsigned char *) bitmap; | 477 | b2 = (unsigned char *) bitmap; |
478 | for (i = 0; i < e4b->bd_sb->s_blocksize; i++) { | 478 | for (i = 0; i < e4b->bd_sb->s_blocksize; i++) { |
479 | if (b1[i] != b2[i]) { | 479 | if (b1[i] != b2[i]) { |
480 | printk(KERN_ERR "corruption in group %lu " | 480 | printk(KERN_ERR "corruption in group %u " |
481 | "at byte %u(%u): %x in copy != %x " | 481 | "at byte %u(%u): %x in copy != %x " |
482 | "on disk/prealloc\n", | 482 | "on disk/prealloc\n", |
483 | e4b->bd_group, i, i * 8, b1[i], b2[i]); | 483 | e4b->bd_group, i, i * 8, b1[i], b2[i]); |
@@ -691,7 +691,7 @@ static void ext4_mb_generate_buddy(struct super_block *sb, | |||
691 | 691 | ||
692 | if (free != grp->bb_free) { | 692 | if (free != grp->bb_free) { |
693 | ext4_error(sb, __func__, | 693 | ext4_error(sb, __func__, |
694 | "EXT4-fs: group %lu: %u blocks in bitmap, %u in gd", | 694 | "EXT4-fs: group %u: %u blocks in bitmap, %u in gd", |
695 | group, free, grp->bb_free); | 695 | group, free, grp->bb_free); |
696 | /* | 696 | /* |
697 | * If we intent to continue, we consider group descritor | 697 | * If we intent to continue, we consider group descritor |
@@ -800,7 +800,7 @@ static int ext4_mb_init_cache(struct page *page, char *incore) | |||
800 | get_bh(bh[i]); | 800 | get_bh(bh[i]); |
801 | bh[i]->b_end_io = end_buffer_read_sync; | 801 | bh[i]->b_end_io = end_buffer_read_sync; |
802 | submit_bh(READ, bh[i]); | 802 | submit_bh(READ, bh[i]); |
803 | mb_debug("read bitmap for group %lu\n", first_group + i); | 803 | mb_debug("read bitmap for group %u\n", first_group + i); |
804 | } | 804 | } |
805 | 805 | ||
806 | /* wait for I/O completion */ | 806 | /* wait for I/O completion */ |
@@ -895,7 +895,7 @@ ext4_mb_load_buddy(struct super_block *sb, ext4_group_t group, | |||
895 | struct page *page; | 895 | struct page *page; |
896 | int ret; | 896 | int ret; |
897 | 897 | ||
898 | mb_debug("load group %lu\n", group); | 898 | mb_debug("load group %u\n", group); |
899 | 899 | ||
900 | blocks_per_page = PAGE_CACHE_SIZE / sb->s_blocksize; | 900 | blocks_per_page = PAGE_CACHE_SIZE / sb->s_blocksize; |
901 | 901 | ||
@@ -1096,7 +1096,7 @@ static void mb_free_blocks(struct inode *inode, struct ext4_buddy *e4b, | |||
1096 | le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block); | 1096 | le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block); |
1097 | ext4_unlock_group(sb, e4b->bd_group); | 1097 | ext4_unlock_group(sb, e4b->bd_group); |
1098 | ext4_error(sb, __func__, "double-free of inode" | 1098 | ext4_error(sb, __func__, "double-free of inode" |
1099 | " %lu's block %llu(bit %u in group %lu)", | 1099 | " %lu's block %llu(bit %u in group %u)", |
1100 | inode ? inode->i_ino : 0, blocknr, block, | 1100 | inode ? inode->i_ino : 0, blocknr, block, |
1101 | e4b->bd_group); | 1101 | e4b->bd_group); |
1102 | ext4_lock_group(sb, e4b->bd_group); | 1102 | ext4_lock_group(sb, e4b->bd_group); |
@@ -1934,13 +1934,13 @@ static int ext4_mb_seq_history_show(struct seq_file *seq, void *v) | |||
1934 | if (hs->op == EXT4_MB_HISTORY_ALLOC) { | 1934 | if (hs->op == EXT4_MB_HISTORY_ALLOC) { |
1935 | fmt = "%-5u %-8u %-23s %-23s %-23s %-5u %-5u %-2u " | 1935 | fmt = "%-5u %-8u %-23s %-23s %-23s %-5u %-5u %-2u " |
1936 | "%-5u %-5s %-5u %-6u\n"; | 1936 | "%-5u %-5s %-5u %-6u\n"; |
1937 | sprintf(buf2, "%lu/%d/%u@%u", hs->result.fe_group, | 1937 | sprintf(buf2, "%u/%d/%u@%u", hs->result.fe_group, |
1938 | hs->result.fe_start, hs->result.fe_len, | 1938 | hs->result.fe_start, hs->result.fe_len, |
1939 | hs->result.fe_logical); | 1939 | hs->result.fe_logical); |
1940 | sprintf(buf, "%lu/%d/%u@%u", hs->orig.fe_group, | 1940 | sprintf(buf, "%u/%d/%u@%u", hs->orig.fe_group, |
1941 | hs->orig.fe_start, hs->orig.fe_len, | 1941 | hs->orig.fe_start, hs->orig.fe_len, |
1942 | hs->orig.fe_logical); | 1942 | hs->orig.fe_logical); |
1943 | sprintf(buf3, "%lu/%d/%u@%u", hs->goal.fe_group, | 1943 | sprintf(buf3, "%u/%d/%u@%u", hs->goal.fe_group, |
1944 | hs->goal.fe_start, hs->goal.fe_len, | 1944 | hs->goal.fe_start, hs->goal.fe_len, |
1945 | hs->goal.fe_logical); | 1945 | hs->goal.fe_logical); |
1946 | seq_printf(seq, fmt, hs->pid, hs->ino, buf, buf3, buf2, | 1946 | seq_printf(seq, fmt, hs->pid, hs->ino, buf, buf3, buf2, |
@@ -1949,20 +1949,20 @@ static int ext4_mb_seq_history_show(struct seq_file *seq, void *v) | |||
1949 | hs->buddy ? 1 << hs->buddy : 0); | 1949 | hs->buddy ? 1 << hs->buddy : 0); |
1950 | } else if (hs->op == EXT4_MB_HISTORY_PREALLOC) { | 1950 | } else if (hs->op == EXT4_MB_HISTORY_PREALLOC) { |
1951 | fmt = "%-5u %-8u %-23s %-23s %-23s\n"; | 1951 | fmt = "%-5u %-8u %-23s %-23s %-23s\n"; |
1952 | sprintf(buf2, "%lu/%d/%u@%u", hs->result.fe_group, | 1952 | sprintf(buf2, "%u/%d/%u@%u", hs->result.fe_group, |
1953 | hs->result.fe_start, hs->result.fe_len, | 1953 | hs->result.fe_start, hs->result.fe_len, |
1954 | hs->result.fe_logical); | 1954 | hs->result.fe_logical); |
1955 | sprintf(buf, "%lu/%d/%u@%u", hs->orig.fe_group, | 1955 | sprintf(buf, "%u/%d/%u@%u", hs->orig.fe_group, |
1956 | hs->orig.fe_start, hs->orig.fe_len, | 1956 | hs->orig.fe_start, hs->orig.fe_len, |
1957 | hs->orig.fe_logical); | 1957 | hs->orig.fe_logical); |
1958 | seq_printf(seq, fmt, hs->pid, hs->ino, buf, "", buf2); | 1958 | seq_printf(seq, fmt, hs->pid, hs->ino, buf, "", buf2); |
1959 | } else if (hs->op == EXT4_MB_HISTORY_DISCARD) { | 1959 | } else if (hs->op == EXT4_MB_HISTORY_DISCARD) { |
1960 | sprintf(buf2, "%lu/%d/%u", hs->result.fe_group, | 1960 | sprintf(buf2, "%u/%d/%u", hs->result.fe_group, |
1961 | hs->result.fe_start, hs->result.fe_len); | 1961 | hs->result.fe_start, hs->result.fe_len); |
1962 | seq_printf(seq, "%-5u %-8u %-23s discard\n", | 1962 | seq_printf(seq, "%-5u %-8u %-23s discard\n", |
1963 | hs->pid, hs->ino, buf2); | 1963 | hs->pid, hs->ino, buf2); |
1964 | } else if (hs->op == EXT4_MB_HISTORY_FREE) { | 1964 | } else if (hs->op == EXT4_MB_HISTORY_FREE) { |
1965 | sprintf(buf2, "%lu/%d/%u", hs->result.fe_group, | 1965 | sprintf(buf2, "%u/%d/%u", hs->result.fe_group, |
1966 | hs->result.fe_start, hs->result.fe_len); | 1966 | hs->result.fe_start, hs->result.fe_len); |
1967 | seq_printf(seq, "%-5u %-8u %-23s free\n", | 1967 | seq_printf(seq, "%-5u %-8u %-23s free\n", |
1968 | hs->pid, hs->ino, buf2); | 1968 | hs->pid, hs->ino, buf2); |
@@ -2075,7 +2075,7 @@ static void *ext4_mb_seq_groups_start(struct seq_file *seq, loff_t *pos) | |||
2075 | return NULL; | 2075 | return NULL; |
2076 | 2076 | ||
2077 | group = *pos + 1; | 2077 | group = *pos + 1; |
2078 | return (void *) group; | 2078 | return (void *) ((unsigned long) group); |
2079 | } | 2079 | } |
2080 | 2080 | ||
2081 | static void *ext4_mb_seq_groups_next(struct seq_file *seq, void *v, loff_t *pos) | 2081 | static void *ext4_mb_seq_groups_next(struct seq_file *seq, void *v, loff_t *pos) |
@@ -2088,13 +2088,13 @@ static void *ext4_mb_seq_groups_next(struct seq_file *seq, void *v, loff_t *pos) | |||
2088 | if (*pos < 0 || *pos >= sbi->s_groups_count) | 2088 | if (*pos < 0 || *pos >= sbi->s_groups_count) |
2089 | return NULL; | 2089 | return NULL; |
2090 | group = *pos + 1; | 2090 | group = *pos + 1; |
2091 | return (void *) group;; | 2091 | return (void *) ((unsigned long) group); |
2092 | } | 2092 | } |
2093 | 2093 | ||
2094 | static int ext4_mb_seq_groups_show(struct seq_file *seq, void *v) | 2094 | static int ext4_mb_seq_groups_show(struct seq_file *seq, void *v) |
2095 | { | 2095 | { |
2096 | struct super_block *sb = seq->private; | 2096 | struct super_block *sb = seq->private; |
2097 | long group = (long) v; | 2097 | ext4_group_t group = (ext4_group_t) ((unsigned long) v); |
2098 | int i; | 2098 | int i; |
2099 | int err; | 2099 | int err; |
2100 | struct ext4_buddy e4b; | 2100 | struct ext4_buddy e4b; |
@@ -2116,7 +2116,7 @@ static int ext4_mb_seq_groups_show(struct seq_file *seq, void *v) | |||
2116 | sizeof(struct ext4_group_info); | 2116 | sizeof(struct ext4_group_info); |
2117 | err = ext4_mb_load_buddy(sb, group, &e4b); | 2117 | err = ext4_mb_load_buddy(sb, group, &e4b); |
2118 | if (err) { | 2118 | if (err) { |
2119 | seq_printf(seq, "#%-5lu: I/O error\n", group); | 2119 | seq_printf(seq, "#%-5u: I/O error\n", group); |
2120 | return 0; | 2120 | return 0; |
2121 | } | 2121 | } |
2122 | ext4_lock_group(sb, group); | 2122 | ext4_lock_group(sb, group); |
@@ -2124,7 +2124,7 @@ static int ext4_mb_seq_groups_show(struct seq_file *seq, void *v) | |||
2124 | ext4_unlock_group(sb, group); | 2124 | ext4_unlock_group(sb, group); |
2125 | ext4_mb_release_desc(&e4b); | 2125 | ext4_mb_release_desc(&e4b); |
2126 | 2126 | ||
2127 | seq_printf(seq, "#%-5lu: %-5u %-5u %-5u [", group, sg.info.bb_free, | 2127 | seq_printf(seq, "#%-5u: %-5u %-5u %-5u [", group, sg.info.bb_free, |
2128 | sg.info.bb_fragments, sg.info.bb_first_free); | 2128 | sg.info.bb_fragments, sg.info.bb_first_free); |
2129 | for (i = 0; i <= 13; i++) | 2129 | for (i = 0; i <= 13; i++) |
2130 | seq_printf(seq, " %-5u", i <= sb->s_blocksize_bits + 1 ? | 2130 | seq_printf(seq, " %-5u", i <= sb->s_blocksize_bits + 1 ? |
@@ -2459,7 +2459,7 @@ static int ext4_mb_init_backend(struct super_block *sb) | |||
2459 | desc = ext4_get_group_desc(sb, i, NULL); | 2459 | desc = ext4_get_group_desc(sb, i, NULL); |
2460 | if (desc == NULL) { | 2460 | if (desc == NULL) { |
2461 | printk(KERN_ERR | 2461 | printk(KERN_ERR |
2462 | "EXT4-fs: can't read descriptor %lu\n", i); | 2462 | "EXT4-fs: can't read descriptor %u\n", i); |
2463 | goto err_freebuddy; | 2463 | goto err_freebuddy; |
2464 | } | 2464 | } |
2465 | if (ext4_mb_add_groupinfo(sb, i, desc) != 0) | 2465 | if (ext4_mb_add_groupinfo(sb, i, desc) != 0) |
@@ -2657,7 +2657,7 @@ static void release_blocks_on_commit(journal_t *journal, transaction_t *txn) | |||
2657 | list_for_each_safe(l, ltmp, &txn->t_private_list) { | 2657 | list_for_each_safe(l, ltmp, &txn->t_private_list) { |
2658 | entry = list_entry(l, struct ext4_free_data, list); | 2658 | entry = list_entry(l, struct ext4_free_data, list); |
2659 | 2659 | ||
2660 | mb_debug("gonna free %u blocks in group %lu (0x%p):", | 2660 | mb_debug("gonna free %u blocks in group %u (0x%p):", |
2661 | entry->count, entry->group, entry); | 2661 | entry->count, entry->group, entry); |
2662 | 2662 | ||
2663 | err = ext4_mb_load_buddy(sb, entry->group, &e4b); | 2663 | err = ext4_mb_load_buddy(sb, entry->group, &e4b); |
@@ -2829,7 +2829,7 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac, | |||
2829 | if (!gdp) | 2829 | if (!gdp) |
2830 | goto out_err; | 2830 | goto out_err; |
2831 | 2831 | ||
2832 | ext4_debug("using block group %lu(%d)\n", ac->ac_b_ex.fe_group, | 2832 | ext4_debug("using block group %u(%d)\n", ac->ac_b_ex.fe_group, |
2833 | gdp->bg_free_blocks_count); | 2833 | gdp->bg_free_blocks_count); |
2834 | 2834 | ||
2835 | err = ext4_journal_get_write_access(handle, gdp_bh); | 2835 | err = ext4_journal_get_write_access(handle, gdp_bh); |
@@ -3351,7 +3351,7 @@ static void ext4_mb_generate_from_pa(struct super_block *sb, void *bitmap, | |||
3351 | preallocated += len; | 3351 | preallocated += len; |
3352 | count++; | 3352 | count++; |
3353 | } | 3353 | } |
3354 | mb_debug("prellocated %u for group %lu\n", preallocated, group); | 3354 | mb_debug("prellocated %u for group %u\n", preallocated, group); |
3355 | } | 3355 | } |
3356 | 3356 | ||
3357 | static void ext4_mb_pa_callback(struct rcu_head *head) | 3357 | static void ext4_mb_pa_callback(struct rcu_head *head) |
@@ -3368,7 +3368,7 @@ static void ext4_mb_pa_callback(struct rcu_head *head) | |||
3368 | static void ext4_mb_put_pa(struct ext4_allocation_context *ac, | 3368 | static void ext4_mb_put_pa(struct ext4_allocation_context *ac, |
3369 | struct super_block *sb, struct ext4_prealloc_space *pa) | 3369 | struct super_block *sb, struct ext4_prealloc_space *pa) |
3370 | { | 3370 | { |
3371 | unsigned long grp; | 3371 | ext4_group_t grp; |
3372 | 3372 | ||
3373 | if (!atomic_dec_and_test(&pa->pa_count) || pa->pa_free != 0) | 3373 | if (!atomic_dec_and_test(&pa->pa_count) || pa->pa_free != 0) |
3374 | return; | 3374 | return; |
@@ -3697,7 +3697,7 @@ ext4_mb_discard_group_preallocations(struct super_block *sb, | |||
3697 | int busy = 0; | 3697 | int busy = 0; |
3698 | int free = 0; | 3698 | int free = 0; |
3699 | 3699 | ||
3700 | mb_debug("discard preallocation for group %lu\n", group); | 3700 | mb_debug("discard preallocation for group %u\n", group); |
3701 | 3701 | ||
3702 | if (list_empty(&grp->bb_prealloc_list)) | 3702 | if (list_empty(&grp->bb_prealloc_list)) |
3703 | return 0; | 3703 | return 0; |
@@ -3705,14 +3705,14 @@ ext4_mb_discard_group_preallocations(struct super_block *sb, | |||
3705 | bitmap_bh = ext4_read_block_bitmap(sb, group); | 3705 | bitmap_bh = ext4_read_block_bitmap(sb, group); |
3706 | if (bitmap_bh == NULL) { | 3706 | if (bitmap_bh == NULL) { |
3707 | ext4_error(sb, __func__, "Error in reading block " | 3707 | ext4_error(sb, __func__, "Error in reading block " |
3708 | "bitmap for %lu", group); | 3708 | "bitmap for %u", group); |
3709 | return 0; | 3709 | return 0; |
3710 | } | 3710 | } |
3711 | 3711 | ||
3712 | err = ext4_mb_load_buddy(sb, group, &e4b); | 3712 | err = ext4_mb_load_buddy(sb, group, &e4b); |
3713 | if (err) { | 3713 | if (err) { |
3714 | ext4_error(sb, __func__, "Error in loading buddy " | 3714 | ext4_error(sb, __func__, "Error in loading buddy " |
3715 | "information for %lu", group); | 3715 | "information for %u", group); |
3716 | put_bh(bitmap_bh); | 3716 | put_bh(bitmap_bh); |
3717 | return 0; | 3717 | return 0; |
3718 | } | 3718 | } |
@@ -3879,14 +3879,14 @@ repeat: | |||
3879 | err = ext4_mb_load_buddy(sb, group, &e4b); | 3879 | err = ext4_mb_load_buddy(sb, group, &e4b); |
3880 | if (err) { | 3880 | if (err) { |
3881 | ext4_error(sb, __func__, "Error in loading buddy " | 3881 | ext4_error(sb, __func__, "Error in loading buddy " |
3882 | "information for %lu", group); | 3882 | "information for %u", group); |
3883 | continue; | 3883 | continue; |
3884 | } | 3884 | } |
3885 | 3885 | ||
3886 | bitmap_bh = ext4_read_block_bitmap(sb, group); | 3886 | bitmap_bh = ext4_read_block_bitmap(sb, group); |
3887 | if (bitmap_bh == NULL) { | 3887 | if (bitmap_bh == NULL) { |
3888 | ext4_error(sb, __func__, "Error in reading block " | 3888 | ext4_error(sb, __func__, "Error in reading block " |
3889 | "bitmap for %lu", group); | 3889 | "bitmap for %u", group); |
3890 | ext4_mb_release_desc(&e4b); | 3890 | ext4_mb_release_desc(&e4b); |
3891 | continue; | 3891 | continue; |
3892 | } | 3892 | } |
@@ -4151,7 +4151,7 @@ ext4_mb_discard_lg_preallocations(struct super_block *sb, | |||
4151 | ext4_get_group_no_and_offset(sb, pa->pa_pstart, &group, NULL); | 4151 | ext4_get_group_no_and_offset(sb, pa->pa_pstart, &group, NULL); |
4152 | if (ext4_mb_load_buddy(sb, group, &e4b)) { | 4152 | if (ext4_mb_load_buddy(sb, group, &e4b)) { |
4153 | ext4_error(sb, __func__, "Error in loading buddy " | 4153 | ext4_error(sb, __func__, "Error in loading buddy " |
4154 | "information for %lu", group); | 4154 | "information for %u", group); |
4155 | continue; | 4155 | continue; |
4156 | } | 4156 | } |
4157 | ext4_lock_group(sb, group); | 4157 | ext4_lock_group(sb, group); |
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c index 411338117443..1865d6a53de3 100644 --- a/fs/ext4/resize.c +++ b/fs/ext4/resize.c | |||
@@ -50,7 +50,7 @@ static int verify_group_input(struct super_block *sb, | |||
50 | ext4_get_group_no_and_offset(sb, start, NULL, &offset); | 50 | ext4_get_group_no_and_offset(sb, start, NULL, &offset); |
51 | if (group != sbi->s_groups_count) | 51 | if (group != sbi->s_groups_count) |
52 | ext4_warning(sb, __func__, | 52 | ext4_warning(sb, __func__, |
53 | "Cannot add at group %u (only %lu groups)", | 53 | "Cannot add at group %u (only %u groups)", |
54 | input->group, sbi->s_groups_count); | 54 | input->group, sbi->s_groups_count); |
55 | else if (offset != 0) | 55 | else if (offset != 0) |
56 | ext4_warning(sb, __func__, "Last group not full"); | 56 | ext4_warning(sb, __func__, "Last group not full"); |
@@ -716,7 +716,7 @@ static void update_backups(struct super_block *sb, | |||
716 | exit_err: | 716 | exit_err: |
717 | if (err) { | 717 | if (err) { |
718 | ext4_warning(sb, __func__, | 718 | ext4_warning(sb, __func__, |
719 | "can't update backup for group %lu (err %d), " | 719 | "can't update backup for group %u (err %d), " |
720 | "forcing fsck on next reboot", group, err); | 720 | "forcing fsck on next reboot", group, err); |
721 | sbi->s_mount_state &= ~EXT4_VALID_FS; | 721 | sbi->s_mount_state &= ~EXT4_VALID_FS; |
722 | sbi->s_es->s_state &= cpu_to_le16(~EXT4_VALID_FS); | 722 | sbi->s_es->s_state &= cpu_to_le16(~EXT4_VALID_FS); |
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index da377f9521bb..8fa57be5040a 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -1470,7 +1470,7 @@ static int ext4_setup_super(struct super_block *sb, struct ext4_super_block *es, | |||
1470 | 1470 | ||
1471 | ext4_commit_super(sb, es, 1); | 1471 | ext4_commit_super(sb, es, 1); |
1472 | if (test_opt(sb, DEBUG)) | 1472 | if (test_opt(sb, DEBUG)) |
1473 | printk(KERN_INFO "[EXT4 FS bs=%lu, gc=%lu, " | 1473 | printk(KERN_INFO "[EXT4 FS bs=%lu, gc=%u, " |
1474 | "bpg=%lu, ipg=%lu, mo=%04lx]\n", | 1474 | "bpg=%lu, ipg=%lu, mo=%04lx]\n", |
1475 | sb->s_blocksize, | 1475 | sb->s_blocksize, |
1476 | sbi->s_groups_count, | 1476 | sbi->s_groups_count, |
@@ -1514,7 +1514,7 @@ static int ext4_fill_flex_info(struct super_block *sb) | |||
1514 | sizeof(struct flex_groups), GFP_KERNEL); | 1514 | sizeof(struct flex_groups), GFP_KERNEL); |
1515 | if (sbi->s_flex_groups == NULL) { | 1515 | if (sbi->s_flex_groups == NULL) { |
1516 | printk(KERN_ERR "EXT4-fs: not enough memory for " | 1516 | printk(KERN_ERR "EXT4-fs: not enough memory for " |
1517 | "%lu flex groups\n", flex_group_count); | 1517 | "%u flex groups\n", flex_group_count); |
1518 | goto failed; | 1518 | goto failed; |
1519 | } | 1519 | } |
1520 | 1520 | ||
@@ -1599,14 +1599,14 @@ static int ext4_check_descriptors(struct super_block *sb) | |||
1599 | block_bitmap = ext4_block_bitmap(sb, gdp); | 1599 | block_bitmap = ext4_block_bitmap(sb, gdp); |
1600 | if (block_bitmap < first_block || block_bitmap > last_block) { | 1600 | if (block_bitmap < first_block || block_bitmap > last_block) { |
1601 | printk(KERN_ERR "EXT4-fs: ext4_check_descriptors: " | 1601 | printk(KERN_ERR "EXT4-fs: ext4_check_descriptors: " |
1602 | "Block bitmap for group %lu not in group " | 1602 | "Block bitmap for group %u not in group " |
1603 | "(block %llu)!\n", i, block_bitmap); | 1603 | "(block %llu)!\n", i, block_bitmap); |
1604 | return 0; | 1604 | return 0; |
1605 | } | 1605 | } |
1606 | inode_bitmap = ext4_inode_bitmap(sb, gdp); | 1606 | inode_bitmap = ext4_inode_bitmap(sb, gdp); |
1607 | if (inode_bitmap < first_block || inode_bitmap > last_block) { | 1607 | if (inode_bitmap < first_block || inode_bitmap > last_block) { |
1608 | printk(KERN_ERR "EXT4-fs: ext4_check_descriptors: " | 1608 | printk(KERN_ERR "EXT4-fs: ext4_check_descriptors: " |
1609 | "Inode bitmap for group %lu not in group " | 1609 | "Inode bitmap for group %u not in group " |
1610 | "(block %llu)!\n", i, inode_bitmap); | 1610 | "(block %llu)!\n", i, inode_bitmap); |
1611 | return 0; | 1611 | return 0; |
1612 | } | 1612 | } |
@@ -1614,14 +1614,14 @@ static int ext4_check_descriptors(struct super_block *sb) | |||
1614 | if (inode_table < first_block || | 1614 | if (inode_table < first_block || |
1615 | inode_table + sbi->s_itb_per_group - 1 > last_block) { | 1615 | inode_table + sbi->s_itb_per_group - 1 > last_block) { |
1616 | printk(KERN_ERR "EXT4-fs: ext4_check_descriptors: " | 1616 | printk(KERN_ERR "EXT4-fs: ext4_check_descriptors: " |
1617 | "Inode table for group %lu not in group " | 1617 | "Inode table for group %u not in group " |
1618 | "(block %llu)!\n", i, inode_table); | 1618 | "(block %llu)!\n", i, inode_table); |
1619 | return 0; | 1619 | return 0; |
1620 | } | 1620 | } |
1621 | spin_lock(sb_bgl_lock(sbi, i)); | 1621 | spin_lock(sb_bgl_lock(sbi, i)); |
1622 | if (!ext4_group_desc_csum_verify(sbi, i, gdp)) { | 1622 | if (!ext4_group_desc_csum_verify(sbi, i, gdp)) { |
1623 | printk(KERN_ERR "EXT4-fs: ext4_check_descriptors: " | 1623 | printk(KERN_ERR "EXT4-fs: ext4_check_descriptors: " |
1624 | "Checksum for group %lu failed (%u!=%u)\n", | 1624 | "Checksum for group %u failed (%u!=%u)\n", |
1625 | i, le16_to_cpu(ext4_group_desc_csum(sbi, i, | 1625 | i, le16_to_cpu(ext4_group_desc_csum(sbi, i, |
1626 | gdp)), le16_to_cpu(gdp->bg_checksum)); | 1626 | gdp)), le16_to_cpu(gdp->bg_checksum)); |
1627 | if (!(sb->s_flags & MS_RDONLY)) { | 1627 | if (!(sb->s_flags & MS_RDONLY)) { |
@@ -3154,7 +3154,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) | |||
3154 | if (!ext4_group_desc_csum_verify(sbi, g, gdp)) { | 3154 | if (!ext4_group_desc_csum_verify(sbi, g, gdp)) { |
3155 | printk(KERN_ERR | 3155 | printk(KERN_ERR |
3156 | "EXT4-fs: ext4_remount: " | 3156 | "EXT4-fs: ext4_remount: " |
3157 | "Checksum for group %lu failed (%u!=%u)\n", | 3157 | "Checksum for group %u failed (%u!=%u)\n", |
3158 | g, le16_to_cpu(ext4_group_desc_csum(sbi, g, gdp)), | 3158 | g, le16_to_cpu(ext4_group_desc_csum(sbi, g, gdp)), |
3159 | le16_to_cpu(gdp->bg_checksum)); | 3159 | le16_to_cpu(gdp->bg_checksum)); |
3160 | err = -EINVAL; | 3160 | err = -EINVAL; |