CernVM-FS  2.9.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)
 
void Unset ()
 
void Get (uid_t *uid, gid_t *gid, pid_t *pid)
 
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

This file is part of the CernVM File System. A client context associates a file system call with the uid, gid, and pid of the calling process. For the library, that's the current process and user. For the Fuse module, the uid and gid are provided by fuse, the pid can be figured out from the system. A client context is used to download files with the credentials of the caller.

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 25 of file clientctx.h.

Constructor & Destructor Documentation

ClientCtx::~ClientCtx ( )

Definition at line 31 of file clientctx.cc.

Here is the call graph for this function:

ClientCtx::ClientCtx ( )
private

Definition at line 23 of file clientctx.cc.

Here is the call graph for this function:

Member Function Documentation

void ClientCtx::CleanupInstance ( )
static

Definition at line 17 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 
)

Definition at line 56 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 44 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 71 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 
)

Definition at line 81 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 100 of file clientctx.cc.

Here is the call graph for this function:

void ClientCtx::Unset ( )

Definition at line 118 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 46 of file clientctx.h.

pthread_mutex_t* ClientCtx::lock_tls_blocks_
private

Definition at line 52 of file clientctx.h.

pthread_key_t ClientCtx::thread_local_storage_
private

Definition at line 51 of file clientctx.h.

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

Definition at line 53 of file clientctx.h.


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