diff options
author | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-05-19 01:09:05 -0400 |
---|---|---|
committer | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-05-19 01:09:05 -0400 |
commit | c203e45f069af47ca7623e4dcd8c00bfba2722e4 (patch) | |
tree | 4563115b6565dcfd97015c1c9366fb3d07cabf19 /fs/fat | |
parent | a94477da38e0b261a7ecea71f4c95a3bcd5be69c (diff) | |
parent | b8291ad07a7f3b5b990900f0001198ac23ba893e (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into for-linus
Diffstat (limited to 'fs/fat')
-rw-r--r-- | fs/fat/cache.c | 6 | ||||
-rw-r--r-- | fs/fat/fatent.c | 2 | ||||
-rw-r--r-- | fs/fat/file.c | 2 | ||||
-rw-r--r-- | fs/fat/inode.c | 8 |
4 files changed, 8 insertions, 10 deletions
diff --git a/fs/fat/cache.c b/fs/fat/cache.c index 639b3b4f86d1..fda25479af26 100644 --- a/fs/fat/cache.c +++ b/fs/fat/cache.c | |||
@@ -242,7 +242,7 @@ int fat_get_cluster(struct inode *inode, int cluster, int *fclus, int *dclus) | |||
242 | /* prevent the infinite loop of cluster chain */ | 242 | /* prevent the infinite loop of cluster chain */ |
243 | if (*fclus > limit) { | 243 | if (*fclus > limit) { |
244 | fat_fs_panic(sb, "%s: detected the cluster chain loop" | 244 | fat_fs_panic(sb, "%s: detected the cluster chain loop" |
245 | " (i_pos %lld)", __FUNCTION__, | 245 | " (i_pos %lld)", __func__, |
246 | MSDOS_I(inode)->i_pos); | 246 | MSDOS_I(inode)->i_pos); |
247 | nr = -EIO; | 247 | nr = -EIO; |
248 | goto out; | 248 | goto out; |
@@ -253,7 +253,7 @@ int fat_get_cluster(struct inode *inode, int cluster, int *fclus, int *dclus) | |||
253 | goto out; | 253 | goto out; |
254 | else if (nr == FAT_ENT_FREE) { | 254 | else if (nr == FAT_ENT_FREE) { |
255 | fat_fs_panic(sb, "%s: invalid cluster chain" | 255 | fat_fs_panic(sb, "%s: invalid cluster chain" |
256 | " (i_pos %lld)", __FUNCTION__, | 256 | " (i_pos %lld)", __func__, |
257 | MSDOS_I(inode)->i_pos); | 257 | MSDOS_I(inode)->i_pos); |
258 | nr = -EIO; | 258 | nr = -EIO; |
259 | goto out; | 259 | goto out; |
@@ -286,7 +286,7 @@ static int fat_bmap_cluster(struct inode *inode, int cluster) | |||
286 | return ret; | 286 | return ret; |
287 | else if (ret == FAT_ENT_EOF) { | 287 | else if (ret == FAT_ENT_EOF) { |
288 | fat_fs_panic(sb, "%s: request beyond EOF (i_pos %lld)", | 288 | fat_fs_panic(sb, "%s: request beyond EOF (i_pos %lld)", |
289 | __FUNCTION__, MSDOS_I(inode)->i_pos); | 289 | __func__, MSDOS_I(inode)->i_pos); |
290 | return -EIO; | 290 | return -EIO; |
291 | } | 291 | } |
292 | return dclus; | 292 | return dclus; |
diff --git a/fs/fat/fatent.c b/fs/fat/fatent.c index 13ab763cc510..302e95c4af7e 100644 --- a/fs/fat/fatent.c +++ b/fs/fat/fatent.c | |||
@@ -546,7 +546,7 @@ int fat_free_clusters(struct inode *inode, int cluster) | |||
546 | goto error; | 546 | goto error; |
547 | } else if (cluster == FAT_ENT_FREE) { | 547 | } else if (cluster == FAT_ENT_FREE) { |
548 | fat_fs_panic(sb, "%s: deleting FAT entry beyond EOF", | 548 | fat_fs_panic(sb, "%s: deleting FAT entry beyond EOF", |
549 | __FUNCTION__); | 549 | __func__); |
550 | err = -EIO; | 550 | err = -EIO; |
551 | goto error; | 551 | goto error; |
552 | } | 552 | } |
diff --git a/fs/fat/file.c b/fs/fat/file.c index d604bb132422..27cc1164ec36 100644 --- a/fs/fat/file.c +++ b/fs/fat/file.c | |||
@@ -208,7 +208,7 @@ static int fat_free(struct inode *inode, int skip) | |||
208 | } else if (ret == FAT_ENT_FREE) { | 208 | } else if (ret == FAT_ENT_FREE) { |
209 | fat_fs_panic(sb, | 209 | fat_fs_panic(sb, |
210 | "%s: invalid cluster chain (i_pos %lld)", | 210 | "%s: invalid cluster chain (i_pos %lld)", |
211 | __FUNCTION__, MSDOS_I(inode)->i_pos); | 211 | __func__, MSDOS_I(inode)->i_pos); |
212 | ret = -EIO; | 212 | ret = -EIO; |
213 | } else if (ret > 0) { | 213 | } else if (ret > 0) { |
214 | err = fat_ent_write(inode, &fatent, FAT_ENT_EOF, wait); | 214 | err = fat_ent_write(inode, &fatent, FAT_ENT_EOF, wait); |
diff --git a/fs/fat/inode.c b/fs/fat/inode.c index 5f522a55b596..4e0a3dd9d677 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c | |||
@@ -1222,8 +1222,7 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, | |||
1222 | brelse(bh); | 1222 | brelse(bh); |
1223 | goto out_invalid; | 1223 | goto out_invalid; |
1224 | } | 1224 | } |
1225 | logical_sector_size = | 1225 | logical_sector_size = get_unaligned_le16(&b->sector_size); |
1226 | le16_to_cpu(get_unaligned((__le16 *)&b->sector_size)); | ||
1227 | if (!is_power_of_2(logical_sector_size) | 1226 | if (!is_power_of_2(logical_sector_size) |
1228 | || (logical_sector_size < 512) | 1227 | || (logical_sector_size < 512) |
1229 | || (logical_sector_size > 4096)) { | 1228 | || (logical_sector_size > 4096)) { |
@@ -1322,8 +1321,7 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, | |||
1322 | sbi->dir_per_block_bits = ffs(sbi->dir_per_block) - 1; | 1321 | sbi->dir_per_block_bits = ffs(sbi->dir_per_block) - 1; |
1323 | 1322 | ||
1324 | sbi->dir_start = sbi->fat_start + sbi->fats * sbi->fat_length; | 1323 | sbi->dir_start = sbi->fat_start + sbi->fats * sbi->fat_length; |
1325 | sbi->dir_entries = | 1324 | sbi->dir_entries = get_unaligned_le16(&b->dir_entries); |
1326 | le16_to_cpu(get_unaligned((__le16 *)&b->dir_entries)); | ||
1327 | if (sbi->dir_entries & (sbi->dir_per_block - 1)) { | 1325 | if (sbi->dir_entries & (sbi->dir_per_block - 1)) { |
1328 | if (!silent) | 1326 | if (!silent) |
1329 | printk(KERN_ERR "FAT: bogus directroy-entries per block" | 1327 | printk(KERN_ERR "FAT: bogus directroy-entries per block" |
@@ -1335,7 +1333,7 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, | |||
1335 | rootdir_sectors = sbi->dir_entries | 1333 | rootdir_sectors = sbi->dir_entries |
1336 | * sizeof(struct msdos_dir_entry) / sb->s_blocksize; | 1334 | * sizeof(struct msdos_dir_entry) / sb->s_blocksize; |
1337 | sbi->data_start = sbi->dir_start + rootdir_sectors; | 1335 | sbi->data_start = sbi->dir_start + rootdir_sectors; |
1338 | total_sectors = le16_to_cpu(get_unaligned((__le16 *)&b->sectors)); | 1336 | total_sectors = get_unaligned_le16(&b->sectors); |
1339 | if (total_sectors == 0) | 1337 | if (total_sectors == 0) |
1340 | total_sectors = le32_to_cpu(b->total_sect); | 1338 | total_sectors = le32_to_cpu(b->total_sect); |
1341 | 1339 | ||