]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
adding DISKD code
authorwessels <>
Wed, 30 Jun 1999 11:49:37 +0000 (11:49 +0000)
committerwessels <>
Wed, 30 Jun 1999 11:49:37 +0000 (11:49 +0000)
src/Makefile.in
src/cache_cf.cc
src/comm_select.cc
src/enums.h
src/protos.h
src/structs.h

index 446c00b48091289c45dde97591fb6d8c5492a19c..04654ba8d708400fc0bf8cc63b0733d2e14939fb 100644 (file)
@@ -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)
 
index 850943404c5cd581c5157a37119bd20b64a2e789..11bfcbc1839167251112fed4b304bee61d56dd32 100644 (file)
@@ -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);
index b8b1c306a1a8bc0b8e50bb110c9af22554d58100..18d7c86fe3e94f777817f443d7045e8bda3385c7 100644 (file)
@@ -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();
index bbabca4e4b720fe465ce1b5cd728fc99d2611965..899573a4d858b10d2ffedc94123d63c001a7215f 100644 (file)
@@ -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;
index dc8a9abc37406a8ddf32ca898ad9d8a61575484c..06dd5927879550b215843245734306b789ad9dda 100644 (file)
@@ -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
 
 
 /*
index f42548a931451316f040eaa9add78531379871c6..b07d30b36d370d6e69207aff9243378826c9b09e 100644 (file)
@@ -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;
 };