From: wessels <> Date: Wed, 30 Jun 1999 11:49:37 +0000 (+0000) Subject: adding DISKD code X-Git-Tag: SQUID_3_0_PRE1~2132 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8798ad05730f073f039e64cf977af5a6bf539c78;p=thirdparty%2Fsquid.git adding DISKD code --- diff --git a/src/Makefile.in b/src/Makefile.in index 446c00b480..04654ba8d7 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1,7 +1,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.176 1999/05/27 05:56:31 wessels Exp $ +# $Id: Makefile.in,v 1.177 1999/06/30 05:49:37 wessels Exp $ # # Uncomment and customize the following to suit your needs: # @@ -26,6 +26,7 @@ DNSSERVER_EXE = dnsserver$(exec_suffix) UNLINKD_EXE = unlinkd$(exec_suffix) PINGER_EXE = pinger$(exec_suffix) CACHEMGR_EXE = cachemgr$(cgi_suffix) +DISKD_EXE = diskd$(exec_suffix) DEFAULT_PREFIX = $(prefix) DEFAULT_CONFIG_FILE = $(sysconfdir)/squid.conf @@ -71,6 +72,7 @@ SQUID_LIBS = -L../lib $(CRYPTLIB) $(REGEXLIB) @SQUID_PTHREAD_LIB@ \ $(SNMPLIB) $(MALLOCLIB) -lmiscutil $(XTRA_LIBS) CLIENT_LIBS = -L../lib -lmiscutil $(XTRA_LIBS) DNSSERVER_LIBS = -L../lib -lmiscutil $(XTRA_LIBS) +DISKD_LIBS = -L../lib -lmiscutil $(XTRA_LIBS) PINGER_LIBS = -L../lib -lmiscutil $(XTRA_LIBS) STD_APP_LIBS = -L../lib -lmiscutil $(XTRA_LIBS) @@ -154,6 +156,7 @@ OBJS = \ store.o \ store_io.o \ store_io_ufs.o \ + diskd.o \ store_client.o \ store_digest.o \ store_dir.o \ @@ -221,6 +224,12 @@ $(CLIENT_EXE): client.o $(DNSSERVER_EXE): dnsserver.o $(CC) -o $@ $(LDFLAGS) dnsserver.o $(DNSSERVER_LIBS) +$(DISKD_EXE): diskd-daemon.o + $(CC) -o $@ $(LDFLAGS) diskd.o $(DISKD_LIBS) + +diskd-daemon.o: diskd.c + $(CC) -c $(CFLAGS) -DDISKD_DAEMON=1 $(srcdir)/diskd.c -o $@ + $(CACHEMGR_EXE): cachemgr.o $(CC) -o $@ $(LDFLAGS) cachemgr.o $(CLIENT_LIBS) diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 850943404c..11bfcbc183 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.cc,v 1.333 1999/06/24 20:19:56 wessels Exp $ + * $Id: cache_cf.cc,v 1.334 1999/06/30 05:49:39 wessels Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -812,6 +812,10 @@ parse_cachedir(cacheSwap * swap) #if USE_ASYNC_IO } else if (0 == strcasecmp(type_str, "asyncufs")) { storeAufsDirParse(swap); +#endif +#if USE_DISKD + } else if (0 == strcasecmp(type_str, "diskd")) { + storeDiskdDirParse(swap); #endif } else { fatalf("Unknown cache_dir type '%s'\n", type_str); diff --git a/src/comm_select.cc b/src/comm_select.cc index b8b1c306a1..18d7c86fe3 100644 --- a/src/comm_select.cc +++ b/src/comm_select.cc @@ -1,6 +1,6 @@ /* - * $Id: comm_select.cc,v 1.35 1999/05/04 21:58:19 wessels Exp $ + * $Id: comm_select.cc,v 1.36 1999/06/30 05:49:40 wessels Exp $ * * DEBUG: section 5 Socket Functions * @@ -36,6 +36,8 @@ #if USE_ASYNC_IO #define MAX_POLL_TIME 10 +#elif USE_DISKD +#define MAX_POLL_TIME 10 #else #define MAX_POLL_TIME 1000 #endif @@ -304,6 +306,9 @@ comm_poll(int msec) #endif #if USE_ASYNC_IO aioCheckCallbacks(); +#endif +#if USE_DISKD + storeDiskdReadQueue(); #endif if (commCheckICPIncoming) comm_poll_icp_incoming(); @@ -591,6 +596,9 @@ comm_select(int msec) #endif #if USE_ASYNC_IO aioCheckCallbacks(); +#endif +#if USE_DISKD + storeDiskdReadQueue(); #endif if (commCheckICPIncoming) comm_select_icp_incoming(); diff --git a/src/enums.h b/src/enums.h index bbabca4e4b..899573a4d8 100644 --- a/src/enums.h +++ b/src/enums.h @@ -1,6 +1,6 @@ /* - * $Id: enums.h,v 1.157 1999/06/18 04:24:59 wessels Exp $ + * $Id: enums.h,v 1.158 1999/06/30 05:49:41 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -638,5 +638,8 @@ enum { typedef enum { SWAPDIR_UFS, SWAPDIR_ASYNCUFS, +#if USE_DISKD + SWAPDIR_DISKD, +#endif SWAPDIR_MAX } swapdir_t; diff --git a/src/protos.h b/src/protos.h index dc8a9abc37..06dd592787 100644 --- a/src/protos.h +++ b/src/protos.h @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.340 1999/06/24 20:20:05 wessels Exp $ + * $Id: protos.h,v 1.341 1999/06/30 05:49:42 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -885,6 +885,19 @@ extern void storeAufsWrite(storeIOState *, char *, size_t, off_t, FREE *); extern void storeAufsUnlink(int fileno); #endif +#if USE_DISKD +/* + * diskd.c + */ +extern storeIOState *storeDiskdOpen(sfileno, mode_t, STIOCB *, void *); +extern void storeDiskdClose(storeIOState * sio); +extern void storeDiskdRead(storeIOState *, char *, size_t, off_t, STRCB *, void *); +extern void storeDiskdWrite(storeIOState *, char *, size_t, off_t, FREE *); +extern void storeDiskdUnlink(int fileno); +extern STINIT storeDiskdInit; +extern void storeDiskdReadQueue(void); +#endif + /* * store_log.c */ @@ -956,9 +969,13 @@ extern void storeUfsDirParse(cacheSwap * swap); extern void storeUfsDirDump(StoreEntry * entry, const char *name, SwapDir * s); extern void storeUfsDirFree(SwapDir *); extern char *storeUfsFullPath(sfileno fn, char *fullpath); +extern STINIT storeUfsDirInit; #if USE_ASYNC_IO extern void storeAufsDirParse(cacheSwap * swap); #endif +#if USE_DISKD +extern void storeDiskdDirParse(cacheSwap *); +#endif /* diff --git a/src/structs.h b/src/structs.h index f42548a931..b07d30b36d 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.301 1999/06/30 05:23:44 wessels Exp $ + * $Id: structs.h,v 1.302 1999/06/30 05:49:44 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -1317,6 +1317,19 @@ struct _SwapDir { int l2; int swaplog_fd; } ufs; +#if USE_DISKD + struct { + int l1; + int l2; + int swaplog_fd; + int smsgid; + int rmsgid; + int wfd; + int send_no; + int recv_no; + int away; + } diskd; +#endif } u; }; @@ -1380,6 +1393,16 @@ struct _storeIOState { const char *read_buf; link_list *pending_writes; } aufs; +#if USE_DISKD + struct { + int id; + struct { + unsigned int reading:1; + unsigned int writing:1; + } flags; + char *read_buf; + } diskd; +#endif } type; };