~clint-fewbar/ubuntu/precise/squid3/ignore-sighup-early

« back to all changes in this revision

Viewing changes to src/StoreFileSystem.h

  • Committer: Bazaar Package Importer
  • Author(s): Luigi Gangitano
  • Date: 2009-09-24 14:51:06 UTC
  • mfrom: (1.1.12 upstream)
  • mto: (20.2.1 sid)
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: james.westby@ubuntu.com-20090924145106-38jgrzmj0d73pha5
Tags: 3.1.0.13-1
* Upload to experimental

* New upstream release
  - Fixes Follow-X-Forwarded-For support (Closes: #523943)
  - Adds IPv6 support (Closes: #432351)

* debian/rules
  - Removed obsolete configuration options
  - Enable db and radius basic authentication modules

* debian/patches/01-cf.data.debian
  - Adapted to new upstream version

* debian/patches/02-makefile-defaults
  - Adapted to new upstream version

* debian/{squid.postinst,squid.rc,README.Debian,watch}
  - Updated references to squid 3.1

* debian/squid3.install
  - Install CSS file for error pages
  - Install manual pages for new authentication modules

* debian/squid3-common.install
  - Install documented version of configuration file in /usr/share/doc/squid3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
1
/*
3
 
 * $Id: StoreFileSystem.h,v 1.2 2006/05/29 00:15:01 robertc Exp $
 
2
 * $Id$
4
3
 *
5
4
 * SQUID Web Proxy Cache          http://www.squid-cache.org/
6
5
 * ----------------------------------------------------------
18
17
 *  it under the terms of the GNU General Public License as published by
19
18
 *  the Free Software Foundation; either version 2 of the License, or
20
19
 *  (at your option) any later version.
21
 
 *  
 
20
 *
22
21
 *  This program is distributed in the hope that it will be useful,
23
22
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
24
23
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
25
24
 *  GNU General Public License for more details.
26
 
 *  
 
25
 *
27
26
 *  You should have received a copy of the GNU General Public License
28
27
 *  along with this program; if not, write to the Free Software
29
28
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
37
36
#include "squid.h"
38
37
#include "Array.h"
39
38
 
40
 
/* forward decls */
41
 
 
42
 
class CacheManager;
43
 
 
 
39
/* ****** DOCUMENTATION ***** */
 
40
 
 
41
/**
 
42
 \defgroup FileSystems  Storage Filesystems
 
43
 *
 
44
 \section Introduction Introduction
 
45
 \par
 
46
 * Traditionally, Squid has always used the Unix filesystem (\link UFS UFS\endlink)
 
47
 * to store cache objects on disk.  Over the years, the
 
48
 * poor performance of \link UFS UFS\endlink has become very obvious.  In most
 
49
 * cases, \link UFS UFS\endlink limits Squid to about 30-50 requests per second.
 
50
 * Our work indicates that the poor performance is mostly
 
51
 * due to the synchronous nature of open() and unlink()
 
52
 * system calls, and perhaps thrashing of inode/buffer caches.
 
53
 *
 
54
 \par
 
55
 * We want to try out our own, customized filesystems with Squid.
 
56
 * In order to do that, we need a well-defined interface
 
57
 * for the bits of Squid that access the permanent storage
 
58
 * devices. We also require tighter control of the replacement
 
59
 * policy by each storage module, rather than a single global
 
60
 * replacement policy.
 
61
 *
 
62
 \section BuildStructure Build structure
 
63
 \par
 
64
 * The storage types live in \em src/fs/. Each subdirectory corresponds
 
65
 * to the name of the storage type. When a new storage type is implemented
 
66
 * configure.in must be updated to autogenerate a Makefile in
 
67
 * \em src/fs/foo/ from a Makefile.in file.
 
68
 *
 
69
 \todo DOCS: add template addition to configure.in for storage module addition.
 
70
 \todo DOCS: add template Makefile.am for storage module addition.
 
71
 *
 
72
 \par
 
73
 * configure will take a list of storage types through the
 
74
 * --enable-store-io parameter. This parameter takes a list of
 
75
 * space seperated storage types. For example,
 
76
 * --enable-store-io="ufs coss" .
 
77
 *
 
78
 \par
 
79
 * Each storage type must create an archive file
 
80
 * in \em src/fs/foo/.a . This file is automatically linked into
 
81
 * squid at compile time.
 
82
 *
 
83
 \par
 
84
 * Each storage filesystem must inherit from StoreFileSystem and provide
 
85
 * all virtual function hooks for squid to operate with.
 
86
 *
 
87
 \section OperationOfStorageModules Operation of a Storage Module
 
88
 \par
 
89
 *    Squid understands the concept of multiple diverse storage directories.
 
90
 *    Each storage directory provides a caching object store, with object
 
91
 *    storage, retrieval, indexing and replacement.
 
92
 *
 
93
 \par
 
94
 *    Each open object has associated with it a storeIOState object. The
 
95
 *    storeIOState object is used to record the state of the current
 
96
 *    object. Each storeIOState can have a storage module specific data
 
97
 *    structure containing information private to the storage module.
 
98
 *
 
99
 \par
 
100
 *    Each SwapDir has the concept of a maximum object size. This is used
 
101
 *    as a basic hint to the storage layer in first choosing a suitable
 
102
 *    SwapDir. The checkobj function is then called for suitable
 
103
 *    candidate SwapDirs to find out whether it wants to store a
 
104
 *    given StoreEntry. A maxobjsize of -1 means 'any size'.
 
105
 */
 
106
 
 
107
class SwapDir;
 
108
 
 
109
/**
 
110
 \ingroup FileSystems
 
111
 *
 
112
 * The core API for storage modules this class provides all the hooks
 
113
 * squid uses to interact with a filesystem IO module.
 
114
 */
44
115
class StoreFileSystem
45
116
{
46
117
 
47
118
public:
48
 
    static void RegisterAllFsWithCacheManager(CacheManager & manager);
49
119
    static void SetupAllFs();
50
120
    static void FsAdd(StoreFileSystem &);
51
121
    static void FreeAllFs();
52
122
    static Vector<StoreFileSystem*> const &FileSystems();
53
123
    typedef Vector<StoreFileSystem*>::iterator iterator;
54
124
    typedef Vector<StoreFileSystem*>::const_iterator const_iterator;
55
 
    StoreFileSystem() : initialised (false) {}
 
125
    StoreFileSystem() : initialised(false) {}
56
126
 
57
 
    virtual ~StoreFileSystem(){}
 
127
    virtual ~StoreFileSystem() {}
58
128
 
59
129
    virtual char const *type () const = 0;
60
130
    virtual SwapDir *createSwapDir() = 0;
61
131
    virtual void done() = 0;
62
 
    virtual void registerWithCacheManager(CacheManager & manager);
63
132
    virtual void setup() = 0;
64
133
    // Not implemented
65
134
    StoreFileSystem(StoreFileSystem const &);
67
136
 
68
137
protected:
69
138
    bool initialised;
 
139
    virtual void registerWithCacheManager(void);
70
140
 
71
141
private:
72
142
    static Vector<StoreFileSystem*> &GetFileSystems();
73
143
    static Vector<StoreFileSystem*> *_FileSystems;
 
144
    static void RegisterAllFsWithCacheManager(void);
74
145
};
75
146
 
 
147
// TODO: Kill this typedef!
76
148
typedef StoreFileSystem storefs_entry_t;
77
149
 
78
150