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