4 #include <exec/types.h>
5 #include <libraries/iffparse.h>
13 // #define CHECKCODE_SLOW
14 //#define CHECKCODE_BNODES
15 // #define CHECKCODE_TRANSACTIONS // MagicValue, also uncomment stuff in redblacktree.h
17 // #define CHECKCHECKSUMSALWAYS
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
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
57 #define TOBADDR(x) (((ULONG)(x)) >> 2)
59 #define TOBADDR(x) (MKBADDR(x))
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);
70 #define DOSTYPE_ID AROS_MAKE_ID('S','F','S',0)
72 #define DOSTYPE_ID AROS_MAKE_ID('s','f','s',0)
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))
83 ULONG cache_operationdecode
;
84 ULONG cache_emptyoperationdecode
;
88 ULONG cachedio_misses
;