StoreFileSystem.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2017 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 /* DEBUG: section 92 Storage File System */
10 
11 #include "squid.h"
12 #include "StoreFileSystem.h"
13 
14 std::vector<StoreFileSystem*> *StoreFileSystem::_FileSystems = NULL;
15 
16 void
18 {
19  for (iterator i = GetFileSystems().begin(); i != GetFileSystems().end(); ++i)
20  (*i)->registerWithCacheManager();
21 }
22 
23 void
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 
31 void
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 
44 std::vector<StoreFileSystem *> const &
46 {
47  return GetFileSystems();
48 }
49 
50 std::vector<StoreFileSystem*> &
52 {
53  if (!_FileSystems)
54  _FileSystems = new std::vector<StoreFileSystem *>;
55 
56  return *_FileSystems;
57 }
58 
59 /*
60  * called when a graceful shutdown is to occur
61  * of each fs module.
62  */
63 void
65 {
66  while (!GetFileSystems().empty()) {
67  StoreFileSystem *fs = GetFileSystems().back();
68  GetFileSystems().pop_back();
69  fs->done();
70  }
71 }
72 
73 /* no filesystem is required to export statistics */
74 void
76 {}
77 
#define assert(EX)
Definition: assert.h:17
virtual char const * type() const =0
static void FreeAllFs()
static void RegisterAllFsWithCacheManager(void)
int i
Definition: membanger.c:49
std::vector< StoreFileSystem * >::iterator iterator
static std::vector< StoreFileSystem * > const & FileSystems()
static void SetupAllFs()
virtual void registerWithCacheManager(void)
static std::vector< StoreFileSystem * > * _FileSystems
static std::vector< StoreFileSystem * > & GetFileSystems()
static void FsAdd(StoreFileSystem &)
#define NULL
Definition: types.h:166
virtual void done()=0

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors