--------------------- PatchSet 348 Date: 2002/12/13 11:35:58 Author: rbcollins Branch: unify-io Tag: (none) Log: make doublechecking a method Members: src/SwapDir.cc:1.1.2.7->1.1.2.8 src/SwapDir.h:1.1.2.11->1.1.2.12 src/store_rebuild.cc:1.1.20.2->1.1.20.3 src/ufscommon.cc:1.4.10.12->1.4.10.13 src/ufscommon.h:1.1.20.34->1.1.20.35 src/fs/aufs/store_dir_aufs.cc:1.2.12.13->1.2.12.14 src/fs/coss/store_dir_coss.cc:1.4.10.10->1.4.10.11 src/fs/diskd/store_dir_diskd.cc:1.2.16.20->1.2.16.21 src/fs/ufs/store_dir_ufs.cc:1.1.20.13->1.1.20.14 Index: squid3/src/SwapDir.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/SwapDir.cc,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -u -r1.1.2.7 -r1.1.2.8 --- squid3/src/SwapDir.cc 13 Dec 2002 11:17:46 -0000 1.1.2.7 +++ squid3/src/SwapDir.cc 13 Dec 2002 11:35:58 -0000 1.1.2.8 @@ -1,6 +1,6 @@ /* - * $Id: SwapDir.cc,v 1.1.2.7 2002/12/13 11:17:46 rbcollins Exp $ + * $Id: SwapDir.cc,v 1.1.2.8 2002/12/13 11:35:58 rbcollins Exp $ * * DEBUG: section ?? Swap Dir base object * AUTHOR: Robert Collins @@ -56,3 +56,9 @@ void SwapDir::dump(StoreEntry &)const{} + +bool +SwapDir::doubleCheck(StoreEntry &) +{ + return false; +} Index: squid3/src/SwapDir.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/SwapDir.h,v retrieving revision 1.1.2.11 retrieving revision 1.1.2.12 diff -u -r1.1.2.11 -r1.1.2.12 --- squid3/src/SwapDir.h 13 Dec 2002 11:17:46 -0000 1.1.2.11 +++ squid3/src/SwapDir.h 13 Dec 2002 11:35:58 -0000 1.1.2.12 @@ -1,6 +1,6 @@ /* - * $Id: SwapDir.h,v 1.1.2.11 2002/12/13 11:17:46 rbcollins Exp $ + * $Id: SwapDir.h,v 1.1.2.12 2002/12/13 11:35:58 rbcollins Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -34,7 +34,6 @@ #ifndef SQUID_SWAPDIR_H #define SQUID_SWAPDIR_H -typedef int STDBLCHECK(SwapDir *, StoreEntry *); typedef void STSTATFS(SwapDir *, StoreEntry *); typedef void STMAINTAINFS(SwapDir *); typedef int STCHECKOBJ(SwapDir *, const StoreEntry *); @@ -77,7 +76,7 @@ virtual void init() = 0; /* Initialise the fs */ virtual void newFileSystem(); /* Create a new fs */ virtual void dump(StoreEntry &)const; /* Dump fs config snippet */ - STDBLCHECK *dblcheck; /* Double check the obj integrity */ + virtual bool doubleCheck(StoreEntry &); /* Double check the obj integrity */ STSTATFS *statfs; /* Dump fs statistics */ STMAINTAINFS *maintainfs; /* Replacement maintainence */ STCHECKOBJ *checkobj; /* Check if the fs will store an object */ Index: squid3/src/store_rebuild.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/store_rebuild.cc,v retrieving revision 1.1.20.2 retrieving revision 1.1.20.3 diff -u -r1.1.20.2 -r1.1.20.3 --- squid3/src/store_rebuild.cc 2 Dec 2002 15:25:38 -0000 1.1.20.2 +++ squid3/src/store_rebuild.cc 13 Dec 2002 11:35:58 -0000 1.1.20.3 @@ -1,6 +1,6 @@ /* - * $Id: store_rebuild.cc,v 1.1.20.2 2002/12/02 15:25:38 rbcollins Exp $ + * $Id: store_rebuild.cc,v 1.1.20.3 2002/12/13 11:35:58 rbcollins Exp $ * * DEBUG: section 20 Store Rebuild Routines * AUTHOR: Duane Wessels @@ -54,7 +54,7 @@ storeCleanupDoubleCheck(StoreEntry * e) { SwapDir *SD = INDEXSD(e->swap_dirn); - return (SD->dblcheck(SD, e)); + return (SD->doubleCheck(*e)); } static void Index: squid3/src/ufscommon.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Attic/ufscommon.cc,v retrieving revision 1.4.10.12 retrieving revision 1.4.10.13 diff -u -r1.4.10.12 -r1.4.10.13 --- squid3/src/ufscommon.cc 13 Dec 2002 11:19:04 -0000 1.4.10.12 +++ squid3/src/ufscommon.cc 13 Dec 2002 11:35:58 -0000 1.4.10.13 @@ -1,5 +1,5 @@ /* - * $Id: ufscommon.cc,v 1.4.10.12 2002/12/13 11:19:04 rbcollins Exp $ + * $Id: ufscommon.cc,v 1.4.10.13 2002/12/13 11:35:58 rbcollins Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -1552,27 +1552,27 @@ * * This is called by storeCleanup() if -S was given on the command line. */ -int -commonUfsCleanupDoubleCheck(SwapDir * sd, StoreEntry * e) +bool +UFSSwapDir::doubleCheck(StoreEntry & e) { struct stat sb; - if (stat(commonUfsDirFullPath(sd, e->swap_filen, NULL), &sb) < 0) { + if (stat(commonUfsDirFullPath(this, e.swap_filen, NULL), &sb) < 0) { debug(47, 0) ("commonUfsCleanupDoubleCheck: MISSING SWAP FILE\n"); - debug(47, 0) ("commonUfsCleanupDoubleCheck: FILENO %08X\n", e->swap_filen); + debug(47, 0) ("commonUfsCleanupDoubleCheck: FILENO %08X\n", e.swap_filen); debug(47, 0) ("commonUfsCleanupDoubleCheck: PATH %s\n", - commonUfsDirFullPath(sd, e->swap_filen, NULL)); - storeEntryDump(e, 0); - return -1; + commonUfsDirFullPath(this, e.swap_filen, NULL)); + storeEntryDump(&e, 0); + return true; } - if ((off_t)e->swap_file_sz != sb.st_size) { + if ((off_t)e.swap_file_sz != sb.st_size) { debug(47, 0) ("commonUfsCleanupDoubleCheck: SIZE MISMATCH\n"); - debug(47, 0) ("commonUfsCleanupDoubleCheck: FILENO %08X\n", e->swap_filen); + debug(47, 0) ("commonUfsCleanupDoubleCheck: FILENO %08X\n", e.swap_filen); debug(47, 0) ("commonUfsCleanupDoubleCheck: PATH %s\n", - commonUfsDirFullPath(sd, e->swap_filen, NULL)); + commonUfsDirFullPath(this, e.swap_filen, NULL)); debug(47, 0) ("commonUfsCleanupDoubleCheck: ENTRY SIZE: %ld, FILE SIZE: %ld\n", - (long int) e->swap_file_sz, (long int) sb.st_size); - storeEntryDump(e, 0); - return -1; + (long int) e.swap_file_sz, (long int) sb.st_size); + storeEntryDump(&e, 0); + return true; } - return 0; + return false; } Index: squid3/src/ufscommon.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Attic/ufscommon.h,v retrieving revision 1.1.20.34 retrieving revision 1.1.20.35 diff -u -r1.1.20.34 -r1.1.20.35 --- squid3/src/ufscommon.h 13 Dec 2002 11:17:46 -0000 1.1.20.34 +++ squid3/src/ufscommon.h 13 Dec 2002 11:35:58 -0000 1.1.20.35 @@ -1,6 +1,6 @@ /* - * $Id: ufscommon.h,v 1.1.20.34 2002/12/13 11:17:46 rbcollins Exp $ + * $Id: ufscommon.h,v 1.1.20.35 2002/12/13 11:35:58 rbcollins Exp $ * * SQUID Web Proxy Cache http://www.squid-cache.org/ * ---------------------------------------------------------- @@ -84,6 +84,7 @@ virtual void newFileSystem(); virtual void dump(StoreEntry &) const; ~UFSSwapDir(); + virtual bool doubleCheck(StoreEntry &); private: static EVH CleanEvent; void initBitmap(); Index: squid3/src/fs/aufs/store_dir_aufs.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/fs/aufs/Attic/store_dir_aufs.cc,v retrieving revision 1.2.12.13 retrieving revision 1.2.12.14 diff -u -r1.2.12.13 -r1.2.12.14 --- squid3/src/fs/aufs/store_dir_aufs.cc 13 Dec 2002 11:17:46 -0000 1.2.12.13 +++ squid3/src/fs/aufs/store_dir_aufs.cc 13 Dec 2002 11:35:58 -0000 1.2.12.14 @@ -1,6 +1,6 @@ /* - * $Id: store_dir_aufs.cc,v 1.2.12.13 2002/12/13 11:17:46 rbcollins Exp $ + * $Id: store_dir_aufs.cc,v 1.2.12.14 2002/12/13 11:35:58 rbcollins Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -189,7 +189,6 @@ aioinfo->map = NULL; /* Debugging purposes */ aioinfo->suggest = 0; aioinfo->io.storeDirUnlinkFile = storeAufsDirIOUnlinkFile; - sd->dblcheck = commonUfsCleanupDoubleCheck; sd->statfs = commonUfsDirStats; sd->maintainfs = commonUfsDirMaintain; sd->checkobj = storeAufsDirCheckObj; Index: squid3/src/fs/coss/store_dir_coss.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/fs/coss/store_dir_coss.cc,v retrieving revision 1.4.10.10 retrieving revision 1.4.10.11 diff -u -r1.4.10.10 -r1.4.10.11 --- squid3/src/fs/coss/store_dir_coss.cc 13 Dec 2002 11:17:46 -0000 1.4.10.10 +++ squid3/src/fs/coss/store_dir_coss.cc 13 Dec 2002 11:35:59 -0000 1.4.10.11 @@ -1,6 +1,6 @@ /* - * $Id: store_dir_coss.cc,v 1.4.10.10 2002/12/13 11:17:46 rbcollins Exp $ + * $Id: store_dir_coss.cc,v 1.4.10.11 2002/12/13 11:35:59 rbcollins Exp $ * * DEBUG: section 47 Store COSS Directory Routines * AUTHOR: Eric Stern @@ -759,7 +759,6 @@ cs->fd = -1; cs->swaplog_fd = -1; - sd->dblcheck = NULL; sd->statfs = storeCossDirStats; sd->maintainfs = NULL; sd->checkobj = storeCossDirCheckObj; Index: squid3/src/fs/diskd/store_dir_diskd.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/fs/diskd/Attic/store_dir_diskd.cc,v retrieving revision 1.2.16.20 retrieving revision 1.2.16.21 diff -u -r1.2.16.20 -r1.2.16.21 --- squid3/src/fs/diskd/store_dir_diskd.cc 13 Dec 2002 11:17:46 -0000 1.2.16.20 +++ squid3/src/fs/diskd/store_dir_diskd.cc 13 Dec 2002 11:35:59 -0000 1.2.16.21 @@ -1,6 +1,6 @@ /* - * $Id: store_dir_diskd.cc,v 1.2.16.20 2002/12/13 11:17:46 rbcollins Exp $ + * $Id: store_dir_diskd.cc,v 1.2.16.21 2002/12/13 11:35:59 rbcollins Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -396,7 +396,6 @@ ufsinfo->map = NULL; /* Debugging purposes */ ufsinfo->suggest = 0; ufsinfo->io.storeDirUnlinkFile = storeDiskdDirIOUnlinkFile; - sd->dblcheck = commonUfsCleanupDoubleCheck; sd->statfs = storeDiskdDirStats; sd->maintainfs = commonUfsDirMaintain; sd->checkobj = storeDiskdDirCheckObj; Index: squid3/src/fs/ufs/store_dir_ufs.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/fs/ufs/store_dir_ufs.cc,v retrieving revision 1.1.20.13 retrieving revision 1.1.20.14 diff -u -r1.1.20.13 -r1.1.20.14 --- squid3/src/fs/ufs/store_dir_ufs.cc 13 Dec 2002 11:19:04 -0000 1.1.20.13 +++ squid3/src/fs/ufs/store_dir_ufs.cc 13 Dec 2002 11:35:59 -0000 1.1.20.14 @@ -1,6 +1,6 @@ /* - * $Id: store_dir_ufs.cc,v 1.1.20.13 2002/12/13 11:19:04 rbcollins Exp $ + * $Id: store_dir_ufs.cc,v 1.1.20.14 2002/12/13 11:35:59 rbcollins Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -170,7 +170,6 @@ ufsinfo->map = NULL; /* Debugging purposes */ ufsinfo->suggest = 0; ufsinfo->io.storeDirUnlinkFile = storeUfsDirIOUnlinkFile; - sd->dblcheck = commonUfsCleanupDoubleCheck; sd->statfs = commonUfsDirStats; sd->maintainfs = commonUfsDirMaintain; sd->checkobj = storeUfsDirCheckObj;