CernVM-FS  2.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cvmfs.cc File Reference
#include <sys/xattr.h>
#include "cvmfs_config.h"
#include "cvmfs.h"
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <google/dense_hash_map>
#include <inttypes.h>
#include <pthread.h>
#include <stddef.h>
#include <stdint.h>
#include <sys/errno.h>
#include <sys/file.h>
#include <sys/mount.h>
#include <sys/resource.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <algorithm>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <functional>
#include <map>
#include <new>
#include <string>
#include <utility>
#include <vector>
#include "authz/authz_session.h"
#include "auto_umount.h"
#include "backoff.h"
#include "cache.h"
#include "cache_posix.h"
#include "cache_stream.h"
#include "catalog_mgr_client.h"
#include "clientctx.h"
#include "compat.h"
#include "compression.h"
#include "crypto/crypto_util.h"
#include "crypto/hash.h"
#include "crypto/signature.h"
#include "directory_entry.h"
#include "duplex_fuse.h"
#include "fence.h"
#include "fetch.h"
#include "file_chunk.h"
#include "fuse_inode_gen.h"
#include "fuse_remount.h"
#include "globals.h"
#include "glue_buffer.h"
#include "history_sqlite.h"
#include "interrupt.h"
#include "loader.h"
#include "lru_md.h"
#include "magic_xattr.h"
#include "manifest_fetch.h"
#include "monitor.h"
#include "mountpoint.h"
#include "network/download.h"
#include "nfs_maps.h"
#include "notification_client.h"
#include "options.h"
#include "quota_listener.h"
#include "quota_posix.h"
#include "sanitizer.h"
#include "shortstring.h"
#include "sqlitemem.h"
#include "sqlitevfs.h"
#include "statistics.h"
#include "talk.h"
#include "telemetry_aggregator.h"
#include "tracer.h"
#include "util/algorithm.h"
#include "util/atomic.h"
#include "util/concurrency.h"
#include "util/exception.h"
#include "util/logging.h"
#include "util/platform.h"
#include "util/smalloc.h"
#include "util/uuid.h"
#include "wpad.h"
#include "xattr.h"

Go to the source code of this file.

Classes

struct  cvmfs::DirectoryListing
 
class  cvmfs::FuseInterruptCue
 
struct  cvmfs::FuseState
 
class  ExpiresMagicXattr
 
class  InodeMaxMagicXattr
 
class  MaxFdMagicXattr
 
class  PidMagicXattr
 
class  UptimeMagicXattr
 

Namespaces

 cvmfs
 

Macros

#define ENOATTR   ENODATA
 
#define __STDC_FORMAT_MACROS
 

Typedefs

typedef google::dense_hash_map
< uint64_t, DirectoryListing,
hash_murmur< uint64_t > > 
cvmfs::DirectoryHandles
 

Functions

static bool cvmfs::IncAndCheckNoOpenFiles ()
 
static double cvmfs::GetKcacheTimeout ()
 
void cvmfs::GetReloadStatus (bool *drainout_mode, bool *maintenance_mode)
 
static bool cvmfs::UseWatchdog ()
 
std::string cvmfs::PrintInodeGeneration ()
 
static bool cvmfs::CheckVoms (const fuse_ctx &fctx)
 
static bool cvmfs::MayBeInPageCacheTracker (const catalog::DirectoryEntry &dirent)
 
static bool cvmfs::HasDifferentContent (const catalog::DirectoryEntry &dirent, const shash::Any &hash, const struct stat &info)
 
static bool cvmfs::FixupOpenInode (const PathString &path, catalog::DirectoryEntry *dirent)
 
static bool cvmfs::GetDirentForInode (const fuse_ino_t ino, catalog::DirectoryEntry *dirent)
 
static uint64_t cvmfs::GetDirentForPath (const PathString &path, catalog::DirectoryEntry *dirent)
 
static bool cvmfs::GetPathForInode (const fuse_ino_t ino, PathString *path)
 
static void cvmfs::DoTraceInode (const int event, fuse_ino_t ino, const std::string &msg)
 
static void cvmfs::TraceInode (const int event, fuse_ino_t ino, const std::string &msg)
 
static void cvmfs::cvmfs_lookup (fuse_req_t req, fuse_ino_t parent, const char *name)
 
static void cvmfs::cvmfs_forget (fuse_req_t req, fuse_ino_t ino, uint64_t nlookup)
 
static void cvmfs::ReplyNegative (const catalog::DirectoryEntry &dirent, fuse_req_t req)
 
static void cvmfs::cvmfs_getattr (fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi)
 
