aboutsummaryrefslogtreecommitdiff
path: root/fs/fat/inode.c
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-12-09 11:37:00 +0000
committerMark Brown <broonie@linaro.org>2013-12-09 11:37:00 +0000
commiteed4bafd63b5584adb832a582a931ecba41dec55 (patch)
tree5855807caaf53aec80037b2635eb2e2c0744565b /fs/fat/inode.c
parent8bb495e3f02401ee6f76d1b1d77f3ac9f079e376 (diff)
parent2c06cb20454795a38876be5bd93dd6a8ddcc9d98 (diff)
Merge branch 'android-3.10' of https://android.googlesource.com/kernel/common into lsk-v3.10-aosp
Diffstat (limited to 'fs/fat/inode.c')
-rw-r--r--fs/fat/inode.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 5d4513cb1b3..a14dd4c0528 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -1252,6 +1252,7 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, int isvfat,
struct inode *fsinfo_inode = NULL;
struct buffer_head *bh;
struct fat_boot_sector *b;
+ struct fat_boot_bsx *bsx;
struct msdos_sb_info *sbi;
u16 logical_sector_size;
u32 total_sectors, total_clusters, fat_clusters, rootdir_sectors;
@@ -1398,6 +1399,8 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, int isvfat,
goto out_fail;
}
+ bsx = (struct fat_boot_bsx *)(bh->b_data + FAT32_BSX_OFFSET);
+
fsinfo = (struct fat_boot_fsinfo *)fsinfo_bh->b_data;
if (!IS_FSINFO(fsinfo)) {
fat_msg(sb, KERN_WARNING, "Invalid FSINFO signature: "
@@ -1413,8 +1416,14 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, int isvfat,
}
brelse(fsinfo_bh);
+ } else {
+ bsx = (struct fat_boot_bsx *)(bh->b_data + FAT16_BSX_OFFSET);
}
+ /* interpret volume ID as a little endian 32 bit integer */
+ sbi->vol_id = (((u32)bsx->vol_id[0]) | ((u32)bsx->vol_id[1] << 8) |
+ ((u32)bsx->vol_id[2] << 16) | ((u32)bsx->vol_id[3] << 24));
+
sbi->dir_per_block = sb->s_blocksize / sizeof(struct msdos_dir_entry);
sbi->dir_per_block_bits = ffs(sbi->dir_per_block) - 1;