From: wessels <> Date: Fri, 1 Dec 2000 03:07:32 +0000 (+0000) Subject: indent -br -ce -i4 -ci4 -l80 -nlp -npcs -npsl -d0 -sc -di0 -psl X-Git-Tag: SQUID_3_0_PRE1~1756 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36e336290bbcbfc369dea65c8418ce7702f14957;p=thirdparty%2Fsquid.git indent -br -ce -i4 -ci4 -l80 -nlp -npcs -npsl -d0 -sc -di0 -psl --- diff --git a/src/fs/aufs/store_dir_aufs.cc b/src/fs/aufs/store_dir_aufs.cc index 983ea03457..da1169045c 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.16 2000/11/10 21:42:03 hno Exp $ + * $Id: store_dir_aufs.cc,v 1.17 2000/11/30 20:07:32 wessels Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -119,7 +119,7 @@ static EVH storeAufsDirCleanEvent; static int storeAufsDirIs(SwapDir * sd); static int storeAufsFilenoBelongsHere(int fn, int F0, int F1, int F2); static int storeAufsCleanupDoubleCheck(SwapDir *, StoreEntry *); -static int storeAufsCheckFile(SwapDir * sd, sfileno filn, size_t swap_file_sz ); +static int storeAufsCheckFile(SwapDir * sd, sfileno filn, size_t swap_file_sz); static void storeAufsDirStats(SwapDir *, StoreEntry *); static void storeAufsDirInitBitmap(SwapDir *); static int storeAufsDirValidFileno(SwapDir *, sfileno, int); @@ -478,7 +478,7 @@ storeAufsDirRebuildFromDirectory(void *data) debug(20, 1) ("storeAufsDirRebuildFromDirectory: SIZE MISMATCH %d!=%d\n", tmpe.swap_file_sz, (int) sb.st_size); storeAufsDirUnlinkFile(SD, sfileno); - rb->counts.filesizemismatchcount++; + rb->counts.filesizemismatchcount++; continue; } if (EBIT_TEST(tmpe.flags, KEY_PRIVATE)) { @@ -612,20 +612,20 @@ storeAufsDirRebuildFromSwapLog(void *data) * appear to have a newer entry? Compare 'lastref' from the * swap log to e->lastref. */ disk_entry_newer = e ? (s.lastref > e->lastref ? 1 : 0) : 0; - if (!used && (rb->flags.need_to_validate || - (opt_store_doublecheck != DBLCHECK_NONE))){ - file_bad = storeAufsCheckFile(SD, s.swap_filen, s.swap_file_sz); - } else - file_bad = 0; - if (file_bad){ - if (file_bad==-2){ - if (opt_store_doublecheck == DBLCHECK_FORCE) - storeAufsDirUnlinkFile(SD, s.swap_filen); - rb->counts.filesizemismatchcount++; - continue; - } - rb->counts.missingcount++; - continue; + if (!used && (rb->flags.need_to_validate || + (opt_store_doublecheck != DBLCHECK_NONE))) { + file_bad = storeAufsCheckFile(SD, s.swap_filen, s.swap_file_sz); + } else + file_bad = 0; + if (file_bad) { + if (file_bad == -2) { + if (opt_store_doublecheck == DBLCHECK_FORCE) + storeAufsDirUnlinkFile(SD, s.swap_filen); + rb->counts.filesizemismatchcount++; + continue; + } + rb->counts.missingcount++; + continue; } else if (used && !disk_entry_newer) { /* log entry is old, ignore it */ rb->counts.clashcount++; @@ -1603,8 +1603,9 @@ storeAufsDirFullPath(SwapDir * SD, sfileno filn, char *fullpath) static int storeAufsCleanupDoubleCheck(SwapDir * sd, StoreEntry * e) { - int rv= storeAufsCheckFile(sd, e->swap_filen, e->swap_file_sz); - if (rv) storeEntryDump(e, 0); + int rv = storeAufsCheckFile(sd, e->swap_filen, e->swap_file_sz); + if (rv) + storeEntryDump(e, 0); return rv; } @@ -1615,22 +1616,22 @@ storeAufsCleanupDoubleCheck(SwapDir * sd, StoreEntry * e) * line. or a Dirty state is found */ static int -storeAufsCheckFile(SwapDir * sd, sfileno filen, size_t swap_file_sz ) +storeAufsCheckFile(SwapDir * sd, sfileno filen, size_t swap_file_sz) { struct stat sb; if (stat(storeAufsDirFullPath(sd, filen, NULL), &sb) < 0) { - debug(20, 1) ("storeAufsCheckFile: MISSING SWAP FILE\n"); - debug(20, 1) ("storeAufsCheckFile: FILENO %08X\n", filen); - debug(20, 1) ("storeAufsCheckFile: PATH %s\n", storeAufsDirFullPath(sd, filen, NULL)); - return -1; + debug(20, 1) ("storeAufsCheckFile: MISSING SWAP FILE\n"); + debug(20, 1) ("storeAufsCheckFile: FILENO %08X\n", filen); + debug(20, 1) ("storeAufsCheckFile: PATH %s\n", storeAufsDirFullPath(sd, filen, NULL)); + return -1; } if (swap_file_sz != sb.st_size) { - debug(20, 1) ("storeAufsCheckFile: SIZE MISMATCH\n"); - debug(20, 1) ("storeAufsCheckFile: FILENO %08X\n", filen); - debug(20, 1) ("storeAufsCheckFile: PATH %s\n", storeAufsDirFullPath(sd, filen, NULL)); - debug(20, 1) ("storeAufsCheckFile: ENTRY SIZE: %d, FILE SIZE: %d\n", swap_file_sz, (int) sb.st_size); - return -2; + debug(20, 1) ("storeAufsCheckFile: SIZE MISMATCH\n"); + debug(20, 1) ("storeAufsCheckFile: FILENO %08X\n", filen); + debug(20, 1) ("storeAufsCheckFile: PATH %s\n", storeAufsDirFullPath(sd, filen, NULL)); + debug(20, 1) ("storeAufsCheckFile: ENTRY SIZE: %d, FILE SIZE: %d\n", swap_file_sz, (int) sb.st_size); + return -2; } return 0; } diff --git a/src/fs/diskd/store_dir_diskd.cc b/src/fs/diskd/store_dir_diskd.cc index 06c816c092..427b309d91 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.24 2000/11/10 09:04:52 adrian Exp $ + * $Id: store_dir_diskd.cc,v 1.25 2000/11/30 20:07:32 wessels Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -644,7 +644,7 @@ storeDiskdDirRebuildFromDirectory(void *data) debug(20, 1) ("storeDiskdDirRebuildFromDirectory: SIZE MISMATCH %d!=%d\n", tmpe.swap_file_sz, (int) sb.st_size); storeDiskdDirUnlinkFile(SD, sfileno); - rb->counts.filesizemismatchcount++; + rb->counts.filesizemismatchcount++; continue; } if (EBIT_TEST(tmpe.flags, KEY_PRIVATE)) { @@ -803,21 +803,21 @@ storeDiskdDirRebuildFromSwapLog(void *data) * appear to have a newer entry? Compare 'lastref' from the * swap log to e->lastref. */ disk_entry_newer = e ? (s.lastref > e->lastref ? 1 : 0) : 0; - if (!used && (rb->flags.need_to_validate || - (opt_store_doublecheck != DBLCHECK_NONE))){ - file_bad = storeDiskdCheckFile(SD, s.swap_filen, s.swap_file_sz); - } else - file_bad = 0; - if (file_bad){ - if (file_bad==-2){ - if (opt_store_doublecheck == DBLCHECK_FORCE) - storeDiskdDirUnlinkFile(SD, s.swap_filen); - rb->counts.filesizemismatchcount++; - continue; - } - rb->counts.missingcount++; - continue; - } else if (used && !disk_entry_newer) { + if (!used && (rb->flags.need_to_validate || + (opt_store_doublecheck != DBLCHECK_NONE))) { + file_bad = storeDiskdCheckFile(SD, s.swap_filen, s.swap_file_sz); + } else + file_bad = 0; + if (file_bad) { + if (file_bad == -2) { + if (opt_store_doublecheck == DBLCHECK_FORCE) + storeDiskdDirUnlinkFile(SD, s.swap_filen); + rb->counts.filesizemismatchcount++; + continue; + } + rb->counts.missingcount++; + continue; + } else if (used && !disk_entry_newer) { /* log entry is old, ignore it */ rb->counts.clashcount++; continue; @@ -1845,8 +1845,9 @@ storeDiskdDirFullPath(SwapDir * SD, sfileno filn, char *fullpath) static int storeDiskdCleanupDoubleCheck(SwapDir * sd, StoreEntry * e) { - int rv= storeDiskdCheckFile(sd, e->swap_filen, e->swap_file_sz); - if (rv) storeEntryDump(e, 0); + int rv = storeDiskdCheckFile(sd, e->swap_filen, e->swap_file_sz); + if (rv) + storeEntryDump(e, 0); return rv; } @@ -1856,24 +1857,24 @@ storeDiskdCleanupDoubleCheck(SwapDir * sd, StoreEntry * e) * This is called by storerebuildFromSwapLog if -S was given on the command line * or a Dirty state is found */ static int -storeDiskdCheckFile(SwapDir * sd, sfileno filen, size_t swap_file_sz ) +storeDiskdCheckFile(SwapDir * sd, sfileno filen, size_t swap_file_sz) { - struct stat sb; + struct stat sb; if (stat(storeDiskdDirFullPath(sd, filen, NULL), &sb) < 0) { - debug(20, 1) ("storeDiskdCheckFile: MISSING SWAP FILE\n"); - debug(20, 1) ("storeDiskdCheckFile: FILENO %08X\n", filen); - debug(20, 1) ("storeDiskdCheckFile: PATH %s\n", storeDiskdDirFullPath(sd, filen, NULL)); + debug(20, 1) ("storeDiskdCheckFile: MISSING SWAP FILE\n"); + debug(20, 1) ("storeDiskdCheckFile: FILENO %08X\n", filen); + debug(20, 1) ("storeDiskdCheckFile: PATH %s\n", storeDiskdDirFullPath(sd, filen, NULL)); - return -1; + return -1; } if (swap_file_sz != sb.st_size) { - debug(20, 1) ("storeDiskdCheckFile: SIZE MISMATCH\n"); - debug(20, 1) ("storeDiskdCheckFile: FILENO %08X\n", filen); - debug(20, 1) ("storeDiskdCheckFile: PATH %s\n", storeDiskdDirFullPath(sd, filen, NULL)); - debug(20, 1) ("storeDiskdCheckFile: ENTRY SIZE: %d, FILE SIZE: %d\n", swap_file_sz, (int) sb.st_size); - return -2; - } + debug(20, 1) ("storeDiskdCheckFile: SIZE MISMATCH\n"); + debug(20, 1) ("storeDiskdCheckFile: FILENO %08X\n", filen); + debug(20, 1) ("storeDiskdCheckFile: PATH %s\n", storeDiskdDirFullPath(sd, filen, NULL)); + debug(20, 1) ("storeDiskdCheckFile: ENTRY SIZE: %d, FILE SIZE: %d\n", swap_file_sz, (int) sb.st_size); + return -2; + } return 0; } diff --git a/src/fs/ufs/store_dir_ufs.cc b/src/fs/ufs/store_dir_ufs.cc index 52964ab07e..945ff7e13d 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.14 2000/11/10 09:04:53 adrian Exp $ + * $Id: store_dir_ufs.cc,v 1.15 2000/11/30 20:07:33 wessels Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -117,7 +117,7 @@ static EVH storeUfsDirCleanEvent; static int storeUfsDirIs(SwapDir * sd); static int storeUfsFilenoBelongsHere(int fn, int F0, int F1, int F2); static int storeUfsCleanupDoubleCheck(SwapDir *, StoreEntry *); -static int storeUfsCheckFile(SwapDir * sd, sfileno filn, size_t swap_file_sz ); +static int storeUfsCheckFile(SwapDir * sd, sfileno filn, size_t swap_file_sz); static void storeUfsDirStats(SwapDir *, StoreEntry *); static void storeUfsDirInitBitmap(SwapDir *); static int storeUfsDirValidFileno(SwapDir *, sfileno, int); @@ -476,7 +476,7 @@ storeUfsDirRebuildFromDirectory(void *data) debug(20, 1) ("storeUfsDirRebuildFromDirectory: SIZE MISMATCH %d!=%d\n", tmpe.swap_file_sz, (int) sb.st_size); storeUfsDirUnlinkFile(SD, sfileno); - rb->counts.filesizemismatchcount++; + rb->counts.filesizemismatchcount++; continue; } if (EBIT_TEST(tmpe.flags, KEY_PRIVATE)) { @@ -610,21 +610,21 @@ storeUfsDirRebuildFromSwapLog(void *data) * appear to have a newer entry? Compare 'lastref' from the * swap log to e->lastref. */ disk_entry_newer = e ? (s.lastref > e->lastref ? 1 : 0) : 0; - if (!used && (rb->flags.need_to_validate || - (opt_store_doublecheck != DBLCHECK_NONE))){ - file_bad = storeUfsCheckFile(SD, s.swap_filen, s.swap_file_sz); - } else - file_bad = 0; - if (file_bad){ - if (file_bad==-2){ - if (opt_store_doublecheck == DBLCHECK_FORCE) - storeUfsDirUnlinkFile(SD, s.swap_filen); - rb->counts.filesizemismatchcount++; - continue; - } - rb->counts.missingcount++; - continue; - }else if (used && !disk_entry_newer) { + if (!used && (rb->flags.need_to_validate || + (opt_store_doublecheck != DBLCHECK_NONE))) { + file_bad = storeUfsCheckFile(SD, s.swap_filen, s.swap_file_sz); + } else + file_bad = 0; + if (file_bad) { + if (file_bad == -2) { + if (opt_store_doublecheck == DBLCHECK_FORCE) + storeUfsDirUnlinkFile(SD, s.swap_filen); + rb->counts.filesizemismatchcount++; + continue; + } + rb->counts.missingcount++; + continue; + } else if (used && !disk_entry_newer) { /* log entry is old, ignore it */ rb->counts.clashcount++; continue; @@ -687,19 +687,19 @@ storeUfsDirRebuildFromSwapLog(void *data) /* load new */ (void) 0; } - /* update store_swap_size */ - rb->counts.objcount++; - e = storeUfsDirAddDiskRestore(SD, s.key, - s.swap_filen, - s.swap_file_sz, - s.expires, - s.timestamp, - s.lastref, - s.lastmod, - s.refcount, - s.flags, - (int) rb->flags.clean); - storeDirSwapLog(e, SWAP_LOG_ADD); + /* update store_swap_size */ + rb->counts.objcount++; + e = storeUfsDirAddDiskRestore(SD, s.key, + s.swap_filen, + s.swap_file_sz, + s.expires, + s.timestamp, + s.lastref, + s.lastmod, + s.refcount, + s.flags, + (int) rb->flags.clean); + storeDirSwapLog(e, SWAP_LOG_ADD); } eventAdd("storeRebuild", storeUfsDirRebuildFromSwapLog, rb, 0.0, 1); } @@ -1591,8 +1591,9 @@ storeUfsDirFullPath(SwapDir * SD, sfileno filn, char *fullpath) static int storeUfsCleanupDoubleCheck(SwapDir * sd, StoreEntry * e) { - int rv= storeUfsCheckFile(sd, e->swap_filen, e->swap_file_sz); - if (rv) storeEntryDump(e, 0); + int rv = storeUfsCheckFile(sd, e->swap_filen, e->swap_file_sz); + if (rv) + storeEntryDump(e, 0); return rv; } @@ -1602,23 +1603,23 @@ storeUfsCleanupDoubleCheck(SwapDir * sd, StoreEntry * e) * This is called by storerebuildFromSwapLog if -S was given on the command line. or a Dirty state is found */ static int -storeUfsCheckFile(SwapDir * sd, sfileno filen, size_t swap_file_sz ) +storeUfsCheckFile(SwapDir * sd, sfileno filen, size_t swap_file_sz) { struct stat sb; if (stat(storeUfsDirFullPath(sd, filen, NULL), &sb) < 0) { - debug(20, 1) ("storeUfsCheckFile: MISSING SWAP FILE\n"); - debug(20, 1) ("storeUfsCheckFile: FILENO %08X\n", filen); - debug(20, 1) ("storeUfsCheckFile: PATH %s\n", storeUfsDirFullPath(sd, filen, NULL)); + debug(20, 1) ("storeUfsCheckFile: MISSING SWAP FILE\n"); + debug(20, 1) ("storeUfsCheckFile: FILENO %08X\n", filen); + debug(20, 1) ("storeUfsCheckFile: PATH %s\n", storeUfsDirFullPath(sd, filen, NULL)); - return -1; + return -1; } if (swap_file_sz != sb.st_size) { - debug(20, 1) ("storeUfsCheckFile: SIZE MISMATCH\n"); - debug(20, 1) ("storeUfsCheckFile: FILENO %08X\n", filen); - debug(20, 1) ("storeUfsCheckFile: PATH %s\n", storeUfsDirFullPath(sd, filen, NULL)); - debug(20, 1) ("storeUfsCheckFile: ENTRY SIZE: %d, FILE SIZE: %d\n", swap_file_sz, (int) sb.st_size); - return -2; + debug(20, 1) ("storeUfsCheckFile: SIZE MISMATCH\n"); + debug(20, 1) ("storeUfsCheckFile: FILENO %08X\n", filen); + debug(20, 1) ("storeUfsCheckFile: PATH %s\n", storeUfsDirFullPath(sd, filen, NULL)); + debug(20, 1) ("storeUfsCheckFile: ENTRY SIZE: %d, FILE SIZE: %d\n", swap_file_sz, (int) sb.st_size); + return -2; } return 0; }