--------------------- PatchSet 374 Date: 2002/12/14 05:07:15 Author: rbcollins Branch: unify-io Tag: (none) Log: and more Members: src/ufscommon.cc:1.4.10.25->1.4.10.26 src/ufscommon.h:1.1.20.50->1.1.20.51 src/fs/aufs/store_io_aufs.cc:1.3.12.38->1.3.12.39 src/fs/diskd/store_io_diskd.cc:1.1.20.42->1.1.20.43 src/fs/ufs/store_io_ufs.cc:1.3.10.45->1.3.10.46 Index: squid3/src/ufscommon.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Attic/ufscommon.cc,v retrieving revision 1.4.10.25 retrieving revision 1.4.10.26 diff -u -r1.4.10.25 -r1.4.10.26 --- squid3/src/ufscommon.cc 14 Dec 2002 04:55:40 -0000 1.4.10.25 +++ squid3/src/ufscommon.cc 14 Dec 2002 05:07:15 -0000 1.4.10.26 @@ -1,5 +1,5 @@ /* - * $Id: ufscommon.cc,v 1.4.10.25 2002/12/14 04:55:40 rbcollins Exp $ + * $Id: ufscommon.cc,v 1.4.10.26 2002/12/14 05:07:15 rbcollins Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -66,23 +66,11 @@ static EVH commonUfsDirRebuildFromDirectory; static EVH commonUfsDirRebuildFromSwapLog; static int commonUfsDirGetNextFile(RebuildState *, sfileno *, int *size); -static StoreEntry *commonUfsDirAddDiskRestore(SwapDir * SD, const cache_key * key, - sfileno file_number, - size_t swap_file_sz, - time_t expires, - time_t timestamp, - time_t lastref, - time_t lastmod, - u_int32_t refcount, - u_int16_t flags, - int clean); static STLOGCLEANWRITE commonUfsDirWriteCleanEntry; static QS rev_int_sort; -static void commonUfsDirMapBitSet(SwapDir * SD, sfileno filn); static int commonUfsDirClean(int swap_index); static int commonUfsDirIs(SwapDir * sd); static int commonUfsDirValidFileno(SwapDir * SD, sfileno filn, int flag); -void commonUfsDirMapBitReset(SwapDir * SD, sfileno filn); int UFSSwapDir::mapBitTest(sfileno filn) @@ -93,18 +81,18 @@ } void -commonUfsDirMapBitSet(SwapDir * SD, sfileno filn) +UFSSwapDir::mapBitSet(sfileno filn) { squidufsinfo_t *ioinfo; - ioinfo = (squidufsinfo_t *) SD->fsdata; + ioinfo = (squidufsinfo_t *) fsdata; file_map_bit_set(ioinfo->map, filn); } void -commonUfsDirMapBitReset(SwapDir * SD, sfileno filn) +UFSSwapDir::mapBitReset(sfileno filn) { squidufsinfo_t *ioinfo; - ioinfo = (squidufsinfo_t *) SD->fsdata; + ioinfo = (squidufsinfo_t *) fsdata; /* * We have to test the bit before calling file_map_bit_reset. * file_map_bit_reset doesn't do bounds checking. It assumes @@ -312,7 +300,8 @@ commonUfsDirRebuildFromDirectory(void *data) { RebuildState *rb = (RebuildState *)data; - SwapDir *SD = rb->sd; + UFSSwapDir *SD = dynamic_cast(rb->sd); + assert (SD); LOCAL_ARRAY(char, hdr_buf, SM_PAGE_SIZE); StoreEntry *e = NULL; StoreEntry tmpe; @@ -434,7 +423,7 @@ } rb->counts.objcount++; storeEntryDump(&tmpe, 5); - e = commonUfsDirAddDiskRestore(SD, key, + e = SD->addDiskRestore(key, filn, tmpe.swap_file_sz, tmpe.expires, @@ -508,7 +497,7 @@ storeReleaseRequest(e); if (e->swap_filen > -1) { commonUfsDirReplRemove(e); - commonUfsDirMapBitReset(SD, e->swap_filen); + SD->mapBitReset(e->swap_filen); e->swap_filen = -1; e->swap_dirn = -1; } @@ -597,7 +586,7 @@ if (e->swap_filen > -1) { commonUfsDirReplRemove(e); /* Make sure we don't actually unlink the file */ - commonUfsDirMapBitReset(SD, e->swap_filen); + SD->mapBitReset(e->swap_filen); e->swap_filen = -1; e->swap_dirn = -1; } @@ -610,7 +599,7 @@ } /* update store_swap_size */ rb->counts.objcount++; - e = commonUfsDirAddDiskRestore(SD, s.key, + e = SD->addDiskRestore(s.key, s.swap_filen, s.swap_file_sz, s.expires, @@ -715,7 +704,7 @@ /* Add a new object to the cache with empty memory copy and pointer to disk * use to rebuild store from disk. */ StoreEntry * -commonUfsDirAddDiskRestore(SwapDir * SD, const cache_key * key, +UFSSwapDir::addDiskRestore(const cache_key * key, sfileno file_number, size_t swap_file_sz, time_t expires, @@ -735,7 +724,7 @@ storeSetMemStatus(e, NOT_IN_MEMORY); e->swap_status = SWAPOUT_DONE; e->swap_filen = file_number; - e->swap_dirn = SD->index; + e->swap_dirn = index; e->swap_file_sz = swap_file_sz; e->lock_count = 0; e->lastref = lastref; @@ -749,9 +738,9 @@ EBIT_CLR(e->flags, KEY_PRIVATE); e->ping_status = PING_NONE; EBIT_CLR(e->flags, ENTRY_VALIDATED); - commonUfsDirMapBitSet(SD, e->swap_filen); + mapBitSet(e->swap_filen); storeHashInsert(e, key); /* do it after we clear KEY_PRIVATE */ - commonUfsDirReplAdd(SD, e); + commonUfsDirReplAdd(this, e); return e; } Index: squid3/src/ufscommon.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Attic/ufscommon.h,v retrieving revision 1.1.20.50 retrieving revision 1.1.20.51 diff -u -r1.1.20.50 -r1.1.20.51 --- squid3/src/ufscommon.h 14 Dec 2002 04:55:40 -0000 1.1.20.50 +++ squid3/src/ufscommon.h 14 Dec 2002 05:07:15 -0000 1.1.20.51 @@ -1,6 +1,6 @@ /* - * $Id: ufscommon.h,v 1.1.20.50 2002/12/14 04:55:40 rbcollins Exp $ + * $Id: ufscommon.h,v 1.1.20.51 2002/12/14 05:07:15 rbcollins Exp $ * * SQUID Web Proxy Cache http://www.squid-cache.org/ * ---------------------------------------------------------- @@ -104,6 +104,18 @@ FILE *openTmpSwapLog(int *clean_flag, int *zero_flag); char *swapSubDir(int subdirn) const; int mapBitTest(sfileno filn); + void mapBitReset(sfileno filn); + void mapBitSet(sfileno filn); + StoreEntry *addDiskRestore(const cache_key * key, + sfileno file_number, + size_t swap_file_sz, + time_t expires, + time_t timestamp, + time_t lastref, + time_t lastmod, + u_int32_t refcount, + u_int16_t flags, + int clean); private: static EVH CleanEvent; void initBitmap(); Index: squid3/src/fs/aufs/store_io_aufs.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/fs/aufs/Attic/store_io_aufs.cc,v retrieving revision 1.3.12.38 retrieving revision 1.3.12.39 diff -u -r1.3.12.38 -r1.3.12.39 --- squid3/src/fs/aufs/store_io_aufs.cc 14 Dec 2002 00:02:04 -0000 1.3.12.38 +++ squid3/src/fs/aufs/store_io_aufs.cc 14 Dec 2002 05:07:15 -0000 1.3.12.39 @@ -280,7 +280,7 @@ { debug(79, 3) ("storeAufsUnlink: dirno %d, fileno %08X\n", index, e.swap_filen); commonUfsDirReplRemove(&e); - commonUfsDirMapBitReset(this, e.swap_filen); + mapBitReset(e.swap_filen); unlinkFile(e.swap_filen); } Index: squid3/src/fs/diskd/store_io_diskd.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/fs/diskd/Attic/store_io_diskd.cc,v retrieving revision 1.1.20.42 retrieving revision 1.1.20.43 diff -u -r1.1.20.42 -r1.1.20.43 --- squid3/src/fs/diskd/store_io_diskd.cc 13 Dec 2002 20:44:00 -0000 1.1.20.42 +++ squid3/src/fs/diskd/store_io_diskd.cc 14 Dec 2002 05:07:16 -0000 1.1.20.43 @@ -1,6 +1,6 @@ /* - * $Id: store_io_diskd.cc,v 1.1.20.42 2002/12/13 20:44:00 rbcollins Exp $ + * $Id: store_io_diskd.cc,v 1.1.20.43 2002/12/14 05:07:16 rbcollins Exp $ * * DEBUG: section 79 Squid-side DISKD I/O functions. * AUTHOR: Duane Wessels @@ -519,7 +519,7 @@ debug(79, 3) ("storeDiskdUnlink: dirno %d, fileno %08X\n", index, e.swap_filen); commonUfsDirReplRemove(&e); - commonUfsDirMapBitReset(this, e.swap_filen); + mapBitReset(e.swap_filen); if (IO->shedLoad()) { /* Damn, we need to issue a sync unlink here :( */ debug(79, 2) ("storeDiskUnlink: Out of queue space, sync unlink\n"); Index: squid3/src/fs/ufs/store_io_ufs.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/fs/ufs/store_io_ufs.cc,v retrieving revision 1.3.10.45 retrieving revision 1.3.10.46 diff -u -r1.3.10.45 -r1.3.10.46 --- squid3/src/fs/ufs/store_io_ufs.cc 14 Dec 2002 00:54:29 -0000 1.3.10.45 +++ squid3/src/fs/ufs/store_io_ufs.cc 14 Dec 2002 05:07:17 -0000 1.3.10.46 @@ -1,6 +1,6 @@ /* - * $Id: store_io_ufs.cc,v 1.3.10.45 2002/12/14 00:54:29 rbcollins Exp $ + * $Id: store_io_ufs.cc,v 1.3.10.46 2002/12/14 05:07:17 rbcollins Exp $ * * DEBUG: section 79 Storage Manager UFS Interface * AUTHOR: Duane Wessels @@ -294,7 +294,7 @@ { debug(79, 3) ("storeUfsUnlink: fileno %08X\n", e.swap_filen); commonUfsDirReplRemove(&e); - commonUfsDirMapBitReset(this, e.swap_filen); + mapBitReset(e.swap_filen); unlinkFile(e.swap_filen); } @@ -546,7 +546,7 @@ debug(79, 3) ("UFSStrategy::create: fileno %08X\n", filn); if (shedLoad()) { openFailed(); - commonUfsDirMapBitReset (SD, filn); + ((UFSSwapDir *)SD)->mapBitReset (filn); return NULL; } @@ -567,7 +567,7 @@ state->creating = true; myFile->create (state->mode, 0644, state); if (myFile->error()) { - commonUfsDirMapBitReset (SD, filn); + ((UFSSwapDir *)SD)->mapBitReset (filn); return NULL; }