History

fat: add extended fileds to struct fat_boot_sector

Later we will need "state" field to check if volume was cleanly unmounted.

Oleksij Rempel committed 13 years ago

Commit 6b464191 parent 899bed02 files · +32 −12Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/msdos_fs.h+28−8
@@ -120,14 +120,34 @@ struct fat_boot_sector { · 119 unmodified lines
120120 __le32 hidden; /* hidden sectors (unused) */
121121 __le32 total_sect; /* number of sectors (if sectors == 0) */
122122
123− /* The following fields are only used by FAT32 */
124− __le32 fat32_length; /* sectors/FAT */
125− __le16 flags; /* bit 8: fat mirroring, low 4: active fat */
126− __u8 version[2]; /* major, minor filesystem version */
127− __le32 root_cluster; /* first cluster in root directory */
128− __le16 info_sector; /* filesystem info sector */
129− __le16 backup_boot; /* backup boot sector */
130− __le16 reserved2[6]; /* Unused */
123+ union {
124+ struct {
125+ /* Extended BPB Fields for FAT16 */
126+ __u8 drive_number; /* Physical drive number */
127+ __u8 state; /* undocumented, but used
128+ for mount state. */
129+ /* other fiealds are not added here */
130+ } fat16;
131+
132+ struct {
133+ /* only used by FAT32 */
134+ __le32 length; /* sectors/FAT */
135+ __le16 flags; /* bit 8: fat mirroring,
136+ low 4: active fat */
137+ __u8 version[2]; /* major, minor filesystem
138+ version */
139+ __le32 root_cluster; /* first cluster in
140+ root directory */
141+ __le16 info_sector; /* filesystem info sector */
142+ __le16 backup_boot; /* backup boot sector */
143+ __le16 reserved2[6]; /* Unused */
144+ /* Extended BPB Fields for FAT32 */
145+ __u8 drive_number; /* Physical drive number */
146+ __u8 state; /* undocumented, but used
147+ for mount state. */
148+ /* other fiealds are not added here */
149+ } fat32;
150+ };
131151 };
132152
133153 struct fat_boot_fsinfo {