]> git.ipfire.org Git - thirdparty/squid.git/blob - src/fs/Module.cc
4668e6751f9c17c0e3b6240a60f85eac073547f3
[thirdparty/squid.git] / src / fs / Module.cc
1 #include "squid.h"
2 #include "Module.h"
3 #if defined(HAVE_FS_UFS) || defined(HAVE_FS_AUFS) || defined(HAVE_FS_DISKD)
4 #include "fs/ufs/StoreFSufs.h"
5 #include "fs/ufs/UFSSwapDir.h"
6 #endif
7
8 #if HAVE_FS_COSS
9 #include "fs/coss/StoreFScoss.h"
10 #endif
11
12 #if HAVE_FS_UFS
13 static Fs::Ufs::StoreFSufs<Fs::Ufs::UFSSwapDir> *UfsInstance;
14 #endif
15
16 #if HAVE_FS_AUFS
17 static Fs::Ufs::StoreFSufs<Fs::Ufs::UFSSwapDir> *AufsInstance;
18 #endif
19
20
21 #if HAVE_FS_DISKD
22 static Fs::Ufs::StoreFSufs<Fs::Ufs::UFSSwapDir> *DiskdInstance;
23 #endif
24
25 #if HAVE_FS_ROCK
26 #include "fs/rock/RockStoreFileSystem.h"
27 static Rock::StoreFileSystem *RockInstance = NULL;
28 #endif
29
30
31 /* TODO: Modify coss code to:
32 * (a) remove the StoreFScoss::GetInstance method,
33 * (b) declare the StoreFScoss::stats as static and
34 * (c) merge the StoreFScoss::stat() method with the static
35 * StoreFScoss::Stats() */
36 #if HAVE_FS_COSS
37 StoreFScoss &CossInstance = StoreFScoss::GetInstance();
38 #endif
39
40
41 void Fs::Init()
42 {
43
44 #if HAVE_FS_UFS
45 UfsInstance = new Fs::Ufs::StoreFSufs<Fs::Ufs::UFSSwapDir>("Blocking", "ufs");
46 #endif
47
48 #if HAVE_FS_AUFS
49 AufsInstance = new Fs::Ufs::StoreFSufs<Fs::Ufs::UFSSwapDir>("DiskThreads", "aufs");;
50 #endif
51
52
53 #if HAVE_FS_DISKD
54 DiskdInstance = new Fs::Ufs::StoreFSufs<Fs::Ufs::UFSSwapDir>("DiskDaemon", "diskd");;
55 #endif
56
57 #if HAVE_FS_ROCK
58 RockInstance = new Rock::StoreFileSystem();
59 #endif
60
61 }
62
63
64 void Fs::Clean()
65 {
66 #if HAVE_FS_UFS
67 delete UfsInstance;
68 #endif
69
70 #if HAVE_FS_AUFS
71 delete AufsInstance;
72 #endif
73
74
75 #if HAVE_FS_DISKD
76 delete DiskdInstance;
77 #endif
78
79 #if HAVE_FS_ROCK
80 delete RockInstance;
81 #endif
82
83 }