diff options
author | Eric Sandeen <esandeen@redhat.com> | 2006-09-27 04:49:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-27 11:26:09 -0400 |
commit | eee194e76c681dbdbf5024b889fda1181b66ef57 (patch) | |
tree | bbefd2b2da5a49dcf8057e182f35c044445111e9 /fs/ext3/super.c | |
parent | 41f04d852e359582518f950d12b2287766613022 (diff) |
[PATCH] ext3: inode numbers are unsigned long
This is primarily format string fixes, with changes to ialloc.c where large
inode counts could overflow, and also pass around journal_inum as an
unsigned long, just to be pedantic about it....
Signed-off-by: Eric Sandeen <esandeen@redhat.com>
Cc: Mingming Cao <cmm@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/ext3/super.c')
-rw-r--r-- | fs/ext3/super.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 762dff7b56fb..bc7a768f9bb4 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c | |||
@@ -45,7 +45,7 @@ | |||
45 | static int ext3_load_journal(struct super_block *, struct ext3_super_block *, | 45 | static int ext3_load_journal(struct super_block *, struct ext3_super_block *, |
46 | unsigned long journal_devnum); | 46 | unsigned long journal_devnum); |
47 | static int ext3_create_journal(struct super_block *, struct ext3_super_block *, | 47 | static int ext3_create_journal(struct super_block *, struct ext3_super_block *, |
48 | int); | 48 | unsigned int); |
49 | static void ext3_commit_super (struct super_block * sb, | 49 | static void ext3_commit_super (struct super_block * sb, |
50 | struct ext3_super_block * es, | 50 | struct ext3_super_block * es, |
51 | int sync); | 51 | int sync); |
@@ -376,7 +376,7 @@ static void dump_orphan_list(struct super_block *sb, struct ext3_sb_info *sbi) | |||
376 | list_for_each(l, &sbi->s_orphan) { | 376 | list_for_each(l, &sbi->s_orphan) { |
377 | struct inode *inode = orphan_list_entry(l); | 377 | struct inode *inode = orphan_list_entry(l); |
378 | printk(KERN_ERR " " | 378 | printk(KERN_ERR " " |
379 | "inode %s:%ld at %p: mode %o, nlink %d, next %d\n", | 379 | "inode %s:%lu at %p: mode %o, nlink %d, next %d\n", |
380 | inode->i_sb->s_id, inode->i_ino, inode, | 380 | inode->i_sb->s_id, inode->i_ino, inode, |
381 | inode->i_mode, inode->i_nlink, | 381 | inode->i_mode, inode->i_nlink, |
382 | NEXT_ORPHAN(inode)); | 382 | NEXT_ORPHAN(inode)); |
@@ -753,7 +753,7 @@ static ext3_fsblk_t get_sb_block(void **data) | |||
753 | } | 753 | } |
754 | 754 | ||
755 | static int parse_options (char *options, struct super_block *sb, | 755 | static int parse_options (char *options, struct super_block *sb, |
756 | unsigned long *inum, unsigned long *journal_devnum, | 756 | unsigned int *inum, unsigned long *journal_devnum, |
757 | ext3_fsblk_t *n_blocks_count, int is_remount) | 757 | ext3_fsblk_t *n_blocks_count, int is_remount) |
758 | { | 758 | { |
759 | struct ext3_sb_info *sbi = EXT3_SB(sb); | 759 | struct ext3_sb_info *sbi = EXT3_SB(sb); |
@@ -1306,17 +1306,17 @@ static void ext3_orphan_cleanup (struct super_block * sb, | |||
1306 | DQUOT_INIT(inode); | 1306 | DQUOT_INIT(inode); |
1307 | if (inode->i_nlink) { | 1307 | if (inode->i_nlink) { |
1308 | printk(KERN_DEBUG | 1308 | printk(KERN_DEBUG |
1309 | "%s: truncating inode %ld to %Ld bytes\n", | 1309 | "%s: truncating inode %lu to %Ld bytes\n", |
1310 | __FUNCTION__, inode->i_ino, inode->i_size); | 1310 | __FUNCTION__, inode->i_ino, inode->i_size); |
1311 | jbd_debug(2, "truncating inode %ld to %Ld bytes\n", | 1311 | jbd_debug(2, "truncating inode %lu to %Ld bytes\n", |
1312 | inode->i_ino, inode->i_size); | 1312 | inode->i_ino, inode->i_size); |
1313 | ext3_truncate(inode); | 1313 | ext3_truncate(inode); |
1314 | nr_truncates++; | 1314 | nr_truncates++; |
1315 | } else { | 1315 | } else { |
1316 | printk(KERN_DEBUG | 1316 | printk(KERN_DEBUG |
1317 | "%s: deleting unreferenced inode %ld\n", | 1317 | "%s: deleting unreferenced inode %lu\n", |
1318 | __FUNCTION__, inode->i_ino); | 1318 | __FUNCTION__, inode->i_ino); |
1319 | jbd_debug(2, "deleting unreferenced inode %ld\n", | 1319 | jbd_debug(2, "deleting unreferenced inode %lu\n", |
1320 | inode->i_ino); | 1320 | inode->i_ino); |
1321 | nr_orphans++; | 1321 | nr_orphans++; |
1322 | } | 1322 | } |
@@ -1395,7 +1395,7 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent) | |||
1395 | ext3_fsblk_t sb_block = get_sb_block(&data); | 1395 | ext3_fsblk_t sb_block = get_sb_block(&data); |
1396 | ext3_fsblk_t logic_sb_block; | 1396 | ext3_fsblk_t logic_sb_block; |
1397 | unsigned long offset = 0; | 1397 | unsigned long offset = 0; |
1398 | unsigned long journal_inum = 0; | 1398 | unsigned int journal_inum = 0; |
1399 | unsigned long journal_devnum = 0; | 1399 | unsigned long journal_devnum = 0; |
1400 | unsigned long def_mount_opts; | 1400 | unsigned long def_mount_opts; |
1401 | struct inode *root; | 1401 | struct inode *root; |
@@ -1844,7 +1844,8 @@ static void ext3_init_journal_params(struct super_block *sb, journal_t *journal) | |||
1844 | spin_unlock(&journal->j_state_lock); | 1844 | spin_unlock(&journal->j_state_lock); |
1845 | } | 1845 | } |
1846 | 1846 | ||
1847 | static journal_t *ext3_get_journal(struct super_block *sb, int journal_inum) | 1847 | static journal_t *ext3_get_journal(struct super_block *sb, |
1848 | unsigned int journal_inum) | ||
1848 | { | 1849 | { |
1849 | struct inode *journal_inode; | 1850 | struct inode *journal_inode; |
1850 | journal_t *journal; | 1851 | journal_t *journal; |
@@ -1979,7 +1980,7 @@ static int ext3_load_journal(struct super_block *sb, | |||
1979 | unsigned long journal_devnum) | 1980 | unsigned long journal_devnum) |
1980 | { | 1981 | { |
1981 | journal_t *journal; | 1982 | journal_t *journal; |
1982 | int journal_inum = le32_to_cpu(es->s_journal_inum); | 1983 | unsigned int journal_inum = le32_to_cpu(es->s_journal_inum); |
1983 | dev_t journal_dev; | 1984 | dev_t journal_dev; |
1984 | int err = 0; | 1985 | int err = 0; |
1985 | int really_read_only; | 1986 | int really_read_only; |
@@ -2065,7 +2066,7 @@ static int ext3_load_journal(struct super_block *sb, | |||
2065 | 2066 | ||
2066 | static int ext3_create_journal(struct super_block * sb, | 2067 | static int ext3_create_journal(struct super_block * sb, |
2067 | struct ext3_super_block * es, | 2068 | struct ext3_super_block * es, |
2068 | int journal_inum) | 2069 | unsigned int journal_inum) |
2069 | { | 2070 | { |
2070 | journal_t *journal; | 2071 | journal_t *journal; |
2071 | 2072 | ||
@@ -2078,7 +2079,7 @@ static int ext3_create_journal(struct super_block * sb, | |||
2078 | if (!(journal = ext3_get_journal(sb, journal_inum))) | 2079 | if (!(journal = ext3_get_journal(sb, journal_inum))) |
2079 | return -EINVAL; | 2080 | return -EINVAL; |
2080 | 2081 | ||
2081 | printk(KERN_INFO "EXT3-fs: creating new journal on inode %d\n", | 2082 | printk(KERN_INFO "EXT3-fs: creating new journal on inode %u\n", |
2082 | journal_inum); | 2083 | journal_inum); |
2083 | 2084 | ||
2084 | if (journal_create(journal)) { | 2085 | if (journal_create(journal)) { |