static void cvmfs::cvmfs_readlink (fuse_req_t req, fuse_ino_t ino)
 
static void cvmfs::AddToDirListing (const fuse_req_t req, const char *name, const struct stat *stat_info, BigVector< char > *listing)
 
static void cvmfs::cvmfs_opendir (fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi)
 
static void cvmfs::cvmfs_releasedir (fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi)
 
static void cvmfs::ReplyBufferSlice (const fuse_req_t req, const char *buffer, const size_t buffer_size, const off_t offset, const size_t max_size)
 
static void cvmfs::cvmfs_readdir (fuse_req_t req, fuse_ino_t ino, size_t size, off_t off, struct fuse_file_info *fi)
 
static void cvmfs::FillOpenFlags (const glue::PageCacheTracker::OpenDirectives od, struct fuse_file_info *fi)
 
static void cvmfs::cvmfs_open (fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi)
 
static void cvmfs::cvmfs_read (fuse_req_t req, fuse_ino_t ino, size_t size, off_t off, struct fuse_file_info *fi)
 
static void cvmfs::cvmfs_release (fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi)
 
static void cvmfs::cvmfs_statfs (fuse_req_t req, fuse_ino_t ino)
 
static void cvmfs::cvmfs_getxattr (fuse_req_t req, fuse_ino_t ino, const char *name, size_t size)
 
static void cvmfs::cvmfs_listxattr (fuse_req_t req, fuse_ino_t ino, size_t size)
 
bool cvmfs::Evict (const string &path)
 
bool cvmfs::Pin (const string &path)
 
static void cvmfs::cvmfs_init (void *userdata, struct fuse_conn_info *conn)
 
static void cvmfs::cvmfs_destroy (void *unused __attribute__((unused)))
 
static void cvmfs::SetCvmfsOperations (struct fuse_lowlevel_ops *cvmfs_operations)
 
void cvmfs::UnregisterQuotaListener ()
 
bool cvmfs::SendFuseFd (const std::string &socket_path)
 
static void RegisterMagicXattrs ()
 
static FileSystemInitSystemFs (const string &mount_path, const string &fqrn, FileSystem::FileSystemInfo fs_info)
 
static void InitOptionsMgr (const loader::LoaderExports *loader_exports)
 
static unsigned CheckMaxOpenFiles ()
 
static int Init (const loader::LoaderExports *loader_exports)
 
static void Spawn ()
 
static string GetErrorMsg ()
 
static void ShutdownMountpoint ()
 
static void Fini ()
 
static int AltProcessFlavor (int argc, char **argv)
 
static bool MaintenanceMode (const int fd_progress)
 
static bool SaveState (const int fd_progress, loader::StateList *saved_states)
 
static bool RestoreState (const int fd_progress, const loader::StateList &saved_states)
 
static void FreeSavedState (const int fd_progress, const loader::StateList &saved_states)
 
static void __attribute__ ((constructor)) LibraryMain()
 
static void __attribute__ ((destructor)) LibraryExit()
 

Variables

FileSystemcvmfs::file_system_ = NULL
 
MountPointcvmfs::mount_point_ = NULL
 
TalkManagercvmfs::talk_mgr_ = NULL
 
NotificationClientcvmfs::notification_client_ = NULL
 
Watchdogcvmfs::watchdog_ = NULL
 
FuseRemountercvmfs::fuse_remounter_ = NULL
 
InodeGenerationInfo cvmfs::inode_generation_info_
 
const loader::LoaderExportscvmfs::loader_exports_ = NULL
 
OptionsManagercvmfs::options_mgr_ = NULL
 
pid_t cvmfs::pid_ = 0
 
quota::ListenerHandlecvmfs::watchdog_listener_ = NULL
 
quota::ListenerHandlecvmfs::unpin_listener_ = NULL
 
DirectoryHandles * cvmfs::directory_handles_ = NULL
 
pthread_mutex_t cvmfs::lock_directory_handles_ = PTHREAD_MUTEX_INITIALIZER
 
uint64_t cvmfs::next_directory_handle_ = 0
 
unsigned cvmfs::max_open_files_
 
bool cvmfs::check_fd_overflow_ = true
 
const int cvmfs::kNumReservedFd = 512
 
const unsigned int cvmfs::kMinOpenFiles = 8192
 
string * g_boot_error = NULL
 

Macro Definition Documentation

#define __STDC_FORMAT_MACROS

Definition at line 28 of file cvmfs.cc.

#define ENOATTR   ENODATA

This file is part of the CernVM File System.

CernVM-FS is a FUSE module which implements an HTTP read-only filesystem. The original idea is based on GROW-FS.

