Go to the documentation of this file. 1 #ifndef _UAPI_LINUX_MSDOS_FS_H
2 #define _UAPI_LINUX_MSDOS_FS_H
4 #include <linux/types.h>
5 #include <linux/magic.h>
6 #include <asm/byteorder.h>
12 #define SECTOR_SIZE 512
14 #define MSDOS_DPB (MSDOS_DPS)
15 #define MSDOS_DPB_BITS 4
16 #define MSDOS_DPS (SECTOR_SIZE / sizeof(struct msdos_dir_entry))
17 #define MSDOS_DPS_BITS 4
18 #define MSDOS_LONGNAME 256
19 #define CF_LE_W(v) le16_to_cpu(v)
20 #define CF_LE_L(v) le32_to_cpu(v)
21 #define CT_LE_W(v) cpu_to_le16(v)
22 #define CT_LE_L(v) cpu_to_le32(v)
24 #define MSDOS_ROOT_INO 1
25 #define MSDOS_FSINFO_INO 2
27 #define MSDOS_DIR_BITS 5
30 #define FAT_MAX_DIR_ENTRIES (65536)
31 #define FAT_MAX_DIR_SIZE (FAT_MAX_DIR_ENTRIES << MSDOS_DIR_BITS)
42 #define ATTR_UNUSED (ATTR_VOLUME | ATTR_ARCH | ATTR_SYS | ATTR_HIDDEN)
44 #define ATTR_EXT (ATTR_RO | ATTR_HIDDEN | ATTR_SYS | ATTR_VOLUME)
46 #define CASE_LOWER_BASE 8
47 #define CASE_LOWER_EXT 16
49 #define DELETED_FLAG 0xe5
50 #define IS_FREE(n) (!*(n) || *(n) == DELETED_FLAG)
52 #define FAT_LFN_LEN 255
54 #define MSDOS_SLOTS 21
55 #define MSDOS_DOT ". "
56 #define MSDOS_DOTDOT ".. "
58 #define FAT_FIRST_ENT(s, x) ((MSDOS_SB(s)->fat_bits == 32 ? 0x0FFFFF00 : \
59 MSDOS_SB(s)->fat_bits == 16 ? 0xFF00 : 0xF00) | (x))
62 #define FAT_START_ENT 2
65 #define MAX_FAT12 0xFF4
66 #define MAX_FAT16 0xFFF4
67 #define MAX_FAT32 0x0FFFFFF6
68 #define MAX_FAT(s) (MSDOS_SB(s)->fat_bits == 32 ? MAX_FAT32 : \
69 MSDOS_SB(s)->fat_bits == 16 ? MAX_FAT16 : MAX_FAT12)
72 #define BAD_FAT12 0xFF7
73 #define BAD_FAT16 0xFFF7
74 #define BAD_FAT32 0x0FFFFFF7
77 #define EOF_FAT12 0xFFF
78 #define EOF_FAT16 0xFFFF
79 #define EOF_FAT32 0x0FFFFFFF
81 #define FAT_ENT_FREE (0)
82 #define FAT_ENT_BAD (BAD_FAT32)
83 #define FAT_ENT_EOF (EOF_FAT32)
85 #define FAT_FSINFO_SIG1 0x41615252
86 #define FAT_FSINFO_SIG2 0x61417272
87 #define IS_FSINFO(x) (le32_to_cpu((x)->signature1) == FAT_FSINFO_SIG1 \
88 && le32_to_cpu((x)->signature2) == FAT_FSINFO_SIG2)
100 #define VFAT_IOCTL_READDIR_BOTH _IOR('r', 1, struct __fat_dirent[2])
101 #define VFAT_IOCTL_READDIR_SHORT _IOR('r', 2, struct __fat_dirent[2])
103 #define FAT_IOCTL_GET_ATTRIBUTES _IOR('r', 0x10, __u32)
104 #define FAT_IOCTL_SET_ATTRIBUTES _IOW('r', 0x11, __u32)