CernVM-FS  2.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ClientCtx Class Reference

#include <clientctx.h>

Collaboration diagram for ClientCtx:

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 ClientCtxGetInstance ()
 
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 ClientCtxinstance_ = NULL
 

Detailed Description

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.

Constructor & Destructor Documentation

ClientCtx::~ClientCtx ( )

Definition at line 32 of file clientctx.cc.

Here is the call graph for this function:

ClientCtx::ClientCtx ( )
private

Definition at line 24 of file clientctx.cc.

Here is the call graph for this function:

Member Function Documentation

void ClientCtx::CleanupInstance ( )
static

Definition at line 18 of file clientctx.cc.

Referenced by FileSystem::~FileSystem().

Here is the caller graph for this function:

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(), and cvmfs::Fetcher::Fetch().

Here is the caller graph for this function:

ClientCtx * ClientCtx::GetInstance ( )
static

Definition at line 45 of file clientctx.cc.

Referenced by ClientCtxGuard::ClientCtxGuard(), FileSystem::Create(), cvmfs::Fetcher::Fetch(), and ClientCtxGuard::~ClientCtxGuard().

Here is the call graph for this function:

Here is the caller graph for this function:

bool ClientCtx::IsSet ( )

Definition at line 74 of file clientctx.cc.

Referenced by ClientCtxGuard::ClientCtxGuard(), and cvmfs::Fetcher::Fetch().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

void ClientCtx::TlsDestructor ( void *  data)
staticprivate

Definition at line 104 of file clientctx.cc.

Here is the call graph for this function:

void ClientCtx::Unset ( )

Definition at line 122 of file clientctx.cc.

Referenced by ClientCtxGuard::~ClientCtxGuard().

Here is the caller graph for this function:

Member Data Documentation

ClientCtx * ClientCtx::instance_ = NULL
staticprivate

Definition at line 53 of file clientctx.h.

pthread_mutex_t* ClientCtx::lock_tls_blocks_
private

Definition at line 59 of file clientctx.h.

pthread_key_t ClientCtx::thread_local_storage_
private

Definition at line 58 of file clientctx.h.

std::vector<ThreadLocalStorage *> ClientCtx::tls_blocks_
private

Definition at line 60 of file clientctx.h.


The documentation for this class was generated from the following files: