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

Macro Definition Documentation

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

Definition at line 36 of file diskd.cc.

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

Typedef Documentation

typedef struct _file_state file_state

Definition at line 38 of file diskd.cc.

Function Documentation

static void alarm_handler ( int  )
static

Definition at line 299 of file diskd.cc.

Referenced by main().

static int do_close ( diomsg r,
int   
)
static

Definition at line 88 of file diskd.cc.

References DEBUG, _file_state::fd, hash_lookup(), hash_remove_link(), diomsg::id, NULL, and xfree.

Referenced by diskHandleWrite(), and msg_handle().

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

Definition at line 54 of file diskd.cc.

References DEBUG, _file_state::fd, hash_join(), diomsg::id, _file_state::id, _file_state::key, diomsg::offset, and xcalloc.

Referenced by msg_handle().

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

Definition at line 214 of file diskd.cc.

References DEBUG, and diomsg::id.

Referenced by msg_handle().

static int do_write ( diomsg r,
int  ,
const char *  buf 
)
static
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().

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

Definition at line 291 of file diskd.cc.

Referenced by main().

int main ( int  argc,
char *  argv[] 
)
void xassert ( const char *  msg,
const char *  file,
int  line 
)

Definition at line 28 of file diskd.cc.

Variable Documentation

int DebugLevel = 0
static

Definition at line 51 of file diskd.cc.

hash_table* hash = NULL
static

Definition at line 48 of file diskd.cc.

pid_t mypid
static

Definition at line 49 of file diskd.cc.

char* shmbuf
static

Definition at line 50 of file diskd.cc.

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors