Commit a9df9a49 authored by Theodore Ts'o's avatar Theodore Ts'o

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: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent cde64360
...@@ -100,7 +100,7 @@ unsigned ext4_init_block_bitmap(struct super_block *sb, struct buffer_head *bh, ...@@ -100,7 +100,7 @@ unsigned ext4_init_block_bitmap(struct super_block *sb, struct buffer_head *bh,
* essentially implementing a per-group read-only flag. */ * essentially implementing a per-group read-only flag. */
if (!ext4_group_desc_csum_verify(sbi, block_group, gdp)) { if (!ext4_group_desc_csum_verify(sbi, block_group, gdp)) {
ext4_error(sb, __func__, ext4_error(sb, __func__,
"Checksum bad for group %lu", block_group); "Checksum bad for group %u", block_group);
gdp->bg_free_blocks_count = 0; gdp->bg_free_blocks_count = 0;
gdp->bg_free_inodes_count = 0; gdp->bg_free_inodes_count = 0;
gdp->bg_itable_unused = 0; gdp->bg_itable_unused = 0;
...@@ -213,7 +213,7 @@ struct ext4_group_desc * ext4_get_group_desc(struct super_block *sb, ...@@ -213,7 +213,7 @@ struct ext4_group_desc * ext4_get_group_desc(struct super_block *sb,
if (block_group >= sbi->s_groups_count) { if (block_group >= sbi->s_groups_count) {
ext4_error(sb, "ext4_get_group_desc", ext4_error(sb, "ext4_get_group_desc",
"block_group >= groups_count - " "block_group >= groups_count - "
"block_group = %lu, groups_count = %lu", "block_group = %u, groups_count = %u",
block_group, sbi->s_groups_count); block_group, sbi->s_groups_count);
return NULL; return NULL;
...@@ -225,7 +225,7 @@ struct ext4_group_desc * ext4_get_group_desc(struct super_block *sb, ...@@ -225,7 +225,7 @@ struct ext4_group_desc * ext4_get_group_desc(struct super_block *sb,
if (!sbi->s_group_desc[group_desc]) { if (!sbi->s_group_desc[group_desc]) {
ext4_error(sb, "ext4_get_group_desc", ext4_error(sb, "ext4_get_group_desc",
"Group descriptor not loaded - " "Group descriptor not loaded - "
"block_group = %lu, group_desc = %lu, desc = %lu", "block_group = %u, group_desc = %lu, desc = %lu",
block_group, group_desc, offset); block_group, group_desc, offset);
return NULL; return NULL;
} }
...@@ -315,7 +315,7 @@ ext4_read_block_bitmap(struct super_block *sb, ext4_group_t block_group) ...@@ -315,7 +315,7 @@ ext4_read_block_bitmap(struct super_block *sb, ext4_group_t block_group)
if (unlikely(!bh)) { if (unlikely(!bh)) {
ext4_error(sb, __func__, ext4_error(sb, __func__,
"Cannot read block bitmap - " "Cannot read block bitmap - "
"block_group = %lu, block_bitmap = %llu", "block_group = %u, block_bitmap = %llu",
block_group, bitmap_blk); block_group, bitmap_blk);
return NULL; return NULL;
} }
...@@ -337,7 +337,7 @@ ext4_read_block_bitmap(struct super_block *sb, ext4_group_t block_group) ...@@ -337,7 +337,7 @@ ext4_read_block_bitmap(struct super_block *sb, ext4_group_t block_group)
put_bh(bh); put_bh(bh);
ext4_error(sb, __func__, ext4_error(sb, __func__,
"Cannot read block bitmap - " "Cannot read block bitmap - "
"block_group = %lu, block_bitmap = %llu", "block_group = %u, block_bitmap = %llu",
block_group, bitmap_blk); block_group, bitmap_blk);
return NULL; return NULL;
} }
......
...@@ -965,7 +965,7 @@ ext4_group_first_block_no(struct super_block *sb, ext4_group_t group_no) ...@@ -965,7 +965,7 @@ ext4_group_first_block_no(struct super_block *sb, ext4_group_t group_no)
#define ERR_BAD_DX_DIR -75000 #define ERR_BAD_DX_DIR -75000
void ext4_get_group_no_and_offset(struct super_block *sb, ext4_fsblk_t blocknr, void ext4_get_group_no_and_offset(struct super_block *sb, ext4_fsblk_t blocknr,
unsigned long *blockgrpp, ext4_grpblk_t *offsetp); ext4_group_t *blockgrpp, ext4_grpblk_t *offsetp);
extern struct proc_dir_entry *ext4_proc_root; extern struct proc_dir_entry *ext4_proc_root;
......
...@@ -31,7 +31,7 @@ typedef unsigned long long ext4_fsblk_t; ...@@ -31,7 +31,7 @@ typedef unsigned long long ext4_fsblk_t;
typedef __u32 ext4_lblk_t; typedef __u32 ext4_lblk_t;
/* data type for block group number */ /* data type for block group number */
typedef unsigned long ext4_group_t; typedef unsigned int ext4_group_t;
#define rsv_start rsv_window._rsv_start #define rsv_start rsv_window._rsv_start
#define rsv_end rsv_window._rsv_end #define rsv_end rsv_window._rsv_end
......
...@@ -74,7 +74,7 @@ unsigned ext4_init_inode_bitmap(struct super_block *sb, struct buffer_head *bh, ...@@ -74,7 +74,7 @@ unsigned ext4_init_inode_bitmap(struct super_block *sb, struct buffer_head *bh,
/* If checksum is bad mark all blocks and inodes use to prevent /* If checksum is bad mark all blocks and inodes use to prevent
* allocation, essentially implementing a per-group read-only flag. */ * allocation, essentially implementing a per-group read-only flag. */
if (!ext4_group_desc_csum_verify(sbi, block_group, gdp)) { if (!ext4_group_desc_csum_verify(sbi, block_group, gdp)) {
ext4_error(sb, __func__, "Checksum bad for group %lu", ext4_error(sb, __func__, "Checksum bad for group %u",
block_group); block_group);
gdp->bg_free_blocks_count = 0; gdp->bg_free_blocks_count = 0;
gdp->bg_free_inodes_count = 0; gdp->bg_free_inodes_count = 0;
...@@ -111,7 +111,7 @@ ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group) ...@@ -111,7 +111,7 @@ ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group)
if (unlikely(!bh)) { if (unlikely(!bh)) {
ext4_error(sb, __func__, ext4_error(sb, __func__,
"Cannot read inode bitmap - " "Cannot read inode bitmap - "
"block_group = %lu, inode_bitmap = %llu", "block_group = %u, inode_bitmap = %llu",
block_group, bitmap_blk); block_group, bitmap_blk);
return NULL; return NULL;
} }
...@@ -133,7 +133,7 @@ ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group) ...@@ -133,7 +133,7 @@ ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group)
put_bh(bh); put_bh(bh);
ext4_error(sb, __func__, ext4_error(sb, __func__,
"Cannot read inode bitmap - " "Cannot read inode bitmap - "
"block_group = %lu, inode_bitmap = %llu", "block_group = %u, inode_bitmap = %llu",
block_group, bitmap_blk); block_group, bitmap_blk);
return NULL; return NULL;
} }
...@@ -690,7 +690,7 @@ struct inode *ext4_new_inode(handle_t *handle, struct inode *dir, int mode) ...@@ -690,7 +690,7 @@ struct inode *ext4_new_inode(handle_t *handle, struct inode *dir, int mode)
ino > EXT4_INODES_PER_GROUP(sb)) { ino > EXT4_INODES_PER_GROUP(sb)) {
ext4_error(sb, __func__, ext4_error(sb, __func__,
"reserved inode or inode > inodes count - " "reserved inode or inode > inodes count - "
"block_group = %lu, inode=%lu", group, "block_group = %u, inode=%lu", group,
ino + group * EXT4_INODES_PER_GROUP(sb)); ino + group * EXT4_INODES_PER_GROUP(sb));
err = -EIO; err = -EIO;
goto fail; goto fail;
......
...@@ -447,7 +447,7 @@ static void mb_free_blocks_double(struct inode *inode, struct ext4_buddy *e4b, ...@@ -447,7 +447,7 @@ static void mb_free_blocks_double(struct inode *inode, struct ext4_buddy *e4b,
le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block); le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block);
ext4_error(sb, __func__, "double-free of inode" ext4_error(sb, __func__, "double-free of inode"
" %lu's block %llu(bit %u in group %lu)", " %lu's block %llu(bit %u in group %u)",
inode ? inode->i_ino : 0, blocknr, inode ? inode->i_ino : 0, blocknr,
first + i, e4b->bd_group); first + i, e4b->bd_group);
} }
...@@ -477,7 +477,7 @@ static void mb_cmp_bitmaps(struct ext4_buddy *e4b, void *bitmap) ...@@ -477,7 +477,7 @@ static void mb_cmp_bitmaps(struct ext4_buddy *e4b, void *bitmap)
b2 = (unsigned char *) bitmap; b2 = (unsigned char *) bitmap;
for (i = 0; i < e4b->bd_sb->s_blocksize; i++) { for (i = 0; i < e4b->bd_sb->s_blocksize; i++) {
if (b1[i] != b2[i]) { if (b1[i] != b2[i]) {
printk(KERN_ERR "corruption in group %lu " printk(KERN_ERR "corruption in group %u "
"at byte %u(%u): %x in copy != %x " "at byte %u(%u): %x in copy != %x "
"on disk/prealloc\n", "on disk/prealloc\n",
e4b->bd_group, i, i * 8, b1[i], b2[i]); 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,7 +691,7 @@ static void ext4_mb_generate_buddy(struct super_block *sb,
if (free != grp->bb_free) { if (free != grp->bb_free) {
ext4_error(sb, __func__, ext4_error(sb, __func__,
"EXT4-fs: group %lu: %u blocks in bitmap, %u in gd", "EXT4-fs: group %u: %u blocks in bitmap, %u in gd",
group, free, grp->bb_free); group, free, grp->bb_free);
/* /*
* If we intent to continue, we consider group descritor * 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,7 +800,7 @@ static int ext4_mb_init_cache(struct page *page, char *incore)
get_bh(bh[i]); get_bh(bh[i]);
bh[i]->b_end_io = end_buffer_read_sync; bh[i]->b_end_io = end_buffer_read_sync;
submit_bh(READ, bh[i]); submit_bh(READ, bh[i]);
mb_debug("read bitmap for group %lu\n", first_group + i); mb_debug("read bitmap for group %u\n", first_group + i);
} }
/* wait for I/O completion */ /* wait for I/O completion */
...@@ -895,7 +895,7 @@ ext4_mb_load_buddy(struct super_block *sb, ext4_group_t group, ...@@ -895,7 +895,7 @@ ext4_mb_load_buddy(struct super_block *sb, ext4_group_t group,
struct page *page; struct page *page;
int ret; int ret;
mb_debug("load group %lu\n", group); mb_debug("load group %u\n", group);
blocks_per_page = PAGE_CACHE_SIZE / sb->s_blocksize; blocks_per_page = PAGE_CACHE_SIZE / sb->s_blocksize;
...@@ -1096,7 +1096,7 @@ static void mb_free_blocks(struct inode *inode, struct ext4_buddy *e4b, ...@@ -1096,7 +1096,7 @@ static void mb_free_blocks(struct inode *inode, struct ext4_buddy *e4b,
le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block); le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block);
ext4_unlock_group(sb, e4b->bd_group); ext4_unlock_group(sb, e4b->bd_group);
ext4_error(sb, __func__, "double-free of inode" ext4_error(sb, __func__, "double-free of inode"
" %lu's block %llu(bit %u in group %lu)", " %lu's block %llu(bit %u in group %u)",
inode ? inode->i_ino : 0, blocknr, block, inode ? inode->i_ino : 0, blocknr, block,
e4b->bd_group); e4b->bd_group);
ext4_lock_group(sb, e4b->bd_group); 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,13 +1934,13 @@ static int ext4_mb_seq_history_show(struct seq_file *seq, void *v)
if (hs->op == EXT4_MB_HISTORY_ALLOC) { if (hs->op == EXT4_MB_HISTORY_ALLOC) {
fmt = "%-5u %-8u %-23s %-23s %-23s %-5u %-5u %-2u " fmt = "%-5u %-8u %-23s %-23s %-23s %-5u %-5u %-2u "
"%-5u %-5s %-5u %-6u\n"; "%-5u %-5s %-5u %-6u\n";
sprintf(buf2, "%lu/%d/%u@%u", hs->result.fe_group, sprintf(buf2, "%u/%d/%u@%u", hs->result.fe_group,
hs->result.fe_start, hs->result.fe_len, hs->result.fe_start, hs->result.fe_len,
hs->result.fe_logical); hs->result.fe_logical);
sprintf(buf, "%lu/%d/%u@%u", hs->orig.fe_group, sprintf(buf, "%u/%d/%u@%u", hs->orig.fe_group,
hs->orig.fe_start, hs->orig.fe_len, hs->orig.fe_start, hs->orig.fe_len,
hs->orig.fe_logical); hs->orig.fe_logical);
sprintf(buf3, "%lu/%d/%u@%u", hs->goal.fe_group, sprintf(buf3, "%u/%d/%u@%u", hs->goal.fe_group,
hs->goal.fe_start, hs->goal.fe_len, hs->goal.fe_start, hs->goal.fe_len,
hs->goal.fe_logical); hs->goal.fe_logical);
seq_printf(seq, fmt, hs->pid, hs->ino, buf, buf3, buf2, 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,20 +1949,20 @@ static int ext4_mb_seq_history_show(struct seq_file *seq, void *v)
hs->buddy ? 1 << hs->buddy : 0); hs->buddy ? 1 << hs->buddy : 0);
} else if (hs->op == EXT4_MB_HISTORY_PREALLOC) { } else if (hs->op == EXT4_MB_HISTORY_PREALLOC) {
fmt = "%-5u %-8u %-23s %-23s %-23s\n"; fmt = "%-5u %-8u %-23s %-23s %-23s\n";
sprintf(buf2, "%lu/%d/%u@%u", hs->result.fe_group, sprintf(buf2, "%u/%d/%u@%u", hs->result.fe_group,
hs->result.fe_start, hs->result.fe_len, hs->result.fe_start, hs->result.fe_len,
hs->result.fe_logical); hs->result.fe_logical);
sprintf(buf, "%lu/%d/%u@%u", hs->orig.fe_group, sprintf(buf, "%u/%d/%u@%u", hs->orig.fe_group,
hs->orig.fe_start, hs->orig.fe_len, hs->orig.fe_start, hs->orig.fe_len,
hs->orig.fe_logical); hs->orig.fe_logical);
seq_printf(seq, fmt, hs->pid, hs->ino, buf, "", buf2); seq_printf(seq, fmt, hs->pid, hs->ino, buf, "", buf2);
} else if (hs->op == EXT4_MB_HISTORY_DISCARD) { } else if (hs->op == EXT4_MB_HISTORY_DISCARD) {
sprintf(buf2, "%lu/%d/%u", hs->result.fe_group, sprintf(buf2, "%u/%d/%u", hs->result.fe_group,
hs->result.fe_start, hs->result.fe_len); hs->result.fe_start, hs->result.fe_len);
seq_printf(seq, "%-5u %-8u %-23s discard\n", seq_printf(seq, "%-5u %-8u %-23s discard\n",
hs->pid, hs->ino, buf2); hs->pid, hs->ino, buf2);
} else if (hs->op == EXT4_MB_HISTORY_FREE) { } else if (hs->op == EXT4_MB_HISTORY_FREE) {
sprintf(buf2, "%lu/%d/%u", hs->result.fe_group, sprintf(buf2, "%u/%d/%u", hs->result.fe_group,
hs->result.fe_start, hs->result.fe_len); hs->result.fe_start, hs->result.fe_len);
seq_printf(seq, "%-5u %-8u %-23s free\n", seq_printf(seq, "%-5u %-8u %-23s free\n",
hs->pid, hs->ino, buf2); hs->pid, hs->ino, buf2);
...@@ -2075,7 +2075,7 @@ static void *ext4_mb_seq_groups_start(struct seq_file *seq, loff_t *pos) ...@@ -2075,7 +2075,7 @@ static void *ext4_mb_seq_groups_start(struct seq_file *seq, loff_t *pos)
return NULL; return NULL;
group = *pos + 1; group = *pos + 1;
return (void *) group; return (void *) ((unsigned long) group);
} }
static void *ext4_mb_seq_groups_next(struct seq_file *seq, void *v, loff_t *pos) 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,13 +2088,13 @@ static void *ext4_mb_seq_groups_next(struct seq_file *seq, void *v, loff_t *pos)
if (*pos < 0 || *pos >= sbi->s_groups_count) if (*pos < 0 || *pos >= sbi->s_groups_count)
return NULL; return NULL;
group = *pos + 1; group = *pos + 1;
return (void *) group;; return (void *) ((unsigned long) group);
} }
static int ext4_mb_seq_groups_show(struct seq_file *seq, void *v) static int ext4_mb_seq_groups_show(struct seq_file *seq, void *v)
{ {
struct super_block *sb = seq->private; struct super_block *sb = seq->private;
long group = (long) v; ext4_group_t group = (ext4_group_t) ((unsigned long) v);
int i; int i;
int err; int err;
struct ext4_buddy e4b; struct ext4_buddy e4b;
...@@ -2116,7 +2116,7 @@ static int ext4_mb_seq_groups_show(struct seq_file *seq, void *v) ...@@ -2116,7 +2116,7 @@ static int ext4_mb_seq_groups_show(struct seq_file *seq, void *v)
sizeof(struct ext4_group_info); sizeof(struct ext4_group_info);
err = ext4_mb_load_buddy(sb, group, &e4b); err = ext4_mb_load_buddy(sb, group, &e4b);
if (err) { if (err) {
seq_printf(seq, "#%-5lu: I/O error\n", group); seq_printf(seq, "#%-5u: I/O error\n", group);
return 0; return 0;
} }
ext4_lock_group(sb, group); ext4_lock_group(sb, group);
...@@ -2124,7 +2124,7 @@ static int ext4_mb_seq_groups_show(struct seq_file *seq, void *v) ...@@ -2124,7 +2124,7 @@ static int ext4_mb_seq_groups_show(struct seq_file *seq, void *v)
ext4_unlock_group(sb, group); ext4_unlock_group(sb, group);
ext4_mb_release_desc(&e4b); ext4_mb_release_desc(&e4b);
seq_printf(seq, "#%-5lu: %-5u %-5u %-5u [", group, sg.info.bb_free, seq_printf(seq, "#%-5u: %-5u %-5u %-5u [", group, sg.info.bb_free,
sg.info.bb_fragments, sg.info.bb_first_free); sg.info.bb_fragments, sg.info.bb_first_free);
for (i = 0; i <= 13; i++) for (i = 0; i <= 13; i++)
seq_printf(seq, " %-5u", i <= sb->s_blocksize_bits + 1 ? 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,7 +2459,7 @@ static int ext4_mb_init_backend(struct super_block *sb)
desc = ext4_get_group_desc(sb, i, NULL); desc = ext4_get_group_desc(sb, i, NULL);
if (desc == NULL) { if (desc == NULL) {
printk(KERN_ERR printk(KERN_ERR
"EXT4-fs: can't read descriptor %lu\n", i); "EXT4-fs: can't read descriptor %u\n", i);
goto err_freebuddy; goto err_freebuddy;
} }
if (ext4_mb_add_groupinfo(sb, i, desc) != 0) 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,7 +2657,7 @@ static void release_blocks_on_commit(journal_t *journal, transaction_t *txn)
list_for_each_safe(l, ltmp, &txn->t_private_list) { list_for_each_safe(l, ltmp, &txn->t_private_list) {
entry = list_entry(l, struct ext4_free_data, list); entry = list_entry(l, struct ext4_free_data, list);
mb_debug("gonna free %u blocks in group %lu (0x%p):", mb_debug("gonna free %u blocks in group %u (0x%p):",
entry->count, entry->group, entry); entry->count, entry->group, entry);
err = ext4_mb_load_buddy(sb, entry->group, &e4b); err = ext4_mb_load_buddy(sb, entry->group, &e4b);
...@@ -2829,7 +2829,7 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac, ...@@ -2829,7 +2829,7 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac,
if (!gdp) if (!gdp)
goto out_err; goto out_err;
ext4_debug("using block group %lu(%d)\n", ac->ac_b_ex.fe_group, ext4_debug("using block group %u(%d)\n", ac->ac_b_ex.fe_group,
gdp->bg_free_blocks_count); gdp->bg_free_blocks_count);
err = ext4_journal_get_write_access(handle, gdp_bh); 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,7 +3351,7 @@ static void ext4_mb_generate_from_pa(struct super_block *sb, void *bitmap,
preallocated += len; preallocated += len;
count++; count++;
} }
mb_debug("prellocated %u for group %lu\n", preallocated, group); mb_debug("prellocated %u for group %u\n", preallocated, group);
} }
static void ext4_mb_pa_callback(struct rcu_head *head) 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,7 +3368,7 @@ static void ext4_mb_pa_callback(struct rcu_head *head)
static void ext4_mb_put_pa(struct ext4_allocation_context *ac, static void ext4_mb_put_pa(struct ext4_allocation_context *ac,
struct super_block *sb, struct ext4_prealloc_space *pa) struct super_block *sb, struct ext4_prealloc_space *pa)
{ {
unsigned long grp; ext4_group_t grp;
if (!atomic_dec_and_test(&pa->pa_count) || pa->pa_free != 0) if (!atomic_dec_and_test(&pa->pa_count) || pa->pa_free != 0)
return; return;
...@@ -3697,7 +3697,7 @@ ext4_mb_discard_group_preallocations(struct super_block *sb, ...@@ -3697,7 +3697,7 @@ ext4_mb_discard_group_preallocations(struct super_block *sb,
int busy = 0; int busy = 0;
int free = 0; int free = 0;
mb_debug("discard preallocation for group %lu\n", group); mb_debug("discard preallocation for group %u\n", group);
if (list_empty(&grp->bb_prealloc_list)) if (list_empty(&grp->bb_prealloc_list))
return 0; return 0;
...@@ -3705,14 +3705,14 @@ ext4_mb_discard_group_preallocations(struct super_block *sb, ...@@ -3705,14 +3705,14 @@ ext4_mb_discard_group_preallocations(struct super_block *sb,
bitmap_bh = ext4_read_block_bitmap(sb, group); bitmap_bh = ext4_read_block_bitmap(sb, group);
if (bitmap_bh == NULL) { if (bitmap_bh == NULL) {
ext4_error(sb, __func__, "Error in reading block " ext4_error(sb, __func__, "Error in reading block "
"bitmap for %lu", group); "bitmap for %u", group);
return 0; return 0;
} }
err = ext4_mb_load_buddy(sb, group, &e4b); err = ext4_mb_load_buddy(sb, group, &e4b);
if (err) { if (err) {
ext4_error(sb, __func__, "Error in loading buddy " ext4_error(sb, __func__, "Error in loading buddy "
"information for %lu", group); "information for %u", group);
put_bh(bitmap_bh); put_bh(bitmap_bh);
return 0; return 0;
} }
...@@ -3879,14 +3879,14 @@ void ext4_discard_preallocations(struct inode *inode) ...@@ -3879,14 +3879,14 @@ void ext4_discard_preallocations(struct inode *inode)
err = ext4_mb_load_buddy(sb, group, &e4b); err = ext4_mb_load_buddy(sb, group, &e4b);
if (err) { if (err) {
ext4_error(sb, __func__, "Error in loading buddy " ext4_error(sb, __func__, "Error in loading buddy "
"information for %lu", group); "information for %u", group);
continue; continue;
} }
bitmap_bh = ext4_read_block_bitmap(sb, group); bitmap_bh = ext4_read_block_bitmap(sb, group);
if (bitmap_bh == NULL) { if (bitmap_bh == NULL) {
ext4_error(sb, __func__, "Error in reading block " ext4_error(sb, __func__, "Error in reading block "
"bitmap for %lu", group); "bitmap for %u", group);
ext4_mb_release_desc(&e4b); ext4_mb_release_desc(&e4b);
continue; continue;
} }
...@@ -4151,7 +4151,7 @@ ext4_mb_discard_lg_preallocations(struct super_block *sb, ...@@ -4151,7 +4151,7 @@ ext4_mb_discard_lg_preallocations(struct super_block *sb,
ext4_get_group_no_and_offset(sb, pa->pa_pstart, &group, NULL); ext4_get_group_no_and_offset(sb, pa->pa_pstart, &group, NULL);
if (ext4_mb_load_buddy(sb, group, &e4b)) { if (ext4_mb_load_buddy(sb, group, &e4b)) {
ext4_error(sb, __func__, "Error in loading buddy " ext4_error(sb, __func__, "Error in loading buddy "
"information for %lu", group); "information for %u", group);
continue; continue;
} }
ext4_lock_group(sb, group); ext4_lock_group(sb, group);
......
...@@ -50,7 +50,7 @@ static int verify_group_input(struct super_block *sb, ...@@ -50,7 +50,7 @@ static int verify_group_input(struct super_block *sb,
ext4_get_group_no_and_offset(sb, start, NULL, &offset); ext4_get_group_no_and_offset(sb, start, NULL, &offset);
if (group != sbi->s_groups_count) if (group != sbi->s_groups_count)
ext4_warning(sb, __func__, ext4_warning(sb, __func__,
"Cannot add at group %u (only %lu groups)", "Cannot add at group %u (only %u groups)",
input->group, sbi->s_groups_count); input->group, sbi->s_groups_count);
else if (offset != 0) else if (offset != 0)
ext4_warning(sb, __func__, "Last group not full"); ext4_warning(sb, __func__, "Last group not full");
...@@ -716,7 +716,7 @@ static void update_backups(struct super_block *sb, ...@@ -716,7 +716,7 @@ static void update_backups(struct super_block *sb,
exit_err: exit_err:
if (err) { if (err) {
ext4_warning(sb, __func__, ext4_warning(sb, __func__,
"can't update backup for group %lu (err %d), " "can't update backup for group %u (err %d), "
"forcing fsck on next reboot", group, err); "forcing fsck on next reboot", group, err);
sbi->s_mount_state &= ~EXT4_VALID_FS; sbi->s_mount_state &= ~EXT4_VALID_FS;
sbi->s_es->s_state &= cpu_to_le16(~EXT4_VALID_FS); sbi->s_es->s_state &= cpu_to_le16(~EXT4_VALID_FS);
......
...@@ -1470,7 +1470,7 @@ static int ext4_setup_super(struct super_block *sb, struct ext4_super_block *es, ...@@ -1470,7 +1470,7 @@ static int ext4_setup_super(struct super_block *sb, struct ext4_super_block *es,
ext4_commit_super(sb, es, 1); ext4_commit_super(sb, es, 1);
if (test_opt(sb, DEBUG)) if (test_opt(sb, DEBUG))
printk(KERN_INFO "[EXT4 FS bs=%lu, gc=%lu, " printk(KERN_INFO "[EXT4 FS bs=%lu, gc=%u, "
"bpg=%lu, ipg=%lu, mo=%04lx]\n", "bpg=%lu, ipg=%lu, mo=%04lx]\n",
sb->s_blocksize, sb->s_blocksize,
sbi->s_groups_count, sbi->s_groups_count,
...@@ -1514,7 +1514,7 @@ static int ext4_fill_flex_info(struct super_block *sb) ...@@ -1514,7 +1514,7 @@ static int ext4_fill_flex_info(struct super_block *sb)
sizeof(struct flex_groups), GFP_KERNEL); sizeof(struct flex_groups), GFP_KERNEL);
if (sbi->s_flex_groups == NULL) { if (sbi->s_flex_groups == NULL) {
printk(KERN_ERR "EXT4-fs: not enough memory for " printk(KERN_ERR "EXT4-fs: not enough memory for "
"%lu flex groups\n", flex_group_count); "%u flex groups\n", flex_group_count);
goto failed; goto failed;
} }
...@@ -1599,14 +1599,14 @@ static int ext4_check_descriptors(struct super_block *sb) ...@@ -1599,14 +1599,14 @@ static int ext4_check_descriptors(struct super_block *sb)
block_bitmap = ext4_block_bitmap(sb, gdp); block_bitmap = ext4_block_bitmap(sb, gdp);
if (block_bitmap < first_block || block_bitmap > last_block) { if (block_bitmap < first_block || block_bitmap > last_block) {
printk(KERN_ERR "EXT4-fs: ext4_check_descriptors: " printk(KERN_ERR "EXT4-fs: ext4_check_descriptors: "
"Block bitmap for group %lu not in group " "Block bitmap for group %u not in group "
"(block %llu)!\n", i, block_bitmap); "(block %llu)!\n", i, block_bitmap);
return 0; return 0;
} }
inode_bitmap = ext4_inode_bitmap(sb, gdp); inode_bitmap = ext4_inode_bitmap(sb, gdp);
if (inode_bitmap < first_block || inode_bitmap > last_block) { if (inode_bitmap < first_block || inode_bitmap > last_block) {
printk(KERN_ERR "EXT4-fs: ext4_check_descriptors: " printk(KERN_ERR "EXT4-fs: ext4_check_descriptors: "
"Inode bitmap for group %lu not in group " "Inode bitmap for group %u not in group "
"(block %llu)!\n", i, inode_bitmap); "(block %llu)!\n", i, inode_bitmap);
return 0; return 0;
} }
...@@ -1614,14 +1614,14 @@ static int ext4_check_descriptors(struct super_block *sb) ...@@ -1614,14 +1614,14 @@ static int ext4_check_descriptors(struct super_block *sb)
if (inode_table < first_block || if (inode_table < first_block ||
inode_table + sbi->s_itb_per_group - 1 > last_block) { inode_table + sbi->s_itb_per_group - 1 > last_block) {
printk(KERN_ERR "EXT4-fs: ext4_check_descriptors: " printk(KERN_ERR "EXT4-fs: ext4_check_descriptors: "
"Inode table for group %lu not in group " "Inode table for group %u not in group "
"(block %llu)!\n", i, inode_table); "(block %llu)!\n", i, inode_table);
return 0; return 0;
} }
spin_lock(sb_bgl_lock(sbi, i)); spin_lock(sb_bgl_lock(sbi, i));
if (!ext4_group_desc_csum_verify(sbi, i, gdp)) { if (!ext4_group_desc_csum_verify(sbi, i, gdp)) {
printk(KERN_ERR "EXT4-fs: ext4_check_descriptors: " printk(KERN_ERR "EXT4-fs: ext4_check_descriptors: "
"Checksum for group %lu failed (%u!=%u)\n", "Checksum for group %u failed (%u!=%u)\n",
i, le16_to_cpu(ext4_group_desc_csum(sbi, i, i, le16_to_cpu(ext4_group_desc_csum(sbi, i,
gdp)), le16_to_cpu(gdp->bg_checksum)); gdp)), le16_to_cpu(gdp->bg_checksum));
if (!(sb->s_flags & MS_RDONLY)) { if (!(sb->s_flags & MS_RDONLY)) {
...@@ -3154,7 +3154,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) ...@@ -3154,7 +3154,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
if (!ext4_group_desc_csum_verify(sbi, g, gdp)) { if (!ext4_group_desc_csum_verify(sbi, g, gdp)) {
printk(KERN_ERR printk(KERN_ERR
"EXT4-fs: ext4_remount: " "EXT4-fs: ext4_remount: "
"Checksum for group %lu failed (%u!=%u)\n", "Checksum for group %u failed (%u!=%u)\n",
g, le16_to_cpu(ext4_group_desc_csum(sbi, g, gdp)), g, le16_to_cpu(ext4_group_desc_csum(sbi, g, gdp)),
le16_to_cpu(gdp->bg_checksum)); le16_to_cpu(gdp->bg_checksum));
err = -EINVAL; err = -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment