]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Cleaned up the "null" FS by removing all unused "junk", and merging it into
authorhno <>
Thu, 8 Feb 2001 00:42:21 +0000 (00:42 +0000)
committerhno <>
Thu, 8 Feb 2001 00:42:21 +0000 (00:42 +0000)
one (small) file.

src/fs/null/Makefile.in
src/fs/null/store_null.cc [new file with mode: 0644]

index 97b99eb90f1e10a9de10f5506ae5a7825fd4bc73..7e3eb02f20abb916aa04076d8f9ce2abbd5f204e 100644 (file)
@@ -1,7 +1,7 @@
 #
 #  Makefile for the UFS storage driver for the Squid Object Cache server
 #
-#  $Id: Makefile.in,v 1.1 2000/12/09 04:12:16 wessels Exp $
+#  $Id: Makefile.in,v 1.2 2001/02/07 17:42:21 hno Exp $
 #
 
 FS             = null
@@ -22,8 +22,7 @@ CFLAGS                = $(AC_CFLAGS) $(INCLUDE) $(DEFINES)
 OUT            = ../$(FS).a
 
 OBJS           = \
-               store_dir_null.o \
-               store_io_null.o
+               store_null.o \
 
 
 all: $(OUT)
diff --git a/src/fs/null/store_null.cc b/src/fs/null/store_null.cc
new file mode 100644 (file)
index 0000000..9887bfb
--- /dev/null
@@ -0,0 +1,129 @@
+
+/*
+ * $Id: store_null.cc,v 1.1 2001/02/07 17:42:37 hno Exp $
+ *
+ * DEBUG: section 47    Store Directory Routines
+ * AUTHOR: Duane Wessels
+ *
+ * SQUID Web Proxy Cache          http://www.squid-cache.org/
+ * ----------------------------------------------------------
+ *
+ *  Squid is the result of efforts by numerous individuals from
+ *  the Internet community; see the CONTRIBUTORS file for full
+ *  details.   Many organizations have provided support for Squid's
+ *  development; see the SPONSORS file for full details.  Squid is
+ *  Copyrighted (C) 2001 by the Regents of the University of
+ *  California; see the COPYRIGHT file for full details.  Squid
+ *  incorporates software developed and/or copyrighted by other
+ *  sources; see the CREDITS file for full details.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *  
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *  
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
+ *
+ */
+
+#include "squid.h"
+#if HAVE_STATVFS
+#if HAVE_SYS_STATVFS_H
+#include <sys/statvfs.h>
+#endif
+#endif
+
+static int null_initialised = 0;
+static void storeNullDirInit(SwapDir * sd);
+static void storeNullDirStats(SwapDir * SD, StoreEntry * sentry);
+static STCHECKOBJ storeNullDirCheckObj;
+static STFSRECONFIGURE storeNullDirReconfigure;
+static STLOGCLEANSTART storeNullDirWriteCleanStart;
+static STLOGCLEANDONE storeNullDirWriteCleanDone;
+static EVH storeNullDirRebuildComplete;
+
+/* The only externally visible interface */
+STSETUP storeFsSetup_null;
+
+static void
+storeNullDirReconfigure(SwapDir * sd, int index, char *path)
+{
+    (void) 0;
+}
+
+static void
+storeNullDirDone(void)
+{
+    null_initialised = 0;
+}
+
+static void
+storeNullDirStats(SwapDir * SD, StoreEntry * sentry)
+{
+    (void) 0;
+}
+
+static void
+storeNullDirInit(SwapDir * sd)
+{
+    eventAdd("storeNullDirRebuildComplete", storeNullDirRebuildComplete,
+       NULL, 0.0, 1);
+}
+
+static void
+storeNullDirRebuildComplete(void *unused)
+{
+    struct _store_rebuild_data counts;
+    memset(&counts, '\0', sizeof(counts));
+    storeRebuildComplete(&counts);
+}
+
+static int
+storeNullDirCheckObj(SwapDir * SD, const StoreEntry * e)
+{
+    return -1;
+}
+
+static int
+storeNullDirWriteCleanStart(SwapDir * unused)
+{
+    return 0;
+}
+
+static void
+storeNullDirWriteCleanDone(SwapDir * unused)
+{
+    (void) 0;
+}
+
+static void
+storeNullDirParse(SwapDir * sd, int index, char *path)
+{
+    sd->index = index;
+    sd->path = xstrdup(path);
+    sd->statfs = storeNullDirStats;
+    sd->init = storeNullDirInit;
+    sd->checkobj = storeNullDirCheckObj;
+    sd->log.clean.start = storeNullDirWriteCleanStart;
+    sd->log.clean.done = storeNullDirWriteCleanDone;
+}
+
+/* Setup and register the store module */
+
+void
+storeFsSetup_null(storefs_entry_t * storefs)
+{
+    assert(!null_initialised);
+    storefs->parsefunc = storeNullDirParse;
+    storefs->reconfigurefunc = storeNullDirReconfigure;
+    storefs->donefunc = storeNullDirDone;
+    null_initialised = 1;
+}
+