]> git.ipfire.org Git - thirdparty/squid.git/blob - src/store/Disks.h
Bug 7: Update cached entries on 304 responses.
[thirdparty/squid.git] / src / store / Disks.h
1 /*
2 * Copyright (C) 1996-2016 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_STORE_DISKS_H
10 #define SQUID_STORE_DISKS_H
11
12 #include "store/Controlled.h"
13 #include "store/forward.h"
14
15 namespace Store {
16
17 /// summary view of all disk caches (cache_dirs) combined
18 class Disks: public Controlled
19 {
20 public:
21 /* Storage API */
22 virtual void create() override;
23 virtual void init() override;
24 virtual StoreEntry *get(const cache_key *) override;
25 virtual uint64_t maxSize() const override;
26 virtual uint64_t minSize() const override;
27 virtual uint64_t currentSize() const override;
28 virtual uint64_t currentCount() const override;
29 virtual int64_t maxObjectSize() const override;
30 virtual void getStats(StoreInfoStats &stats) const override;
31 virtual void stat(StoreEntry &) const override;
32 virtual void sync() override;
33 virtual void reference(StoreEntry &) override;
34 virtual bool dereference(StoreEntry &e) override;
35 virtual void updateHeaders(StoreEntry *) override;
36 virtual void maintain() override;
37 virtual bool anchorCollapsed(StoreEntry &e, bool &inSync) override;
38 virtual bool updateCollapsed(StoreEntry &e) override;
39 virtual void markForUnlink(StoreEntry &) override;
40 virtual void unlink(StoreEntry &) override;
41 virtual int callback() override;
42
43 private:
44 /* migration logic */
45 SwapDir *store(int const x) const;
46 SwapDir &dir(int const idx) const;
47 };
48
49 } // namespace Store
50
51 /* Store::Disks globals that should be converted to use RegisteredRunner */
52 void storeDirOpenSwapLogs(void);
53 int storeDirWriteCleanLogs(int reopen);
54 void storeDirCloseSwapLogs(void);
55
56 /* Globals that should be converted to static Store::Disks methods */
57 void allocate_new_swapdir(Store::DiskConfig *swap);
58 void free_cachedir(Store::DiskConfig *swap);
59
60 /* Globals that should be converted to Store::Disks private data members */
61 typedef int STDIRSELECT(const StoreEntry *e);
62 extern STDIRSELECT *storeDirSelectSwapDir;
63
64 /* Globals that should be moved to some Store::UFS-specific logging module */
65 void storeDirSwapLog(const StoreEntry *e, int op);
66
67 #endif /* SQUID_STORE_DISKS_H */
68