revert 213 commits (to 56092) from the last month. 10 still need work to resolve...
[AROS.git] / rom / filesys / SFS / FS / fs.h
blobfd1875d8d6bbf24dadfc36c1bef50f2dc9e2be16
1 #ifndef _FS_H
2 #define _FS_H
4 #include <exec/types.h>
5 #include <libraries/iffparse.h>
6 #include <dos/dos.h>
8 #ifndef SFS_BE
9 #define SFS_BE 1
10 #endif
12 #define CHECKCODE
13 // #define CHECKCODE_SLOW
14 //#define CHECKCODE_BNODES
15 // #define CHECKCODE_TRANSACTIONS // MagicValue, also uncomment stuff in redblacktree.h
17 // #define CHECKCHECKSUMSALWAYS
19 // #define DEBUGCODE
20 // #define DEBUGKPRINTF /* If defined and DEBUGCODE is defined then uses kprintf as output */
21 // #define DEBUG115200
23 // #define WORDCOMPRESSION
24 #define LONGCOMPRESSION
25 // #define NOCOMPRESSION
26 // #define ALTERNATIVECOMPRESSION
27 // #define BLOCKCOMPRESSION
29 #define PROGRAMNAME "Smart Filesystem"
30 #define PROGRAMNAMEVER "SmartFilesystem"
32 #define MAX_NAME_LENGTH (100)
33 #define MAX_TRANSACTIONPOOLSIZE (32768)
34 #define MAX_RETRIES (0)
36 #define ALWAYSFREE (3) // The number of blocks SFS always tries to keep free.
38 #define ROVING_SMALL_WRITE (8192) // If a write is larger than this then no extra space will be
39 // skipped by the roving pointer for possible future use by
40 // the same file.
42 #define ROVING_RESERVED_SPACE (8192) // Space the roving ptr will skip extra for possible future
43 // use by the same file.
45 #define INTERR_CHECKSUM_FAILURE 80
46 #define INTERR_BLOCK_WRONG_TYPE 81
47 #define INTERR_OWNBLOCK_WRONG 82
48 #define INTERR_BTREE 83
49 #define INTERR_SAFE_DELETE 84
50 #define INTERR_NODES 85
51 #define INTERR_EXTENT 86
52 #define INTERR_DEFRAGMENTER 87
54 /* macros */
56 #ifndef __AROS__
57 #define TOBADDR(x) (((ULONG)(x)) >> 2)
58 #else
59 #define TOBADDR(x) (MKBADDR(x))
60 #endif
62 #define remove(n) (n)->ln_Succ->ln_Pred=(n)->ln_Pred; (n)->ln_Pred->ln_Succ=(n)->ln_Succ
63 #define addtail(l,n) (n)->ln_Succ=(l)->lh_TailPred->ln_Succ; (l)->lh_TailPred->ln_Succ=(n); (n)->ln_Pred=(l)->lh_TailPred; (l)->lh_TailPred=(n)
65 #define removem(n) (n)->mln_Succ->mln_Pred=(n)->mln_Pred; (n)->mln_Pred->mln_Succ=(n)->mln_Succ
66 #define addtailm(l,n) (n)->mln_Succ=(l)->mlh_TailPred->mln_Succ; (l)->mlh_TailPred->mln_Succ=(n); (n)->mln_Pred=(l)->mlh_TailPred; (l)->mlh_TailPred=(n)
67 #define addheadm(l,n) (n)->mln_Succ=(l)->mlh_Head; (n)->mln_Pred=(struct MinNode *)(l); (l)->mlh_Head->mln_Pred=(n); (l)->mlh_Head=(n);
69 #if SFS_BE
70 #define DOSTYPE_ID AROS_MAKE_ID('S','F','S',0)
71 #else
72 #define DOSTYPE_ID AROS_MAKE_ID('s','f','s',0)
73 #endif
75 /* HASHENTRY(x) is used to determine which hashchain to use for
76 a specific hash value. */
78 #define HASHCHAIN(x) (UWORD)(x % (UWORD)((globals->bytes_block-sizeof(struct fsHashTable))>>2))
81 struct fsStatistics {
82 ULONG cache_accesses;
83 ULONG cache_operationdecode;
84 ULONG cache_emptyoperationdecode;
85 ULONG cache_misses;
87 ULONG cachedio_hits;
88 ULONG cachedio_misses;
91 #endif // _FS_H