CernVM-FS
2.12.0
|
#include <stdint.h>
Go to the source code of this file.
Classes | |
struct | cvmcache_hash |
struct | cvmcache_object_info |
struct | cvmcache_info |
struct | cvmcache_session |
struct | cvmcache_breadcrumb |
struct | cvmcache_callbacks |
Macros | |
#define | LIBCVMFS_CACHE_REVISION 5 |
#define | CVMCACHE_SIZE_UNKNOWN (uint64_t(-1)) |
Typedefs | |
typedef struct OptionsManager | cvmcache_option_map |
Variables | |
unsigned char | digest [20] |
char | algorithm |
struct cvmcache_object_info | __attribute__ |
#define CVMCACHE_SIZE_UNKNOWN (uint64_t(-1)) |
Definition at line 81 of file libcvmfs_cache.h.
Referenced by main(), and PluginRamCache::ram_start_txn().
#define LIBCVMFS_CACHE_REVISION 5 |
This file is part of the CernVM File System.
See cvmfs_cache_null plugin for a demo user of the library.
Definition at line 18 of file libcvmfs_cache.h.
typedef struct OptionsManager cvmcache_option_map |
Definition at line 27 of file libcvmfs_cache.h.
Definition at line 65 of file libcvmfs_cache.h.
Enumerator | |
---|---|
CVMCACHE_HASH_SHA1 | |
CVMCACHE_HASH_RIPEMD160 | |
CVMCACHE_HASH_SHAKE128 |
Definition at line 31 of file libcvmfs_cache.h.
enum cvmcache_object_type |
Enumerator | |
---|---|
CVMCACHE_OBJECT_REGULAR | |
CVMCACHE_OBJECT_CATALOG | |
CVMCACHE_OBJECT_VOLATILE |
Definition at line 58 of file libcvmfs_cache.h.
enum cvmcache_status |
Definition at line 38 of file libcvmfs_cache.h.
struct cvmcache_hash __attribute__ | ( | (__packed__) | ) |
void cvmcache_ask_detach | ( | struct cvmcache_context * | ctx | ) |
Politely ask connected clients to release open nested catalogs so that more objects in the cache become unpinned.
Definition at line 335 of file libcvmfs_cache.cc.
Referenced by PluginRamCache::CheckHighPinWatermark(), and main().
void cvmcache_cleanup_global | ( | ) |
Deletes global state, afterwards no further calls to cvmcache_... functions should take place.
Definition at line 316 of file libcvmfs_cache.cc.
Referenced by main().
void cvmcache_get_session | ( | cvmcache_session * | session | ) |
Returns a static pointer to an origin struct that identifies the client connection that triggered a callback. Calling this function is only valid from within a callback. Otherwise the function returns NULL values.
Definition at line 352 of file libcvmfs_cache.cc.
int cvmcache_hash_cmp | ( | struct cvmcache_hash * | a, |
struct cvmcache_hash * | b | ||
) |
Returns -1, 0, or 1 like other C comparison functions
Definition at line 296 of file libcvmfs_cache.cc.
Referenced by ComparableHash::operator!=(), ComparableHash::operator<(), ComparableHash::operator==(), and ComparableHash::operator>().
char* cvmcache_hash_print | ( | const struct cvmcache_hash * | h | ) |
The caller has to free the resulting string
Definition at line 307 of file libcvmfs_cache.cc.
struct cvmcache_context* cvmcache_init | ( | struct cvmcache_callbacks * | callbacks | ) |
Definition at line 322 of file libcvmfs_cache.cc.
Referenced by main().
void cvmcache_init_global | ( | ) |
Should be called before any other cvmcache_... function.
Definition at line 313 of file libcvmfs_cache.cc.
Referenced by main().
int cvmcache_is_supervised | ( | ) |
True if the plugin was started from a cvmfs mountpoint and thus will terminate by itself when the last mount point disconnects.
Definition at line 318 of file libcvmfs_cache.cc.
Referenced by main().
int cvmcache_listen | ( | struct cvmcache_context * | ctx, |
char * | locator | ||
) |
The locator is either a UNIX domain socket (unix=/path/to/socket) or a tcp socket (tcp=hostname:port)
Definition at line 326 of file libcvmfs_cache.cc.
Referenced by main().
uint32_t cvmcache_max_object_size | ( | struct cvmcache_context * | ctx | ) |
Definition at line 348 of file libcvmfs_cache.cc.
char* cvmcache_options_dump | ( | cvmcache_option_map * | opts | ) |
Prints the key-value pairs of cvmfs_option_map line-by-line. The resulting string needs to be freed by a call to cvmfs_options_free().
void cvmcache_options_fini | ( | cvmcache_option_map * | opts | ) |
Frees the resources of a cvmfs_options_map, which was created by a call to cvmfs_options_init().
Referenced by main().
void cvmcache_options_free | ( | char * | value | ) |
Frees a string returned from cvmfs_options_get() or cvmfs_options_dump().
Definition at line 32 of file libcvmfs_cache_options.cc.
Referenced by anonymous_namespace{cvmfs_cache_posix.cc}::GetSettings(), and main().
char* cvmcache_options_get | ( | cvmcache_option_map * | opts, |
const char * | key | ||
) |
Retrieves the value for a given key or NULL of the key does not exist. If the result is not NULL, it must be freed by a call to cvmfs_options_free().
Referenced by anonymous_namespace{cvmfs_cache_posix.cc}::GetSettings(), and main().
cvmcache_option_map* cvmcache_options_init | ( | ) |
Definition at line 55 of file libcvmfs_cache_options.cc.
Referenced by main().
int cvmcache_options_parse | ( | cvmcache_option_map * | opts, |
const char * | path | ||
) |
Sets options from a file with linewise KEY=VALUE pairs. Returns 0 on success and -1 otherwise.
Referenced by main().
void cvmcache_options_set | ( | cvmcache_option_map * | opts, |
const char * | key, | ||
const char * | value | ||
) |
Fills a cvmfs_options_map. Use the same key/value pairs as the configuration parameters used by the fuse module in /etc/cvmfs/...
void cvmcache_options_unset | ( | cvmcache_option_map * | opts, |
const char * | key | ||
) |
Removes a key-value pair from a cvmfs_options_map. The key may or may not exist before the call.
void cvmcache_process_requests | ( | struct cvmcache_context * | ctx, |
unsigned | nworkers | ||
) |
Spawns a separate I/O thread that can be stopped with cvmcache_terminate. The nworkers parameter is currently unused.
Definition at line 330 of file libcvmfs_cache.cc.
Referenced by main().
void cvmcache_spawn_watchdog | ( | const char * | crash_dump_file | ) |
Can be used to spawn a second process that superwises the cache plugin. The watchdog can use gdb/lldb to generate stack traces. Must be closed by a call to cvmcache_close_watchdog(), otherwise the main process will be reported has having died unexpectedly.
Definition at line 361 of file libcvmfs_cache.cc.
Referenced by main().
void cvmcache_terminate | ( | struct cvmcache_context * | ctx | ) |
Stops the processing thread.
Definition at line 344 of file libcvmfs_cache.cc.
Referenced by anonymous_namespace{cvmfs_cache_posix.cc}::handle_sigint(), and main().
void cvmcache_terminate_watchdog | ( | ) |
Definition at line 369 of file libcvmfs_cache.cc.
Referenced by main().
void cvmcache_wait_for | ( | struct cvmcache_context * | ctx | ) |
Blocks until the processing thread finishes. Can either happen due to a call to cvmcache_terminate or – when the plugin is started from cvmfs – when the last repository is unmounted. Invalidates the context object.
Definition at line 339 of file libcvmfs_cache.cc.
Referenced by main().
|
inline |
Used when the caller remembers the size, so that it can call sxunmap later.
Free memory acquired by sxmmap.
Pointer is aligned at a multiple of the size. The size has to be a multiple of 2MB.
Definition at line 24 of file atomic.h.
Referenced by Tracer::DoTrace(), AuthzSessionManager::HashPidKey(), and AuthzSessionManager::HashSessionKey().
char algorithm |
Definition at line 294 of file libcvmfs_cache.h.
Referenced by shash::Any::Any(), shash::Any::CastToMd5(), catalog::VirtualCatalog::CreateNestedCatalogMarker(), cipher::Cipher::Decrypt(), cipher::Cipher::Encrypt(), download::DownloadManager::Fetch(), shash::Digest< 16, kMd5 >::GetDigestSize(), shash::Digest< 16, kMd5 >::GetHexSize(), shash::HashFd(), shash::HashMem(), shash::Hmac(), shash::Digest< 16, kMd5 >::IsNull(), publish::CmdHash::Main(), catalog::CatalogBalancer< CatalogMgrT >::MakeEmptyDirectoryEntryBase(), compat::shash_v1::Md5::Md5(), shash::Md5::Md5(), shash::Digest< 16, kMd5 >::operator<(), shash::Digest< 16, kMd5 >::operator==(), shash::Digest< 16, kMd5 >::operator>(), shash::Digest< 16, kMd5 >::ToFingerprint(), and whitelist::Whitelist::VerifyLoadedCertificate().
unsigned char digest[20] |
Definition at line 293 of file libcvmfs_cache.h.
Referenced by shash::Any::CastToMd5(), swissknife::anonymous_namespace{swissknife_pull.cc}::ChunkJob::ChunkJob(), ObjectPackConsumer::ConsumeNext(), shash::Digest< 16, kMd5 >::Digest(), swissknife::anonymous_namespace{swissknife_pull.cc}::ChunkJob::hash(), shash::HexFromSha256(), shash::Hmac256(), shash::Digest< 16, kMd5 >::IsNull(), compat::shash_v1::Md5::Md5(), shash::Md5::Md5(), shash::Digest< 16, kMd5 >::operator<(), shash::Digest< 16, kMd5 >::operator==(), shash::Digest< 16, kMd5 >::operator>(), shash::Digest< 16, kMd5 >::Partial32(), receiver::PayloadProcessor::Process(), shash::Digest< 16, kMd5 >::Randomize(), shash::Digest< 16, kMd5 >::SetNull(), shash::Sha256File(), shash::Sha256Mem(), and shash::Md5::ToIntPair().