]> git.ipfire.org Git - thirdparty/squid.git/blob - src/fs/ufs/UFSStrategy.h
SourceLayout: introduce Fs::Ufs namespace, split ufscommon, store_dir_ufs and store_i...
[thirdparty/squid.git] / src / fs / ufs / UFSStrategy.h
1 /*
2 * SQUID Web Proxy Cache http://www.squid-cache.org/
3 * ----------------------------------------------------------
4 *
5 * Squid is the result of efforts by numerous individuals from
6 * the Internet community; see the CONTRIBUTORS file for full
7 * details. Many organizations have provided support for Squid's
8 * development; see the SPONSORS file for full details. Squid is
9 * Copyrighted (C) 2001 by the Regents of the University of
10 * California; see the COPYRIGHT file for full details. Squid
11 * incorporates software developed and/or copyrighted by other
12 * sources; see the CREDITS file for full details.
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
27 *
28 */
29
30 #ifndef SQUID_FS_UFS_UFSSTRATEGY_H
31 #define SQUID_FS_UFS_UFSSTRATEGY_H
32
33 #include "DiskIO/DiskFile.h"
34 #include "StoreIOState.h"
35
36 class Swapdir;
37 class StoreEntry;
38 class DiskIOStrategy;
39
40 namespace Fs
41 {
42 namespace Ufs
43 {
44 /// \ingroup UFS
45 class UFSStrategy
46 {
47 public:
48 UFSStrategy (DiskIOStrategy *);
49 virtual ~UFSStrategy ();
50 virtual bool shedLoad();
51
52 virtual int load();
53
54 StoreIOState::Pointer createState(SwapDir *SD, StoreEntry *e, StoreIOState::STIOCB * callback, void *callback_data) const;
55 /* UFS specific */
56 virtual RefCount<DiskFile> newFile (char const *path);
57 StoreIOState::Pointer open(SwapDir *, StoreEntry *, StoreIOState::STFNCB *,
58 StoreIOState::STIOCB *, void *);
59 StoreIOState::Pointer create(SwapDir *, StoreEntry *, StoreIOState::STFNCB *,
60 StoreIOState::STIOCB *, void *);
61
62 virtual void unlinkFile (char const *);
63 virtual void sync();
64
65 virtual int callback();
66
67 /** Init per-instance logic */
68 virtual void init();
69
70 /** cachemgr output on the IO instance stats */
71 virtual void statfs(StoreEntry & sentry)const;
72
73 /** The io strategy in use */
74 DiskIOStrategy *io;
75
76 protected:
77
78 friend class UFSSwapDir;
79
80 private:
81 UFSStrategy(); //disabled
82 UFSStrategy(UFSStrategy const &); //disabled
83 UFSStrategy &operator=(UFSStrategy const &); //disabled
84
85 };
86
87 } //namespace Ufs
88 } //namespace Fs
89
90 #endif /* SQUID_FS_UFS_UFSSTRATEGY_H */