summaryrefslogtreecommitdiffstats
path: root/fs/fat/cache.c
diff options
context:
space:
mode:
authorCarmeli Tamir <carmeli.tamir@gmail.com>2019-01-04 00:28:00 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2019-01-04 22:13:47 +0100
commit306790f75ac2fe021a900395255e468807002c42 (patch)
tree2099a8597d8214025191201bdd321b37a9419291 /fs/fat/cache.c
parentfat: move MAX_FAT to fat.h and change it to inline function (diff)
downloadlinux-306790f75ac2fe021a900395255e468807002c42.tar.xz
linux-306790f75ac2fe021a900395255e468807002c42.zip
fat: new inline functions to determine the FAT variant (32, 16 or 12)
This patch introduces 3 new inline functions - is_fat12, is_fat16 and is_fat32, and replaces every occurrence in the code in which the FS variant (whether this is FAT12, FAT16 or FAT32) was previously checked using msdos_sb_info->fat_bits. Link: http://lkml.kernel.org/r/1544990640-11604-4-git-send-email-carmeli.tamir@gmail.com Signed-off-by: Carmeli Tamir <carmeli.tamir@gmail.com> Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Cc: Johannes Thumshirn <jthumshirn@suse.de> Cc: Bart Van Assche <bvanassche@acm.org> Cc: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/fat/cache.c')
-rw-r--r--fs/fat/cache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/fat/cache.c b/fs/fat/cache.c
index 78d501c1fb65..738e427e2d21 100644
--- a/fs/fat/cache.c
+++ b/fs/fat/cache.c
@@ -363,7 +363,7 @@ int fat_bmap(struct inode *inode, sector_t sector, sector_t *phys,
*phys = 0;
*mapped_blocks = 0;
- if ((sbi->fat_bits != 32) && (inode->i_ino == MSDOS_ROOT_INO)) {
+ if (!is_fat32(sbi) && (inode->i_ino == MSDOS_ROOT_INO)) {
if (sector < (sbi->dir_entries >> sbi->dir_per_block_bits)) {
*phys = sector + sbi->dir_start;
*mapped_blocks = 1;