]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/fs/coss/store_coss.h
7 #define COSS_MEMBUF_SZ 1048576
10 /** \note swap_filen in sio/e are actually disk offsets too! */
12 /** What we're doing in storeCossAllocate() */
13 #define COSS_ALLOC_NOTIFY 0
15 /** What we're doing in storeCossAllocate() */
16 #define COSS_ALLOC_ALLOCATE 1
18 /** What we're doing in storeCossAllocate() */
19 #define COSS_ALLOC_REALLOC 2
28 void describe(int level
, int line
);
29 void maybeWrite(CossSwapDir
* SD
);
30 void write(CossSwapDir
* SD
);
32 off_t diskstart
; /* in blocks */
33 off_t diskend
; /* in blocks */
36 char buffer
[COSS_MEMBUF_SZ
];
38 struct _cossmembuf_flags
{
40 unsigned int writing
:1;
47 \note The dlink_node MUST be the first member of the structure.
48 * This member is later pointer typecasted to coss_index_node *.
55 * Per-storeiostate info
57 class CossState
: public StoreIOState
61 MEMPROXY_CLASS(CossState
);
62 CossState(CossSwapDir
*);
68 size_t requestoffset
; /* in blocks */
69 int64_t reqdiskoffset
; /* in blocks */
72 unsigned int reading
:1;
73 unsigned int writing
:1;
76 CossMemBuf
*locked_membuf
;
78 void read_(char *buf
, size_t size
, off_t offset
, STRCB
* callback
, void *callback_data
);
79 void write(char const *buf
, size_t size
, off_t offset
, FREE
* free_func
);
80 virtual void close(int);
81 void doCallback(int errflag
);
87 MEMPROXY_CLASS_INLINE(CossState
);
90 typedef struct _cossindex CossIndexNode
;
94 * Whether the coss system has been setup or not
96 extern int coss_initialised
;
98 extern MemAllocator
*coss_membuf_pool
;
100 extern MemAllocator
*coss_index_pool
;
102 #include "DiskIO/ReadRequest.h"
105 class CossRead
: public ReadRequest
109 void * operator new (size_t);
110 void operator delete (void *);
111 CossRead(ReadRequest
const &base
, StoreIOState::Pointer anSio
) : ReadRequest(base
) , sio(anSio
) {}
113 StoreIOState::Pointer sio
;
116 CBDATA_CLASS(CossRead
);
119 #include "DiskIO/WriteRequest.h"
122 class CossWrite
: public WriteRequest
126 void * operator new (size_t);
127 void operator delete (void *);
128 CossWrite(WriteRequest
const &base
, CossMemBuf
*aBuf
) : WriteRequest(base
) , membuf(aBuf
) {}
133 CBDATA_CLASS(CossWrite
);