Skip to content

Commit

Permalink
fat: i_blocks warning fix
Browse files Browse the repository at this point in the history
blkcnt_t type depends on CONFIG_LSF. Use unsigned long long always for
printk().  But lazy to type it, so add "llu" and use it.

Signed-off-by: OGAWA Hirofumi <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
OGAWAHirofumi authored and torvalds committed Nov 6, 2008
1 parent 9ca59f4 commit c330293
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion fs/fat/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ static int fat__get_entry(struct inode *dir, loff_t *pos,
*bh = sb_bread(sb, phys);
if (*bh == NULL) {
printk(KERN_ERR "FAT: Directory bread(block %llu) failed\n",
(unsigned long long)phys);
(llu)phys);
/* skip this block */
*pos = (iblock + 1) << sb->s_blocksize_bits;
goto next;
Expand Down
3 changes: 3 additions & 0 deletions fs/fat/fat.h
Original file line number Diff line number Diff line change
Expand Up @@ -323,4 +323,7 @@ extern int fat_sync_bhs(struct buffer_head **bhs, int nr_bhs);
int fat_cache_init(void);
void fat_cache_destroy(void);

/* helper for printk */
typedef unsigned long long llu;

#endif /* !_FAT_H */
5 changes: 2 additions & 3 deletions fs/fat/fatent.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ static int fat12_ent_bread(struct super_block *sb, struct fat_entry *fatent,
err_brelse:
brelse(bhs[0]);
err:
printk(KERN_ERR "FAT: FAT read failed (blocknr %llu)\n",
(unsigned long long)blocknr);
printk(KERN_ERR "FAT: FAT read failed (blocknr %llu)\n", (llu)blocknr);
return -EIO;
}

Expand All @@ -107,7 +106,7 @@ static int fat_ent_bread(struct super_block *sb, struct fat_entry *fatent,
fatent->bhs[0] = sb_bread(sb, blocknr);
if (!fatent->bhs[0]) {
printk(KERN_ERR "FAT: FAT read failed (blocknr %llu)\n",
(unsigned long long)blocknr);
(llu)blocknr);
return -EIO;
}
fatent->nr_bhs = 1;
Expand Down
5 changes: 3 additions & 2 deletions fs/fat/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ int fat_chain_add(struct inode *inode, int new_dclus, int nr_cluster)
mark_inode_dirty(inode);
}
if (new_fclus != (inode->i_blocks >> (sbi->cluster_bits - 9))) {
fat_fs_panic(sb, "clusters badly computed (%d != %lu)",
new_fclus, inode->i_blocks >> (sbi->cluster_bits - 9));
fat_fs_panic(sb, "clusters badly computed (%d != %llu)",
new_fclus,
(llu)(inode->i_blocks >> (sbi->cluster_bits - 9)));
fat_cache_inval_inode(inode);
}
inode->i_blocks += nr_cluster << (sbi->cluster_bits - 9);
Expand Down

0 comments on commit c330293

Please sign in to comment.