]> git.ipfire.org Git - thirdparty/squid.git/blame - src/fs/ufs/UFSStrategy.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / fs / ufs / UFSStrategy.h
CommitLineData
58373ff8 1/*
4ac4a490 2 * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
58373ff8 3 *
bbc27441
AJ
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.
58373ff8
FC
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
15class Swapdir;
16class StoreEntry;
17class DiskIOStrategy;
18
19namespace Fs
20{
21namespace Ufs
22{
23/// \ingroup UFS
24class UFSStrategy
25{
26public:
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
55protected:
56
57 friend class UFSSwapDir;
58
59private:
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 */
f53969cc 70