GCC Code Coverage Report


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