![]() |
CernVM-FS
2.12.0
|
#include "libcvmfs_cache.h"
#include <unistd.h>
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <string>
#include "cache_plugin/channel.h"
#include "cache_transport.h"
#include "crypto/hash.h"
#include "manifest.h"
#include "monitor.h"
#include "util/pointer.h"
Go to the source code of this file.
Classes | |
class | anonymous_namespace{libcvmfs_cache.cc}::ForwardCachePlugin |
struct | cvmcache_context |
Namespaces | |
anonymous_namespace{libcvmfs_cache.cc} | |
Macros | |
#define | _FILE_OFFSET_BITS 64 |
#define | __STDC_FORMAT_MACROS |
Variables | |
Watchdog * | anonymous_namespace{libcvmfs_cache.cc}::g_watchdog = NULL |
#define __STDC_FORMAT_MACROS |
Definition at line 6 of file libcvmfs_cache.cc.
#define _FILE_OFFSET_BITS 64 |
This file is part of the CernVM File System.
Definition at line 5 of file libcvmfs_cache.cc.
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.
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().