]> git.ipfire.org Git - thirdparty/squid.git/blame - src/StoreFileSystem.cc
SourceFormat Enforcement
[thirdparty/squid.git] / src / StoreFileSystem.cc
CommitLineData
59b2d47f 1/*
4ac4a490 2 * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
26ac0430 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.
59b2d47f 7 */
8
bbc27441
AJ
9/* DEBUG: section 92 Storage File System */
10
582c2af2 11#include "squid.h"
59b2d47f 12#include "StoreFileSystem.h"
13
81481ec0 14std::vector<StoreFileSystem*> *StoreFileSystem::_FileSystems = NULL;
59b2d47f 15
62ee09ca 16void
ff82835a 17StoreFileSystem::RegisterAllFsWithCacheManager(void)
62ee09ca 18{
19 for (iterator i = GetFileSystems().begin(); i != GetFileSystems().end(); ++i)
15fab853 20 (*i)->registerWithCacheManager();
62ee09ca 21}
22
59b2d47f 23void
24StoreFileSystem::SetupAllFs()
25{
26 for (iterator i = GetFileSystems().begin(); i != GetFileSystems().end(); ++i)
27 /* Call the FS to set up capabilities and initialize the FS driver */
28 (*i)->setup();
29}
30
31void
32StoreFileSystem::FsAdd(StoreFileSystem &instance)
33{
34 iterator i = GetFileSystems().begin();
35
36 while (i != GetFileSystems().end()) {
37 assert(strcmp((*i)->type(), instance.type()) != 0);
38 ++i;
39 }
40
41 GetFileSystems().push_back (&instance);
42}
43
81481ec0 44std::vector<StoreFileSystem *> const &
59b2d47f 45StoreFileSystem::FileSystems()
46{
47 return GetFileSystems();
48}
49
81481ec0 50std::vector<StoreFileSystem*> &
59b2d47f 51StoreFileSystem::GetFileSystems()
52{
53 if (!_FileSystems)
81481ec0 54 _FileSystems = new std::vector<StoreFileSystem *>;
59b2d47f 55
56 return *_FileSystems;
57}
58
59/*
60 * called when a graceful shutdown is to occur
61 * of each fs module.
62 */
63void
64StoreFileSystem::FreeAllFs()
65{
385acf91 66 while (!GetFileSystems().empty()) {
59b2d47f 67 StoreFileSystem *fs = GetFileSystems().back();
68 GetFileSystems().pop_back();
69 fs->done();
70 }
71}
72
62ee09ca 73/* no filesystem is required to export statistics */
74void
15fab853 75StoreFileSystem::registerWithCacheManager(void)
62ee09ca 76{}
f53969cc 77