GCC Code Coverage Report


Directory: cvmfs/
File: cvmfs/mountpoint.h
Date: 2026-08-09 02:40:25
Exec Total Coverage
Lines: 55 130 42.3%
Branches: 1 2 50.0%

Line Branch Exec Source
1 /**
2 * This file is part of the CernVM File System.
3 *
4 * Steers the booting of CernVM-FS repositories.
5 */
6
7 #ifndef CVMFS_MOUNTPOINT_H_
8 #define CVMFS_MOUNTPOINT_H_
9
10 #include <pthread.h>
11 #include <sys/statvfs.h>
12 #include <unistd.h>
13
14 #include <ctime>
15 #include <set>
16 #include <string>
17 #include <vector>
18
19 #include "cache.h"
20 #include "crypto/hash.h"
21 #include "path_filters/inclusion_spec.h"
22 #include "duplex_testing.h"
23 #include "file_watcher.h"
24 #include "loader.h"
25 #include "magic_xattr.h"
26 #include "util/algorithm.h"
27
28 class AuthzAttachment;
29 class AuthzFetcher;
30 class AuthzSessionManager;
31 class BackoffThrottle;
32 class BundleMgr;
33 class CacheManager;
34 namespace catalog {
35 class ClientCatalogManager;
36 class InodeAnnotation;
37 } // namespace catalog
38 struct ChunkTables;
39 namespace cvmfs {
40 class Fetcher;
41 class Uuid;
42 } // namespace cvmfs
43 namespace download {
44 class DownloadManager;
45 }
46 namespace glue {
47 class InodeTracker;
48 class DentryTracker;
49 class PageCacheTracker;
50 } // namespace glue
51 namespace lru {
52 class InodeCache;
53 class Md5PathCache;
54 class PathCache;
55 } // namespace lru
56 class NfsMaps;
57 class OptionsManager;
58 namespace perf {
59 class Counter;
60 class Statistics;
61 class TelemetryAggregator;
62 } // namespace perf
63 namespace signature {
64 class SignatureManager;
65 }
66 class SimpleChunkTables;
67 class Tracer;
68
69
70 /**
71 * Construction of FileSystem and MountPoint can go wrong. In this case, we'd
72 * like to know why. This is a base class for both FileSystem and MountPoint.
73 */
74 class BootFactory {
75 public:
76 4022 BootFactory() : boot_status_(loader::kFailUnknown) { }
77 189 bool IsValid() { return boot_status_ == loader::kFailOk; }
78 3085 loader::Failures boot_status() { return boot_status_; }
79 48 std::string boot_error() { return boot_error_; }
80
81 /**
82 * Used in the fuse module to artificially set boot errors that are specific
83 * to the fuse boot procedure.
84 */
85 void set_boot_status(loader::Failures code) { boot_status_ = code; }
86
87 protected:
88 loader::Failures boot_status_;
89 std::string boot_error_;
90 };
91
92
93 /**
94 * The FileSystem object initializes cvmfs' global state. It sets up sqlite and
95 * the cache directory and it can contain multiple mount points. It currently
96 * does so only for libcvmfs; the cvmfs fuse module has exactly one FileSystem
97 * object and one MountPoint object.
98 */
99 class FileSystem : SingleCopy, public BootFactory {
100 FRIEND_TEST(T_MountPoint, MkCacheParm);
101 FRIEND_TEST(T_MountPoint, CacheSettings);
102 FRIEND_TEST(T_MountPoint, CheckInstanceName);
103 FRIEND_TEST(T_MountPoint, CheckPosixCacheSettings);
104 FRIEND_TEST(T_Cvmfs, Basics);
105 /**
106 * The mockfuse unit tests drive the fuse callbacks against a FileSystem that
107 * is constructed rather than booted: no sqlite VFS, no workspace, no cache
108 * directory. See test/unittests/mockfuse/mock_mountpoint.h.
109 */
110 friend class MockFileSystem;
111
112 public:
113 enum Type {
114 kFsFuse = 0,
115 kFsLibrary
116 };
117
118 struct FileSystemInfo {
119 1503 FileSystemInfo()
120 3006 : type(kFsFuse)
121 1503 , options_mgr(NULL)
122 1503 , wait_workspace(false)
123 1503 , foreground(false) { }
124 /**
125 * Name can is used to identify this particular instance of cvmfs in the
126 * cache (directory). Normally it is the fully qualified repository name.
127 * For libcvmfs and in other special mount conditions, it can be something
128 * else. Only file systems with different names can share a cache because
129 * the name is part of a lock file.
130 */
131 std::string name;
132
133 /**
134 * Used to fork & execve into different flavors of the binary, e.g. the
135 * quota manager.
136 */
137 std::string exe_path;
138
139 /**
140 * Fuse mount point or libcvmfs.
141 */
142 Type type;
143
144 /**
145 * All further configuration has to be present in the options manager.
146 */
147 OptionsManager *options_mgr;
148
149 /**
150 * Decides if FileSystem construction should block if the workspace is
151 * currently taken. This is used to coordinate fuse mounts where the next
152 * mount happens while the previous fuse module is not yet fully cleaned
153 * up.
154 */
155 bool wait_workspace;
156 /**
157 * The fuse module should not daemonize. That means the quota manager
158 * should not daemonize, too, but print debug messages to stdout.
159 */
160 bool foreground;
161 };
162
163 /**
164 * Keeps information about I/O errors, e.g. writing local files, permanent
165 * network errors, etc. It counts the number of errors and the timestamp
166 * of the latest errors for consumption by monitoring tools such as Nagios
167 */
168 class IoErrorInfo {
169 public:
170 IoErrorInfo();
171
172 void Reset();
173 void AddIoError();
174 void SetCounter(perf::Counter *c);
175 int64_t count();
176 time_t timestamp_last();
177
178 private:
179 perf::Counter *counter_;
180 time_t timestamp_last_;
181 };
182
183 /**
184 * No NFS maps.
185 */
186 static const unsigned kNfsNone = 0x00;
187 /**
188 * Normal NFS maps by leveldb
189 */
190 static const unsigned kNfsMaps = 0x01;
191 /**
192 * NFS maps maintained by sqlite so that they can reside on an NFS mount
193 */
194 static const unsigned kNfsMapsHa = 0x02;
195
196 static FileSystem *Create(const FileSystemInfo &fs_info);
197 ~FileSystem();
198
199 // Used to setup logging before the file system object is created
200 static void SetupLoggingStandalone(const OptionsManager &options_mgr,
201 const std::string &prefix);
202
203 1666 bool IsNfsSource() { return nfs_mode_ & kNfsMaps; }
204 44 bool IsHaNfsSource() { return nfs_mode_ & kNfsMapsHa; }
205 void ResetErrorCounters();
206 void TearDown2ReadOnly();
207 void RemapCatalogFd(int from, int to);
208
209 // Used in cvmfs' RestoreState to prevent change of cache manager type
210 // during reload
211 void ReplaceCacheManager(CacheManager *new_cache_mgr);
212
213 3703 CacheManager *cache_mgr() { return cache_mgr_; }
214 264 std::string cache_mgr_instance() { return cache_mgr_instance_; }
215 std::string exe_path() { return exe_path_; }
216 88 bool found_previous_crash() { return found_previous_crash_; }
217 Log2Histogram *hist_fs_lookup() { return hist_fs_lookup_; }
218 Log2Histogram *hist_fs_forget() { return hist_fs_forget_; }
219 Log2Histogram *hist_fs_forget_multi() { return hist_fs_forget_multi_; }
220 Log2Histogram *hist_fs_getattr() { return hist_fs_getattr_; }
221 Log2Histogram *hist_fs_readlink() { return hist_fs_readlink_; }
222 Log2Histogram *hist_fs_opendir() { return hist_fs_opendir_; }
223 Log2Histogram *hist_fs_releasedir() { return hist_fs_releasedir_; }
224 Log2Histogram *hist_fs_readdir() { return hist_fs_readdir_; }
225 Log2Histogram *hist_fs_open() { return hist_fs_open_; }
226 Log2Histogram *hist_fs_read() { return hist_fs_read_; }
227 Log2Histogram *hist_fs_release() { return hist_fs_release_; }
228
229 perf::Counter *n_fs_dir_open() { return n_fs_dir_open_; }
230 perf::Counter *n_fs_forget() { return n_fs_forget_; }
231 perf::Counter *n_fs_inode_replace() { return n_fs_inode_replace_; }
232 perf::Counter *n_fs_lookup() { return n_fs_lookup_; }
233 perf::Counter *n_fs_lookup_negative() { return n_fs_lookup_negative_; }
234 perf::Counter *n_fs_open() { return n_fs_open_; }
235 perf::Counter *n_fs_read() { return n_fs_read_; }
236 perf::Counter *n_fs_readlink() { return n_fs_readlink_; }
237 381 perf::Counter *n_fs_stat() { return n_fs_stat_; }
238 perf::Counter *n_fs_stat_stale() { return n_fs_stat_stale_; }
239 perf::Counter *n_fs_statfs() { return n_fs_statfs_; }
240 perf::Counter *n_fs_statfs_cached() { return n_fs_statfs_cached_; }
241 IoErrorInfo *io_error_info() { return &io_error_info_; }
242 1417 std::string name() { return name_; }
243 NfsMaps *nfs_maps() { return nfs_maps_; }
244 perf::Counter *no_open_dirs() { return no_open_dirs_; }
245 perf::Counter *no_open_files() { return no_open_files_; }
246 perf::Counter *n_eio_total() { return n_eio_total_; }
247 perf::Counter *n_eio_01() { return n_eio_01_; }
248 perf::Counter *n_eio_02() { return n_eio_02_; }
249 perf::Counter *n_eio_03() { return n_eio_03_; }
250 perf::Counter *n_eio_04() { return n_eio_04_; }
251 perf::Counter *n_eio_05() { return n_eio_05_; }
252 perf::Counter *n_eio_06() { return n_eio_06_; }
253 perf::Counter *n_eio_07() { return n_eio_07_; }
254 perf::Counter *n_eio_08() { return n_eio_08_; }
255 perf::Counter *n_emfile() { return n_emfile_; }
256 3999 OptionsManager *options_mgr() { return options_mgr_; }
257 1461 perf::Statistics *statistics() { return statistics_; }
258 3179 Type type() { return type_; }
259 1505 cvmfs::Uuid *uuid_cache() { return uuid_cache_; }
260 2634 std::string workspace() { return workspace_; }
261
262 protected:
263 void SetHasCustomVfs(bool setting) { has_custom_sqlitevfs_ = setting; }
264
265 private:
266 /**
267 * Only one instance may be alive at any given time
268 */
269 static bool g_alive;
270 static const char *kDefaultCacheBase; // /var/lib/cvmfs
271 static const unsigned kDefaultQuotaLimit = 1024 * 1024 * 1024; // 1GB
272 static const unsigned kDefaultNfiles = 8192; // if CVMFS_NFILES is unset
273 static const char *kDefaultCacheMgrInstance; // "default"
274
275 struct PosixCacheSettings {
276 2192 PosixCacheSettings()
277 2192 : is_shared(false)
278 2192 , is_alien(false)
279 2192 , is_managed(false)
280 2192 , avoid_rename(false)
281 2192 , cache_base_defined(false)
282 2192 , cache_dir_defined(false)
283 2192 , quota_limit(0)
284 2192 , do_refcount(true)
285 2192 , cleanup_unused_first(false) { }
286 bool is_shared;
287 bool is_alien;
288 bool is_managed;
289 bool avoid_rename;
290 bool cache_base_defined;
291 bool cache_dir_defined;
292 /**
293 * Soft limit in bytes for the cache. The quota manager removes half the
294 * cache when the limit is exceeded.
295 */
296 int64_t quota_limit;
297 bool do_refcount;
298 bool cleanup_unused_first;
299 std::string cache_path;
300 /**
301 * Different from cache_path only if CVMFS_WORKSPACE or
302 * CVMFS_CACHE_WORKSPACE is set.
303 */
304 std::string workspace;
305 };
306
307 static void LogSqliteError(void *user_data __attribute__((unused)),
308 int sqlite_extended_error,
309 const char *message);
310
311 explicit FileSystem(const FileSystemInfo &fs_info);
312
313 void SetupLogging();
314 void CreateStatistics();
315 void SetupSqlite();
316 bool DetermineNfsMode();
317 bool SetupWorkspace();
318 bool SetupCwd();
319 bool LockWorkspace();
320 bool SetupCrashGuard();
321 bool SetupNfsMaps();
322 void SetupUuid();
323
324 std::string MkCacheParm(const std::string &generic_parameter,
325 const std::string &instance);
326 bool CheckInstanceName(const std::string &instance);
327 bool TriageCacheMgr();
328 CacheManager *SetupCacheMgr(const std::string &instance);
329 CacheManager *SetupPosixCacheMgr(const std::string &instance);
330 CacheManager *SetupRamCacheMgr(const std::string &instance);
331 CacheManager *SetupTieredCacheMgr(const std::string &instance);
332 CacheManager *SetupExternalCacheMgr(const std::string &instance);
333 PosixCacheSettings DeterminePosixCacheSettings(const std::string &instance);
334 bool CheckPosixCacheSettings(const PosixCacheSettings &settings);
335 bool SetupPosixQuotaMgr(const PosixCacheSettings &settings,
336 CacheManager *cache_mgr);
337
338 // See FileSystemInfo for the following fields
339 std::string name_;
340 std::string exe_path_;
341 Type type_;
342 /**
343 * Not owned by the FileSystem object
344 */
345 OptionsManager *options_mgr_;
346 bool wait_workspace_;
347 bool foreground_;
348
349 perf::Counter *n_fs_open_;
350 perf::Counter *n_fs_dir_open_;
351 perf::Counter *n_fs_lookup_;
352 perf::Counter *n_fs_lookup_negative_;
353 perf::Counter *n_fs_stat_;
354 perf::Counter *n_fs_stat_stale_;
355 perf::Counter *n_fs_statfs_;
356 perf::Counter *n_fs_statfs_cached_;
357 perf::Counter *n_fs_read_;
358 perf::Counter *n_fs_readlink_;
359 perf::Counter *n_fs_forget_;
360 perf::Counter *n_fs_inode_replace_;
361 perf::Counter *no_open_files_;
362 perf::Counter *no_open_dirs_;
363 perf::Counter *n_eio_total_;
364 perf::Counter *n_eio_01_;
365 perf::Counter *n_eio_02_;
366 perf::Counter *n_eio_03_;
367 perf::Counter *n_eio_04_;
368 perf::Counter *n_eio_05_;
369 perf::Counter *n_eio_06_;
370 perf::Counter *n_eio_07_;
371 perf::Counter *n_eio_08_;
372 perf::Counter *n_emfile_;
373 IoErrorInfo io_error_info_;
374 perf::Statistics *statistics_;
375
376 Log2Histogram *hist_fs_lookup_;
377 Log2Histogram *hist_fs_forget_;
378 Log2Histogram *hist_fs_forget_multi_;
379 Log2Histogram *hist_fs_getattr_;
380 Log2Histogram *hist_fs_readlink_;
381 Log2Histogram *hist_fs_opendir_;
382 Log2Histogram *hist_fs_releasedir_;
383 Log2Histogram *hist_fs_readdir_;
384 Log2Histogram *hist_fs_open_;
385 Log2Histogram *hist_fs_read_;
386 Log2Histogram *hist_fs_release_;
387
388 /**
389 * A writeable local directory. Only small amounts of data (few bytes) will
390 * be stored here. Needed because the cache can be read-only. The workspace
391 * and the cache directory can be identical. A workspace can be shared among
392 * FileSystem instances if their name is different.
393 */
394 std::string workspace_;
395 /**
396 * During setup, the fuse module changes its working directory to workspace.
397 * Afterwards, workspace_ is ".". Store the original one in
398 * workspace_fullpath_
399 */
400 std::string workspace_fullpath_;
401 int fd_workspace_lock_;
402 std::string path_workspace_lock_;
403
404 /**
405 * An empty file that is removed on proper shutdown.
406 */
407 std::string path_crash_guard_;
408
409 /**
410 * A crash guard was found, thus we assume the file system was not shutdown
411 * properly last time.
412 */
413 bool found_previous_crash_;
414
415 /**
416 * Only needed for fuse to detect and prevent double mounting at the same
417 * location.
418 */
419 std::string mountpoint_;
420 /**
421 * The user-provided name of the parimay cache manager or 'default' if none
422 * is specified.
423 */
424 std::string cache_mgr_instance_;
425 /**
426 * Keep track of all the cache instances to detect circular definitions with
427 * the tiered cache.
428 */
429 std::set<std::string> constructed_instances_;
430 std::string nfs_maps_dir_;
431 /**
432 * Combination of kNfs... flags
433 */
434 unsigned nfs_mode_;
435 CacheManager *cache_mgr_;
436 /**
437 * Persistent for the cache directory + name combination. It is used in the
438 * Geo-API to allow for per-client responses when no proxy is used.
439 */
440 cvmfs::Uuid *uuid_cache_;
441
442 /**
443 * TODO(jblomer): Move to MountPoint. Tricky because of the sqlite maps
444 * and the sqlite configuration done for the file catalogs.
445 */
446 NfsMaps *nfs_maps_;
447 /**
448 * Used internally to remember if the Sqlite memory manager need to be shut
449 * down.
450 */
451 bool has_custom_sqlitevfs_;
452 };
453
454 /**
455 * The StatfsCache class is a class purely designed as "struct" (= holding
456 * object for all its parameters).
457 * All its logic, including the locking mechanism, is implemented in the
458 * function cvmfs_statfs in cvmfs.cc
459 */
460 class StatfsCache : SingleCopy {
461 public:
462 689 explicit StatfsCache(uint64_t cacheValid)
463 689 : expiry_deadline_(0), cache_timeout_(cacheValid) {
464 689 memset(&info_, 0, sizeof(info_));
465 689 lock_ = reinterpret_cast<pthread_mutex_t *>(
466 689 smalloc(sizeof(pthread_mutex_t)));
467 689 const int retval = pthread_mutex_init(lock_, NULL);
468
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 689 times.
689 assert(retval == 0);
469 689 }
470 689 ~StatfsCache() {
471 689 pthread_mutex_destroy(lock_);
472 689 free(lock_);
473 689 }
474 uint64_t *expiry_deadline() { return &expiry_deadline_; }
475 const uint64_t cache_timeout() { return cache_timeout_; }
476 struct statvfs *info() { return &info_; }
477 pthread_mutex_t *lock() { return lock_; }
478
479 private:
480 pthread_mutex_t *lock_;
481 // Timestamp/deadline when the currently cached statvfs info_ becomes invalid
482 uint64_t expiry_deadline_;
483 // Time in seconds how long statvfs info_ should be cached
484 uint64_t cache_timeout_;
485 struct statvfs info_;
486 };
487
488 /**
489 * A MountPoint provides a clip around all the different *Manager objects that
490 * in combination represent a mounted cvmfs repository. Its main purpose is
491 * the controlled construction and deconstruction of the involved ensemble of
492 * classes based on the information passed from an options manager.
493 *
494 * A MountPoint is constructed on top of a successfully constructed FileSystem.
495 *
496 * We use pointers to manager classes to make the order of construction and
497 * destruction explicit and also to keep the include list for this header small.
498 */
499 class MountPoint : SingleCopy, public BootFactory {
500 friend class T_BundleMgr;
501 /**
502 * The mockfuse unit tests drive the fuse callbacks against a MountPoint that
503 * is constructed rather than booted, so that no signature manager, download
504 * manager or catalog is needed. The test double fills in the members the
505 * callbacks under test dereference.
506 * See test/unittests/mockfuse/mock_mountpoint.h.
507 */
508 friend class MockMountPoint;
509
510 public:
511 /**
512 * If catalog reload fails, try again in 3 minutes
513 */
514 static const unsigned kShortTermTTL = 180;
515 static const time_t kIndefiniteDeadline = time_t(-1);
516
517 static MountPoint *Create(const std::string &fqrn,
518 FileSystem *file_system,
519 OptionsManager *options_mgr = NULL);
520 ~MountPoint();
521
522 // Check whether permission is needed to read from user process environment
523 static bool NeedsReadEnviron(OptionsManager *omgr);
524
525 unsigned GetMaxTtlMn();
526 unsigned GetEffectiveTtlSec();
527 void SetMaxTtlMn(unsigned value_minutes);
528 void SetMaxTtlSec(unsigned value_secs);
529 void ReEvaluateAuthz();
530
531 AuthzSessionManager *authz_session_mgr() { return authz_session_mgr_; }
532 BackoffThrottle *backoff_throttle() { return backoff_throttle_; }
533 /**
534 * The file bundle prefetcher; NULL unless CVMFS_PREFETCH_FILEBUNDLES is on.
535 */
536 128 BundleMgr *bundle_mgr() { return bundle_mgr_; }
537 821 catalog::ClientCatalogManager *catalog_mgr() { return catalog_mgr_; }
538 ChunkTables *chunk_tables() { return chunk_tables_; }
539 146 download::DownloadManager *download_mgr() { return download_mgr_; }
540 176 download::DownloadManager *external_download_mgr() {
541 176 return external_download_mgr_;
542 }
543 download::DownloadManager *full_replica_download_mgr() {
544 return full_replica_download_mgr_;
545 }
546 file_watcher::FileWatcher *resolv_conf_watcher() {
547 return resolv_conf_watcher_;
548 }
549 1141 cvmfs::Fetcher *fetcher() { return fetcher_; }
550 bool fixed_catalog() { return fixed_catalog_; }
551 1181 std::string fqrn() const { return fqrn_; }
552 // TODO(jblomer): use only a singler fetcher object
553 cvmfs::Fetcher *external_fetcher() { return external_fetcher_; }
554 AuthzFetcher *authz_fetcher() { return authz_fetcher_; };
555 1274 FileSystem *file_system() { return file_system_; }
556 MagicXattrManager *magic_xattr_mgr() { return magic_xattr_mgr_; }
557 48 bool has_membership_req() { return has_membership_req_; }
558 bool enforce_acls() { return enforce_acls_; }
559 bool cache_symlinks() { return cache_symlinks_; }
560 bool fuse_expire_entry() { return fuse_expire_entry_; }
561 catalog::InodeAnnotation *inode_annotation() { return inode_annotation_; }
562 glue::InodeTracker *inode_tracker() { return inode_tracker_; }
563 lru::InodeCache *inode_cache() { return inode_cache_; }
564 double kcache_timeout_sec() { return kcache_timeout_sec_; }
565 726 lru::Md5PathCache *md5path_cache() { return md5path_cache_; }
566 std::string membership_req() { return membership_req_; }
567 glue::DentryTracker *dentry_tracker() { return dentry_tracker_; }
568 glue::PageCacheTracker *page_cache_tracker() { return page_cache_tracker_; }
569 lru::PathCache *path_cache() { return path_cache_; }
570 std::string repository_tag() { return repository_tag_; }
571 SimpleChunkTables *simple_chunk_tables() { return simple_chunk_tables_; }
572 3255 perf::Statistics *statistics() { return statistics_; }
573 perf::TelemetryAggregator *telemetry_aggr() { return telemetry_aggr_; }
574 1085 signature::SignatureManager *signature_mgr() { return signature_mgr_; }
575 uid_t talk_socket_uid() { return talk_socket_uid_; }
576 gid_t talk_socket_gid() { return talk_socket_gid_; }
577 std::string talk_socket_path() { return talk_socket_path_; }
578 Tracer *tracer() { return tracer_; }
579 cvmfs::Uuid *uuid() { return uuid_; }
580 StatfsCache *statfs_cache() { return statfs_cache_; }
581
582 /**
583 * Returns the partial replication inclusion spec if this mount point is
584 * connected to a partial Stratum-1, or NULL otherwise. Not owned by caller.
585 */
586 catalog::InclusionSpec *partial_inclusion_spec() const {
587 return partial_inclusion_spec_;
588 }
589
590 /**
591 * Returns true if the partial replica mode is "fail" (return EIO for missing
592 * objects instead of failing over to a full replica).
593 */
594 bool partial_replica_fail_mode() const { return partial_replica_fail_mode_; }
595
596 bool ReloadBlacklists();
597 void DisableCacheSymlinks();
598 void EnableFuseExpireEntry();
599
600 MountPoint(const std::string &fqrn,
601 FileSystem *file_system,
602 OptionsManager *options_mgr);
603
604 private:
605 /**
606 * The maximum TTL can be used to cap a root catalogs registered ttl. By
607 * default this is disabled (= 0).
608 */
609 static const unsigned kDefaultMaxTtlSec = 0;
610 /**
611 * Let fuse cache dentries for 1 minute.
612 */
613 static const unsigned kDefaultKCacheTtlSec = 60;
614 /**
615 * Number of Md5Path entries in the libcvmfs cache.
616 */
617 static const unsigned kLibPathCacheSize = 32000;
618 /**
619 * Cache seven times more md5 paths than inodes in the fuse module.
620 */
621 static const unsigned kInodeCacheFactor = 7;
622 /**
623 * Default to 16M RAM for meta-data caches; does not include the inode tracker
624 */
625 static const unsigned kDefaultMemcacheSize = 16 * 1024 * 1024;
626 /**
627 * Where to look for external authz helpers.
628 */
629 static const char *kDefaultAuthzSearchPath; // "/usr/libexec/cvmfs/authz"
630 /**
631 * Maximum number of concurrent HTTP connections.
632 */
633 static const unsigned kDefaultNumConnections = 16;
634 /**
635 * Default network timeout
636 */
637 static const unsigned kDefaultTimeoutSec = 5;
638 static const unsigned kDefaultRetries = 1;
639 static const unsigned kDefaultBackoffInitMs = 2000;
640 static const unsigned kDefaultBackoffMaxMs = 10000;
641 /**
642 * Memory buffer sizes for an activated tracer
643 */
644 static const unsigned kTracerBufferSize = 8192;
645 static const unsigned kTracerFlushThreshold = 7000;
646 static const char *kDefaultBlacklist; // "/etc/cvmfs/blacklist"
647 /**
648 * Default values for telemetry aggregator
649 */
650 static const int kDefaultTelemetrySendRateSec = 5 * 60; // 5min
651 static const int kMinimumTelemetrySendRateSec = 5; // 5sec
652
653
654 void CreateStatistics();
655 void CreateAuthz();
656 void CreateBundleMgr();
657 bool CreateSignatureManager();
658 bool CheckBlacklists();
659 bool CreateDownloadManagers();
660 bool CreateResolvConfWatcher();
661 void CreateFetchers();
662 void SetupPartialReplica();
663 bool CreateCatalogManager();
664 void CreateTables();
665 bool CreateTracer();
666 bool SetupBehavior();
667 void SetupDnsTuning(download::DownloadManager *manager);
668 void SetupHttpTuning();
669 bool SetupExternalDownloadMgr(bool dogeosort);
670 void SetupInodeAnnotation();
671 bool SetupOwnerMaps();
672 bool DetermineRootHash(shash::Any *root_hash);
673 bool FetchHistory(std::string *history_path);
674 std::string ReplaceHosts(std::string hosts);
675 std::string GetUniqFileSuffix();
676
677 std::string fqrn_;
678 cvmfs::Uuid *uuid_;
679 /**
680 * In contrast to the manager objects, the FileSystem is not owned.
681 */
682 FileSystem *file_system_;
683 /**
684 * The options manager is not owned.
685 */
686 OptionsManager *options_mgr_;
687
688 perf::Statistics *statistics_;
689 perf::TelemetryAggregator *telemetry_aggr_;
690 AuthzFetcher *authz_fetcher_;
691 AuthzSessionManager *authz_session_mgr_;
692 AuthzAttachment *authz_attachment_;
693 BackoffThrottle *backoff_throttle_;
694 signature::SignatureManager *signature_mgr_;
695 download::DownloadManager *download_mgr_;
696 download::DownloadManager *external_download_mgr_;
697 /**
698 * Optional download manager targeting a full Stratum-1, used as a fallback
699 * when this mount point's primary server is a partial replica. Owned.
700 */
701 download::DownloadManager *full_replica_download_mgr_;
702 cvmfs::Fetcher *fetcher_;
703 cvmfs::Fetcher *external_fetcher_;
704 /**
705 * Parsed inclusion spec downloaded from the partial Stratum-1, or NULL.
706 */
707 catalog::InclusionSpec *partial_inclusion_spec_;
708 /** True when partial replica mode is "fail" (vs. "failover"). */
709 bool partial_replica_fail_mode_;
710 catalog::InodeAnnotation *inode_annotation_;
711 catalog::ClientCatalogManager *catalog_mgr_;
712 /**
713 * File bundle prefetcher, NULL unless CVMFS_PREFETCH_FILEBUNDLES is on.
714 * Owns background threads that use catalog_mgr_ and the fetchers, so it
715 * must be destroyed before them.
716 */
717 BundleMgr *bundle_mgr_;
718 ChunkTables *chunk_tables_;
719 SimpleChunkTables *simple_chunk_tables_;
720 lru::InodeCache *inode_cache_;
721 lru::PathCache *path_cache_;
722 lru::Md5PathCache *md5path_cache_;
723 Tracer *tracer_;
724 glue::InodeTracker *inode_tracker_;
725 glue::DentryTracker *dentry_tracker_;
726 glue::PageCacheTracker *page_cache_tracker_;
727 MagicXattrManager *magic_xattr_mgr_;
728 StatfsCache *statfs_cache_;
729
730 file_watcher::FileWatcher *resolv_conf_watcher_;
731
732 unsigned max_ttl_sec_;
733 pthread_mutex_t lock_max_ttl_;
734 double kcache_timeout_sec_;
735 bool fixed_catalog_;
736 bool enforce_acls_;
737 bool cache_symlinks_;
738 bool fuse_expire_entry_;
739 std::string repository_tag_;
740 std::vector<std::string> blacklist_paths_;
741
742 // TODO(jblomer): this should go in the catalog manager
743 std::string membership_req_;
744 bool has_membership_req_;
745
746 std::string talk_socket_path_;
747 uid_t talk_socket_uid_;
748 gid_t talk_socket_gid_;
749 }; // class MointPoint
750
751 #endif // CVMFS_MOUNTPOINT_H_
752
753