57 debugs(79, 3,
"storeDiskdIO::shedLoad: Shedding, too many requests away");
104 debugs(79, 2,
"storeDiskUnlink: Out of queue space, sync unlink");
116 buf = (
char *)
shm.
get(&shm_offset);
157 smsgid = msgget((key_t) ikey, 0700 | IPC_CREAT);
162 fatal(
"msgget failed");
165 rmsgid = msgget((key_t) (ikey + 1), 0700 | IPC_CREAT);
170 fatal(
"msgget failed");
174 snprintf(skey1, 32,
"%d", ikey);
175 snprintf(skey2, 32,
"%d", ikey + 1);
176 snprintf(skey3, 32,
"%d", ikey + 2);
225 char *aBuf =
nullptr;
228 for (i = 0; i <
nbufs; ++i) {
236 aBuf =
buf + (*shm_offset);
261 id = shmget((key_t) (ikey + 2),
267 fatal(
"shmget failed");
270 buf = (
char *)shmat(
id,
nullptr, 0);
272 if (
buf == (
void *) -1) {
275 fatal(
"shmat failed");
281 for (
int i = 0; i <
nbufs; ++i) {
359 return SEND(&M, mtype,
id,
size, offset, shm_offset);
369 return SEND(&M, mtype,
id,
size, offset, shm_offset);
375 static int send_errors = 0;
376 static int last_seq_no = 0;
377 static int seq_no = 0;
388 if (M->
seq_no < last_seq_no)
403 assert(send_errors < 100);
420 struct timeval delay = {0, 1};
423 xselect(0,
nullptr,
nullptr,
nullptr, &delay);
426 if (delay.tv_usec < 1000000)
445 if (strcmp(name,
"Q1") != 0)
455 if (old_magic1 <
magic1) {
464 debugs(3,
DBG_IMPORTANT,
"WARNING: cannot increase cache_dir Q1 value while Squid is running.");
484 if (strcmp(name,
"Q2") != 0)
494 if (old_magic2 <
magic2) {
496 debugs(3,
DBG_IMPORTANT,
"WARNING: cannot increase cache_dir Q2 value while Squid is running.");
520 static time_t lastmsg = 0;
int cbdataReferenceValid(const void *p)
#define cbdataReferenceDone(var)
#define cbdataReference(var)
std::vector< ConfigOption * > options
bool optionQ1Parse(char const *option, const char *value, int reconfiguring)
int SEND(diomsg *M, int mtype, int id, size_t size, off_t offset, ssize_t shm_offset)
void unlinkDone(diomsg *M)
ConfigOption * getOptionTree() const override
void optionQ2Dump(StoreEntry *e) const
static size_t newInstance()
bool optionQ2Parse(char const *option, const char *value, int reconfiguring)
void optionQ1Dump(StoreEntry *e) const
int send(int mtype, int id, DiskdFile *theFile, size_t size, off_t offset, ssize_t shm_offset, Lock *requestor)
void statfs(StoreEntry &sentry) const override
RefCount< DiskFile > newFile(char const *path) override
static size_t nextInstanceID
void unlinkFile(char const *) override
bool unlinkdUseful() const override
void init(int ikey, int magic2)
struct SquidConfig::@83 Program
struct StatCounters::@112 syscalls
struct StatCounters::@112::@116 disk
int callback() override
called once every main loop iteration; TODO: Move to UFS code.
int commSetNonBlocking(int fd)
void commUnsetFdTimeout(int fd)
clear a timeout handler by FD number
#define debugs(SECTION, LEVEL, CONTENT)
#define CBIT_SET(mask, bit)
#define CBIT_CLR(mask, bit)
#define CBIT_TEST(mask, bit)
void fatal(const char *message)
void fatalf(const char *fmt,...)
void fd_note(int fd, const char *s)
diskd_stats_t diskd_stats
pid_t ipcCreate(int type, const char *prog, const char *const args[], const char *name, Ip::Address &local_addr, int *rfd, int *wfd, void **hIpc)
void QuickPollRequired(void)
Controller & Root()
safely access controller singleton
int xselect(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout)
POSIX select(2) equivalent.
void storeAppendPrintf(StoreEntry *e, const char *fmt,...)
static const int msg_snd_rcv_sz
struct diskd_stats_t::@34 unlink
void unlinkdUnlink(const char *path)
void * xcalloc(size_t n, size_t sz)
const char * xstrerr(int error)
char * xstrncpy(char *dst, const char *src, size_t n)