4 * Internal declarations for the DiskThreads routines
7 #ifndef __DISKTHREADS_H__
8 #define __DISKTHREADS_H__
10 #ifdef AUFS_IO_THREADS
11 #define NUMTHREADS AUFS_IO_THREADS
13 #define NUMTHREADS (Config.cacheSwap.n_configured*16)
16 /* Queue limit where swapouts are deferred (load calculation) */
17 #define MAGIC1 (NUMTHREADS*Config.cacheSwap.n_configured*5)
18 /* Queue limit where swapins are deferred (open/create fails) */
19 #define MAGIC2 (NUMTHREADS*Config.cacheSwap.n_configured*20)
21 /* Which operations to run async */
24 #define ASYNC_CREATE 1
28 enum _squidaio_request_type
{
38 typedef enum _squidaio_request_type squidaio_request_type
;
40 typedef void AIOCB(int fd
, void *cbdata
, const char *buf
, int aio_return
, int aio_errno
);
42 struct squidaio_result_t
46 enum _squidaio_request_type result_type
;
47 void *_data
; /* Internal housekeeping */
48 void *data
; /* Available to the caller */
51 struct squidaio_ctrl_t
54 struct squidaio_ctrl_t
*next
;
58 void *done_handler_data
;
59 squidaio_result_t result
;
66 void squidaio_init(void);
67 void squidaio_shutdown(void);
68 int squidaio_cancel(squidaio_result_t
*);
69 int squidaio_open(const char *, int, mode_t
, squidaio_result_t
*);
70 int squidaio_read(int, char *, size_t, off_t
, int, squidaio_result_t
*);
71 int squidaio_write(int, char *, size_t, off_t
, int, squidaio_result_t
*);
72 int squidaio_close(int, squidaio_result_t
*);
74 int squidaio_stat(const char *, struct stat
*, squidaio_result_t
*);
75 int squidaio_unlink(const char *, squidaio_result_t
*);
76 int squidaio_opendir(const char *, squidaio_result_t
*);
77 squidaio_result_t
*squidaio_poll_done(void);
78 int squidaio_operations_pending(void);
79 int squidaio_sync(void);
80 int squidaio_get_queue_len(void);
81 void *squidaio_xmalloc(int size
);
82 void squidaio_xfree(void *p
, int size
);
83 void squidaio_stats(StoreEntry
*);
88 void aioOpen(const char *, int, mode_t
, AIOCB
*, void *);
90 void aioWrite(int, off_t offset
, char *, size_t size
, AIOCB
*, void *, FREE
*);
91 void aioRead(int, off_t offset
, size_t size
, AIOCB
*, void *);
93 void aioStat(char *, struct stat
*, AIOCB
*, void *);
94 void aioUnlink(const char *, AIOCB
*, void *);
95 int aioQueueSize(void);
97 #include "DiskIO/DiskFile.h"
99 class DiskThreadsIOStrategy
;
119 extern AIOCounts squidaio_counts
;
120 extern dlink_list used_list
;