diskd.cc File Reference
#include "squid.h"
#include "DiskIO/DiskDaemon/diomsg.h"
#include "hash.h"
#include <cerrno>
#include <iostream>
Include dependency graph for diskd.cc:

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_tablehash = nullptr
 
static pid_t mypid
 
static char * shmbuf
 
static int DebugLevel = 0
 

Macro Definition Documentation

◆ DEBUG

#define DEBUG (   LEVEL)    if ((LEVEL) <= DebugLevel)

Definition at line 36 of file diskd.cc.

Typedef Documentation

◆ file_state

typedef struct _file_state file_state

Definition at line 38 of file diskd.cc.

Function Documentation

◆ alarm_handler()

static void alarm_handler ( int  )
static

Definition at line 299 of file diskd.cc.

Referenced by main().

◆ do_close()

static int do_close ( diomsg r,
int   
)
static

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()

static int do_open ( diomsg r,
int  ,
const char *  buf 
)
static

◆ do_read()

static int do_read ( diomsg r,
int  ,
char *  buf 
)
static

◆ do_unlink()

static int do_unlink ( diomsg r,
int  ,
const char *  buf 
)
static

Definition at line 214 of file diskd.cc.

References DEBUG, diomsg::id, and mypid.

Referenced by msg_handle().

◆ do_write()

static int do_write ( diomsg r,
int  ,
const char *  buf 
)
static

◆ fsCmp()

static int fsCmp ( const void *  a,
const void *  b 
)
static

Definition at line 283 of file diskd.cc.

References A, and B.

Referenced by main().

◆ fsHash()

static unsigned int fsHash ( const void *  key,
unsigned int  n 
)
static

Definition at line 291 of file diskd.cc.

Referenced by main().

◆ main()

int main ( int  argc,
char *  argv[] 
)

◆ msg_handle()

◆ xassert()

void xassert ( const char *  msg,
const char *  file,
int  line 
)

Definition at line 28 of file diskd.cc.

Variable Documentation

◆ DebugLevel

int DebugLevel = 0
static

Definition at line 51 of file diskd.cc.

◆ hash

hash_table* hash = nullptr
static

Definition at line 48 of file diskd.cc.

Referenced by do_close(), do_open(), do_read(), do_write(), and main().

◆ mypid

pid_t 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

char* shmbuf
static

Definition at line 50 of file diskd.cc.

Referenced by main(), and msg_handle().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors