--------------------- PatchSet 375 Date: 2002/12/14 05:19:59 Author: rbcollins Branch: unify-io Tag: (none) Log: and more Members: src/ufscommon.cc:1.4.10.26->1.4.10.27 src/ufscommon.h:1.1.20.51->1.1.20.52 Index: squid3/src/ufscommon.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Attic/ufscommon.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/ufscommon.cc 14 Dec 2002 05:07:15 -0000 1.4.10.26 +++ squid3/src/ufscommon.cc 14 Dec 2002 05:19:59 -0000 1.4.10.27 @@ -1,5 +1,5 @@ /* - * $Id: ufscommon.cc,v 1.4.10.26 2002/12/14 05:07:15 rbcollins Exp $ + * $Id: ufscommon.cc,v 1.4.10.27 2002/12/14 05:19:59 rbcollins Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -69,7 +69,6 @@ static STLOGCLEANWRITE commonUfsDirWriteCleanEntry; static QS rev_int_sort; static int commonUfsDirClean(int swap_index); -static int commonUfsDirIs(SwapDir * sd); static int commonUfsDirValidFileno(SwapDir * SD, sfileno filn, int flag); int @@ -1160,7 +1159,7 @@ dir_index = (int *)xcalloc(n_dirs, sizeof(*dir_index)); for (i = 0, n = 0; i < Config.cacheSwap.n_configured; i++) { sd = INDEXSD(i); - if (!commonUfsDirIs(sd)) + if (!UFSSwapDir::IsUFSDir(sd)) continue; dir_index[n++] = i; ioinfo = (squidufsinfo_t *) sd->fsdata; @@ -1183,15 +1182,10 @@ } int -commonUfsDirIs(SwapDir * sd) +UFSSwapDir::IsUFSDir(SwapDir * sd) { - if (strncmp(sd->type, "aufs", 4) == 0) - return 1; - if (strncmp(sd->type, "diskd", 5) == 0) - return 1; - if (strncmp(sd->type, "ufs", 3) == 0) - return 1; - return 0; + UFSSwapDir *mySD = dynamic_cast(sd); + return mySD ? 1 : 0 ; } /* Index: squid3/src/ufscommon.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Attic/ufscommon.h,v retrieving revision 1.1.20.51 retrieving revision 1.1.20.52 diff -u -r1.1.20.51 -r1.1.20.52 --- squid3/src/ufscommon.h 14 Dec 2002 05:07:15 -0000 1.1.20.51 +++ squid3/src/ufscommon.h 14 Dec 2002 05:19:59 -0000 1.1.20.52 @@ -1,6 +1,6 @@ /* - * $Id: ufscommon.h,v 1.1.20.51 2002/12/14 05:07:15 rbcollins Exp $ + * $Id: ufscommon.h,v 1.1.20.52 2002/12/14 05:19:59 rbcollins Exp $ * * SQUID Web Proxy Cache http://www.squid-cache.org/ * ---------------------------------------------------------- @@ -69,13 +69,14 @@ void commonUfsDirFree(SwapDir * s); int commonUfsCleanupDoubleCheck(SwapDir * sd, StoreEntry * e); int commonUfsDirMapBitAllocate(SwapDir * SD); -void commonUfsDirMapBitReset(SwapDir * SD, sfileno filn); #include "SwapDir.h" class UFSStrategy; class UFSSwapDir : public SwapDir { public: + static int IsUFSDir(SwapDir* sd); + UFSSwapDir(); virtual void init(); virtual void newFileSystem();