--------------------- PatchSet 380 Date: 2002/12/14 11:23:48 Author: rbcollins Branch: unify-io Tag: (none) Log: log write -> method Members: src/SwapDir.cc:1.1.2.21->1.1.2.22 src/SwapDir.h:1.1.2.29->1.1.2.30 src/store_dir.cc:1.4.10.12->1.4.10.13 src/ufscommon.cc:1.4.10.31->1.4.10.32 src/ufscommon.h:1.1.20.53->1.1.20.54 src/fs/aufs/store_dir_aufs.cc:1.2.12.29->1.2.12.30 src/fs/coss/store_coss.h:1.3.10.25->1.3.10.26 src/fs/coss/store_dir_coss.cc:1.4.10.26->1.4.10.27 src/fs/diskd/store_dir_diskd.cc:1.2.16.37->1.2.16.38 src/fs/ufs/store_dir_ufs.cc:1.1.20.32->1.1.20.33 Index: squid3/src/SwapDir.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/SwapDir.cc,v retrieving revision 1.1.2.21 retrieving revision 1.1.2.22 diff -u -r1.1.2.21 -r1.1.2.22 --- squid3/src/SwapDir.cc 14 Dec 2002 04:39:40 -0000 1.1.2.21 +++ squid3/src/SwapDir.cc 14 Dec 2002 11:23:48 -0000 1.1.2.22 @@ -1,6 +1,6 @@ /* - * $Id: SwapDir.cc,v 1.1.2.21 2002/12/14 04:39:40 rbcollins Exp $ + * $Id: SwapDir.cc,v 1.1.2.22 2002/12/14 11:23:48 rbcollins Exp $ * * DEBUG: section ?? Swap Dir base object * AUTHOR: Robert Collins @@ -115,3 +115,6 @@ { return 0; } + +void +SwapDir::logEntry(const StoreEntry & e, int op) const{} Index: squid3/src/SwapDir.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/SwapDir.h,v retrieving revision 1.1.2.29 retrieving revision 1.1.2.30 diff -u -r1.1.2.29 -r1.1.2.30 --- squid3/src/SwapDir.h 14 Dec 2002 04:39:40 -0000 1.1.2.29 +++ squid3/src/SwapDir.h 14 Dec 2002 11:23:48 -0000 1.1.2.30 @@ -1,6 +1,6 @@ /* - * $Id: SwapDir.h,v 1.1.2.29 2002/12/14 04:39:40 rbcollins Exp $ + * $Id: SwapDir.h,v 1.1.2.30 2002/12/14 11:23:48 rbcollins Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -35,7 +35,6 @@ #define SQUID_SWAPDIR_H #include "StoreIOState.h" -typedef void STLOGWRITE(const SwapDir *, const StoreEntry *, int); typedef const StoreEntry *STLOGCLEANNEXTENTRY(SwapDir *); typedef void STLOGCLEANWRITE(SwapDir *, const StoreEntry *); typedef void STLOGCLEANDONE(SwapDir *); @@ -80,8 +79,8 @@ bool canLog(StoreEntry const &e)const; virtual void openLog(); virtual void closeLog(); + virtual void logEntry(const StoreEntry & e, int op) const; struct { - STLOGWRITE *write; struct { STLOGCLEANNEXTENTRY *nextentry; STLOGCLEANWRITE *write; Index: squid3/src/store_dir.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/store_dir.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/store_dir.cc 14 Dec 2002 04:39:40 -0000 1.4.10.12 +++ squid3/src/store_dir.cc 14 Dec 2002 11:23:48 -0000 1.4.10.13 @@ -1,6 +1,6 @@ /* - * $Id: store_dir.cc,v 1.4.10.12 2002/12/14 04:39:40 rbcollins Exp $ + * $Id: store_dir.cc,v 1.4.10.13 2002/12/14 11:23:48 rbcollins Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -262,7 +262,7 @@ e->swap_dirn, e->swap_filen); sd = INDEXSD(e->swap_dirn); - sd->log.write(sd, e, op); + sd->logEntry(*e, op); } void Index: squid3/src/ufscommon.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Attic/ufscommon.cc,v retrieving revision 1.4.10.31 retrieving revision 1.4.10.32 diff -u -r1.4.10.31 -r1.4.10.32 --- squid3/src/ufscommon.cc 14 Dec 2002 10:48:16 -0000 1.4.10.31 +++ squid3/src/ufscommon.cc 14 Dec 2002 11:23:48 -0000 1.4.10.32 @@ -1,5 +1,5 @@ /* - * $Id: ufscommon.cc,v 1.4.10.31 2002/12/14 10:48:16 rbcollins Exp $ + * $Id: ufscommon.cc,v 1.4.10.32 2002/12/14 11:23:48 rbcollins Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -1063,20 +1063,20 @@ } void -commonUfsDirSwapLog(const SwapDir * sd, const StoreEntry * e, int op) +UFSSwapDir::logEntry(const StoreEntry & e, int op) const { - squidufsinfo_t *ioinfo = (squidufsinfo_t *) sd->fsdata; + squidufsinfo_t *ioinfo = (squidufsinfo_t *) fsdata; storeSwapLogData *s = (storeSwapLogData *)memAllocate(MEM_SWAP_LOG_DATA); s->op = (char) op; - s->swap_filen = e->swap_filen; - s->timestamp = e->timestamp; - s->lastref = e->lastref; - s->expires = e->expires; - s->lastmod = e->lastmod; - s->swap_file_sz = e->swap_file_sz; - s->refcount = e->refcount; - s->flags = e->flags; - xmemcpy(s->key, e->key, MD5_DIGEST_CHARS); + s->swap_filen = e.swap_filen; + s->timestamp = e.timestamp; + s->lastref = e.lastref; + s->expires = e.expires; + s->lastmod = e.lastmod; + s->swap_file_sz = e.swap_file_sz; + s->refcount = e.refcount; + s->flags = e.flags; + xmemcpy(s->key, e.key, MD5_DIGEST_CHARS); file_write(ioinfo->swaplog_fd, -1, s, Index: squid3/src/ufscommon.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Attic/ufscommon.h,v retrieving revision 1.1.20.53 retrieving revision 1.1.20.54 diff -u -r1.1.20.53 -r1.1.20.54 --- squid3/src/ufscommon.h 14 Dec 2002 09:40:24 -0000 1.1.20.53 +++ squid3/src/ufscommon.h 14 Dec 2002 11:23:48 -0000 1.1.20.54 @@ -1,6 +1,6 @@ /* - * $Id: ufscommon.h,v 1.1.20.53 2002/12/14 09:40:24 rbcollins Exp $ + * $Id: ufscommon.h,v 1.1.20.54 2002/12/14 11:23:48 rbcollins Exp $ * * SQUID Web Proxy Cache http://www.squid-cache.org/ * ---------------------------------------------------------- @@ -93,6 +93,7 @@ virtual void openLog(); virtual void closeLog(); virtual int writeCleanStart(); + virtual void logEntry(const StoreEntry & e, int op) const; void unlinkFile(sfileno f); // move down when unlink is a virtual method 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.29 retrieving revision 1.2.12.30 diff -u -r1.2.12.29 -r1.2.12.30 --- squid3/src/fs/aufs/store_dir_aufs.cc 14 Dec 2002 04:39:40 -0000 1.2.12.29 +++ squid3/src/fs/aufs/store_dir_aufs.cc 14 Dec 2002 11:23:48 -0000 1.2.12.30 @@ -1,6 +1,6 @@ /* - * $Id: store_dir_aufs.cc,v 1.2.12.29 2002/12/14 04:39:40 rbcollins Exp $ + * $Id: store_dir_aufs.cc,v 1.2.12.30 2002/12/14 11:23:48 rbcollins Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -188,7 +188,6 @@ aioinfo->map = NULL; /* Debugging purposes */ aioinfo->suggest = 0; aioinfo->io.storeDirUnlinkFile = storeAufsDirIOUnlinkFile; - sd->log.write = commonUfsDirSwapLog; sd->log.clean.nextentry = commonUfsDirCleanLogNextEntry; sd->log.clean.done = commonUfsDirWriteCleanDone; Index: squid3/src/fs/coss/store_coss.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/fs/coss/store_coss.h,v retrieving revision 1.3.10.25 retrieving revision 1.3.10.26 diff -u -r1.3.10.25 -r1.3.10.26 --- squid3/src/fs/coss/store_coss.h 14 Dec 2002 04:39:40 -0000 1.3.10.25 +++ squid3/src/fs/coss/store_coss.h 14 Dec 2002 11:23:48 -0000 1.3.10.26 @@ -113,6 +113,7 @@ virtual void openLog(); virtual void closeLog(); virtual int writeCleanStart(); + virtual void logEntry(const StoreEntry & e, int op) const; }; extern off_t storeCossAllocate(SwapDir * SD, const StoreEntry * e, int which); 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.26 retrieving revision 1.4.10.27 diff -u -r1.4.10.26 -r1.4.10.27 --- squid3/src/fs/coss/store_dir_coss.cc 14 Dec 2002 04:39:40 -0000 1.4.10.26 +++ squid3/src/fs/coss/store_dir_coss.cc 14 Dec 2002 11:23:48 -0000 1.4.10.27 @@ -1,6 +1,6 @@ /* - * $Id: store_dir_coss.cc,v 1.4.10.26 2002/12/14 04:39:40 rbcollins Exp $ + * $Id: store_dir_coss.cc,v 1.4.10.27 2002/12/14 11:23:48 rbcollins Exp $ * * DEBUG: section 47 Store COSS Directory Routines * AUTHOR: Eric Stern @@ -78,7 +78,6 @@ static STLOGCLEANNEXTENTRY storeCossDirCleanLogNextEntry; static STLOGCLEANWRITE storeCossDirWriteCleanEntry; static STLOGCLEANDONE storeCossDirWriteCleanDone; -static STLOGWRITE storeCossDirSwapLog; static STFSPARSE storeCossDirParse; static STFSRECONFIGURE storeCossDirReconfigure; @@ -618,21 +617,21 @@ memFree(s, MEM_SWAP_LOG_DATA); } -static void -storeCossDirSwapLog(const SwapDir * sd, const StoreEntry * e, int op) +void +CossSwapDir::logEntry(const StoreEntry & e, int op) const { - CossInfo *cs = (CossInfo *) sd->fsdata; + CossInfo *cs = (CossInfo *) fsdata; storeSwapLogData *s = (storeSwapLogData *)memAllocate(MEM_SWAP_LOG_DATA); s->op = (char) op; - s->swap_filen = e->swap_filen; - s->timestamp = e->timestamp; - s->lastref = e->lastref; - s->expires = e->expires; - s->lastmod = e->lastmod; - s->swap_file_sz = e->swap_file_sz; - s->refcount = e->refcount; - s->flags = e->flags; - xmemcpy(s->key, e->key, MD5_DIGEST_CHARS); + s->swap_filen = e.swap_filen; + s->timestamp = e.timestamp; + s->lastref = e.lastref; + s->expires = e.expires; + s->lastmod = e.lastmod; + s->swap_file_sz = e.swap_file_sz; + s->refcount = e.refcount; + s->flags = e.flags; + xmemcpy(s->key, e.key, MD5_DIGEST_CHARS); file_write(cs->swaplog_fd, -1, s, @@ -750,7 +749,6 @@ cs->fd = -1; cs->swaplog_fd = -1; - sd->log.write = storeCossDirSwapLog; sd->log.clean.write = storeCossDirWriteCleanEntry; sd->log.clean.nextentry = storeCossDirCleanLogNextEntry; sd->log.clean.done = storeCossDirWriteCleanDone; 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.37 retrieving revision 1.2.16.38 diff -u -r1.2.16.37 -r1.2.16.38 --- squid3/src/fs/diskd/store_dir_diskd.cc 14 Dec 2002 04:39:40 -0000 1.2.16.37 +++ squid3/src/fs/diskd/store_dir_diskd.cc 14 Dec 2002 11:23:48 -0000 1.2.16.38 @@ -1,6 +1,6 @@ /* - * $Id: store_dir_diskd.cc,v 1.2.16.37 2002/12/14 04:39:40 rbcollins Exp $ + * $Id: store_dir_diskd.cc,v 1.2.16.38 2002/12/14 11:23:48 rbcollins Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -393,7 +393,6 @@ ufsinfo->map = NULL; /* Debugging purposes */ ufsinfo->suggest = 0; ufsinfo->io.storeDirUnlinkFile = storeDiskdDirIOUnlinkFile; - sd->log.write = commonUfsDirSwapLog; sd->log.clean.nextentry = commonUfsDirCleanLogNextEntry; sd->log.clean.done = commonUfsDirWriteCleanDone; 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.32 retrieving revision 1.1.20.33 diff -u -r1.1.20.32 -r1.1.20.33 --- squid3/src/fs/ufs/store_dir_ufs.cc 14 Dec 2002 04:39:40 -0000 1.1.20.32 +++ squid3/src/fs/ufs/store_dir_ufs.cc 14 Dec 2002 11:23:48 -0000 1.1.20.33 @@ -1,6 +1,6 @@ /* - * $Id: store_dir_ufs.cc,v 1.1.20.32 2002/12/14 04:39:40 rbcollins Exp $ + * $Id: store_dir_ufs.cc,v 1.1.20.33 2002/12/14 11:23:48 rbcollins Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -169,7 +169,6 @@ ufsinfo->map = NULL; /* Debugging purposes */ ufsinfo->suggest = 0; ufsinfo->io.storeDirUnlinkFile = storeUfsDirIOUnlinkFile; - sd->log.write = commonUfsDirSwapLog; sd->log.clean.nextentry = commonUfsDirCleanLogNextEntry; sd->log.clean.done = commonUfsDirWriteCleanDone;