--------------------- PatchSet 1575 Date: 2001/02/15 12:25:16 Author: rbcollins Branch: generic_modules Tag: (none) Log: fs modules using mod_register. Removed store_modules.sh Members: src/Makefile.in:1.7.4.3->1.7.4.4 src/cf.data.pre:1.21.4.2->1.21.4.3 src/main.c:1.19.4.1->1.19.4.2 src/protos.h:1.18.4.3->1.18.4.4 src/store.c:1.9.8.1->1.9.8.2 src/store_modules.sh:1.2->1.2.38.1(DEAD) src/fs/aufs/store_dir_aufs.c:1.13->1.13.4.1 src/fs/coss/store_dir_coss.c:1.10->1.10.4.1 src/fs/diskd/store_dir_diskd.c:1.14->1.14.4.1 src/fs/null/store_null.c:1.2->1.2.6.1 src/fs/ufs/store_dir_ufs.c:1.12->1.12.4.1 Index: squid/src/Makefile.in =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/Makefile.in,v retrieving revision 1.7.4.3 retrieving revision 1.7.4.4 diff -u -r1.7.4.3 -r1.7.4.4 --- squid/src/Makefile.in 15 Feb 2001 11:44:58 -0000 1.7.4.3 +++ squid/src/Makefile.in 15 Feb 2001 12:25:16 -0000 1.7.4.4 @@ -1,7 +1,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.7.4.3 2001/02/15 11:44:58 rbcollins Exp $ +# $Id: Makefile.in,v 1.7.4.4 2001/02/15 12:25:16 rbcollins Exp $ # # Uncomment and customize the following to suit your needs: # @@ -171,7 +171,6 @@ store_dir.o \ store_key_md5.o \ store_log.o \ - store_modules.o \ store_rebuild.o \ store_swapin.o \ store_swapmeta.o \ @@ -281,12 +280,6 @@ s%@DEFAULT_PREFIX@%$(DEFAULT_PREFIX)%g;"\ < $(srcdir)/cf.data.pre >$@ -store_modules.c: store_modules.sh Makefile - sh $(srcdir)/store_modules.sh $(STORE_MODULES) >store_modules.c - -store_modules.o: store_modules.c - $(CC) -c store_modules.c $(CFLAGS) -I$(srcdir) - $(STORE_OBJS): @sh -c "cd `dirname $@` && $(MAKE) $(MFLAGS) `basename $@`" @@ -300,7 +293,7 @@ @sh -c "cd `dirname $@` && $(MAKE) $(MFLAGS) `basename $@`" conf_modules.c: conf_modules.sh Makefile - sh $(srcdir)/conf_modules.sh $(CONF_MODULES) $(AUTH_MODULES) $(REPL_POLICIES) >conf_modules.c + sh $(srcdir)/conf_modules.sh $(CONF_MODULES) $(AUTH_MODULES) $(REPL_POLICIES) $(STORE_MODULES) >conf_modules.c conf_modules.o: conf_modules.c $(CC) -c conf_modules.c $(CFLAGS) -I$(srcdir) Index: squid/src/cf.data.pre =================================================================== RCS file: /cvsroot/squid-sf//squid/src/cf.data.pre,v retrieving revision 1.21.4.2 retrieving revision 1.21.4.3 diff -u -r1.21.4.2 -r1.21.4.3 --- squid/src/cf.data.pre 15 Feb 2001 11:44:58 -0000 1.21.4.2 +++ squid/src/cf.data.pre 15 Feb 2001 12:25:16 -0000 1.21.4.3 @@ -1,6 +1,6 @@ # -# $Id: cf.data.pre,v 1.21.4.2 2001/02/15 11:44:58 rbcollins Exp $ +# $Id: cf.data.pre,v 1.21.4.3 2001/02/15 12:25:16 rbcollins Exp $ # # # SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -77,7 +77,7 @@ #mod_register internal aufs #mod_register internal diskd #mod_register internal null -#mod_register ... +#mod_register internal coss # authentication scheme modules mod_register internal basic Index: squid/src/main.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/main.c,v retrieving revision 1.19.4.1 retrieving revision 1.19.4.2 diff -u -r1.19.4.1 -r1.19.4.2 --- squid/src/main.c 14 Feb 2001 13:40:59 -0000 1.19.4.1 +++ squid/src/main.c 15 Feb 2001 12:25:16 -0000 1.19.4.2 @@ -1,6 +1,6 @@ /* - * $Id: main.c,v 1.19.4.1 2001/02/14 13:40:59 rbcollins Exp $ + * $Id: main.c,v 1.19.4.2 2001/02/15 12:25:16 rbcollins Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -622,7 +622,6 @@ memInit(); cbdataInit(); eventInit(); /* eventInit() is required for config parsing */ - storeFsInit(); /* required for config parsing */ parse_err = parseConfigFile(ConfigFile); if (opt_parse_cfg_only) Index: squid/src/protos.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/protos.h,v retrieving revision 1.18.4.3 retrieving revision 1.18.4.4 diff -u -r1.18.4.3 -r1.18.4.4 --- squid/src/protos.h 15 Feb 2001 11:44:59 -0000 1.18.4.3 +++ squid/src/protos.h 15 Feb 2001 12:25:17 -0000 1.18.4.4 @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.18.4.3 2001/02/15 11:44:59 rbcollins Exp $ + * $Id: protos.h,v 1.18.4.4 2001/02/15 12:25:17 rbcollins Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -910,14 +910,10 @@ extern void storeEntryReset(StoreEntry *); extern void storeHeapPositionUpdate(StoreEntry *, SwapDir *); extern void storeSwapFileNumberSet(StoreEntry * e, sfileno filn); -extern void storeFsInit(void); extern void storeFsDone(void); extern void storeFsAdd(const char *, STSETUP *); extern void storeReplAdd(const char *, REMOVALPOLICYCREATE *); -/* store_modules.c */ -extern void storeFsSetup(void); - /* store_io.c */ extern storeIOState *storeCreate(StoreEntry *, STFNCB *, STIOCB *, void *); extern storeIOState *storeOpen(StoreEntry *, STFNCB *, STIOCB *, void *); Index: squid/src/store.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/store.c,v retrieving revision 1.9.8.1 retrieving revision 1.9.8.2 diff -u -r1.9.8.1 -r1.9.8.2 --- squid/src/store.c 15 Feb 2001 11:44:59 -0000 1.9.8.1 +++ squid/src/store.c 15 Feb 2001 12:25:17 -0000 1.9.8.2 @@ -1,6 +1,6 @@ /* - * $Id: store.c,v 1.9.8.1 2001/02/15 11:44:59 rbcollins Exp $ + * $Id: store.c,v 1.9.8.2 2001/02/15 12:25:17 rbcollins Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -1215,20 +1215,6 @@ } /* - * storeFsInit - * - * This routine calls the SETUP routine for each fs type. - * I don't know where the best place for this is, and I'm not going to shuffle - * around large chunks of code right now (that can be done once its working.) - */ -void -storeFsInit(void) -{ - storeFsSetup(); -} - - -/* * similar to above, but is called when a graceful shutdown is to occur * of each fs module. */ --- squid/src/store_modules.sh Wed Feb 14 00:50:27 2007 +++ /dev/null Wed Feb 14 00:50:05 2007 @@ -1,15 +0,0 @@ -#!/bin/sh -echo "/* automatically generated by $0 $*" -echo " * do not edit" -echo " */" -echo "#include \"squid.h\"" -echo "" -for module in "$@"; do - echo "extern STSETUP storeFsSetup_${module};" -done -echo "void storeFsSetup(void)" -echo "{" -for module in "$@"; do - echo " storeFsAdd(\"$module\", storeFsSetup_${module});" -done -echo "}" Index: squid/src/fs/aufs/store_dir_aufs.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/aufs/store_dir_aufs.c,v retrieving revision 1.13 retrieving revision 1.13.4.1 diff -u -r1.13 -r1.13.4.1 --- squid/src/fs/aufs/store_dir_aufs.c 10 Feb 2001 16:49:05 -0000 1.13 +++ squid/src/fs/aufs/store_dir_aufs.c 15 Feb 2001 12:25:17 -0000 1.13.4.1 @@ -121,6 +121,21 @@ /* The MAIN externally visible function */ STSETUP storeFsSetup_aufs; +/* register as a module + */ +void +mod_install_aufs (const char *namestr) +{ + storeFsAdd(namestr, storeFsSetup_aufs); +} + +/* deregister as a module */ +unsigned int +mod_uninstall_aufs(const char *namestr) { + /* deregistration not supported for this module */ + return 0; +} + /* * These functions were ripped straight out of the heart of store_dir.c. * They assume that the given filenum is on a asyncufs partiton, which may or Index: squid/src/fs/coss/store_dir_coss.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/coss/store_dir_coss.c,v retrieving revision 1.10 retrieving revision 1.10.4.1 diff -u -r1.10 -r1.10.4.1 --- squid/src/fs/coss/store_dir_coss.c 10 Feb 2001 16:49:05 -0000 1.10 +++ squid/src/fs/coss/store_dir_coss.c 15 Feb 2001 12:25:17 -0000 1.10.4.1 @@ -90,6 +90,21 @@ /* The "only" externally visible function */ STSETUP storeFsSetup_coss; +/* register as a module + */ +void +mod_install_coss (const char *namestr) +{ + storeFsAdd(namestr, storeFsSetup_coss); +} + +/* deregister as a module */ +unsigned int +mod_uninstall_coss(const char *namestr) { + /* deregistration not supported for this module */ + return 0; +} + static char * storeCossDirSwapLogFile(SwapDir * sd, const char *ext) { Index: squid/src/fs/diskd/store_dir_diskd.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/diskd/store_dir_diskd.c,v retrieving revision 1.14 retrieving revision 1.14.4.1 diff -u -r1.14 -r1.14.4.1 --- squid/src/fs/diskd/store_dir_diskd.c 10 Feb 2001 16:49:06 -0000 1.14 +++ squid/src/fs/diskd/store_dir_diskd.c 15 Feb 2001 12:25:18 -0000 1.14.4.1 @@ -131,6 +131,21 @@ /* The only externally visible interface */ STSETUP storeFsSetup_diskd; +/* register as a module + */ +void +mod_install_diskd (const char *namestr) +{ + storeFsAdd(namestr, storeFsSetup_diskd); +} + +/* deregister as a module */ +unsigned int +mod_uninstall_diskd(const char *namestr) { + /* deregistration not supported for this module */ + return 0; +} + /* * These functions were ripped straight out of the heart of store_dir.c. * They assume that the given filenum is on a diskd partiton, which may or Index: squid/src/fs/null/store_null.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/null/store_null.c,v retrieving revision 1.2 retrieving revision 1.2.6.1 diff -u -r1.2 -r1.2.6.1 --- squid/src/fs/null/store_null.c 10 Feb 2001 16:49:07 -0000 1.2 +++ squid/src/fs/null/store_null.c 15 Feb 2001 12:25:18 -0000 1.2.6.1 @@ -52,6 +52,21 @@ /* The only externally visible interface */ STSETUP storeFsSetup_null; +/* register as a module + */ +void +mod_install_null (const char *namestr) +{ + storeFsAdd(namestr, storeFsSetup_null); +} + +/* deregister as a module */ +unsigned int +mod_uninstall_null(const char *namestr) { + /* deregistration not supported for this module */ + return 0; +} + static void storeNullDirReconfigure(SwapDir * sd, int index, char *path) { Index: squid/src/fs/ufs/store_dir_ufs.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/ufs/store_dir_ufs.c,v retrieving revision 1.12 retrieving revision 1.12.4.1 diff -u -r1.12 -r1.12.4.1 --- squid/src/fs/ufs/store_dir_ufs.c 10 Feb 2001 16:49:07 -0000 1.12 +++ squid/src/fs/ufs/store_dir_ufs.c 15 Feb 2001 12:25:18 -0000 1.12.4.1 @@ -118,6 +118,21 @@ STSETUP storeFsSetup_ufs; +/* register as a module + */ +void +mod_install_ufs (const char *namestr) +{ + storeFsAdd(namestr, storeFsSetup_ufs); +} + +/* deregister as a module */ +unsigned int +mod_uninstall_ufs(const char *namestr) { + /* deregistration not supported for this module */ + return 0; +} + /* * These functions were ripped straight out of the heart of store_dir.c. * They assume that the given filenum is on a ufs partiton, which may or