]> git.ipfire.org Git - thirdparty/squid.git/blob - src/fs/ufs/UFSStrategy.h
2a93f1968a91f044d1e4374801424a71a73080f2
[thirdparty/squid.git] / src / fs / ufs / UFSStrategy.h
1 /*
2 * Copyright (C) 1996-2019 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9 #ifndef SQUID_FS_UFS_UFSSTRATEGY_H
10 #define SQUID_FS_UFS_UFSSTRATEGY_H
11
12 #include "DiskIO/DiskFile.h"
13 #include "StoreIOState.h"
14
15 class Swapdir;
16 class StoreEntry;
17 class DiskIOStrategy;
18
19 namespace Fs
20 {
21 namespace Ufs
22 {
23 /// \ingroup UFS
24 class UFSStrategy
25 {
26 public:
27 UFSStrategy (DiskIOStrategy *);
28 virtual ~UFSStrategy ();
29 virtual bool shedLoad();
30
31 virtual int load();
32
33 StoreIOState::Pointer createState(SwapDir *SD, StoreEntry *e, StoreIOState::STIOCB * callback, void *callback_data) const;
34 /* UFS specific */
35 virtual RefCount<DiskFile> newFile (char const *path);
36 StoreIOState::Pointer open(SwapDir *, StoreEntry *, StoreIOState::STFNCB *,
37 StoreIOState::STIOCB *, void *);
38 StoreIOState::Pointer create(SwapDir *, StoreEntry *, StoreIOState::STFNCB *,
39 StoreIOState::STIOCB *, void *);
40
41 virtual void unlinkFile (char const *);
42 virtual void sync();
43
44 virtual int callback();
45
46 /** Init per-instance logic */
47 virtual void init();
48
49 /** cachemgr output on the IO instance stats */
50 virtual void statfs(StoreEntry & sentry)const;
51
52 /** The io strategy in use */
53 DiskIOStrategy *io;
54
55 protected:
56
57 friend class UFSSwapDir;
58
59 private:
60 UFSStrategy(); //disabled
61 UFSStrategy(UFSStrategy const &); //disabled
62 UFSStrategy &operator=(UFSStrategy const &); //disabled
63
64 };
65
66 } //namespace Ufs
67 } //namespace Fs
68
69 #endif /* SQUID_FS_UFS_UFSSTRATEGY_H */
70