![]() |
XRootD
|
#include <sys/types.h>
#include <sys/stat.h>
#include <cerrno>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdarg.h>
#include <memory>
#include <radosstriper/libradosstriper.hpp>
#include <map>
#include <stdexcept>
#include <string>
#include <sstream>
#include <sys/xattr.h>
#include <time.h>
#include <limits>
#include <pthread.h>
#include "XrdSfs/XrdSfsAio.hh"
#include "XrdSys/XrdSysPthread.hh"
#include "XrdOuc/XrdOucName2Name.hh"
#include "XrdSys/XrdSysPlatform.hh"
#include "XrdCeph/XrdCephPosix.hh"
Go to the source code of this file.
Classes | |
struct | AioArgs |
small struct for aio API callbacks More... | |
struct | CephFile |
small structs to store file metadata More... | |
struct | CephFileRef |
struct | DirIterator |
small struct for directory listing More... | |
Typedefs | |
typedef std::map< std::string, librados::IoCtx * > | IOCtxDict |
typedef std::map< std::string, libradosstriper::RadosStriper * > | StriperDict |
Functions | |
ssize_t | ceph_aio_read (int fd, XrdSfsAio *aiop, AioCB *cb) |
static void | ceph_aio_read_complete (rados_completion_t c, void *arg) |
ssize_t | ceph_aio_write (int fd, XrdSfsAio *aiop, AioCB *cb) |
static void | ceph_aio_write_complete (rados_completion_t c, void *arg) |
int | ceph_posix_close (int fd) |
int | ceph_posix_closedir (DIR *dirp) |
void | ceph_posix_disconnect_all () |
int | ceph_posix_fcntl (int fd, int cmd,...) |
ssize_t | ceph_posix_fgetxattr (int fd, const char *name, void *value, size_t size) |
int | ceph_posix_flistxattrs (int fd, XrdSysXAttr::AList **aPL, int getSz) |
void | ceph_posix_freexattrlist (XrdSysXAttr::AList *aPL) |
int | ceph_posix_fremovexattr (int fd, const char *name) |
int | ceph_posix_fsetxattr (int fd, const char *name, const void *value, size_t size, int flags) |
int | ceph_posix_fstat (int fd, struct stat *buf) |
int | ceph_posix_fsync (int fd) |
int | ceph_posix_ftruncate (int fd, unsigned long long size) |
ssize_t | ceph_posix_getxattr (XrdOucEnv *env, const char *path, const char *name, void *value, size_t size) |
static ssize_t | ceph_posix_internal_getxattr (const CephFile &file, const char *name, void *value, size_t size) |
static int | ceph_posix_internal_listxattrs (const CephFile &file, XrdSysXAttr::AList **aPL, int getSz) |
static int | ceph_posix_internal_removexattr (const CephFile &file, const char *name) |
static ssize_t | ceph_posix_internal_setxattr (const CephFile &file, const char *name, const void *value, size_t size, int flags) |
static int | ceph_posix_internal_truncate (const CephFile &file, unsigned long long size) |
int | ceph_posix_listxattrs (XrdOucEnv *env, const char *path, XrdSysXAttr::AList **aPL, int getSz) |
off_t | ceph_posix_lseek (int fd, off_t offset, int whence) |
off64_t | ceph_posix_lseek64 (int fd, off64_t offset, int whence) |
int | ceph_posix_open (XrdOucEnv *env, const char *pathname, int flags, mode_t mode) |
DIR * | ceph_posix_opendir (XrdOucEnv *env, const char *pathname) |
ssize_t | ceph_posix_pread (int fd, void *buf, size_t count, off64_t offset) |
ssize_t | ceph_posix_pwrite (int fd, const void *buf, size_t count, off64_t offset) |
ssize_t | ceph_posix_read (int fd, void *buf, size_t count) |
int | ceph_posix_readdir (DIR *dirp, char *buff, int blen) |
int | ceph_posix_removexattr (XrdOucEnv *env, const char *path, const char *name) |
void | ceph_posix_set_defaults (const char *value) |
void | ceph_posix_set_logfunc (void(*logfunc)(char *, va_list argp)) |
ssize_t | ceph_posix_setxattr (XrdOucEnv *env, const char *path, const char *name, const void *value, size_t size, int flags) |
int | ceph_posix_stat (XrdOucEnv *env, const char *pathname, struct stat *buf) |
int | ceph_posix_statfs (long long *totalSpace, long long *freeSpace) |
int | ceph_posix_truncate (XrdOucEnv *env, const char *pathname, unsigned long long size) |
int | ceph_posix_unlink (XrdOucEnv *env, const char *pathname) |
ssize_t | ceph_posix_write (int fd, const void *buf, size_t count) |
librados::Rados * | checkAndCreateCluster (unsigned int cephPoolIdx, std::string userId=g_defaultParams.userId) |
int | checkAndCreateStriper (unsigned int cephPoolIdx, std::string &userAtPool, const CephFile &file) |
void | deleteFileRef (int fd, const CephFileRef &fr) |
deletes a FileRef from the global table of file descriptors More... | |
void | fillCephFile (const char *path, XrdOucEnv *env, CephFile &file) |
fill a ceph file struct from a path and an environment More... | |
void | fillCephFileParams (const std::string ¶ms, XrdOucEnv *env, CephFile &file) |
static int | fillCephNbStripes (const std::string ¶ms, unsigned int offset, XrdOucEnv *env, CephFile &file) |
static void | fillCephObjectSize (const std::string ¶ms, unsigned int offset, XrdOucEnv *env, CephFile &file) |
static int | fillCephPool (const std::string ¶ms, unsigned int offset, XrdOucEnv *env, CephFile &file) |
static int | fillCephStripeUnit (const std::string ¶ms, unsigned int offset, XrdOucEnv *env, CephFile &file) |
static int | fillCephUserId (const std::string ¶ms, XrdOucEnv *env, CephFile &file) |
static CephFile | getCephFile (const char *path, XrdOucEnv *env) |
static CephFileRef | getCephFileRef (const char *path, XrdOucEnv *env, int flags, mode_t mode, unsigned long long offset) |
unsigned int | getCephPoolIdxAndIncrease () |
CephFileRef * | getFileRef (int fd) |
look for a FileRef from its file descriptor More... | |
static librados::IoCtx * | getIoCtx (const CephFile &file) |
static libradosstriper::RadosStriper * | getRadosStriper (const CephFile &file) |
int | insertFileRef (CephFileRef &fr) |
bool | isOpenForWrite (std::string &name) |
check whether a file is open for write More... | |
static void | logwrapper (char *format,...) |
static off64_t | lseek_compute_offset (CephFileRef &fr, off64_t offset, int whence) |
static unsigned int | stoui (const std::string &s) |
simple integer parsing, to be replaced by std::stoi when C++11 can be used More... | |
static unsigned long long int | stoull (const std::string &s) |
simple integer parsing, to be replaced by std::stoll when C++11 can be used More... | |
void | translateFileName (std::string &physName, std::string logName) |
converts a logical filename to physical one if needed More... | |
Variables | |
unsigned int | g_cephPoolIdx = 0 |
index of current Striper/IoCtx to be used More... | |
std::vector< librados::Rados * > | g_cluster |
CephFile | g_defaultParams |
global variable containing defaults for CephFiles More... | |
std::string | g_defaultPool = "default" |
std::string | g_defaultUserId = "admin" |
XrdSysMutex | g_fd_mutex |
mutex protecting the map of file descriptors and the openForWrite multiset More... | |
std::map< unsigned int, CephFileRef > | g_fds |
global variable holding a map of file descriptor to file reference More... | |
std::multiset< std::string > | g_filesOpenForWrite |
global variable holding a list of files currently opened for write More... | |
XrdSysMutex | g_init_mutex |
mutex protecting initialization of ceph clusters More... | |
std::vector< IOCtxDict > | g_ioCtx |
static void(* | g_logfunc )(char *, va_list argp)=0 |
global variable for the log function More... | |
unsigned int | g_maxCephPoolIdx = 1 |
XrdOucName2Name * | g_namelib = 0 |
unsigned int | g_nextCephFd = 0 |
global variable remembering the next available file descriptor More... | |
std::vector< StriperDict > | g_radosStripers |
XrdSysMutex | g_striper_mutex |
mutex protecting the striper and ioctx maps More... | |
struct DirIterator |
small struct for directory listing
Definition at line 84 of file XrdCephPosix.cc.
Class Members | ||
---|---|---|
IoCtx * | m_ioctx | |
NObjectIterator | m_iterator |
typedef std::map<std::string, librados::IoCtx*> IOCtxDict |
Definition at line 106 of file XrdCephPosix.cc.
typedef std::map<std::string, libradosstriper::RadosStriper*> StriperDict |
global variables holding stripers/ioCtxs/cluster objects Note that we have a pool of them to circumvent the limitation of having a single objecter/messenger per IoCtx
Definition at line 104 of file XrdCephPosix.cc.
Definition at line 953 of file XrdCephPosix.cc.
References aiocb::aio_nbytes, aiocb::aio_offset, CephFileRef::asyncRdStartCount, ceph_aio_read_complete(), checkAndCreateCluster(), CephFileRef::flags, getCephPoolIdxAndIncrease(), getFileRef(), getRadosStriper(), CephFile::name, XrdSfsAio::sfsAio, and CephFileRef::statsMutex.
Referenced by XrdCephOssFile::Read().
|
static |
Definition at line 932 of file XrdCephPosix.cc.
References aiocb::aio_buf, AioArgs::aiop, CephFileRef::asyncRdCompletionCount, AioArgs::bl, AioArgs::callback, AioArgs::fd, getFileRef(), XrdSfsAio::sfsAio, and CephFileRef::statsMutex.
Referenced by ceph_aio_read().
Definition at line 839 of file XrdCephPosix.cc.
References aiocb::aio_buf, aiocb::aio_nbytes, aiocb::aio_offset, CephFileRef::asyncWrStartCount, CephFileRef::bytesAsyncWritePending, ceph_aio_write_complete(), checkAndCreateCluster(), CephFileRef::flags, getCephPoolIdxAndIncrease(), getFileRef(), getRadosStriper(), if(), CephFileRef::lastAsyncSubmission, CephFile::name, XrdSfsAio::sfsAio, and CephFileRef::statsMutex.
Referenced by XrdCephOssFile::Write().
|
static |
Definition at line 809 of file XrdCephPosix.cc.
References aiocb::aio_nbytes, aiocb::aio_offset, AioArgs::aiop, CephFileRef::asyncWrCompletionCount, CephFileRef::bytesAsyncWritePending, CephFileRef::bytesWritten, AioArgs::callback, AioArgs::fd, getFileRef(), CephFileRef::longestAsyncWriteTime, CephFileRef::longestCallbackInvocation, CephFileRef::maxOffsetWritten, AioArgs::nbBytes, XrdSfsAio::sfsAio, AioArgs::startTime, and CephFileRef::statsMutex.
Referenced by ceph_aio_write().
int ceph_posix_close | ( | int | fd | ) |
Definition at line 696 of file XrdCephPosix.cc.
References CephFileRef::asyncRdCompletionCount, CephFileRef::asyncRdStartCount, CephFileRef::asyncWrCompletionCount, CephFileRef::asyncWrStartCount, CephFileRef::bytesAsyncWritePending, CephFileRef::bytesWritten, deleteFileRef(), getFileRef(), CephFileRef::lastAsyncSubmission, logwrapper(), CephFileRef::longestAsyncWriteTime, CephFileRef::longestCallbackInvocation, CephFileRef::maxOffsetWritten, CephFile::name, CephFileRef::rdcount, CephFileRef::statsMutex, and CephFileRef::wrcount.
Referenced by XrdCephOssFile::Close().
int ceph_posix_closedir | ( | DIR * | dirp | ) |
Definition at line 1319 of file XrdCephPosix.cc.
Referenced by XrdCephOssDir::Close().
void ceph_posix_disconnect_all | ( | ) |
Definition at line 609 of file XrdCephPosix.cc.
References g_cluster, g_ioCtx, g_maxCephPoolIdx, g_radosStripers, and g_striper_mutex.
Referenced by XrdCephOss::~XrdCephOss().
int ceph_posix_fcntl | ( | int | fd, |
int | cmd, | ||
... | |||
) |
Definition at line 1058 of file XrdCephPosix.cc.
References getFileRef(), logwrapper(), and CephFileRef::mode.
ssize_t ceph_posix_fgetxattr | ( | int | fd, |
const char * | name, | ||
void * | value, | ||
size_t | size | ||
) |
Definition at line 1095 of file XrdCephPosix.cc.
References ceph_posix_internal_getxattr(), getFileRef(), and logwrapper().
Referenced by XrdCephXAttr::Get().
int ceph_posix_flistxattrs | ( | int | fd, |
XrdSysXAttr::AList ** | aPL, | ||
int | getSz | ||
) |
Definition at line 1207 of file XrdCephPosix.cc.
References ceph_posix_internal_listxattrs(), getFileRef(), and logwrapper().
Referenced by XrdCephXAttr::List().
void ceph_posix_freexattrlist | ( | XrdSysXAttr::AList * | aPL | ) |
Definition at line 1217 of file XrdCephPosix.cc.
References XrdSysXAttr::AList::Name, and XrdSysXAttr::AList::Next.
Referenced by XrdCephXAttr::Free().
int ceph_posix_fremovexattr | ( | int | fd, |
const char * | name | ||
) |
Definition at line 1158 of file XrdCephPosix.cc.
References ceph_posix_internal_removexattr(), getFileRef(), and logwrapper().
int ceph_posix_fsetxattr | ( | int | fd, |
const char * | name, | ||
const void * | value, | ||
size_t | size, | ||
int | flags | ||
) |
Definition at line 1128 of file XrdCephPosix.cc.
References ceph_posix_internal_setxattr(), getFileRef(), and logwrapper().
Referenced by XrdCephXAttr::Set().
int ceph_posix_fstat | ( | int | fd, |
struct stat * | buf | ||
) |
Definition at line 993 of file XrdCephPosix.cc.
References getFileRef(), getRadosStriper(), logwrapper(), and CephFile::name.
Referenced by XrdCephOssFile::Fstat().
int ceph_posix_fsync | ( | int | fd | ) |
Definition at line 1047 of file XrdCephPosix.cc.
References getFileRef(), and logwrapper().
Referenced by XrdCephOssFile::Fsync().
int ceph_posix_ftruncate | ( | int | fd, |
unsigned long long | size | ||
) |
Definition at line 1253 of file XrdCephPosix.cc.
References ceph_posix_internal_truncate(), getFileRef(), and logwrapper().
Referenced by XrdCephOssFile::Ftruncate().
ssize_t ceph_posix_getxattr | ( | XrdOucEnv * | env, |
const char * | path, | ||
const char * | name, | ||
void * | value, | ||
size_t | size | ||
) |
Definition at line 1088 of file XrdCephPosix.cc.
References ceph_posix_internal_getxattr(), getCephFile(), and logwrapper().
Referenced by XrdCephXAttr::Get().
|
static |
Definition at line 1074 of file XrdCephPosix.cc.
References getRadosStriper(), and CephFile::name.
Referenced by ceph_posix_fgetxattr(), and ceph_posix_getxattr().
|
static |
Definition at line 1168 of file XrdCephPosix.cc.
References getRadosStriper(), CephFile::name, XrdSysXAttr::AList::Name, XrdSysXAttr::AList::Next, XrdSysXAttr::AList::Nlen, and XrdSysXAttr::AList::Vlen.
Referenced by ceph_posix_flistxattrs(), and ceph_posix_listxattrs().
|
static |
Definition at line 1140 of file XrdCephPosix.cc.
References getRadosStriper(), and CephFile::name.
Referenced by ceph_posix_fremovexattr(), and ceph_posix_removexattr().
|
static |
Definition at line 1106 of file XrdCephPosix.cc.
References getRadosStriper(), and CephFile::name.
Referenced by ceph_posix_fsetxattr(), and ceph_posix_setxattr().
|
static |
Definition at line 1245 of file XrdCephPosix.cc.
References getRadosStriper(), and CephFile::name.
Referenced by ceph_posix_ftruncate(), and ceph_posix_truncate().
int ceph_posix_listxattrs | ( | XrdOucEnv * | env, |
const char * | path, | ||
XrdSysXAttr::AList ** | aPL, | ||
int | getSz | ||
) |
Definition at line 1202 of file XrdCephPosix.cc.
References ceph_posix_internal_listxattrs(), getCephFile(), and logwrapper().
Referenced by XrdCephXAttr::List().
off_t ceph_posix_lseek | ( | int | fd, |
off_t | offset, | ||
int | whence | ||
) |
Definition at line 737 of file XrdCephPosix.cc.
References getFileRef(), logwrapper(), and lseek_compute_offset().
off64_t ceph_posix_lseek64 | ( | int | fd, |
off64_t | offset, | ||
int | whence | ||
) |
Definition at line 747 of file XrdCephPosix.cc.
References getFileRef(), logwrapper(), and lseek_compute_offset().
int ceph_posix_open | ( | XrdOucEnv * | env, |
const char * | pathname, | ||
int | flags, | ||
mode_t | mode | ||
) |
Definition at line 649 of file XrdCephPosix.cc.
References ceph_posix_unlink(), getCephFileRef(), getRadosStriper(), insertFileRef(), logwrapper(), CephFile::name, and stat().
Referenced by XrdCephOssFile::Open().
DIR* ceph_posix_opendir | ( | XrdOucEnv * | env, |
const char * | pathname | ||
) |
Definition at line 1281 of file XrdCephPosix.cc.
References getCephFile(), getIoCtx(), logwrapper(), DirIterator::m_ioctx, DirIterator::m_iterator, and CephFile::name.
Referenced by XrdCephOssDir::Opendir().
ssize_t ceph_posix_pread | ( | int | fd, |
void * | buf, | ||
size_t | count, | ||
off64_t | offset | ||
) |
Definition at line 908 of file XrdCephPosix.cc.
References CephFileRef::flags, getFileRef(), getRadosStriper(), CephFile::name, CephFileRef::rdcount, and CephFileRef::statsMutex.
Referenced by XrdCephOssFile::Read().
ssize_t ceph_posix_pwrite | ( | int | fd, |
const void * | buf, | ||
size_t | count, | ||
off64_t | offset | ||
) |
Definition at line 783 of file XrdCephPosix.cc.
References CephFileRef::bytesWritten, CephFileRef::flags, getFileRef(), getRadosStriper(), CephFileRef::maxOffsetWritten, CephFile::name, CephFileRef::statsMutex, and CephFileRef::wrcount.
Referenced by XrdCephOssFile::Write().
ssize_t ceph_posix_read | ( | int | fd, |
void * | buf, | ||
size_t | count | ||
) |
Definition at line 883 of file XrdCephPosix.cc.
References CephFileRef::flags, getFileRef(), getRadosStriper(), CephFile::name, CephFileRef::offset, CephFileRef::rdcount, and CephFileRef::statsMutex.
int ceph_posix_readdir | ( | DIR * | dirp, |
char * | buff, | ||
int | blen | ||
) |
Definition at line 1300 of file XrdCephPosix.cc.
Referenced by XrdCephOssDir::Readdir().
int ceph_posix_removexattr | ( | XrdOucEnv * | env, |
const char * | path, | ||
const char * | name | ||
) |
Definition at line 1152 of file XrdCephPosix.cc.
References ceph_posix_internal_removexattr(), getCephFile(), and logwrapper().
Referenced by XrdCephXAttr::Del().
void ceph_posix_set_defaults | ( | const char * | value | ) |
sets the default userId, pool and file layout syntax is [user@]pool[,nbStripes[,stripeUnit[,objectSize]]] may throw std::invalid_argument or std::out_of_range in case of error
Definition at line 386 of file XrdCephPosix.cc.
References fillCephFileParams(), and g_defaultParams.
Referenced by XrdOssGetStorageSystem(), and XrdSysGetXAttrObject().
void ceph_posix_set_logfunc | ( | void(*)(char *, va_list argp) | logfunc | ) |
Definition at line 629 of file XrdCephPosix.cc.
References g_logfunc.
Referenced by XrdOssGetStorageSystem().
ssize_t ceph_posix_setxattr | ( | XrdOucEnv * | env, |
const char * | path, | ||
const char * | name, | ||
const void * | value, | ||
size_t | size, | ||
int | flags | ||
) |
Definition at line 1121 of file XrdCephPosix.cc.
References ceph_posix_internal_setxattr(), getCephFile(), and logwrapper().
Referenced by XrdCephXAttr::Set().
Definition at line 1019 of file XrdCephPosix.cc.
References getCephFile(), getRadosStriper(), isOpenForWrite(), logwrapper(), and CephFile::name.
Referenced by XrdCephOss::Stat().
int ceph_posix_statfs | ( | long long * | totalSpace, |
long long * | freeSpace | ||
) |
Definition at line 1226 of file XrdCephPosix.cc.
References checkAndCreateCluster(), getCephPoolIdxAndIncrease(), and logwrapper().
Referenced by XrdCephOss::StatVS().
int ceph_posix_truncate | ( | XrdOucEnv * | env, |
const char * | pathname, | ||
unsigned long long | size | ||
) |
Definition at line 1263 of file XrdCephPosix.cc.
References ceph_posix_internal_truncate(), getCephFile(), and logwrapper().
Referenced by XrdCephOss::Truncate().
int ceph_posix_unlink | ( | XrdOucEnv * | env, |
const char * | pathname | ||
) |
Definition at line 1270 of file XrdCephPosix.cc.
References getCephFile(), getRadosStriper(), logwrapper(), and CephFile::name.
Referenced by ceph_posix_open(), and XrdCephOss::Unlink().
ssize_t ceph_posix_write | ( | int | fd, |
const void * | buf, | ||
size_t | count | ||
) |
Definition at line 757 of file XrdCephPosix.cc.
References CephFileRef::bytesWritten, CephFileRef::flags, getFileRef(), getRadosStriper(), logwrapper(), CephFileRef::maxOffsetWritten, CephFile::name, CephFileRef::offset, CephFileRef::statsMutex, and CephFileRef::wrcount.
|
inline |
Definition at line 461 of file XrdCephPosix.cc.
References g_cluster, and logwrapper().
Referenced by ceph_aio_read(), ceph_aio_write(), ceph_posix_statfs(), and checkAndCreateStriper().
int checkAndCreateStriper | ( | unsigned int | cephPoolIdx, |
std::string & | userAtPool, | ||
const CephFile & | file | ||
) |
Definition at line 495 of file XrdCephPosix.cc.
References checkAndCreateCluster(), g_cluster, g_ioCtx, g_radosStripers, logwrapper(), CephFile::nbStripes, CephFile::objectSize, CephFile::pool, CephFile::stripeUnit, and CephFile::userId.
Referenced by getIoCtx(), and getRadosStriper().
void deleteFileRef | ( | int | fd, |
const CephFileRef & | fr | ||
) |
deletes a FileRef from the global table of file descriptors
Definition at line 180 of file XrdCephPosix.cc.
References CephFileRef::flags, g_fd_mutex, g_fds, g_filesOpenForWrite, and CephFile::name.
Referenced by ceph_posix_close().
fill a ceph file struct from a path and an environment
Definition at line 411 of file XrdCephPosix.cc.
References fillCephFileParams(), CephFile::name, and translateFileName().
Referenced by getCephFile(), and getCephFileRef().
fill the parameters of a ceph file struct (all but name) from a string and an environment see fillCephFile for the detailed syntax
Definition at line 374 of file XrdCephPosix.cc.
References fillCephNbStripes(), fillCephObjectSize(), fillCephPool(), fillCephStripeUnit(), and fillCephUserId().
Referenced by ceph_posix_set_defaults(), and fillCephFile().
|
static |
fills the nbStriped of a ceph file struct from a string and an environment returns position of first character after the nbStripes
Definition at line 304 of file XrdCephPosix.cc.
References g_defaultParams, XrdOucEnv::Get(), CephFile::nbStripes, and stoui().
Referenced by fillCephFileParams().
|
static |
fills the objectSize of a ceph file struct from a string and an environment returns position of first character after the objectSize
Definition at line 356 of file XrdCephPosix.cc.
References g_defaultParams, XrdOucEnv::Get(), CephFile::objectSize, and stoull().
Referenced by fillCephFileParams().
|
static |
fills the pool of a ceph file struct from a string and an environment returns position of first character after the pool
Definition at line 278 of file XrdCephPosix.cc.
References g_defaultParams, XrdOucEnv::Get(), and CephFile::pool.
Referenced by fillCephFileParams().
|
static |
fills the stripeUnit of a ceph file struct from a string and an environment returns position of first character after the stripeUnit
Definition at line 330 of file XrdCephPosix.cc.
References g_defaultParams, XrdOucEnv::Get(), stoull(), and CephFile::stripeUnit.
Referenced by fillCephFileParams().
fills the userId of a ceph file struct from a string and an environment returns position of first character after the userId
Definition at line 257 of file XrdCephPosix.cc.
References g_defaultParams, XrdOucEnv::Get(), and CephFile::userId.
Referenced by fillCephFileParams().
Definition at line 432 of file XrdCephPosix.cc.
References fillCephFile().
Referenced by ceph_posix_getxattr(), ceph_posix_listxattrs(), ceph_posix_opendir(), ceph_posix_removexattr(), ceph_posix_setxattr(), ceph_posix_stat(), ceph_posix_truncate(), and ceph_posix_unlink().
|
static |
Definition at line 438 of file XrdCephPosix.cc.
References CephFileRef::asyncRdCompletionCount, CephFileRef::asyncRdStartCount, CephFileRef::asyncWrCompletionCount, CephFileRef::asyncWrStartCount, CephFileRef::bytesAsyncWritePending, CephFileRef::bytesWritten, fillCephFile(), CephFileRef::flags, CephFileRef::lastAsyncSubmission, CephFileRef::longestAsyncWriteTime, CephFileRef::longestCallbackInvocation, CephFileRef::maxOffsetWritten, CephFileRef::mode, CephFileRef::offset, CephFileRef::rdcount, and CephFileRef::wrcount.
Referenced by ceph_posix_open().
unsigned int getCephPoolIdxAndIncrease | ( | ) |
Accessor to next ceph pool index Note that this is not thread safe, but we do not care as we only want a rough load balancing
Definition at line 135 of file XrdCephPosix.cc.
References g_cephPoolIdx, g_cluster, g_init_mutex, g_ioCtx, g_maxCephPoolIdx, and g_radosStripers.
Referenced by ceph_aio_read(), ceph_aio_write(), ceph_posix_statfs(), getIoCtx(), and getRadosStriper().
CephFileRef* getFileRef | ( | int | fd | ) |
look for a FileRef from its file descriptor
Definition at line 165 of file XrdCephPosix.cc.
References g_fd_mutex, and g_fds.
Referenced by ceph_aio_read(), ceph_aio_read_complete(), ceph_aio_write(), ceph_aio_write_complete(), ceph_posix_close(), ceph_posix_fcntl(), ceph_posix_fgetxattr(), ceph_posix_flistxattrs(), ceph_posix_fremovexattr(), ceph_posix_fsetxattr(), ceph_posix_fstat(), ceph_posix_fsync(), ceph_posix_ftruncate(), ceph_posix_lseek(), ceph_posix_lseek64(), ceph_posix_pread(), ceph_posix_pwrite(), ceph_posix_read(), and ceph_posix_write().
|
static |
Definition at line 596 of file XrdCephPosix.cc.
References checkAndCreateStriper(), g_ioCtx, g_striper_mutex, getCephPoolIdxAndIncrease(), CephFile::nbStripes, CephFile::objectSize, CephFile::pool, CephFile::stripeUnit, and CephFile::userId.
Referenced by ceph_posix_opendir().
|
static |
Definition at line 582 of file XrdCephPosix.cc.
References checkAndCreateStriper(), g_radosStripers, g_striper_mutex, getCephPoolIdxAndIncrease(), logwrapper(), CephFile::nbStripes, CephFile::objectSize, CephFile::pool, CephFile::stripeUnit, and CephFile::userId.
Referenced by ceph_aio_read(), ceph_aio_write(), ceph_posix_fstat(), ceph_posix_internal_getxattr(), ceph_posix_internal_listxattrs(), ceph_posix_internal_removexattr(), ceph_posix_internal_setxattr(), ceph_posix_internal_truncate(), ceph_posix_open(), ceph_posix_pread(), ceph_posix_pwrite(), ceph_posix_read(), ceph_posix_stat(), ceph_posix_unlink(), and ceph_posix_write().
int insertFileRef | ( | CephFileRef & | fr | ) |
inserts a new FileRef into the global table of file descriptors and return the associated file descriptor
Definition at line 195 of file XrdCephPosix.cc.
References CephFileRef::flags, g_fd_mutex, g_fds, g_filesOpenForWrite, g_nextCephFd, and CephFile::name.
Referenced by ceph_posix_open().
bool isOpenForWrite | ( | std::string & | name | ) |
check whether a file is open for write
Definition at line 159 of file XrdCephPosix.cc.
References g_fd_mutex, and g_filesOpenForWrite.
Referenced by ceph_posix_stat().
|
static |
Definition at line 219 of file XrdCephPosix.cc.
References g_logfunc.
Referenced by ceph_posix_close(), ceph_posix_fcntl(), ceph_posix_fgetxattr(), ceph_posix_flistxattrs(), ceph_posix_fremovexattr(), ceph_posix_fsetxattr(), ceph_posix_fstat(), ceph_posix_fsync(), ceph_posix_ftruncate(), ceph_posix_getxattr(), ceph_posix_listxattrs(), ceph_posix_lseek(), ceph_posix_lseek64(), ceph_posix_open(), ceph_posix_opendir(), ceph_posix_removexattr(), ceph_posix_setxattr(), ceph_posix_stat(), ceph_posix_statfs(), ceph_posix_truncate(), ceph_posix_unlink(), ceph_posix_write(), checkAndCreateCluster(), checkAndCreateStriper(), getRadosStriper(), and translateFileName().
|
static |
Definition at line 723 of file XrdCephPosix.cc.
References CephFileRef::offset.
Referenced by ceph_posix_lseek(), and ceph_posix_lseek64().
|
static |
simple integer parsing, to be replaced by std::stoi when C++11 can be used
Definition at line 242 of file XrdCephPosix.cc.
Referenced by fillCephNbStripes().
|
static |
simple integer parsing, to be replaced by std::stoll when C++11 can be used
Definition at line 228 of file XrdCephPosix.cc.
Referenced by fillCephObjectSize(), fillCephStripeUnit(), and XrdCl::ParseInput().
void translateFileName | ( | std::string & | physName, |
std::string | logName | ||
) |
converts a logical filename to physical one if needed
Definition at line 395 of file XrdCephPosix.cc.
References g_namelib, XrdOucName2Name::lfn2pfn(), and logwrapper().
Referenced by fillCephFile().
unsigned int g_cephPoolIdx = 0 |
index of current Striper/IoCtx to be used
Definition at line 112 of file XrdCephPosix.cc.
Referenced by getCephPoolIdxAndIncrease().
std::vector<librados::Rados*> g_cluster |
Definition at line 108 of file XrdCephPosix.cc.
Referenced by ceph_posix_disconnect_all(), checkAndCreateCluster(), checkAndCreateStriper(), and getCephPoolIdxAndIncrease().
CephFile g_defaultParams |
global variable containing defaults for CephFiles
Definition at line 206 of file XrdCephPosix.cc.
Referenced by ceph_posix_set_defaults(), fillCephNbStripes(), fillCephObjectSize(), fillCephPool(), fillCephStripeUnit(), and fillCephUserId().
std::string g_defaultPool = "default" |
Definition at line 214 of file XrdCephPosix.cc.
std::string g_defaultUserId = "admin" |
Definition at line 213 of file XrdCephPosix.cc.
XrdSysMutex g_fd_mutex |
mutex protecting the map of file descriptors and the openForWrite multiset
Definition at line 128 of file XrdCephPosix.cc.
Referenced by deleteFileRef(), getFileRef(), insertFileRef(), and isOpenForWrite().
std::map<unsigned int, CephFileRef> g_fds |
global variable holding a map of file descriptor to file reference
Definition at line 124 of file XrdCephPosix.cc.
Referenced by deleteFileRef(), getFileRef(), and insertFileRef().
std::multiset<std::string> g_filesOpenForWrite |
global variable holding a list of files currently opened for write
Definition at line 122 of file XrdCephPosix.cc.
Referenced by deleteFileRef(), insertFileRef(), and isOpenForWrite().
XrdSysMutex g_init_mutex |
mutex protecting initialization of ceph clusters
Definition at line 130 of file XrdCephPosix.cc.
Referenced by getCephPoolIdxAndIncrease().
std::vector<IOCtxDict> g_ioCtx |
Definition at line 107 of file XrdCephPosix.cc.
Referenced by ceph_posix_disconnect_all(), checkAndCreateStriper(), getCephPoolIdxAndIncrease(), and getIoCtx().
|
static |
global variable for the log function
Definition at line 217 of file XrdCephPosix.cc.
Referenced by ceph_posix_set_logfunc(), and logwrapper().
unsigned int g_maxCephPoolIdx = 1 |
size of the Striper/IoCtx pool, defaults to 1 may be overwritten in the configuration file (See XrdCephOss::configure)
Definition at line 116 of file XrdCephPosix.cc.
Referenced by ceph_posix_disconnect_all(), XrdCephOss::Configure(), and getCephPoolIdxAndIncrease().
XrdOucName2Name* g_namelib = 0 |
pointer to library providing Name2Name interface. 0 be default populated in case of ceph.namelib entry in the config file in XrdCephOss
Definition at line 119 of file XrdCephPosix.cc.
Referenced by XrdCephOss::Configure(), and translateFileName().
unsigned int g_nextCephFd = 0 |
global variable remembering the next available file descriptor
Definition at line 126 of file XrdCephPosix.cc.
Referenced by insertFileRef().
std::vector<StriperDict> g_radosStripers |
Definition at line 105 of file XrdCephPosix.cc.
Referenced by ceph_posix_disconnect_all(), checkAndCreateStriper(), getCephPoolIdxAndIncrease(), and getRadosStriper().
XrdSysMutex g_striper_mutex |
mutex protecting the striper and ioctx maps
Definition at line 110 of file XrdCephPosix.cc.
Referenced by ceph_posix_disconnect_all(), getIoCtx(), and getRadosStriper().