CernVM-FS
2.12.0
|
#include <sys/types.h>
#include <sys/xattr.h>
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <mntent.h>
#include <pthread.h>
#include <signal.h>
#include <sys/file.h>
#include <sys/mount.h>
#include <sys/prctl.h>
#include <sys/select.h>
#include <sys/stat.h>
#include <sys/utsname.h>
#include <unistd.h>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <string>
#include <vector>
#include "util/smalloc.h"
Go to the source code of this file.
Macros | |
#define | platform_sighandler_t sighandler_t |
#define | MNT_DETACH 0x00000002 |
Typedefs | |
typedef pthread_spinlock_t | platform_spinlock |
typedef struct dirent64 | platform_dirent64 |
typedef struct stat64 | platform_stat64 |
Functions | |
std::vector< std::string > | platform_mountlist () |
bool | platform_umount (const char *mountpoint, const bool lazy) |
bool | platform_umount_lazy (const char *mountpoint) |
int | platform_spinlock_init (platform_spinlock *lock, int pshared) |
int | platform_spinlock_destroy (platform_spinlock *lock) |
int | platform_spinlock_trylock (platform_spinlock *lock) |
void | platform_spinlock_unlock (platform_spinlock *lock) |
pthread_t | platform_gettid () |
int | platform_sigwait (const int signum) |
bool | platform_allow_ptrace (const pid_t pid) |
platform_dirent64 * | platform_readdir (DIR *dirp) |
int | platform_stat (const char *path, platform_stat64 *buf) |
int | platform_lstat (const char *path, platform_stat64 *buf) |
int | platform_fstat (int filedes, platform_stat64 *buf) |
bool | platform_getxattr (const std::string &path, const std::string &name, std::string *value) |
bool | platform_setxattr (const std::string &path, const std::string &name, const std::string &value) |
bool | platform_lsetxattr (const std::string &path, const std::string &name, const std::string &value) |
ssize_t | platform_lgetxattr (const char *path, const char *name, void *value, size_t size) |
ssize_t | platform_llistxattr (const char *path, char *list, size_t size) |
void | platform_disable_kcache (int filedes) |
ssize_t | platform_readahead (int filedes) |
int | platform_invalidate_kcache (const int fd, const off_t offset, const off_t length) |
std::string | platform_libname (const std::string &base_name) |
std::string | platform_getexepath () |
struct timespec | platform_time_with_clock (int clock) |
uint64_t | platform_monotonic_time () |
uint64_t | platform_monotonic_time_ns () |
uint64_t | platform_realtime_ns () |
uint64_t | platform_memsize () |
#define MNT_DETACH 0x00000002 |
Definition at line 57 of file platform_linux.h.
Referenced by platform_umount(), and platform_umount_lazy().
#define platform_sighandler_t sighandler_t |
This file is part of the CernVM File System.
Linux specific system/library calls.
Definition at line 42 of file platform_linux.h.
Referenced by CachePlugin::MainProcessRequests(), and Watchdog::WaitForSupervisee().
typedef struct dirent64 platform_dirent64 |
File system functions, ensure 64bit versions.
Definition at line 202 of file platform_linux.h.
typedef pthread_spinlock_t platform_spinlock |
Spinlocks are not necessarily part of pthread on all platforms.
Definition at line 143 of file platform_linux.h.
typedef struct stat64 platform_stat64 |
Definition at line 208 of file platform_linux.h.
|
inline |
Grants a PID capabilities for ptrace() usage
PID | the PID of the process to be granted ptrace()-access (may be ignored) |
Definition at line 183 of file platform_linux.h.
Referenced by Watchdog::Spawn().
|
inline |
Definition at line 271 of file platform_linux.h.
Referenced by cipher::Key::CreateFromFile(), MainCheck(), and cipher::Key::SaveToFile().
|
inline |
Definition at line 218 of file platform_linux.h.
Referenced by zlib::CompressPath2Path(), CopyPath2File(), CopyPath2Path(), cipher::Key::CreateFromFile(), AuthzSessionManager::GetPidInfo(), PosixCacheManager::GetSize(), FileIngestionSource::GetSize(), MemoryMappedFile::Map(), ObjectPackProducer::ObjectPackProducer(), swissknife::CommandGraft::Publish(), and SetLogMicroSyslog().
|
inline |
Definition at line 311 of file platform_linux.h.
|
inline |
pthread_self() is not necessarily an unsigned long.
Definition at line 164 of file platform_linux.h.
Referenced by anonymous_namespace{crypto_util.cc}::CallbackLibcryptoThreadId().
|
inline |
Definition at line 223 of file platform_linux.h.
Referenced by publish::CmdEnter::CleanupSession(), publish::CmdEnter::GetCvmfsXattr(), publish::SettingsPublisher::GetReadOnlyXAttr(), InitSystemFs(), KillCvmfs(), and swissknife::CommandInfo::Main().
|
inline |
Advises the kernel to evict the given file region from the page cache.
Note: Pages containing the data at offset
and offset + length
are NOT evicted by the kernel. This means that a few pages are not purged when offset and length are not exactly on page boundaries. See below:
offset length | |
+------—+-—|-—+------—+------—+------—+--—|—+------—+ | | | | xxxxxxx | xxxxxxx | xxxxxxx | | | | | | | | xxxxxxx | xxxxxxx | xxxxxxx | | | | +------—+-—|-—+------—+------—+------—+--—|—+------—+ 0 4096 | 8192 12288 16384 20480 | 24576 28672
git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/mm/fadvise.c#n115
TODO(rmeusel): figure out a clever way how to align offset
and length
fd | file descriptor whose page cache should be (partially) evicted |
offset | start offset of the pages to be evicted |
length | number of bytes to be evicted |
Definition at line 302 of file platform_linux.h.
Referenced by FileIngestionSource::Close().
|
inline |
Definition at line 262 of file platform_linux.h.
Referenced by XattrList::CreateFromFile().
|
inline |
Definition at line 307 of file platform_linux.h.
Referenced by loader::LoadLibrary(), and main().
|
inline |
Definition at line 267 of file platform_linux.h.
Referenced by XattrList::CreateFromFile().
|
inline |
Definition at line 255 of file platform_linux.h.
Referenced by PosixSetMeta().
|
inline |
Definition at line 214 of file platform_linux.h.
Referenced by DiffTree(), DirectoryExists(), FileSystemTraversal< T >::DoRecursion(), FileExists(), swissknife::CommandApplyDirtab::FilterCandidatesFromGlobResult(), GetNextFile(), ListDirectory(), main(), ScopedWorkingDirectory::NextDirectoryEntry(), anonymous_namespace{cmd_enter.cc}::RemoveSingle(), RemoveTree(), publish::SyncItem::StatGeneric(), and SymlinkExists().
|
inline |
Definition at line 349 of file platform_linux.h.
Referenced by PluginRamCache::Create(), IngestionPipeline::IngestionPipeline(), and FileSystem::SetupRamCacheMgr().
|
inline |
Definition at line 328 of file platform_linux.h.
Referenced by glue::DentryTracker::Add(), s3fanout::S3FanoutManager::Backoff(), s3fanout::CallbackCurlHeader(), receiver::CheckToken(), cvmfs::cvmfs_statfs(), AuthzExternalFetcher::EnterFailState(), AuthzExternalFetcher::Fetch(), shrinkwrap::GarbageCollect(), receiver::GenerateSessionToken(), perf::Recorder::GetNoTicks(), AuthzSessionManager::LookupAuthzData(), AuthzSessionManager::LookupSessionKey(), glue::DentryTracker::MainCleaner(), FuseInvalidator::MainInvalidator(), FuseRemounter::MainRemountTrigger(), perf::TelemetryAggregator::MainTelemetry(), AuthzSessionManager::MaySweepCreds(), AuthzSessionManager::MaySweepPids(), glue::DentryTracker::Prune(), AuthzExternalFetcher::ReapHelper(), Supervisor::Run(), shrinkwrap::SyncFull(), shrinkwrap::SyncInit(), perf::Recorder::Tick(), perf::MultiRecorder::Tick(), and publish::TransactionRetry().
|
inline |
Definition at line 337 of file platform_linux.h.
Referenced by ReadHalfPipe(), catalog::AbstractCatalogManager< Catalog >::WriteLock(), and HighPrecisionTimer::~HighPrecisionTimer().
|
inline |
Definition at line 44 of file platform_linux.h.
Referenced by IsMountPoint(), anonymous_namespace{cmd_enter.cc}::RemoveUnderlay(), and auto_umount::UmountOnCrash().
|
inline |
Definition at line 275 of file platform_linux.h.
Referenced by sqlite::Database< DerivedT >::FileReadAhead().
|
inline |
Definition at line 204 of file platform_linux.h.
Referenced by PosixQuotaManager::CleanupPipes(), CloseAllFildesInProcSelfFd(), DiffTree(), FileSystemTraversal< T >::DoRecursion(), AuthzExternalFetcher::ExecHelper(), FindDirectories(), FindFilesByPrefix(), FindFilesBySuffix(), GetNextFile(), anonymous_namespace{ssl.cc}::HasCertificates(), ListDirectory(), main(), ScopedWorkingDirectory::NextDirectoryEntry(), and PosixQuotaManager::RebuildDatabase().
|
inline |
Definition at line 343 of file platform_linux.h.
Referenced by RepositoryTag::SetGenericName(), and perf::Statistics::SnapshotCounters().
|
inline |
Definition at line 248 of file platform_linux.h.
|
inline |
Definition at line 166 of file platform_linux.h.
Referenced by WaitForSignal().
|
inline |
Definition at line 149 of file platform_linux.h.
Referenced by Watchdog::~Watchdog().
|
inline |
Definition at line 145 of file platform_linux.h.
Referenced by Watchdog::Watchdog().
|
inline |
Definition at line 153 of file platform_linux.h.
Referenced by Watchdog::SendTrace().
|
inline |
Definition at line 157 of file platform_linux.h.
|
inline |
Definition at line 210 of file platform_linux.h.
Referenced by AttachMount(), CheckFuse(), PosixQuotaManager::CleanupPipes(), swissknife::CommandGraft::DirCallback(), FindDirectories(), FindExecutable(), GetFileSize(), anonymous_namespace{ssl.cc}::HasCertificates(), Lsof(), swissknife::CommandGraft::Main(), MakeCacheDirectories(), MkdirDeep(), Mount(), FileSystem::SetupCrashGuard(), and download::DownloadManager::SetUrlOptions().
struct timespec platform_time_with_clock | ( | int | clock | ) |
Definition at line 321 of file platform_linux.h.
Referenced by platform_monotonic_time(), platform_monotonic_time_ns(), and platform_realtime_ns().
|
inline |
Definition at line 59 of file platform_linux.h.
Referenced by auto_umount::UmountOnCrash().
|
inline |
Definition at line 135 of file platform_linux.h.
Referenced by publish::CmdEnter::CleanupSession(), and anonymous_namespace{cmd_enter.cc}::RemoveUnderlay().