#include "squid.h"
#include "DiskIO/DiskDaemon/diomsg.h"
#include "hash.h"
#include <cerrno>
#include <iostream>
Go to the source code of this file.
Classes | |
struct | _file_state |
Macros | |
#define | DEBUG(LEVEL) if ((LEVEL) <= DebugLevel) |
Typedefs | |
typedef struct _file_state | file_state |
Functions | |
void | xassert (const char *msg, const char *file, int line) |
static int | do_open (diomsg *r, int, const char *buf) |
static int | do_close (diomsg *r, int) |
static int | do_read (diomsg *r, int, char *buf) |
static int | do_write (diomsg *r, int, const char *buf) |
static int | do_unlink (diomsg *r, int, const char *buf) |
static void | msg_handle (diomsg *r, int rl, diomsg *s) |
static int | fsCmp (const void *a, const void *b) |
static unsigned int | fsHash (const void *key, unsigned int n) |
static void | alarm_handler (int) |
int | main (int argc, char *argv[]) |
Variables | |
static hash_table * | hash = nullptr |
static pid_t | mypid |
static char * | shmbuf |
static int | DebugLevel = 0 |
Macro Definition Documentation
◆ DEBUG
#define DEBUG | ( | LEVEL | ) | if ((LEVEL) <= DebugLevel) |
Typedef Documentation
◆ file_state
typedef struct _file_state file_state |
Function Documentation
◆ alarm_handler()
|
static |
◆ do_close()
Definition at line 88 of file diskd.cc.
References DEBUG, _file_state::fd, hash, hash_lookup(), hash_remove_link(), diomsg::id, mypid, and xfree.
Referenced by diskHandleWrite(), and msg_handle().
◆ do_open()
Definition at line 54 of file diskd.cc.
References DEBUG, _file_state::fd, hash, hash_join(), diomsg::id, _file_state::id, _file_state::key, mypid, diomsg::offset, and xcalloc().
Referenced by msg_handle().
◆ do_read()
Definition at line 118 of file diskd.cc.
References DEBUG, _file_state::fd, hash, hash_lookup(), diomsg::id, mypid, diomsg::offset, _file_state::offset, PRId64, and diomsg::size.
Referenced by msg_handle().
◆ do_unlink()
Definition at line 214 of file diskd.cc.
References DEBUG, diomsg::id, and mypid.
Referenced by msg_handle().
◆ do_write()
Definition at line 168 of file diskd.cc.
References DEBUG, _file_state::fd, hash, hash_lookup(), diomsg::id, mypid, diomsg::offset, _file_state::offset, PRId64, and diomsg::size.
Referenced by msg_handle().
◆ fsCmp()
|
static |
◆ fsHash()
◆ main()
Definition at line 303 of file diskd.cc.
References alarm_handler(), assert, DEBUG, fsCmp(), fsHash(), hash, hash_create(), msg_handle(), diomsg::msg_snd_rcv_sz, mypid, SA_RESTART, shmbuf, SQUID_NONBLOCK, and xstrerr().
◆ msg_handle()
Definition at line 232 of file diskd.cc.
References _MQD_CLOSE, _MQD_CREATE, _MQD_OPEN, _MQD_READ, _MQD_UNLINK, _MQD_WRITE, assert, diomsg::callback_data, do_close(), do_open(), do_read(), do_unlink(), do_write(), diomsg::id, diomsg::mtype, mypid, diomsg::newstyle, diomsg::offset, diomsg::requestor, diomsg::seq_no, diomsg::shm_offset, shmbuf, diomsg::size, and diomsg::status.
Referenced by main().
◆ xassert()
void xassert | ( | const char * | msg, |
const char * | file, | ||
int | line | ||
) |
Variable Documentation
◆ DebugLevel
◆ hash
|
static |
Definition at line 48 of file diskd.cc.
Referenced by do_close(), do_open(), do_read(), do_write(), and main().
◆ mypid
|
static |
Definition at line 49 of file diskd.cc.
Referenced by do_close(), do_open(), do_read(), do_unlink(), do_write(), main(), and msg_handle().
◆ shmbuf
|
static |
Definition at line 50 of file diskd.cc.
Referenced by main(), and msg_handle().