--------------------- PatchSet 247 Date: 2002/12/04 12:34:57 Author: rbcollins Branch: unify-io Tag: (none) Log: make refcountable automatically virtual, and move IORequestor down the hierarchy, so to prevent coss being affected Members: include/RefCount.h:1.2->1.2.12.1 src/StoreIOState.h:1.1.2.2->1.1.2.3 src/ufscommon.h:1.1.20.1->1.1.20.2 src/fs/coss/store_coss.h:1.3.10.4->1.3.10.5 src/fs/ufs/store_io_ufs.cc:1.3.10.6->1.3.10.7 src/fs/ufs/store_ufs.h:1.1.20.4->1.1.20.5 Index: squid3/include/RefCount.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/include/RefCount.h,v retrieving revision 1.2 retrieving revision 1.2.12.1 diff -u -r1.2 -r1.2.12.1 --- squid3/include/RefCount.h 22 Nov 2002 03:12:50 -0000 1.2 +++ squid3/include/RefCount.h 4 Dec 2002 12:34:57 -0000 1.2.12.1 @@ -1,6 +1,6 @@ /* - * $Id: RefCount.h,v 1.2 2002/11/22 03:12:50 squidadm Exp $ + * $Id: RefCount.h,v 1.2.12.1 2002/12/04 12:34:57 rbcollins Exp $ * * DEBUG: section xx Refcount allocator * AUTHOR: Robert Collins @@ -81,10 +81,10 @@ }; -struct RefCountable +struct RefCountable_ { - RefCountable():count_(0){} - virtual ~RefCountable(){} + RefCountable_():count_(0){} + virtual ~RefCountable_(){} virtual void deleteSelf() const = 0; /* Not private, to allow class hierarchies */ void RefCountReference() const { ++count_; } @@ -93,4 +93,6 @@ mutable unsigned count_; }; +#define RefCountable virtual RefCountable_ + #endif /* _SQUID_REFCOUNT_H_ */ Index: squid3/src/StoreIOState.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/StoreIOState.h,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- squid3/src/StoreIOState.h 4 Dec 2002 12:06:48 -0000 1.1.2.2 +++ squid3/src/StoreIOState.h 4 Dec 2002 12:34:58 -0000 1.1.2.3 @@ -1,6 +1,6 @@ /* - * $Id: StoreIOState.h,v 1.1.2.2 2002/12/04 12:06:48 rbcollins Exp $ + * $Id: StoreIOState.h,v 1.1.2.3 2002/12/04 12:34:58 rbcollins Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -35,14 +35,7 @@ #define SQUID_STOREIOSTATE_H #include "RefCount.h" - -class IORequestor : public virtual RefCountable{ - public: - typedef RefCount Pointer; - virtual void ioCompletedNotification() = 0; -}; - -class storeIOState : public virtual RefCountable, public IORequestor{ +class storeIOState : public RefCountable{ public: /* storeIOState does not get mempooled - it's children do */ Index: squid3/src/ufscommon.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Attic/ufscommon.h,v retrieving revision 1.1.20.1 retrieving revision 1.1.20.2 diff -u -r1.1.20.1 -r1.1.20.2 --- squid3/src/ufscommon.h 3 Dec 2002 12:25:57 -0000 1.1.20.1 +++ squid3/src/ufscommon.h 4 Dec 2002 12:34:58 -0000 1.1.20.2 @@ -1,6 +1,6 @@ /* - * $Id: ufscommon.h,v 1.1.20.1 2002/12/03 12:25:57 rbcollins Exp $ + * $Id: ufscommon.h,v 1.1.20.2 2002/12/04 12:34:58 rbcollins Exp $ * * SQUID Web Proxy Cache http://www.squid-cache.org/ * ---------------------------------------------------------- @@ -78,8 +78,15 @@ int commonUfsDirMapBitAllocate(SwapDir * SD); void commonUfsDirMapBitReset(SwapDir * SD, sfileno filn); +#include "RefCount.h" + +class IORequestor : public RefCountable{ + public: + typedef RefCount Pointer; + virtual void ioCompletedNotification() = 0; +}; /* Common ufs-store-dir logic */ -class UFSStoreState : public storeIOState { +class UFSStoreState : public storeIOState, public IORequestor { public: virtual void deleteSelf() const = 0; UFSStoreState(); 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.4 retrieving revision 1.3.10.5 diff -u -r1.3.10.4 -r1.3.10.5 --- squid3/src/fs/coss/store_coss.h 4 Dec 2002 12:06:50 -0000 1.3.10.4 +++ squid3/src/fs/coss/store_coss.h 4 Dec 2002 12:34:58 -0000 1.3.10.5 @@ -77,7 +77,6 @@ unsigned int writing:1; } flags; size_t st_size; - void ioCompletedNotification(){assert(0);} private: static MemPool *Pool; }; 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.6 retrieving revision 1.3.10.7 diff -u -r1.3.10.6 -r1.3.10.7 --- squid3/src/fs/ufs/store_io_ufs.cc 4 Dec 2002 12:06:51 -0000 1.3.10.6 +++ squid3/src/fs/ufs/store_io_ufs.cc 4 Dec 2002 12:34:58 -0000 1.3.10.7 @@ -1,6 +1,6 @@ /* - * $Id: store_io_ufs.cc,v 1.3.10.6 2002/12/04 12:06:51 rbcollins Exp $ + * $Id: store_io_ufs.cc,v 1.3.10.7 2002/12/04 12:34:58 rbcollins Exp $ * * DEBUG: section 79 Storage Manager UFS Interface * AUTHOR: Duane Wessels @@ -166,7 +166,7 @@ ufs->flags.reading = 0; ufs->flags.close_request = 0; store_open_disk_fd++; - myFile->open (O_RDONLY | O_BINARY, 0644, sio.getRaw()); + myFile->open (O_RDONLY | O_BINARY, 0644, ufs); /* We should update the heap/dlink position here ! */ return sio; Index: squid3/src/fs/ufs/store_ufs.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/fs/ufs/Attic/store_ufs.h,v retrieving revision 1.1.20.4 retrieving revision 1.1.20.5 diff -u -r1.1.20.4 -r1.1.20.5 --- squid3/src/fs/ufs/store_ufs.h 4 Dec 2002 12:06:51 -0000 1.1.20.4 +++ squid3/src/fs/ufs/store_ufs.h 4 Dec 2002 12:34:58 -0000 1.1.20.5 @@ -7,6 +7,7 @@ #ifndef __STORE_UFS_H__ #define __STORE_UFS_H__ +#include "ufscommon.h" class DiskFile : public RefCountable { public: typedef RefCount Pointer;