4 #include <exec/execbase.h>
7 #include "transactions.h"
14 struct ExecBase
*sysBase
;
16 struct DosLibrary
*dosBase
;
17 struct IntuitionBase
*intuitionBase
;
18 struct UtilityBase
*utilityBase
;
19 struct Device
*timerBase
;
21 struct DosPacket
*packet
;
22 struct DeviceNode
*devnode
;
23 struct DeviceList
*volumenode
;
24 struct MsgPort
*sdlhport
; // The SFS DosList handler port.
26 struct DosEnvec
*dosenvec
;
27 struct timerequest
*inactivitytimer_ioreq
;
28 struct timerequest
*activitytimer_ioreq
; /* How long activity can delay flushing data. */
29 struct FileSysStartupMsg
*startupmsg
;
30 struct MsgPort
*msgporttimer
;
31 struct MsgPort
*msgportflushtimer
;
32 struct MsgPort
*msgportnotify
;
33 struct Process
*mytask
;
35 ULONG diskstate
; /* ID_WRITE_PROTECTED, ID_VALIDATING, ID_VALIDATED */
38 ULONG inhibitnestcounter
;
40 ULONG block_defragptr
;
41 ULONG
*defragmentsteps
;
42 ULONG defragmentlongs
;
44 ULONG blocks_reserved_start
; /* number of blocks reserved at start (=reserved) */
45 ULONG blocks_reserved_end
; /* number of blocks reserved at end (=prealloc) */
47 ULONG blocks_bitmap
; /* number of BTMP blocks for this partition */
48 ULONG blocks_inbitmap
; /* number of blocks a single bitmap block can contain info on */
49 ULONG blocks_admin
; /* the size of all AdminSpaces */
51 ULONG block_root
; /* the block offset of the root block */
52 ULONG block_bitmapbase
; /* the block offset of the first bitmap block */
53 ULONG block_extentbnoderoot
; /* the block offset of the root of the extent bnode tree */
54 ULONG block_adminspace
; /* the block offset of the first adminspacecontainer block */
55 ULONG block_objectnoderoot
; /* the block offset of the root of the objectnode tree */
57 ULONG block_rovingblockptr
; /* the roving block pointer! */
59 ULONG node_containers
; /* number of containers per ExtentIndexContainer */
61 ULONG mask_block32
; /* masks the least significant bits of a BLCKf pointer */
64 ULONG disktype
; /* the type of media inserted (same as id_DiskType in InfoData
67 ULONG max_name_length
;
68 ULONG activity_timeout
;
69 ULONG inactivity_timeout
;
71 UWORD shifts_block32
; /* shift count needed to convert a blockoffset<->32byteoffset (only used by nodes.c!) */
73 UBYTE is_casesensitive
; /* See ROOTBITS_CASESENSITIVE in blockstructure.h */
74 UBYTE has_recycled
; /* See ROOTBITS_RECYCLED in blockstructure.h */
76 struct ExtFileLock
*locklist
; /* pointer to the first lock in the list, or zero if none */
78 LONG totalbuffers
; /* Number of buffers currently in use by filesystem! */
79 struct MinList globalhandles
;
80 struct NotifyRequest
*notifyrequests
;
82 BYTE activitytimeractive
;
83 BYTE pendingchanges
; /* indicates that the commit timer is active and that there are pending changes. */
86 BOOL is_LittleEndian
; /* Little endian filesystem? */
88 struct Space spacelist
[SPACELIST_MAX
+1];
89 UBYTE string
[260]; /* For storing BCPL string (usually path) */
90 UBYTE string2
[260]; /* For storing BCPL string (usually comment) */
91 UBYTE pathstring
[520]; /* Used by fullpath to build a full path */
93 struct fsStatistics statistics
;
96 extern struct MinList cblrulist
;
99 struct fsIORequest
*iolist
;
100 struct IOStdReq
*ioreq
; /* Used for Read/Write */
101 struct IOStdReq
*ioreq2
; /* Used for WriteProtection & DisksChange */
102 struct IOStdReq
*ioreqchangeint
; /* Used for DiskChange interrupt */
103 struct MsgPort
*msgport
;
111 struct fsIORequest fsioreq
;
113 ULONG sectors_total
; /* size of the partition in sectors */
114 UWORD sectors_block
; /* number of sectors in a block */
116 UWORD shifts_block
; /* shift count needed to convert a blockoffset<->byteoffset */
121 ULONG sector_low
; /* sector offset of our partition, needed for SCSI direct */
122 ULONG sector_high
; /* last sector plus one of our partition */
124 ULONG blocks_total
; /* size of the partition in blocks */
125 ULONG blocks_maxtransfer
; /* max. blocks which may be transfered to the device at once (limits io_Length) */
127 UQUAD byte_low
; /* the byte offset of our partition on the disk */
128 UQUAD byte_high
; /* the byte offset of the end of our partition (excluding) on the disk */
130 ULONG bytes_block
; /* size of a block in bytes */
131 ULONG bytes_sector
; /* size of a sector in bytes */
134 IPTR mask_mask
; /* mask as specified by mountlist */
136 ULONG bufmemtype
; /* default value */
138 /* Internal globals */
140 struct SCSICmd scsicmd
; /* for SCSIdirect */
141 struct SCSI10Cmd scsi10cmd
;
143 struct Interrupt changeint
;
152 #define MINSAFETYBLOCKS (16)
153 #define MINCACHESIZE (MINSAFETYBLOCKS*2)
154 #define HASHSHIFT (7)
155 #define HASHSIZE (1<<HASHSHIFT)
157 struct MinList cbhashlist
[HASHSIZE
];
158 struct MinList cblrulist
;
160 void *transactionpool
;
161 ULONG transactionpoolsize
;
162 UBYTE
*compressbuffer
;
163 LONG transactionnestcount
;
165 struct Operation
*operationroot
;
166 struct Operation operationsentinel
;
168 #define IOC_HASHSHIFT (6)
169 #define IOC_HASHSIZE (1<<IOC_HASHSHIFT)
171 struct IOCache
*ioc_hashtable
[IOC_HASHSIZE
];
172 struct MinList
*iocache_lruhead
;
173 struct IOCache
*ioc_buffer
; /* Used for reading data when another iocache has dirty data in it. */
175 ULONG iocache_sizeinblocks
;
178 BYTE iocache_copyback
;
179 // BYTE iocache_readonwrite=TRUE; /* Determines whether a new line is read before writing to it. */
180 BYTE iocache_readonwrite
; /* Determines whether a new line is read before writing to it. */
182 struct EClockVal ecv
;
184 NODE templockedobjectnode
;
186 UBYTE internalrename
; /* If TRUE, then the file is being renamed to recycled... */
188 #define FRAGMENTS (300)
190 ULONG fragment
[FRAGMENTS
];
191 //UBYTE fragmenttype[FRAGMENTS];
195 ULONG searchedblocks
;
197 #define OPTBUFSIZE (131072)
199 ULONG defrag_maxfilestoscan
;
204 #define globals (*(struct SFSBase **)&((struct Process *)FindTask(NULL))->pr_GlobVec)
206 extern struct Globals
*globals
;
233 /* FIXME: Remove these #define xxxBase hacks
234 Do not use this in new code !
237 #define SysBase (globals->sysBase)
239 #define DOSBase (globals->dosBase)
240 #define IntuitionBase (globals->intuitionBase)
241 #define UtilityBase (globals->utilityBase)
242 #define TimerBase (globals->timerBase)
244 #endif /*GLOBALS_H_*/