2 * fat.handler - FAT12/16/32 filesystem handler
4 * Copyright © 2006 Marek Szyprowski
5 * Copyright © 2007 The AROS Development Team
7 * This program is free software; you can redistribute it and/or modify it
8 * under the same terms as AROS itself.
18 #include <aros/libcall.h>
19 #include <devices/trackdisk.h>
21 #include "fat_struct.h"
23 /* filesystem structures */
25 #define ID_FAT_DISK 0x46415400UL
27 #define ID_FAT12_DISK 0x46415400UL
28 #define ID_FAT16_DISK 0x46415401UL
29 #define ID_FAT32_DISK 0x46415402UL
31 #define ACTION_VOLUME_ADD 16000
32 #define ACTION_VOLUME_REMOVE 16001
34 extern struct Globals
*glob
;
36 #define DEF_POOL_SIZE 65536
37 #define DEF_POOL_TRESHOLD DEF_POOL_SIZE
38 #define DEF_BUFF_LINES 128
39 #define DEF_READ_AHEAD 16*1024
42 struct CacheBuffer *next;
69 #define FAT_ROOTDIR_MARK 0xFFFFFFFFlu
77 struct MsgPort
*fl_Task
;
80 /* coinsistency check */
83 /* my directory start cluster */
90 struct Extent data_ext
[1];
92 /* dir entry cache for easy and quick management of long files */
94 /* used in directory scanning and file reading */
100 struct DirCache dircache
[1];
104 UBYTE name
[32]; /* BCPL string */
105 struct DateStamp create_time
;
109 struct FSSuper
*next
;
110 struct DosList
*doslist
;
113 ULONG sectorsize_bits
;
116 ULONG clustersize_bits
;
117 ULONG cluster_sectors_bits
;
119 ULONG first_fat_sector
;
120 ULONG first_data_sector
;
121 ULONG first_rootdir_sector
;
123 ULONG rootdir_sectors
;
126 ULONG clusters_count
;
136 ULONG fat32_cachesize
;
137 ULONG fat32_cachesize_bits
;
138 ULONG fat32_cache_block
;
140 struct Extent first_rootdir_extent
[1];
142 struct VolumeInfo volume
;
145 ULONG (*func_get_fat_entry
)(struct FSSuper
*sb
, ULONG n
);
152 struct Task
*ourtask
;
153 struct MsgPort
*ourport
;
157 struct DosList
*devnode
;
158 struct FileSysStartupMsg
*fssm
;
163 struct IOExtTD
*diskioreq
;
164 struct IOExtTD
*diskchgreq
;
165 struct MsgPort
*diskport
;
169 struct FSSuper
*sb
; /* current sb */
170 struct FSSuper
*sblist
; /* list of sbs with outstanding locks */