2 Copyright © 2010, The AROS Development Team. All rights reserved.
3 $Id: cache.h 33098 2010-04-26 16:58:12Z neil $
11 #include <exec/types.h>
12 #include <exec/lists.h>
16 struct MinNode node1
; /* links into hash table */
17 struct MinNode node2
; /* links into free and dirty lists */
18 ULONG use_count
; /* number of users of this block */
20 ULONG num
; /* start block number */
21 UBYTE
*data
; /* actual block data */
26 ULONG block_count
; /* number of blocks allocated */
27 ULONG block_size
; /* size of a disk block */
28 ULONG hash_size
; /* size of hash table */
29 struct BlockRange
**blocks
; /* array of pointers to all blocks */
30 struct MinList
*hash_table
; /* hash table of all valid cache blocks */
31 struct MinList dirty_list
; /* the dirty list */
32 struct MinList free_list
; /* the free list */
43 APTR
Cache_CreateCache(ULONG hash_size
, ULONG block_count
, ULONG block_size
);
44 VOID
Cache_DestroyCache(APTR cache
);
45 APTR
Cache_GetBlock(APTR cache
, UQUAD blockNum
, UBYTE
**data
);
46 VOID
Cache_FreeBlock(APTR cache
, APTR block
);
47 VOID
Cache_MarkBlockDirty(APTR cache
, APTR block
);
48 BOOL
Cache_Flush(APTR cache
);