Go to the source code of this file.
Classes | |
class | squidaio_result_t |
class | squidaio_ctrl_t |
class | AIOCounts |
Macros | |
#define | NUMTHREADS (Config.cacheSwap.n_configured*16) |
#define | MAGIC1 (NUMTHREADS*Config.cacheSwap.n_configured*5) |
#define | MAGIC2 (NUMTHREADS*Config.cacheSwap.n_configured*20) |
#define | ASYNC_OPEN 1 |
#define | ASYNC_CLOSE 0 |
#define | ASYNC_CREATE 1 |
#define | ASYNC_WRITE 0 |
#define | ASYNC_READ 1 |
Typedefs | |
typedef enum _squidaio_request_type | squidaio_request_type |
typedef void | AIOCB(int fd, void *cbdata, const char *buf, int aio_return, int aio_errno) |
Enumerations | |
enum | _squidaio_request_type { _AIO_OP_NONE = 0 , _AIO_OP_OPEN , _AIO_OP_READ , _AIO_OP_WRITE , _AIO_OP_CLOSE , _AIO_OP_UNLINK , _AIO_OP_OPENDIR , _AIO_OP_STAT } |
Variables | |
AIOCounts | squidaio_counts |
dlink_list | used_list |
Macro Definition Documentation
◆ ASYNC_CLOSE
#define ASYNC_CLOSE 0 |
Definition at line 40 of file DiskThreads.h.
◆ ASYNC_CREATE
#define ASYNC_CREATE 1 |
Definition at line 41 of file DiskThreads.h.
◆ ASYNC_OPEN
#define ASYNC_OPEN 1 |
Definition at line 39 of file DiskThreads.h.
◆ ASYNC_READ
#define ASYNC_READ 1 |
Definition at line 43 of file DiskThreads.h.
◆ ASYNC_WRITE
#define ASYNC_WRITE 0 |
Definition at line 42 of file DiskThreads.h.
◆ MAGIC1
#define MAGIC1 (NUMTHREADS*Config.cacheSwap.n_configured*5) |
Definition at line 34 of file DiskThreads.h.
◆ MAGIC2
#define MAGIC2 (NUMTHREADS*Config.cacheSwap.n_configured*20) |
Definition at line 36 of file DiskThreads.h.
◆ NUMTHREADS
#define NUMTHREADS (Config.cacheSwap.n_configured*16) |
Definition at line 30 of file DiskThreads.h.
Typedef Documentation
◆ AIOCB
Definition at line 57 of file DiskThreads.h.
◆ squidaio_request_type
typedef enum _squidaio_request_type squidaio_request_type |
Definition at line 55 of file DiskThreads.h.
Enumeration Type Documentation
◆ _squidaio_request_type
Enumerator | |
---|---|
_AIO_OP_NONE | |
_AIO_OP_OPEN | |
_AIO_OP_READ | |
_AIO_OP_WRITE | |
_AIO_OP_CLOSE | |
_AIO_OP_UNLINK | |
_AIO_OP_OPENDIR | |
_AIO_OP_STAT |
Definition at line 45 of file DiskThreads.h.
Function Documentation
◆ aioCancel()
void aioCancel | ( | int | fd | ) |
Definition at line 66 of file async_io.cc.
References _AIO_READ, assert, squidaio_ctrl_t::bufp, AIOCounts::cancel, cbdataReferenceValidDone, dlink_node::data, DBG_IMPORTANT, debugs, dlinkDelete(), squidaio_ctrl_t::done_handler, squidaio_ctrl_t::done_handler_data, squidaio_ctrl_t::fd, squidaio_ctrl_t::free_func, dlink_list::head, DiskThreadsIOStrategy::Instance, squidaio_ctrl_t::len, squidaio_unlinkq_t::next, dlink_node::next, squidaio_ctrl_t::operation, squidaio_ctrl_t::result, squidaio_cancel(), squidaio_counts, squidaio_xfree(), and used_list.
Referenced by aioClose(), and DiskThreadsDiskFile::doClose().
◆ aioClose()
void aioClose | ( | int | fd | ) |
Definition at line 47 of file async_io.cc.
References _AIO_CLOSE, aioCancel(), assert, AIOCounts::close_start, squidaio_result_t::data, dlinkAdd(), squidaio_ctrl_t::done_handler, squidaio_ctrl_t::done_handler_data, squidaio_ctrl_t::fd, DiskThreadsIOStrategy::Instance, squidaio_ctrl_t::node, squidaio_ctrl_t::operation, squidaio_ctrl_t::result, squidaio_close(), squidaio_counts, and used_list.
Referenced by DiskThreadsIOStrategy::callback(), and DiskThreadsDiskFile::doClose().
◆ aioDone()
void aioDone | ( | void | ) |
◆ aioInit()
void aioInit | ( | void | ) |
◆ aioOpen()
Definition at line 29 of file async_io.cc.
References _AIO_OPEN, assert, cbdataReference, squidaio_result_t::data, dlinkAdd(), squidaio_ctrl_t::done_handler, squidaio_ctrl_t::done_handler_data, squidaio_ctrl_t::fd, DiskThreadsIOStrategy::Instance, squidaio_ctrl_t::node, AIOCounts::open_start, squidaio_ctrl_t::operation, squidaio_unlinkq_t::path, squidaio_ctrl_t::result, squidaio_counts, squidaio_open(), and used_list.
Referenced by DiskThreadsDiskFile::create(), and DiskThreadsDiskFile::open().
◆ aioQueueSize()
int aioQueueSize | ( | void | ) |
Definition at line 199 of file async_io.cc.
Referenced by DiskThreadsIOStrategy::load(), and DiskThreadsIOStrategy::shedLoad().
◆ aioRead()
Definition at line 135 of file async_io.cc.
References _AIO_READ, assert, squidaio_ctrl_t::bufp, cbdataReference, squidaio_result_t::data, dlinkAdd(), squidaio_ctrl_t::done_handler, squidaio_ctrl_t::done_handler_data, squidaio_ctrl_t::fd, DiskThreadsIOStrategy::Instance, squidaio_ctrl_t::len, squidaio_ctrl_t::node, squidaio_ctrl_t::operation, AIOCounts::read_start, squidaio_ctrl_t::result, squidaio_counts, squidaio_read(), squidaio_xmalloc(), and used_list.
Referenced by DiskThreadsDiskFile::read().
◆ aioStat()
void aioStat | ( | char * | path, |
struct stat * | sb, | ||
AIOCB * | callback, | ||
void * | callback_data | ||
) |
Definition at line 165 of file async_io.cc.
References _AIO_STAT, assert, cbdataReference, squidaio_result_t::data, dlinkAdd(), squidaio_ctrl_t::done_handler, squidaio_ctrl_t::done_handler_data, squidaio_ctrl_t::fd, DiskThreadsIOStrategy::Instance, squidaio_ctrl_t::node, squidaio_ctrl_t::operation, squidaio_unlinkq_t::path, squidaio_ctrl_t::result, sb, squidaio_counts, squidaio_stat(), AIOCounts::stat_start, and used_list.
◆ aioUnlink()
void aioUnlink | ( | const char * | path, |
AIOCB * | callback, | ||
void * | callback_data | ||
) |
Definition at line 183 of file async_io.cc.
References _AIO_UNLINK, assert, cbdataReference, squidaio_result_t::data, dlinkAdd(), squidaio_ctrl_t::done_handler, squidaio_ctrl_t::done_handler_data, squidaio_ctrl_t::fd, DiskThreadsIOStrategy::Instance, squidaio_ctrl_t::node, squidaio_ctrl_t::operation, squidaio_unlinkq_t::path, squidaio_ctrl_t::result, squidaio_counts, squidaio_unlink(), AIOCounts::unlink_start, and used_list.
Referenced by DiskThreadsIOStrategy::unlinkFile().
◆ aioWrite()
void aioWrite | ( | int | fd, |
off_t | offset, | ||
char * | bufp, | ||
size_t | size, | ||
AIOCB * | callback, | ||
void * | callback_data, | ||
FREE * | free_func | ||
) |
Definition at line 107 of file async_io.cc.
References _AIO_WRITE, assert, squidaio_ctrl_t::bufp, cbdataReference, squidaio_result_t::data, dlinkAdd(), squidaio_ctrl_t::done_handler, squidaio_ctrl_t::done_handler_data, squidaio_ctrl_t::fd, squidaio_ctrl_t::free_func, DiskThreadsIOStrategy::Instance, squidaio_ctrl_t::node, squidaio_ctrl_t::operation, squidaio_ctrl_t::result, squidaio_counts, squidaio_write(), used_list, and AIOCounts::write_start.
Referenced by DiskThreadsDiskFile::write().
◆ squidaio_cancel()
int squidaio_cancel | ( | squidaio_result_t * | resultp | ) |
Definition at line 621 of file aiops.cc.
References _AIO_OP_NONE, squidaio_result_t::_data, squidaio_request_t::cancelled, debugs, squidaio_request_t::request_type, squidaio_result_t::result_type, and squidaio_request_t::resultp.
Referenced by aioCancel().
◆ squidaio_close()
int squidaio_close | ( | int | fd, |
squidaio_result_t * | resultp | ||
) |
Definition at line 749 of file aiops.cc.
References _AIO_OP_CLOSE, Mem::Allocator::alloc(), squidaio_request_t::cancelled, squidaio_request_t::fd, squidaio_request_t::request_type, squidaio_result_t::result_type, squidaio_request_t::resultp, squidaio_queue_request(), and squidaio_request_pool.
Referenced by aioClose().
◆ squidaio_get_queue_len()
int squidaio_get_queue_len | ( | void | ) |
Definition at line 963 of file aiops.cc.
References request_queue_len.
Referenced by DiskThreadsIOStrategy::aioStats().
◆ squidaio_init()
void squidaio_init | ( | void | ) |
Definition at line 216 of file aiops.cc.
References _THREAD_FAILED, _THREAD_STARTING, AIO_LARGE_BUFS, AIO_MEDIUM_BUFS, AIO_MICRO_BUFS, AIO_SMALL_BUFS, AIO_TINY_BUFS, Mem::Allocator::alloc(), assert, squidaio_request_queue_t::blocked, squidaio_request_queue_t::cond, squidaio_thread_t::current_req, done_queue, squidaio_thread_t::dwThreadId, FALSE, fatal(), globattr, squidaio_request_queue_t::head, CommIO::Initialize(), main_thread, memPoolCreate, squidaio_request_queue_t::mutex, squidaio_thread_t::next, NULL, NUMTHREADS, request_queue, squidaio_request_queue_t::requests, squidaio_thread_t::requests, squidaio_initialised, squidaio_large_bufs, squidaio_medium_bufs, squidaio_micro_bufs, squidaio_request_pool, squidaio_small_bufs, squidaio_thread_loop(), squidaio_thread_pool, squidaio_tiny_bufs, squidaio_thread_t::status, squidaio_request_queue_t::tailp, squidaio_thread_t::thread, threads, and TRUE.
Referenced by squidaio_open(), squidaio_stat(), and squidaio_unlink().
◆ squidaio_open()
int squidaio_open | ( | const char * | path, |
int | oflag, | ||
mode_t | mode, | ||
squidaio_result_t * | resultp | ||
) |
Definition at line 638 of file aiops.cc.
References _AIO_OP_OPEN, Mem::Allocator::alloc(), squidaio_request_t::cancelled, squidaio_request_t::mode, squidaio_request_t::oflag, squidaio_request_t::path, squidaio_request_t::request_type, squidaio_result_t::result_type, squidaio_request_t::resultp, squidaio_init(), squidaio_queue_request(), squidaio_request_pool, and squidaio_xstrdup().
Referenced by aioOpen().
◆ squidaio_opendir()
int squidaio_opendir | ( | const char * | , |
squidaio_result_t * | |||
) |
◆ squidaio_operations_pending()
int squidaio_operations_pending | ( | void | ) |
Definition at line 945 of file aiops.cc.
References done_requests, and request_queue_len.
Referenced by squidaio_sync().
◆ squidaio_poll_done()
squidaio_result_t * squidaio_poll_done | ( | void | ) |
Definition at line 901 of file aiops.cc.
References squidaio_request_t::cancelled, debugs, done_requests, squidaio_request_t::err, squidaio_request_t::next, NULL, squidaio_request_t::request_type, CommIO::ResetNotifications(), squidaio_request_t::resultp, squidaio_request_t::ret, squidaio_cleanup_request(), squidaio_debug(), and squidaio_poll_queues().
Referenced by DiskThreadsIOStrategy::callback().
◆ squidaio_read()
int squidaio_read | ( | int | fd, |
char * | bufp, | ||
size_t | bufs, | ||
off_t | offset, | ||
int | whence, | ||
squidaio_result_t * | resultp | ||
) |
Definition at line 672 of file aiops.cc.
References _AIO_OP_READ, Mem::Allocator::alloc(), squidaio_request_t::bufferp, squidaio_request_t::buflen, squidaio_request_t::cancelled, squidaio_request_t::fd, squidaio_request_t::offset, squidaio_request_t::request_type, squidaio_result_t::result_type, squidaio_request_t::resultp, squidaio_queue_request(), squidaio_request_pool, and squidaio_request_t::whence.
Referenced by aioRead().
◆ squidaio_shutdown()
void squidaio_shutdown | ( | void | ) |
Definition at line 329 of file aiops.cc.
References squidaio_request_queue_t::cond, done_queue, squidaio_thread_t::exit, main_thread, squidaio_request_queue_t::mutex, squidaio_thread_t::next, CommIO::NotifyIOClose(), NUMTHREADS, request_queue, request_queue_len, squidaio_initialised, squidaio_poll_queues(), squidaio_thread_t::thread, threads, TRUE, xcalloc(), and xfree.
Referenced by DiskThreadsIOStrategy::done().
◆ squidaio_stat()
int squidaio_stat | ( | const char * | path, |
struct stat * | sb, | ||
squidaio_result_t * | resultp | ||
) |
Definition at line 779 of file aiops.cc.
References _AIO_OP_STAT, Mem::Allocator::alloc(), squidaio_request_t::cancelled, squidaio_request_t::path, squidaio_request_t::request_type, squidaio_result_t::result_type, squidaio_request_t::resultp, sb, squidaio_init(), squidaio_queue_request(), squidaio_request_pool, squidaio_xmalloc(), squidaio_xstrdup(), squidaio_request_t::statp, and squidaio_request_t::tmpstatp.
Referenced by aioStat().
◆ squidaio_stats()
void squidaio_stats | ( | StoreEntry * | sentry | ) |
Definition at line 999 of file aiops.cc.
References squidaio_thread_t::dwThreadId, squidaio_thread_t::next, NUMTHREADS, squidaio_thread_t::requests, squidaio_initialised, storeAppendPrintf(), squidaio_thread_t::thread, and threads.
Referenced by DiskThreadsIOStrategy::aioStats().
◆ squidaio_sync()
int squidaio_sync | ( | void | ) |
Definition at line 951 of file aiops.cc.
References request_queue_len, squidaio_operations_pending(), and squidaio_poll_queues().
Referenced by squidaio_queue_request(), and DiskThreadsIOStrategy::sync().
◆ squidaio_unlink()
int squidaio_unlink | ( | const char * | path, |
squidaio_result_t * | resultp | ||
) |
Definition at line 813 of file aiops.cc.
References _AIO_OP_UNLINK, Mem::Allocator::alloc(), squidaio_request_t::cancelled, squidaio_request_t::path, squidaio_request_t::request_type, squidaio_result_t::result_type, squidaio_request_t::resultp, squidaio_init(), squidaio_queue_request(), squidaio_request_pool, and squidaio_xstrdup().
Referenced by aioUnlink().
◆ squidaio_write()
int squidaio_write | ( | int | fd, |
char * | bufp, | ||
size_t | bufs, | ||
off_t | offset, | ||
int | whence, | ||
squidaio_result_t * | resultp | ||
) |
Definition at line 712 of file aiops.cc.
References _AIO_OP_WRITE, Mem::Allocator::alloc(), squidaio_request_t::bufferp, squidaio_request_t::buflen, squidaio_request_t::cancelled, squidaio_request_t::fd, squidaio_request_t::offset, squidaio_request_t::request_type, squidaio_result_t::result_type, squidaio_request_t::resultp, squidaio_queue_request(), squidaio_request_pool, and squidaio_request_t::whence.
Referenced by aioWrite().
◆ squidaio_xfree()
void squidaio_xfree | ( | void * | p, |
int | size | ||
) |
Definition at line 196 of file aiops.cc.
References size, squidaio_get_pool(), and xfree.
Referenced by aioCancel(), DiskThreadsIOStrategy::callback(), and squidaio_cleanup_request().
◆ squidaio_xmalloc()
void * squidaio_xmalloc | ( | int | size | ) |
Definition at line 171 of file aiops.cc.
References size, squidaio_get_pool(), and xmalloc.
Referenced by aioRead(), squidaio_stat(), and squidaio_xstrdup().
Variable Documentation
◆ squidaio_counts
|
extern |
Definition at line 18 of file async_io.cc.
Referenced by aioCancel(), aioClose(), aioOpen(), aioRead(), aioStat(), DiskThreadsIOStrategy::aioStats(), aioUnlink(), aioWrite(), and DiskThreadsIOStrategy::callback().
◆ used_list
|
extern |
Definition at line 26 of file async_io.cc.
Referenced by aioCancel(), aioClose(), aioOpen(), aioRead(), aioStat(), aioUnlink(), aioWrite(), and DiskThreadsIOStrategy::callback().