![]() |
CernVM-FS
2.12.0
|
#include <clientctx.h>
Classes | |
struct | ThreadLocalStorage |
Public Member Functions | |
~ClientCtx () | |
void | Set (uid_t uid, gid_t gid, pid_t pid, InterruptCue *ic) |
void | Unset () |
void | Get (uid_t *uid, gid_t *gid, pid_t *pid, InterruptCue **ic) |
bool | IsSet () |
Static Public Member Functions | |
static ClientCtx * | GetInstance () |
static void | CleanupInstance () |
Private Member Functions | |
ClientCtx () | |
Static Private Member Functions | |
static void | TlsDestructor (void *data) |
Private Attributes | |
pthread_key_t | thread_local_storage_ |
pthread_mutex_t * | lock_tls_blocks_ |
std::vector< ThreadLocalStorage * > | tls_blocks_ |
Static Private Attributes | |
static ClientCtx * | instance_ = NULL |
A client context associates a file system call with the uid, gid, and pid of the calling process and an InterruptCue of the file system request. For the library, the calling process is just the current process and user, the InterruptCue is the default one. For the Fuse module, the uid and gid are provided by fuse, the pid can be figured out from the system. The InterruptCue is the FuseInterruptCue defined in cvmfs.cc. A client context is used to download files with the credentials of the caller and to interrupt a download if the file system request got canceled.
A ClientCtx encapulates thread-local storage. It can be set somewhere at the beginning of a file system call and used anywhere during the processing of the call. It is a singleton.
Definition at line 31 of file clientctx.h.
ClientCtx::~ClientCtx | ( | ) |
|
private |
|
static |
Definition at line 18 of file clientctx.cc.
Referenced by FileSystem::~FileSystem().
void ClientCtx::Get | ( | uid_t * | uid, |
gid_t * | gid, | ||
pid_t * | pid, | ||
InterruptCue ** | ic | ||
) |
Definition at line 57 of file clientctx.cc.
Referenced by ClientCtxGuard::ClientCtxGuard(), cvmfs::Fetcher::Fetch(), and StreamingCacheManager::Stream().
|
static |
Definition at line 45 of file clientctx.cc.
Referenced by ClientCtxGuard::ClientCtxGuard(), FileSystem::Create(), cvmfs::Fetcher::Fetch(), StreamingCacheManager::Stream(), and ClientCtxGuard::~ClientCtxGuard().
bool ClientCtx::IsSet | ( | ) |
Definition at line 74 of file clientctx.cc.
Referenced by ClientCtxGuard::ClientCtxGuard(), cvmfs::Fetcher::Fetch(), and StreamingCacheManager::Stream().
void ClientCtx::Set | ( | uid_t | uid, |
gid_t | gid, | ||
pid_t | pid, | ||
InterruptCue * | ic | ||
) |
Definition at line 84 of file clientctx.cc.
Referenced by ClientCtxGuard::ClientCtxGuard(), and ClientCtxGuard::~ClientCtxGuard().
|
staticprivate |
void ClientCtx::Unset | ( | ) |
Definition at line 122 of file clientctx.cc.
Referenced by ClientCtxGuard::~ClientCtxGuard().
|
staticprivate |
Definition at line 53 of file clientctx.h.
|
private |
Definition at line 59 of file clientctx.h.
|
private |
Definition at line 58 of file clientctx.h.
|
private |
Definition at line 60 of file clientctx.h.