CernVM-FS shows a remote HTTP directory as local file system. The client sees all available files. On first access, a file is downloaded and cached locally. All downloaded pieces are verified by a cryptographic content hash.

To do so, a directory hive has to be transformed into a CVMFS2 "repository". This can be done by the CernVM-FS server tools.

This preparation of directories is transparent to web servers and web proxies. They just serve static content, i.e. arbitrary files. Any HTTP server should do the job. We use Apache + Squid. Serving files from the memory of a web proxy brings a significant performance improvement.instead of including attr/xattr.h

Definition at line 25 of file cvmfs.cc.

Referenced by cvmfs::cvmfs_getxattr().

Function Documentation

static void __attribute__ ( (constructor)  )
static

Definition at line 2973 of file cvmfs.cc.

Here is the call graph for this function:

static void __attribute__ ( (destructor)  )
static

Definition at line 2989 of file cvmfs.cc.

static int AltProcessFlavor ( int  argc,
char **  argv 
)
static

Definition at line 2538 of file cvmfs.cc.

Referenced by __attribute__().

Here is the call graph for this function:

Here is the caller graph for this function:

static unsigned CheckMaxOpenFiles ( )
static

Definition at line 2270 of file cvmfs.cc.

Referenced by Init().

Here is the call graph for this function:

Here is the caller graph for this function:

static void Fini ( )
static

Definition at line 2519 of file cvmfs.cc.

Referenced by __attribute__(), and FuseMain().

Here is the call graph for this function:

Here is the caller graph for this function:

static void FreeSavedState ( const int  fd_progress,
const loader::StateList saved_states 
)
static

Definition at line 2891 of file cvmfs.cc.

Referenced by __attribute__().

Here is the call graph for this function:

Here is the caller graph for this function:

static string GetErrorMsg ( )
static

Definition at line 2478 of file cvmfs.cc.

Referenced by __attribute__().

Here is the caller graph for this function:

static int Init ( const loader::LoaderExports loader_exports)
static

Definition at line 2296 of file cvmfs.cc.

Referenced by __attribute__(), FileSystemTraversal< T >::FileSystemTraversal(), FuseMain(), shash::HashFd(), shash::HashMem(), shash::Hmac(), and catalog::SqlAllChunks::SqlAllChunks().

Here is the call graph for this function:

Here is the caller graph for this function:

static void InitOptionsMgr ( const loader::LoaderExports loader_exports)
static

Definition at line 2250 of file cvmfs.cc.

Referenced by Init().

Here is the call graph for this function:

Here is the caller graph for this function:

static FileSystem* InitSystemFs ( const string &  mount_path,
const string &  fqrn,
FileSystem::FileSystemInfo  fs_info 
)
static

Construct a file system but prevent hanging when already mounted. That means: at most one "system" mount of any given repository name.

Definition at line 2215 of file cvmfs.cc.

Referenced by Init().

Here is the call graph for this function:

Here is the caller graph for this function:

static bool MaintenanceMode ( const int  fd_progress)
static

Definition at line 2549 of file cvmfs.cc.

Referenced by __attribute__().

Here is the call graph for this function:

Here is the caller graph for this function:

static void RegisterMagicXattrs ( )
static

Register cvmfs.cc-specific magic extended attributes to mountpoint's magic xattribute manager

Definition at line 2200 of file cvmfs.cc.

Referenced by Init().

Here is the call graph for this function:

Here is the caller graph for this function:

static bool RestoreState ( const int  fd_progress,
const loader::StateList saved_states 
)
static

Definition at line 2671 of file cvmfs.cc.

Referenced by __attribute__().

Here is the call graph for this function:

Here is the caller graph for this function:

static bool SaveState ( const int  fd_progress,
loader::StateList saved_states 
)
static

Definition at line 2563 of file cvmfs.cc.

Referenced by __attribute__().

Here is the call graph for this function:

Here is the caller graph for this function:

static void ShutdownMountpoint ( )
static

Called alone at the end of SaveState; it performs a Fini() half way through, enough to delete the catalog manager, so that no more open file handles from file catalogs are active.

Definition at line 2490 of file cvmfs.cc.

Referenced by Fini(), and SaveState().

Here is the call graph for this function:

Here is the caller graph for this function:

static void Spawn ( )
static

Things that have to be executed after fork() / daemon()

Definition at line 2427 of file cvmfs.cc.

Referenced by __attribute__(), and FuseMain().

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

string* g_boot_error = NULL

Definition at line 2140 of file cvmfs.cc.

Referenced by Fini(), GetErrorMsg(), and Init().