From 99cce4cb6ac81c32ca07a501e7c4838c0cfa31db Mon Sep 17 00:00:00 2001 From: hno <> Date: Sun, 21 Jul 2002 06:25:44 +0000 Subject: [PATCH] More debug section cleanups --- src/fs/aufs/aiops.cc | 8 +-- src/fs/aufs/store_dir_aufs.cc | 8 +-- src/fs/coss/async_io.cc | 7 ++- src/fs/coss/store_dir_coss.cc | 28 +++++----- src/fs/diskd/store_dir_diskd.cc | 96 ++++++++++++++++----------------- src/fs/diskd/store_io_diskd.cc | 18 +++---- src/fs/ufs/store_dir_ufs.cc | 94 ++++++++++++++++---------------- src/unlinkd.cc | 4 +- 8 files changed, 131 insertions(+), 132 deletions(-) diff --git a/src/fs/aufs/aiops.cc b/src/fs/aufs/aiops.cc index c61e9ed289..615c227493 100644 --- a/src/fs/aufs/aiops.cc +++ b/src/fs/aufs/aiops.cc @@ -1,5 +1,5 @@ /* - * $Id: aiops.cc,v 1.12 2001/10/24 05:26:18 hno Exp $ + * $Id: aiops.cc,v 1.13 2002/07/21 00:25:45 hno Exp $ * * DEBUG: section 43 AIOPS * AUTHOR: Stewart Forster @@ -410,7 +410,7 @@ static void squidaio_queue_request(squidaio_request_t * request) { static int high_start = 0; - debug(41, 9) ("squidaio_queue_request: %p type=%d result=%p\n", + debug(43, 9) ("squidaio_queue_request: %p type=%d result=%p\n", request, request->request_type, request->resultp); /* Mark it as not executed (failing result, no error) */ request->ret = -1; @@ -547,7 +547,7 @@ squidaio_cancel(squidaio_result_t * resultp) squidaio_request_t *request = resultp->_data; if (request && request->resultp == resultp) { - debug(41, 9) ("squidaio_cancel: %p type=%d result=%p\n", + debug(43, 9) ("squidaio_cancel: %p type=%d result=%p\n", request, request->request_type, request->resultp); request->cancelled = 1; request->resultp = NULL; @@ -838,7 +838,7 @@ squidaio_poll_done(void) if (!request) { return NULL; } - debug(41, 9) ("squidaio_poll_done: %p type=%d result=%p\n", + debug(43, 9) ("squidaio_poll_done: %p type=%d result=%p\n", request, request->request_type, request->resultp); done_requests.head = request->next; if (!done_requests.head) diff --git a/src/fs/aufs/store_dir_aufs.cc b/src/fs/aufs/store_dir_aufs.cc index b2eba3b24c..dd3262cc10 100644 --- a/src/fs/aufs/store_dir_aufs.cc +++ b/src/fs/aufs/store_dir_aufs.cc @@ -1,6 +1,6 @@ /* - * $Id: store_dir_aufs.cc,v 1.46 2002/06/26 09:55:57 hno Exp $ + * $Id: store_dir_aufs.cc,v 1.47 2002/07/21 00:25:45 hno Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -1369,7 +1369,7 @@ storeAufsDirCheckObj(SwapDir * SD, const StoreEntry * e) if (ql == 0) loadav = 0; loadav = ql * 1000 / MAGIC1; - debug(41, 9) ("storeAufsDirCheckObj: load=%d\n", loadav); + debug(47, 9) ("storeAufsDirCheckObj: load=%d\n", loadav); return loadav; } @@ -1382,7 +1382,7 @@ storeAufsDirCheckObj(SwapDir * SD, const StoreEntry * e) void storeAufsDirRefObj(SwapDir * SD, StoreEntry * e) { - debug(1, 3) ("storeAufsDirRefObj: referencing %p %d/%d\n", e, e->swap_dirn, + debug(47, 3) ("storeAufsDirRefObj: referencing %p %d/%d\n", e, e->swap_dirn, e->swap_filen); if (SD->repl->Referenced) SD->repl->Referenced(SD->repl, e, &e->repl); @@ -1396,7 +1396,7 @@ storeAufsDirRefObj(SwapDir * SD, StoreEntry * e) void storeAufsDirUnrefObj(SwapDir * SD, StoreEntry * e) { - debug(1, 3) ("storeAufsDirUnrefObj: referencing %p %d/%d\n", e, e->swap_dirn, + debug(47, 3) ("storeAufsDirUnrefObj: referencing %p %d/%d\n", e, e->swap_dirn, e->swap_filen); if (SD->repl->Dereferenced) SD->repl->Dereferenced(SD->repl, e, &e->repl); diff --git a/src/fs/coss/async_io.cc b/src/fs/coss/async_io.cc index 29d42ac97a..9743b92725 100644 --- a/src/fs/coss/async_io.cc +++ b/src/fs/coss/async_io.cc @@ -11,7 +11,7 @@ * supports are read/write, and since COSS works on a single file * per storedir it should work just fine. * - * $Id: async_io.cc,v 1.9 2002/05/19 14:14:52 hno Exp $ + * $Id: async_io.cc,v 1.10 2002/07/21 00:25:45 hno Exp $ */ #include "squid.h" @@ -91,8 +91,7 @@ a_file_read(async_queue_t * q, int fd, void *buf, int req_len, off_t offset, /* Initiate aio */ if (aio_read(&qe->aq_e_aiocb) < 0) { - debug(1, 1) ("Aiee! aio_read() returned error (%d)!\n", errno); - assert(1 == 0); + fatalf(79, 1) ("Aiee! aio_read() returned error (%d)!\n", errno); } } @@ -135,7 +134,7 @@ a_file_write(async_queue_t * q, int fd, off_t offset, void *buf, int len, /* Initiate aio */ if (aio_write(&qe->aq_e_aiocb) < 0) { - debug(1, 1) ("Aiee! aio_read() returned error (%d)!\n", errno); + fatalf("Aiee! aio_read() returned error (%d)!\n", errno); assert(1 == 0); } } diff --git a/src/fs/coss/store_dir_coss.cc b/src/fs/coss/store_dir_coss.cc index 748be2c912..75e91eac86 100644 --- a/src/fs/coss/store_dir_coss.cc +++ b/src/fs/coss/store_dir_coss.cc @@ -1,6 +1,6 @@ /* - * $Id: store_dir_coss.cc,v 1.36 2002/07/20 23:51:05 hno Exp $ + * $Id: store_dir_coss.cc,v 1.37 2002/07/21 00:25:45 hno Exp $ * * DEBUG: section 47 Store COSS Directory Routines * AUTHOR: Eric Stern @@ -132,10 +132,10 @@ storeCossDirOpenSwapLog(SwapDir * sd) path = storeCossDirSwapLogFile(sd, NULL); fd = file_open(path, O_WRONLY | O_CREAT | O_BINARY); if (fd < 0) { - debug(79, 1) ("%s: %s\n", path, xstrerror()); + debug(47, 1) ("%s: %s\n", path, xstrerror()); fatal("storeCossDirOpenSwapLog: Failed to open swap log."); } - debug(79, 3) ("Cache COSS Dir #%d log opened on FD %d\n", sd->index, fd); + debug(47, 3) ("Cache COSS Dir #%d log opened on FD %d\n", sd->index, fd); cs->swaplog_fd = fd; } @@ -146,7 +146,7 @@ storeCossDirCloseSwapLog(SwapDir * sd) if (cs->swaplog_fd < 0) /* not open */ return; file_close(cs->swaplog_fd); - debug(79, 3) ("Cache COSS Dir #%d log closed on FD %d\n", + debug(47, 3) ("Cache COSS Dir #%d log closed on FD %d\n", sd->index, cs->swaplog_fd); cs->swaplog_fd = -1; } @@ -160,7 +160,7 @@ storeCossDirInit(SwapDir * sd) storeCossDirRebuild(sd); cs->fd = file_open(sd->path, O_RDWR | O_CREAT); if (cs->fd < 0) { - debug(79, 1) ("%s: %s\n", sd->path, xstrerror()); + debug(47, 1) ("%s: %s\n", sd->path, xstrerror()); fatal("storeCossDirInit: Failed to open a COSS directory."); } n_coss_dirs++; @@ -214,7 +214,7 @@ storeCossRebuildFromSwapLog(void *data) /* load a number of objects per invocation */ for (count = 0; count < rb->speed; count++) { if (fread(&s, ss, 1, rb->log) != 1) { - debug(79, 1) ("Done reading %s swaplog (%d entries)\n", + debug(47, 1) ("Done reading %s swaplog (%d entries)\n", rb->sd->path, rb->n_read); fclose(rb->log); rb->log = NULL; @@ -226,7 +226,7 @@ storeCossRebuildFromSwapLog(void *data) continue; if (s.op >= SWAP_LOG_MAX) continue; - debug(20, 3) ("storeCossRebuildFromSwapLog: %s %s %08X\n", + debug(47, 3) ("storeCossRebuildFromSwapLog: %s %s %08X\n", swap_log_op_str[(int) s.op], storeKeyText(s.key), s.swap_filen); @@ -256,7 +256,7 @@ storeCossRebuildFromSwapLog(void *data) } else { x = log(++rb->counts.bad_log_op) / log(10.0); if (0.0 == x - (double) (int) x) - debug(20, 1) ("WARNING: %d invalid swap log entries found\n", + debug(47, 1) ("WARNING: %d invalid swap log entries found\n", rb->counts.bad_log_op); rb->counts.invalid++; continue; @@ -310,7 +310,7 @@ storeCossAddDiskRestore(SwapDir * SD, const cache_key * key, int clean) { StoreEntry *e = NULL; - debug(20, 5) ("storeCossAddDiskRestore: %s, fileno=%08X\n", storeKeyText(key), file_number); + debug(47, 5) ("storeCossAddDiskRestore: %s, fileno=%08X\n", storeKeyText(key), file_number); /* if you call this you'd better be sure file_number is not * already in use! */ e = new_StoreEntry(STORE_ENTRY_WITHOUT_MEMOBJ, NULL, NULL); @@ -358,7 +358,7 @@ storeCossDirRebuild(SwapDir * sd) * we'll use storeCossRebuildFromSwapLog(). */ fp = storeCossDirOpenTmpSwapLog(sd, &clean, &zero); - debug(20, 1) ("Rebuilding COSS storage in %s (%s)\n", + debug(47, 1) ("Rebuilding COSS storage in %s (%s)\n", sd->path, clean ? "CLEAN" : "DIRTY"); rb->log = fp; store_dirs_rebuilding++; @@ -422,7 +422,7 @@ storeCossDirOpenTmpSwapLog(SwapDir * sd, int *clean_flag, int *zero_flag) FILE *fp; int fd; if (stat(swaplog_path, &log_sb) < 0) { - debug(47, 1) ("Cache COSS Dir #%d: No log file\n", sd->index); + debug(50, 1) ("Cache COSS Dir #%d: No log file\n", sd->index); safe_free(swaplog_path); safe_free(clean_path); safe_free(new_path); @@ -498,7 +498,7 @@ storeCossDirWriteCleanStart(SwapDir * sd) state->outbuf_offset = 0; unlink(state->cln); state->current = cs->index.tail; - debug(20, 3) ("storeCOssDirWriteCleanLogs: opened %s, FD %d\n", + debug(50, 3) ("storeCOssDirWriteCleanLogs: opened %s, FD %d\n", state->new, state->fd); #if HAVE_FCHMOD if (stat(state->cur, &sb) == 0) @@ -551,7 +551,7 @@ storeCossDirWriteCleanEntry(SwapDir * sd, const StoreEntry * e) if (FD_WRITE_METHOD(state->fd, state->outbuf, state->outbuf_offset) < 0) { debug(50, 0) ("storeCossDirWriteCleanLogs: %s: write: %s\n", state->new, xstrerror()); - debug(20, 0) ("storeCossDirWriteCleanLogs: Current swap logfile not replaced.\n"); + debug(50, 0) ("storeCossDirWriteCleanLogs: Current swap logfile not replaced.\n"); file_close(state->fd); state->fd = -1; unlink(state->new); @@ -576,7 +576,7 @@ storeCossDirWriteCleanDone(SwapDir * sd) if (FD_WRITE_METHOD(state->fd, state->outbuf, state->outbuf_offset) < 0) { debug(50, 0) ("storeCossDirWriteCleanLogs: %s: write: %s\n", state->new, xstrerror()); - debug(20, 0) ("storeCossDirWriteCleanLogs: Current swap logfile " + debug(50, 0) ("storeCossDirWriteCleanLogs: Current swap logfile " "not replaced.\n"); file_close(state->fd); state->fd = -1; diff --git a/src/fs/diskd/store_dir_diskd.cc b/src/fs/diskd/store_dir_diskd.cc index c9d2779c4a..bb56a05ae8 100644 --- a/src/fs/diskd/store_dir_diskd.cc +++ b/src/fs/diskd/store_dir_diskd.cc @@ -1,6 +1,6 @@ /* - * $Id: store_dir_diskd.cc,v 1.68 2002/07/20 23:51:06 hno Exp $ + * $Id: store_dir_diskd.cc,v 1.69 2002/07/21 00:25:46 hno Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -217,12 +217,12 @@ storeDiskdDirCreateDirectory(const char *path, int should_exist) getCurrentTime(); if (0 == stat(path, &st)) { if (S_ISDIR(st.st_mode)) { - debug(20, should_exist ? 3 : 1) ("%s exists\n", path); + debug(47, should_exist ? 3 : 1) ("%s exists\n", path); } else { fatalf("Swap directory %s is not a directory.", path); } } else if (0 == mkdir(path, 0755)) { - debug(20, should_exist ? 1 : 3) ("%s created\n", path); + debug(47, should_exist ? 1 : 3) ("%s created\n", path); created = 1; } else { fatalf("Failed to make swap directory %s: %s", @@ -236,11 +236,11 @@ storeDiskdDirVerifyDirectory(const char *path) { struct stat sb; if (stat(path, &sb) < 0) { - debug(20, 0) ("%s: %s\n", path, xstrerror()); + debug(47, 0) ("%s: %s\n", path, xstrerror()); return -1; } if (S_ISDIR(sb.st_mode) == 0) { - debug(20, 0) ("%s is not a directory\n", path); + debug(47, 0) ("%s is not a directory\n", path); return -1; } return 0; @@ -515,7 +515,7 @@ storeDiskdDirCallback(SwapDir * SD) if (x < 0) break; else if (x != msg_snd_rcv_sz) { - debug(79, 1) ("storeDiskdDirCallback: msgget returns %d\n", + debug(47, 1) ("storeDiskdDirCallback: msgget returns %d\n", x); break; } @@ -549,12 +549,12 @@ storeDiskdDirRebuildFromDirectory(void *data) tlv *tlv_list; tlv *t; assert(rb != NULL); - debug(20, 3) ("storeDiskdDirRebuildFromDirectory: DIR #%d\n", rb->sd->index); + debug(47, 3) ("storeDiskdDirRebuildFromDirectory: DIR #%d\n", rb->sd->index); for (count = 0; count < rb->speed; count++) { assert(fd == -1); fd = storeDiskdDirGetNextFile(rb, &filn, &size); if (fd == -2) { - debug(20, 1) ("Done scanning %s swaplog (%d entries)\n", + debug(47, 1) ("Done scanning %s swaplog (%d entries)\n", rb->sd->path, rb->n_read); store_dirs_rebuilding--; storeDiskdDirCloseTmpSwapLog(rb->sd); @@ -567,7 +567,7 @@ storeDiskdDirRebuildFromDirectory(void *data) assert(fd > -1); /* lets get file stats here */ if (fstat(fd, &sb) < 0) { - debug(20, 1) ("storeDiskdDirRebuildFromDirectory: fstat(FD %d): %s\n", + debug(47, 1) ("storeDiskdDirRebuildFromDirectory: fstat(FD %d): %s\n", fd, xstrerror()); file_close(fd); store_open_disk_fd--; @@ -575,12 +575,12 @@ storeDiskdDirRebuildFromDirectory(void *data) continue; } if ((++rb->counts.scancount & 0xFFFF) == 0) - debug(20, 3) (" %s %7d files opened so far.\n", + debug(47, 3) (" %s %7d files opened so far.\n", rb->sd->path, rb->counts.scancount); - debug(20, 9) ("file_in: fd=%d %08X\n", fd, filn); + debug(47, 9) ("file_in: fd=%d %08X\n", fd, filn); statCounter.syscalls.disk.reads++; if (FD_READ_METHOD(fd, hdr_buf, SM_PAGE_SIZE) < 0) { - debug(20, 1) ("storeDiskdDirRebuildFromDirectory: read(FD %d): %s\n", + debug(47, 1) ("storeDiskdDirRebuildFromDirectory: read(FD %d): %s\n", fd, xstrerror()); file_close(fd); store_open_disk_fd--; @@ -597,12 +597,12 @@ storeDiskdDirRebuildFromDirectory(void *data) #endif tlv_list = storeSwapMetaUnpack(hdr_buf, &swap_hdr_len); if (tlv_list == NULL) { - debug(20, 1) ("storeDiskdDirRebuildFromDirectory: failed to get meta data\n"); + debug(47, 1) ("storeDiskdDirRebuildFromDirectory: failed to get meta data\n"); /* XXX shouldn't this be a call to storeDiskdUnlink ? */ storeDiskdDirUnlinkFile(SD, filn); continue; } - debug(20, 3) ("storeDiskdDirRebuildFromDirectory: successful swap meta unpacking\n"); + debug(47, 3) ("storeDiskdDirRebuildFromDirectory: successful swap meta unpacking\n"); memset(key, '\0', MD5_DIGEST_CHARS); memset(&tmpe, '\0', sizeof(StoreEntry)); for (t = tlv_list; t; t = t->next) { @@ -622,7 +622,7 @@ storeDiskdDirRebuildFromDirectory(void *data) storeSwapTLVFree(tlv_list); tlv_list = NULL; if (storeKeyNull(key)) { - debug(20, 1) ("storeDiskdDirRebuildFromDirectory: NULL key\n"); + debug(47, 1) ("storeDiskdDirRebuildFromDirectory: NULL key\n"); storeDiskdDirUnlinkFile(SD, filn); continue; } @@ -633,7 +633,7 @@ storeDiskdDirRebuildFromDirectory(void *data) } else if (tmpe.swap_file_sz == sb.st_size - swap_hdr_len) { tmpe.swap_file_sz = sb.st_size; } else if (tmpe.swap_file_sz != sb.st_size) { - debug(20, 1) ("storeDiskdDirRebuildFromDirectory: SIZE MISMATCH %ld!=%ld\n", + debug(47, 1) ("storeDiskdDirRebuildFromDirectory: SIZE MISMATCH %ld!=%ld\n", (long int) tmpe.swap_file_sz, (long int) sb.st_size); storeDiskdDirUnlinkFile(SD, filn); continue; @@ -688,7 +688,7 @@ storeDiskdDirRebuildFromSwapLog(void *data) /* load a number of objects per invocation */ for (count = 0; count < rb->speed; count++) { if (fread(&s, ss, 1, rb->log) != 1) { - debug(20, 1) ("Done reading %s swaplog (%d entries)\n", + debug(47, 1) ("Done reading %s swaplog (%d entries)\n", rb->sd->path, rb->n_read); fclose(rb->log); rb->log = NULL; @@ -712,7 +712,7 @@ storeDiskdDirRebuildFromSwapLog(void *data) * to mask it off. */ s.swap_filen &= 0x00FFFFFF; - debug(20, 3) ("storeDiskdDirRebuildFromSwapLog: %s %s %08X\n", + debug(47, 3) ("storeDiskdDirRebuildFromSwapLog: %s %s %08X\n", swap_log_op_str[(int) s.op], storeKeyText(s.key), s.swap_filen); @@ -768,7 +768,7 @@ storeDiskdDirRebuildFromSwapLog(void *data) } else { x = log(++rb->counts.bad_log_op) / log(10.0); if (0.0 == x - (double) (int) x) - debug(20, 1) ("WARNING: %d invalid swap log entries found\n", + debug(47, 1) ("WARNING: %d invalid swap log entries found\n", rb->counts.bad_log_op); rb->counts.invalid++; continue; @@ -809,7 +809,7 @@ storeDiskdDirRebuildFromSwapLog(void *data) storeDiskdDirUnrefObj(SD, e); } else { debug_trap("storeDiskdDirRebuildFromSwapLog: bad condition"); - debug(20, 1) ("\tSee %s:%d\n", __FILE__, __LINE__); + debug(47, 1) ("\tSee %s:%d\n", __FILE__, __LINE__); } continue; } else if (used) { @@ -818,7 +818,7 @@ storeDiskdDirRebuildFromSwapLog(void *data) * point. If the log is dirty, the filesize check should have * caught this. If the log is clean, there should never be a * newer entry. */ - debug(20, 1) ("WARNING: newer swaplog entry for dirno %d, fileno %08X\n", + debug(47, 1) ("WARNING: newer swaplog entry for dirno %d, fileno %08X\n", SD->index, s.swap_filen); /* I'm tempted to remove the swapfile here just to be safe, * but there is a bad race condition in the NOVM version if @@ -881,7 +881,7 @@ storeDiskdDirGetNextFile(RebuildState * rb, sfileno * filn_p, int *size) int fd = -1; int used = 0; int dirs_opened = 0; - debug(20, 3) ("storeDiskdDirGetNextFile: flag=%d, %d: /%02X/%02X\n", + debug(47, 3) ("storeDiskdDirGetNextFile: flag=%d, %d: /%02X/%02X\n", rb->flags.init, rb->sd->index, rb->curlvl1, @@ -913,30 +913,30 @@ storeDiskdDirGetNextFile(RebuildState * rb, sfileno * filn_p, int *size) rb->entry = readdir(rb->td); /* skip . and .. */ rb->entry = readdir(rb->td); if (rb->entry == NULL && errno == ENOENT) - debug(20, 1) ("storeDiskdDirGetNextFile: directory does not exist!.\n"); - debug(20, 3) ("storeDiskdDirGetNextFile: Directory %s\n", rb->fullpath); + debug(47, 1) ("storeDiskdDirGetNextFile: directory does not exist!.\n"); + debug(47, 3) ("storeDiskdDirGetNextFile: Directory %s\n", rb->fullpath); } } if (rb->td != NULL && (rb->entry = readdir(rb->td)) != NULL) { rb->in_dir++; if (sscanf(rb->entry->d_name, "%x", &rb->fn) != 1) { - debug(20, 3) ("storeDiskdDirGetNextFile: invalid %s\n", + debug(47, 3) ("storeDiskdDirGetNextFile: invalid %s\n", rb->entry->d_name); continue; } if (!storeDiskdFilenoBelongsHere(rb->fn, rb->sd->index, rb->curlvl1, rb->curlvl2)) { - debug(20, 3) ("storeDiskdDirGetNextFile: %08X does not belong in %d/%d/%d\n", + debug(47, 3) ("storeDiskdDirGetNextFile: %08X does not belong in %d/%d/%d\n", rb->fn, rb->sd->index, rb->curlvl1, rb->curlvl2); continue; } used = storeDiskdDirMapBitTest(SD, rb->fn); if (used) { - debug(20, 3) ("storeDiskdDirGetNextFile: Locked, continuing with next.\n"); + debug(47, 3) ("storeDiskdDirGetNextFile: Locked, continuing with next.\n"); continue; } snprintf(rb->fullfilename, SQUID_MAXPATHLEN, "%s/%s", rb->fullpath, rb->entry->d_name); - debug(20, 3) ("storeDiskdDirGetNextFile: Opening %s\n", rb->fullfilename); + debug(47, 3) ("storeDiskdDirGetNextFile: Opening %s\n", rb->fullfilename); fd = file_open(rb->fullfilename, O_RDONLY); if (fd < 0) debug(50, 1) ("storeDiskdDirGetNextFile: %s: %s\n", rb->fullfilename, xstrerror()); @@ -975,7 +975,7 @@ storeDiskdDirAddDiskRestore(SwapDir * SD, const cache_key * key, int clean) { StoreEntry *e = NULL; - debug(20, 5) ("storeDiskdAddDiskRestore: %s, fileno=%08X\n", storeKeyText(key), file_number); + debug(47, 5) ("storeDiskdAddDiskRestore: %s, fileno=%08X\n", storeKeyText(key), file_number); /* if you call this you'd better be sure file_number is not * already in use! */ e = new_StoreEntry(STORE_ENTRY_WITHOUT_MEMOBJ, NULL, NULL); @@ -1035,7 +1035,7 @@ storeDiskdDirRebuild(SwapDir * sd) } if (!clean) rb->flags.need_to_validate = 1; - debug(20, 1) ("Rebuilding storage in %s (%s)\n", + debug(47, 1) ("Rebuilding storage in %s (%s)\n", sd->path, clean ? "CLEAN" : "DIRTY"); store_dirs_rebuilding++; eventAdd("storeRebuild", func, rb, 0.0, 1); @@ -1158,7 +1158,7 @@ storeDiskdDirWriteCleanStart(SwapDir * sd) xfree(state); return -1; } - debug(20, 3) ("storeDirWriteCleanLogs: opened %s, FD %d\n", + debug(47, 3) ("storeDirWriteCleanLogs: opened %s, FD %d\n", state->new, state->fd); #if HAVE_FCHMOD if (stat(state->cur, &sb) == 0) @@ -1209,7 +1209,7 @@ storeDiskdDirWriteCleanEntry(SwapDir * sd, const StoreEntry * e) if (FD_WRITE_METHOD(state->fd, state->outbuf, state->outbuf_offset) < 0) { debug(50, 0) ("storeDirWriteCleanLogs: %s: write: %s\n", state->new, xstrerror()); - debug(20, 0) ("storeDirWriteCleanLogs: Current swap logfile not replaced.\n"); + debug(47, 0) ("storeDirWriteCleanLogs: Current swap logfile not replaced.\n"); file_close(state->fd); state->fd = -1; unlink(state->new); @@ -1234,7 +1234,7 @@ storeDiskdDirWriteCleanDone(SwapDir * sd) if (FD_WRITE_METHOD(state->fd, state->outbuf, state->outbuf_offset) < 0) { debug(50, 0) ("storeDirWriteCleanLogs: %s: write: %s\n", state->new, xstrerror()); - debug(20, 0) ("storeDirWriteCleanLogs: Current swap logfile " + debug(47, 0) ("storeDirWriteCleanLogs: Current swap logfile " "not replaced.\n"); file_close(state->fd); state->fd = -1; @@ -1511,7 +1511,7 @@ storeDiskdDirMaintain(SwapDir * SD) * This is kinda cheap, but so we need this priority hack? */ } - debug(20, 3) ("storeMaintainSwapSpace: f=%f, max_scan=%d, max_remove=%d\n", f, max_scan, max_remove); + debug(47, 3) ("storeMaintainSwapSpace: f=%f, max_scan=%d, max_remove=%d\n", f, max_scan, max_remove); walker = SD->repl->PurgeInit(SD->repl, max_scan); while (1) { if (SD->cur_size < SD->low_size) @@ -1525,7 +1525,7 @@ storeDiskdDirMaintain(SwapDir * SD) storeRelease(e); } walker->Done(walker); - debug(20, (removed ? 2 : 3)) ("storeDiskdDirMaintain: %s removed %d/%d f=%.03f max_scan=%d\n", + debug(47, (removed ? 2 : 3)) ("storeDiskdDirMaintain: %s removed %d/%d f=%.03f max_scan=%d\n", SD->path, removed, max_remove, f, max_scan); } @@ -1557,7 +1557,7 @@ storeDiskdDirCheckObj(SwapDir * SD, const StoreEntry * e) void storeDiskdDirRefObj(SwapDir * SD, StoreEntry * e) { - debug(1, 3) ("storeDiskdDirRefObj: referencing %p %d/%d\n", e, e->swap_dirn, + debug(47, 3) ("storeDiskdDirRefObj: referencing %p %d/%d\n", e, e->swap_dirn, e->swap_filen); if (SD->repl->Referenced) SD->repl->Referenced(SD->repl, e, &e->repl); @@ -1571,7 +1571,7 @@ storeDiskdDirRefObj(SwapDir * SD, StoreEntry * e) void storeDiskdDirUnrefObj(SwapDir * SD, StoreEntry * e) { - debug(1, 3) ("storeDiskdDirUnrefObj: referencing %p %d/%d\n", e, + debug(47, 3) ("storeDiskdDirUnrefObj: referencing %p %d/%d\n", e, e->swap_dirn, e->swap_filen); if (SD->repl->Dereferenced) SD->repl->Dereferenced(SD->repl, e, &e->repl); @@ -1587,7 +1587,7 @@ storeDiskdDirUnrefObj(SwapDir * SD, StoreEntry * e) void storeDiskdDirUnlinkFile(SwapDir * SD, sfileno f) { - debug(79, 3) ("storeDiskdDirUnlinkFile: unlinking fileno %08X\n", f); + debug(47, 3) ("storeDiskdDirUnlinkFile: unlinking fileno %08X\n", f); /* storeDiskdDirMapBitReset(SD, f); */ #if USE_UNLINKD unlinkdUnlink(storeDiskdDirFullPath(SD, f, NULL)); @@ -1606,7 +1606,7 @@ storeDiskdDirUnlinkFile(SwapDir * SD, sfileno f) void storeDiskdDirReplAdd(SwapDir * SD, StoreEntry * e) { - debug(20, 4) ("storeDiskdDirReplAdd: added node %p to dir %d\n", e, + debug(47, 4) ("storeDiskdDirReplAdd: added node %p to dir %d\n", e, SD->index); SD->repl->Add(SD->repl, e, &e->repl); } @@ -1619,7 +1619,7 @@ storeDiskdDirReplRemove(StoreEntry * e) if (e->swap_dirn < 0) return; SD = INDEXSD(e->swap_dirn); - debug(20, 4) ("storeDiskdDirReplRemove: remove node %p from dir %d\n", e, + debug(47, 4) ("storeDiskdDirReplRemove: remove node %p from dir %d\n", e, SD->index); SD->repl->Remove(SD->repl, e, &e->repl); } @@ -1872,19 +1872,19 @@ storeDiskdCleanupDoubleCheck(SwapDir * sd, StoreEntry * e) { struct stat sb; if (stat(storeDiskdDirFullPath(sd, e->swap_filen, NULL), &sb) < 0) { - debug(20, 0) ("storeDiskdCleanupDoubleCheck: MISSING SWAP FILE\n"); - debug(20, 0) ("storeDiskdCleanupDoubleCheck: FILENO %08X\n", e->swap_filen); - debug(20, 0) ("storeDiskdCleanupDoubleCheck: PATH %s\n", + debug(47, 0) ("storeDiskdCleanupDoubleCheck: MISSING SWAP FILE\n"); + debug(47, 0) ("storeDiskdCleanupDoubleCheck: FILENO %08X\n", e->swap_filen); + debug(47, 0) ("storeDiskdCleanupDoubleCheck: PATH %s\n", storeDiskdDirFullPath(sd, e->swap_filen, NULL)); storeEntryDump(e, 0); return -1; } if (e->swap_file_sz != sb.st_size) { - debug(20, 0) ("storeDiskdCleanupDoubleCheck: SIZE MISMATCH\n"); - debug(20, 0) ("storeDiskdCleanupDoubleCheck: FILENO %08X\n", e->swap_filen); - debug(20, 0) ("storeDiskdCleanupDoubleCheck: PATH %s\n", + debug(47, 0) ("storeDiskdCleanupDoubleCheck: SIZE MISMATCH\n"); + debug(47, 0) ("storeDiskdCleanupDoubleCheck: FILENO %08X\n", e->swap_filen); + debug(47, 0) ("storeDiskdCleanupDoubleCheck: PATH %s\n", storeDiskdDirFullPath(sd, e->swap_filen, NULL)); - debug(20, 0) ("storeDiskdCleanupDoubleCheck: ENTRY SIZE: %ld, FILE SIZE: %ld\n", + debug(47, 0) ("storeDiskdCleanupDoubleCheck: ENTRY SIZE: %ld, FILE SIZE: %ld\n", (long int) e->swap_file_sz, (long int) sb.st_size); storeEntryDump(e, 0); return -1; @@ -1981,6 +1981,6 @@ storeFsSetup_diskd(storefs_entry_t * storefs) diskd_state_pool = memPoolCreate("DISKD IO State data", sizeof(diskdstate_t)); memset(&diskd_stats, '\0', sizeof(diskd_stats)); cachemgrRegister("diskd", "DISKD Stats", storeDiskdStats, 0, 1); - debug(79, 1) ("diskd started\n"); + debug(47, 1) ("diskd started\n"); diskd_initialised = 1; } diff --git a/src/fs/diskd/store_io_diskd.cc b/src/fs/diskd/store_io_diskd.cc index 9eb31a9e2e..f17fa41024 100644 --- a/src/fs/diskd/store_io_diskd.cc +++ b/src/fs/diskd/store_io_diskd.cc @@ -1,6 +1,6 @@ /* - * $Id: store_io_diskd.cc,v 1.24 2002/07/20 23:51:06 hno Exp $ + * $Id: store_io_diskd.cc,v 1.25 2002/07/21 00:25:46 hno Exp $ * * DEBUG: section 79 Squid-side DISKD I/O functions. * AUTHOR: Duane Wessels @@ -96,7 +96,7 @@ storeDiskdOpen(SwapDir * SD, StoreEntry * e, STFNCB * file_callback, O_RDONLY, shm_offset); if (x < 0) { - debug(50, 1) ("storeDiskdSend OPEN: %s\n", xstrerror()); + debug(79, 1) ("storeDiskdSend OPEN: %s\n", xstrerror()); storeDiskdShmPut(SD, shm_offset); cbdataReferenceDone(sio->callback_data); cbdataFree(sio); @@ -154,7 +154,7 @@ storeDiskdCreate(SwapDir * SD, StoreEntry * e, STFNCB * file_callback, sio->mode, shm_offset); if (x < 0) { - debug(50, 1) ("storeDiskdSend OPEN: %s\n", xstrerror()); + debug(79, 1) ("storeDiskdSend OPEN: %s\n", xstrerror()); storeDiskdShmPut(SD, shm_offset); cbdataReferenceDone(sio->callback_data); cbdataFree(sio); @@ -181,7 +181,7 @@ storeDiskdClose(SwapDir * SD, storeIOState * sio) 0, -1); if (x < 0) { - debug(50, 1) ("storeDiskdSend CLOSE: %s\n", xstrerror()); + debug(79, 1) ("storeDiskdSend CLOSE: %s\n", xstrerror()); storeDiskdIOCallback(sio, DISK_ERROR); } diskdstate->flags.close_request = 1; @@ -220,7 +220,7 @@ storeDiskdRead(SwapDir * SD, storeIOState * sio, char *buf, size_t size, off_t o (int) offset, shm_offset); if (x < 0) { - debug(50, 1) ("storeDiskdSend READ: %s\n", xstrerror()); + debug(79, 1) ("storeDiskdSend READ: %s\n", xstrerror()); storeDiskdShmPut(SD, shm_offset); storeDiskdIOCallback(sio, DISK_ERROR); } @@ -253,7 +253,7 @@ storeDiskdWrite(SwapDir * SD, storeIOState * sio, char *buf, size_t size, off_t (int) offset, shm_offset); if (x < 0) { - debug(50, 1) ("storeDiskdSend WRITE: %s\n", xstrerror()); + debug(79, 1) ("storeDiskdSend WRITE: %s\n", xstrerror()); storeDiskdShmPut(SD, shm_offset); storeDiskdIOCallback(sio, DISK_ERROR); } @@ -274,7 +274,7 @@ storeDiskdUnlink(SwapDir * SD, StoreEntry * e) storeDiskdDirMapBitReset(SD, e->swap_filen); if (diskdinfo->away >= diskdinfo->magic1) { /* Damn, we need to issue a sync unlink here :( */ - debug(50, 2) ("storeDiskUnlink: Out of queue space, sync unlink\n"); + debug(79, 2) ("storeDiskUnlink: Out of queue space, sync unlink\n"); storeDiskdDirUnlinkFile(SD, e->swap_filen); return; } @@ -289,7 +289,7 @@ storeDiskdUnlink(SwapDir * SD, StoreEntry * e) 0, shm_offset); if (x < 0) { - debug(50, 1) ("storeDiskdSend UNLINK: %s\n", xstrerror()); + debug(79, 1) ("storeDiskdSend UNLINK: %s\n", xstrerror()); unlink(buf); /* XXX EWW! */ storeDiskdShmPut(SD, shm_offset); } @@ -481,7 +481,7 @@ storeDiskdSend(int mtype, SwapDir * sd, int id, storeIOState * sio, int size, in diskd_stats.sent_count++; diskdinfo->away++; } else { - debug(50, 1) ("storeDiskdSend: msgsnd: %s\n", xstrerror()); + debug(79, 1) ("storeDiskdSend: msgsnd: %s\n", xstrerror()); cbdataReferenceDone(M.callback_data); assert(++send_errors < 100); } diff --git a/src/fs/ufs/store_dir_ufs.cc b/src/fs/ufs/store_dir_ufs.cc index ca884a792b..3ea0de1829 100644 --- a/src/fs/ufs/store_dir_ufs.cc +++ b/src/fs/ufs/store_dir_ufs.cc @@ -1,6 +1,6 @@ /* - * $Id: store_dir_ufs.cc,v 1.45 2002/06/26 09:55:59 hno Exp $ + * $Id: store_dir_ufs.cc,v 1.46 2002/07/21 00:25:46 hno Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -210,12 +210,12 @@ storeUfsDirCreateDirectory(const char *path, int should_exist) getCurrentTime(); if (0 == stat(path, &st)) { if (S_ISDIR(st.st_mode)) { - debug(20, should_exist ? 3 : 1) ("%s exists\n", path); + debug(47, should_exist ? 3 : 1) ("%s exists\n", path); } else { fatalf("Swap directory %s is not a directory.", path); } } else if (0 == mkdir(path, 0755)) { - debug(20, should_exist ? 1 : 3) ("%s created\n", path); + debug(47, should_exist ? 1 : 3) ("%s created\n", path); created = 1; } else { fatalf("Failed to make swap directory %s: %s", @@ -229,11 +229,11 @@ storeUfsDirVerifyDirectory(const char *path) { struct stat sb; if (stat(path, &sb) < 0) { - debug(20, 0) ("%s: %s\n", path, xstrerror()); + debug(47, 0) ("%s: %s\n", path, xstrerror()); return -1; } if (S_ISDIR(sb.st_mode) == 0) { - debug(20, 0) ("%s is not a directory\n", path); + debug(47, 0) ("%s is not a directory\n", path); return -1; } return 0; @@ -386,12 +386,12 @@ storeUfsDirRebuildFromDirectory(void *data) tlv *tlv_list; tlv *t; assert(rb != NULL); - debug(20, 3) ("storeUfsDirRebuildFromDirectory: DIR #%d\n", rb->sd->index); + debug(47, 3) ("storeUfsDirRebuildFromDirectory: DIR #%d\n", rb->sd->index); for (count = 0; count < rb->speed; count++) { assert(fd == -1); fd = storeUfsDirGetNextFile(rb, &filn, &size); if (fd == -2) { - debug(20, 1) ("Done scanning %s swaplog (%d entries)\n", + debug(47, 1) ("Done scanning %s swaplog (%d entries)\n", rb->sd->path, rb->n_read); store_dirs_rebuilding--; storeUfsDirCloseTmpSwapLog(rb->sd); @@ -404,7 +404,7 @@ storeUfsDirRebuildFromDirectory(void *data) assert(fd > -1); /* lets get file stats here */ if (fstat(fd, &sb) < 0) { - debug(20, 1) ("storeUfsDirRebuildFromDirectory: fstat(FD %d): %s\n", + debug(47, 1) ("storeUfsDirRebuildFromDirectory: fstat(FD %d): %s\n", fd, xstrerror()); file_close(fd); store_open_disk_fd--; @@ -412,12 +412,12 @@ storeUfsDirRebuildFromDirectory(void *data) continue; } if ((++rb->counts.scancount & 0xFFFF) == 0) - debug(20, 3) (" %s %7d files opened so far.\n", + debug(47, 3) (" %s %7d files opened so far.\n", rb->sd->path, rb->counts.scancount); - debug(20, 9) ("file_in: fd=%d %08X\n", fd, filn); + debug(47, 9) ("file_in: fd=%d %08X\n", fd, filn); statCounter.syscalls.disk.reads++; if (FD_READ_METHOD(fd, hdr_buf, SM_PAGE_SIZE) < 0) { - debug(20, 1) ("storeUfsDirRebuildFromDirectory: read(FD %d): %s\n", + debug(47, 1) ("storeUfsDirRebuildFromDirectory: read(FD %d): %s\n", fd, xstrerror()); file_close(fd); store_open_disk_fd--; @@ -434,12 +434,12 @@ storeUfsDirRebuildFromDirectory(void *data) #endif tlv_list = storeSwapMetaUnpack(hdr_buf, &swap_hdr_len); if (tlv_list == NULL) { - debug(20, 1) ("storeUfsDirRebuildFromDirectory: failed to get meta data\n"); + debug(47, 1) ("storeUfsDirRebuildFromDirectory: failed to get meta data\n"); /* XXX shouldn't this be a call to storeUfsUnlink ? */ storeUfsDirUnlinkFile(SD, filn); continue; } - debug(20, 3) ("storeUfsDirRebuildFromDirectory: successful swap meta unpacking\n"); + debug(47, 3) ("storeUfsDirRebuildFromDirectory: successful swap meta unpacking\n"); memset(key, '\0', MD5_DIGEST_CHARS); memset(&tmpe, '\0', sizeof(StoreEntry)); for (t = tlv_list; t; t = t->next) { @@ -459,7 +459,7 @@ storeUfsDirRebuildFromDirectory(void *data) storeSwapTLVFree(tlv_list); tlv_list = NULL; if (storeKeyNull(key)) { - debug(20, 1) ("storeUfsDirRebuildFromDirectory: NULL key\n"); + debug(47, 1) ("storeUfsDirRebuildFromDirectory: NULL key\n"); storeUfsDirUnlinkFile(SD, filn); continue; } @@ -470,7 +470,7 @@ storeUfsDirRebuildFromDirectory(void *data) } else if (tmpe.swap_file_sz == sb.st_size - swap_hdr_len) { tmpe.swap_file_sz = sb.st_size; } else if (tmpe.swap_file_sz != sb.st_size) { - debug(20, 1) ("storeUfsDirRebuildFromDirectory: SIZE MISMATCH %ld!=%ld\n", + debug(47, 1) ("storeUfsDirRebuildFromDirectory: SIZE MISMATCH %ld!=%ld\n", (long int) tmpe.swap_file_sz, (long int) sb.st_size); storeUfsDirUnlinkFile(SD, filn); continue; @@ -525,7 +525,7 @@ storeUfsDirRebuildFromSwapLog(void *data) /* load a number of objects per invocation */ for (count = 0; count < rb->speed; count++) { if (fread(&s, ss, 1, rb->log) != 1) { - debug(20, 1) ("Done reading %s swaplog (%d entries)\n", + debug(47, 1) ("Done reading %s swaplog (%d entries)\n", rb->sd->path, rb->n_read); fclose(rb->log); rb->log = NULL; @@ -549,7 +549,7 @@ storeUfsDirRebuildFromSwapLog(void *data) * to mask it off. */ s.swap_filen &= 0x00FFFFFF; - debug(20, 3) ("storeUfsDirRebuildFromSwapLog: %s %s %08X\n", + debug(47, 3) ("storeUfsDirRebuildFromSwapLog: %s %s %08X\n", swap_log_op_str[(int) s.op], storeKeyText(s.key), s.swap_filen); @@ -580,7 +580,7 @@ storeUfsDirRebuildFromSwapLog(void *data) } else { x = log(++rb->counts.bad_log_op) / log(10.0); if (0.0 == x - (double) (int) x) - debug(20, 1) ("WARNING: %d invalid swap log entries found\n", + debug(47, 1) ("WARNING: %d invalid swap log entries found\n", rb->counts.bad_log_op); rb->counts.invalid++; continue; @@ -621,7 +621,7 @@ storeUfsDirRebuildFromSwapLog(void *data) storeUfsDirUnrefObj(SD, e); } else { debug_trap("storeUfsDirRebuildFromSwapLog: bad condition"); - debug(20, 1) ("\tSee %s:%d\n", __FILE__, __LINE__); + debug(47, 1) ("\tSee %s:%d\n", __FILE__, __LINE__); } continue; } else if (used) { @@ -630,7 +630,7 @@ storeUfsDirRebuildFromSwapLog(void *data) * point. If the log is dirty, the filesize check should have * caught this. If the log is clean, there should never be a * newer entry. */ - debug(20, 1) ("WARNING: newer swaplog entry for dirno %d, fileno %08X\n", + debug(47, 1) ("WARNING: newer swaplog entry for dirno %d, fileno %08X\n", SD->index, s.swap_filen); /* I'm tempted to remove the swapfile here just to be safe, * but there is a bad race condition in the NOVM version if @@ -693,7 +693,7 @@ storeUfsDirGetNextFile(RebuildState * rb, sfileno * filn_p, int *size) int fd = -1; int used = 0; int dirs_opened = 0; - debug(20, 3) ("storeUfsDirGetNextFile: flag=%d, %d: /%02X/%02X\n", + debug(47, 3) ("storeUfsDirGetNextFile: flag=%d, %d: /%02X/%02X\n", rb->flags.init, rb->sd->index, rb->curlvl1, rb->curlvl2); @@ -719,39 +719,39 @@ storeUfsDirGetNextFile(RebuildState * rb, sfileno * filn_p, int *size) rb->td = opendir(rb->fullpath); dirs_opened++; if (rb->td == NULL) { - debug(50, 1) ("storeUfsDirGetNextFile: opendir: %s: %s\n", + debug(47, 1) ("storeUfsDirGetNextFile: opendir: %s: %s\n", rb->fullpath, xstrerror()); } else { rb->entry = readdir(rb->td); /* skip . and .. */ rb->entry = readdir(rb->td); if (rb->entry == NULL && errno == ENOENT) - debug(20, 1) ("storeUfsDirGetNextFile: directory does not exist!.\n"); - debug(20, 3) ("storeUfsDirGetNextFile: Directory %s\n", rb->fullpath); + debug(47, 1) ("storeUfsDirGetNextFile: directory does not exist!.\n"); + debug(47, 3) ("storeUfsDirGetNextFile: Directory %s\n", rb->fullpath); } } if (rb->td != NULL && (rb->entry = readdir(rb->td)) != NULL) { rb->in_dir++; if (sscanf(rb->entry->d_name, "%x", &rb->fn) != 1) { - debug(20, 3) ("storeUfsDirGetNextFile: invalid %s\n", + debug(47, 3) ("storeUfsDirGetNextFile: invalid %s\n", rb->entry->d_name); continue; } if (!storeUfsFilenoBelongsHere(rb->fn, rb->sd->index, rb->curlvl1, rb->curlvl2)) { - debug(20, 3) ("storeUfsDirGetNextFile: %08X does not belong in %d/%d/%d\n", + debug(47, 3) ("storeUfsDirGetNextFile: %08X does not belong in %d/%d/%d\n", rb->fn, rb->sd->index, rb->curlvl1, rb->curlvl2); continue; } used = storeUfsDirMapBitTest(SD, rb->fn); if (used) { - debug(20, 3) ("storeUfsDirGetNextFile: Locked, continuing with next.\n"); + debug(47, 3) ("storeUfsDirGetNextFile: Locked, continuing with next.\n"); continue; } snprintf(rb->fullfilename, SQUID_MAXPATHLEN, "%s/%s", rb->fullpath, rb->entry->d_name); - debug(20, 3) ("storeUfsDirGetNextFile: Opening %s\n", rb->fullfilename); + debug(47, 3) ("storeUfsDirGetNextFile: Opening %s\n", rb->fullfilename); fd = file_open(rb->fullfilename, O_RDONLY | O_BINARY); if (fd < 0) - debug(50, 1) ("storeUfsDirGetNextFile: %s: %s\n", rb->fullfilename, xstrerror()); + debug(47, 1) ("storeUfsDirGetNextFile: %s: %s\n", rb->fullfilename, xstrerror()); else store_open_disk_fd++; continue; @@ -787,7 +787,7 @@ storeUfsDirAddDiskRestore(SwapDir * SD, const cache_key * key, int clean) { StoreEntry *e = NULL; - debug(20, 5) ("storeUfsAddDiskRestore: %s, fileno=%08X\n", storeKeyText(key), file_number); + debug(47, 5) ("storeUfsAddDiskRestore: %s, fileno=%08X\n", storeKeyText(key), file_number); /* if you call this you'd better be sure file_number is not * already in use! */ e = new_StoreEntry(STORE_ENTRY_WITHOUT_MEMOBJ, NULL, NULL); @@ -846,7 +846,7 @@ storeUfsDirRebuild(SwapDir * sd) } if (!clean) rb->flags.need_to_validate = 1; - debug(20, 1) ("Rebuilding storage in %s (%s)\n", + debug(47, 1) ("Rebuilding storage in %s (%s)\n", sd->path, clean ? "CLEAN" : "DIRTY"); store_dirs_rebuilding++; eventAdd("storeRebuild", func, rb, 0.0, 1); @@ -967,7 +967,7 @@ storeUfsDirWriteCleanStart(SwapDir * sd) state->outbuf_offset = 0; state->walker = sd->repl->WalkInit(sd->repl); unlink(state->cln); - debug(20, 3) ("storeDirWriteCleanLogs: opened %s, FD %d\n", + debug(47, 3) ("storeDirWriteCleanLogs: opened %s, FD %d\n", state->new, state->fd); #if HAVE_FCHMOD if (stat(state->cur, &sb) == 0) @@ -1018,7 +1018,7 @@ storeUfsDirWriteCleanEntry(SwapDir * sd, const StoreEntry * e) if (FD_WRITE_METHOD(state->fd, state->outbuf, state->outbuf_offset) < 0) { debug(50, 0) ("storeDirWriteCleanLogs: %s: write: %s\n", state->new, xstrerror()); - debug(20, 0) ("storeDirWriteCleanLogs: Current swap logfile not replaced.\n"); + debug(47, 0) ("storeDirWriteCleanLogs: Current swap logfile not replaced.\n"); file_close(state->fd); state->fd = -1; unlink(state->new); @@ -1044,7 +1044,7 @@ storeUfsDirWriteCleanDone(SwapDir * sd) if (FD_WRITE_METHOD(state->fd, state->outbuf, state->outbuf_offset) < 0) { debug(50, 0) ("storeDirWriteCleanLogs: %s: write: %s\n", state->new, xstrerror()); - debug(20, 0) ("storeDirWriteCleanLogs: Current swap logfile " + debug(50, 0) ("storeDirWriteCleanLogs: Current swap logfile " "not replaced.\n"); file_close(state->fd); state->fd = -1; @@ -1323,7 +1323,7 @@ storeUfsDirMaintain(SwapDir * SD) * This is kinda cheap, but so we need this priority hack? */ } - debug(20, 3) ("storeMaintainSwapSpace: f=%f, max_scan=%d, max_remove=%d\n", f, max_scan, max_remove); + debug(47, 3) ("storeMaintainSwapSpace: f=%f, max_scan=%d, max_remove=%d\n", f, max_scan, max_remove); walker = SD->repl->PurgeInit(SD->repl, max_scan); while (1) { if (SD->cur_size < SD->low_size) @@ -1337,7 +1337,7 @@ storeUfsDirMaintain(SwapDir * SD) storeRelease(e); } walker->Done(walker); - debug(20, (removed ? 2 : 3)) ("storeUfsDirMaintain: %s removed %d/%d f=%.03f max_scan=%d\n", + debug(47, (removed ? 2 : 3)) ("storeUfsDirMaintain: %s removed %d/%d f=%.03f max_scan=%d\n", SD->path, removed, max_remove, f, max_scan); } @@ -1364,7 +1364,7 @@ storeUfsDirCheckObj(SwapDir * SD, const StoreEntry * e) void storeUfsDirRefObj(SwapDir * SD, StoreEntry * e) { - debug(1, 3) ("storeUfsDirRefObj: referencing %p %d/%d\n", e, e->swap_dirn, + debug(47, 3) ("storeUfsDirRefObj: referencing %p %d/%d\n", e, e->swap_dirn, e->swap_filen); if (SD->repl->Referenced) SD->repl->Referenced(SD->repl, e, &e->repl); @@ -1378,7 +1378,7 @@ storeUfsDirRefObj(SwapDir * SD, StoreEntry * e) void storeUfsDirUnrefObj(SwapDir * SD, StoreEntry * e) { - debug(1, 3) ("storeUfsDirUnrefObj: referencing %p %d/%d\n", e, e->swap_dirn, + debug(47, 3) ("storeUfsDirUnrefObj: referencing %p %d/%d\n", e, e->swap_dirn, e->swap_filen); if (SD->repl->Dereferenced) SD->repl->Dereferenced(SD->repl, e, &e->repl); @@ -1413,7 +1413,7 @@ storeUfsDirUnlinkFile(SwapDir * SD, sfileno f) void storeUfsDirReplAdd(SwapDir * SD, StoreEntry * e) { - debug(20, 4) ("storeUfsDirReplAdd: added node %p to dir %d\n", e, + debug(47, 4) ("storeUfsDirReplAdd: added node %p to dir %d\n", e, SD->index); SD->repl->Add(SD->repl, e, &e->repl); } @@ -1423,7 +1423,7 @@ void storeUfsDirReplRemove(StoreEntry * e) { SwapDir *SD = INDEXSD(e->swap_dirn); - debug(20, 4) ("storeUfsDirReplRemove: remove node %p from dir %d\n", e, + debug(47, 4) ("storeUfsDirReplRemove: remove node %p from dir %d\n", e, SD->index); SD->repl->Remove(SD->repl, e, &e->repl); } @@ -1572,19 +1572,19 @@ storeUfsCleanupDoubleCheck(SwapDir * sd, StoreEntry * e) { struct stat sb; if (stat(storeUfsDirFullPath(sd, e->swap_filen, NULL), &sb) < 0) { - debug(20, 0) ("storeUfsCleanupDoubleCheck: MISSING SWAP FILE\n"); - debug(20, 0) ("storeUfsCleanupDoubleCheck: FILENO %08X\n", e->swap_filen); - debug(20, 0) ("storeUfsCleanupDoubleCheck: PATH %s\n", + debug(47, 0) ("storeUfsCleanupDoubleCheck: MISSING SWAP FILE\n"); + debug(47, 0) ("storeUfsCleanupDoubleCheck: FILENO %08X\n", e->swap_filen); + debug(47, 0) ("storeUfsCleanupDoubleCheck: PATH %s\n", storeUfsDirFullPath(sd, e->swap_filen, NULL)); storeEntryDump(e, 0); return -1; } if (e->swap_file_sz != sb.st_size) { - debug(20, 0) ("storeUfsCleanupDoubleCheck: SIZE MISMATCH\n"); - debug(20, 0) ("storeUfsCleanupDoubleCheck: FILENO %08X\n", e->swap_filen); - debug(20, 0) ("storeUfsCleanupDoubleCheck: PATH %s\n", + debug(47, 0) ("storeUfsCleanupDoubleCheck: SIZE MISMATCH\n"); + debug(47, 0) ("storeUfsCleanupDoubleCheck: FILENO %08X\n", e->swap_filen); + debug(47, 0) ("storeUfsCleanupDoubleCheck: PATH %s\n", storeUfsDirFullPath(sd, e->swap_filen, NULL)); - debug(20, 0) ("storeUfsCleanupDoubleCheck: ENTRY SIZE: %ld, FILE SIZE: %ld\n", + debug(47, 0) ("storeUfsCleanupDoubleCheck: ENTRY SIZE: %ld, FILE SIZE: %ld\n", (long int) e->swap_file_sz, (long int) sb.st_size); storeEntryDump(e, 0); return -1; diff --git a/src/unlinkd.cc b/src/unlinkd.cc index edc935a260..1df3167201 100644 --- a/src/unlinkd.cc +++ b/src/unlinkd.cc @@ -1,8 +1,8 @@ /* - * $Id: unlinkd.cc,v 1.47 2002/07/20 23:51:03 hno Exp $ + * $Id: unlinkd.cc,v 1.48 2002/07/21 00:25:44 hno Exp $ * - * DEBUG: section 12 Unlink Daemon + * DEBUG: section 2 Unlink Daemon * AUTHOR: Duane Wessels * * SQUID Web Proxy Cache http://www.squid-cache.org/ -- 2.47.3