From 08f622a12708a0a787c8345532e0b1665b993cab Mon Sep 17 00:00:00 2001 From: Christian Taedcke Date: Wed, 15 Nov 2023 13:44:18 +0100 Subject: fs: fat: calculate FAT type based on cluster count This fixes an issue where the FAT type (FAT12, FAT16) is not correctly detected, e.g. when the BPB field BS_FilSysType contains the valid value "FAT ". According to the FAT spec the field BS_FilSysType has only informational character and does not determine the FAT type. The logic of this code is based on the linux kernel implementation from the file fs/fat/inode.c function fat_fill_super(). For details about FAT see http://elm-chan.org/docs/fat_e.html Signed-off-by: Christian Taedcke --- include/fat.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'include') diff --git a/include/fat.h b/include/fat.h index a9756fb4cd1..3dce99a23cf 100644 --- a/include/fat.h +++ b/include/fat.h @@ -34,12 +34,6 @@ struct disk_partition; /* Maximum number of entry for long file name according to spec */ #define MAX_LFN_SLOT 20 -/* Filesystem identifiers */ -#define FAT12_SIGN "FAT12 " -#define FAT16_SIGN "FAT16 " -#define FAT32_SIGN "FAT32 " -#define SIGNLEN 8 - /* File attributes */ #define ATTR_RO 1 #define ATTR_HIDDEN 2 -- cgit v1.2.3