|
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 <chrono>#include <limits>#include <pthread.h>#include "XrdSfs/XrdSfsAio.hh"#include "XrdSys/XrdSysPthread.hh"#include "XrdOuc/XrdOucName2Name.hh"#include "XrdSys/XrdSysPlatform.hh"#include <XrdOss/XrdOss.hh>#include "XrdOuc/XrdOucIOVec.hh"#include "XrdCeph/XrdCephPosix.hh"#include "XrdCeph/XrdCephBulkAioRead.hh"#include "XrdSfs/XrdSfsFlags.hh"
Include dependency graph for XrdCephPosix.cc:Go to the source code of this file.
Classes | |
| struct | AioArgs |
| small struct for aio API callbacks More... | |
| 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) |
| ssize_t | ceph_nonstriper_readv (int fd, XrdOucIOVec *readV, int n) |
| 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) |
| ssize_t | ceph_posix_maybestriper_pread (int fd, void *buf, size_t count, off64_t offset, bool allowStriper) |
| ssize_t | ceph_posix_nonstriper_pread (int fd, void *buf, size_t count, off64_t offset) |
| 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_stat_pool (char const *poolName, long long *usedSpace) |
| Return the amount of space used in a pool. | |
| 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) |
| ssize_t | ceph_striper_readv (int fd, XrdOucIOVec *readV, int n) |
| 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 | |
| void | dumpClusterInfo () |
| void | fillCephFile (const char *path, XrdOucEnv *env, CephFile &file) |
| fill a ceph file struct from a path and an environment | |
| 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 | |
| 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 | |
| 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 | |
| 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 | |
| void | translateFileName (std::string &physName, std::string logName) |
| converts a logical filename to physical one if needed | |
Variables | |
| unsigned int | g_cephAioWaitThresh = 15 |
| unsigned int | g_cephPoolIdx = 0 |
| index of current Striper/IoCtx to be used | |
| std::vector< librados::Rados * > | g_cluster |
| CephFile | g_defaultParams |
| global variable containing defaults for CephFiles | |
| 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 | |
| std::map< unsigned int, CephFileRef > | g_fds |
| global variable holding a map of file descriptor to file reference | |
| std::multiset< std::string > | g_filesOpenForWrite |
| global variable holding a list of files currently opened for write | |
| std::map< unsigned int, unsigned long long > | g_idxCntr |
| XrdSysMutex | g_init_mutex |
| mutex protecting initialization of ceph clusters | |
| std::vector< IOCtxDict > | g_ioCtx |
| static void(* | g_logfunc )(char *, va_list argp)=0 |
| global variable for the log function | |
| unsigned int | g_maxCephPoolIdx = 1 |
| XrdOucName2Name * | g_namelib = 0 |
| unsigned int | g_nextCephFd = 0 |
| global variable remembering the next available file descriptor | |
| std::vector< StriperDict > | g_radosStripers |
| XrdSysMutex | g_striper_mutex |
| mutex protecting the striper and ioctx maps | |
| struct DirIterator |
small struct for directory listing
Definition at line 60 of file XrdCephPosix.cc.
Collaboration diagram for DirIterator:| Class Members | ||
|---|---|---|
| IoCtx * | m_ioctx | |
| NObjectIterator | m_iterator | |
| typedef std::map<std::string, librados::IoCtx*> IOCtxDict |
Definition at line 82 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 80 of file XrdCephPosix.cc.
Definition at line 1175 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(), and XrdCephBuffer::CephIOAdapterAIORaw::read().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 1154 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().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 903 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(), CephFileRef::lastAsyncSubmission, CephFile::name, XrdSfsAio::sfsAio, and CephFileRef::statsMutex.
Referenced by XrdCephOssFile::Write(), and XrdCephBuffer::CephIOAdapterAIORaw::write().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 873 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().
Here is the call graph for this function:
Here is the caller graph for this function:| ssize_t ceph_nonstriper_readv | ( | int | fd, |
| XrdOucIOVec * | readV, | ||
| int | n ) |
Definition at line 947 of file XrdCephPosix.cc.
References CephFileRef::flags, g_cephAioWaitThresh, bulkAioRead::get_results(), getFileRef(), getIoCtx(), logwrapper(), logwrapper(), CephFile::name, CephFile::nbStripes, CephFileRef::rdcount, bulkAioRead::read(), CephFileRef::statsMutex, and bulkAioRead::submit_and_wait_for_complete().
Referenced by XrdCephOssFile::ReadV().
Here is the call graph for this function:
Here is the caller graph for this function:| int ceph_posix_close | ( | int | fd | ) |
Definition at line 760 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().
Here is the call graph for this function:
Here is the caller graph for this function:| int ceph_posix_closedir | ( | DIR * | dirp | ) |
Definition at line 1626 of file XrdCephPosix.cc.
Referenced by XrdCephOssDir::Close().
Here is the caller graph for this function:| void ceph_posix_disconnect_all | ( | ) |
Definition at line 624 of file XrdCephPosix.cc.
References g_cluster, g_ioCtx, g_maxCephPoolIdx, g_radosStripers, and g_striper_mutex.
Referenced by XrdCephOss::~XrdCephOss().
Here is the caller graph for this function:| int ceph_posix_fcntl | ( | int | fd, |
| int | cmd, | ||
| ... ) |
Definition at line 1286 of file XrdCephPosix.cc.
References getFileRef(), logwrapper(), and CephFileRef::mode.
Here is the call graph for this function:| ssize_t ceph_posix_fgetxattr | ( | int | fd, |
| const char * | name, | ||
| void * | value, | ||
| size_t | size ) |
Definition at line 1323 of file XrdCephPosix.cc.
References ceph_posix_internal_getxattr(), getFileRef(), and logwrapper().
Referenced by XrdCephXAttr::Get().
Here is the call graph for this function:
Here is the caller graph for this function:| int ceph_posix_flistxattrs | ( | int | fd, |
| XrdSysXAttr::AList ** | aPL, | ||
| int | getSz ) |
Definition at line 1435 of file XrdCephPosix.cc.
References ceph_posix_internal_listxattrs(), getFileRef(), and logwrapper().
Referenced by XrdCephXAttr::List().
Here is the call graph for this function:
Here is the caller graph for this function:| void ceph_posix_freexattrlist | ( | XrdSysXAttr::AList * | aPL | ) |
Definition at line 1445 of file XrdCephPosix.cc.
References XrdSysXAttr::AList::Name, and XrdSysXAttr::AList::Next.
Referenced by XrdCephXAttr::Free().
Here is the caller graph for this function:| int ceph_posix_fremovexattr | ( | int | fd, |
| const char * | name ) |
Definition at line 1386 of file XrdCephPosix.cc.
References ceph_posix_internal_removexattr(), getFileRef(), and logwrapper().
Here is the call graph for this function:| int ceph_posix_fsetxattr | ( | int | fd, |
| const char * | name, | ||
| const void * | value, | ||
| size_t | size, | ||
| int | flags ) |
Definition at line 1356 of file XrdCephPosix.cc.
References ceph_posix_internal_setxattr(), getFileRef(), and logwrapper().
Referenced by XrdCephXAttr::Set().
Here is the call graph for this function:
Here is the caller graph for this function:| int ceph_posix_fstat | ( | int | fd, |
| struct stat * | buf ) |
Definition at line 1215 of file XrdCephPosix.cc.
References getFileRef(), getRadosStriper(), logwrapper(), CephFile::name, and stat.
Referenced by XrdCephOssFile::Fstat().
Here is the call graph for this function:
Here is the caller graph for this function:| int ceph_posix_fsync | ( | int | fd | ) |
Definition at line 1275 of file XrdCephPosix.cc.
References getFileRef(), and logwrapper().
Referenced by XrdCephOssFile::Fsync().
Here is the call graph for this function:
Here is the caller graph for this function:| int ceph_posix_ftruncate | ( | int | fd, |
| unsigned long long | size ) |
Definition at line 1525 of file XrdCephPosix.cc.
References ceph_posix_internal_truncate(), getFileRef(), and logwrapper().
Referenced by XrdCephOssFile::Ftruncate().
Here is the call graph for this function:
Here is the caller graph for this function:| ssize_t ceph_posix_getxattr | ( | XrdOucEnv * | env, |
| const char * | path, | ||
| const char * | name, | ||
| void * | value, | ||
| size_t | size ) |
Definition at line 1316 of file XrdCephPosix.cc.
References ceph_posix_internal_getxattr(), getCephFile(), and logwrapper().
Referenced by XrdCephXAttr::Get(), and getNumericAttr().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 1302 of file XrdCephPosix.cc.
References getRadosStriper(), and CephFile::name.
Referenced by ceph_posix_fgetxattr(), and ceph_posix_getxattr().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 1396 of file XrdCephPosix.cc.
References getRadosStriper(), XrdSysXAttr::AList::Name, CephFile::name, XrdSysXAttr::AList::Next, XrdSysXAttr::AList::Nlen, and XrdSysXAttr::AList::Vlen.
Referenced by ceph_posix_flistxattrs(), and ceph_posix_listxattrs().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 1368 of file XrdCephPosix.cc.
References getRadosStriper(), and CephFile::name.
Referenced by ceph_posix_fremovexattr(), ceph_posix_removexattr(), and ceph_posix_unlink().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 1334 of file XrdCephPosix.cc.
References getRadosStriper(), and CephFile::name.
Referenced by ceph_posix_fsetxattr(), and ceph_posix_setxattr().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 1517 of file XrdCephPosix.cc.
References getRadosStriper(), and CephFile::name.
Referenced by ceph_posix_ftruncate(), and ceph_posix_truncate().
Here is the call graph for this function:
Here is the caller graph for this function:| int ceph_posix_listxattrs | ( | XrdOucEnv * | env, |
| const char * | path, | ||
| XrdSysXAttr::AList ** | aPL, | ||
| int | getSz ) |
Definition at line 1430 of file XrdCephPosix.cc.
References ceph_posix_internal_listxattrs(), getCephFile(), and logwrapper().
Referenced by XrdCephXAttr::List().
Here is the call graph for this function:
Here is the caller graph for this function:| off_t ceph_posix_lseek | ( | int | fd, |
| off_t | offset, | ||
| int | whence ) |
Definition at line 801 of file XrdCephPosix.cc.
References getFileRef(), logwrapper(), and lseek_compute_offset().
Here is the call graph for this function:| off64_t ceph_posix_lseek64 | ( | int | fd, |
| off64_t | offset, | ||
| int | whence ) |
Definition at line 811 of file XrdCephPosix.cc.
References getFileRef(), logwrapper(), and lseek_compute_offset().
Here is the call graph for this function:| ssize_t ceph_posix_maybestriper_pread | ( | int | fd, |
| void * | buf, | ||
| size_t | count, | ||
| off64_t | offset, | ||
| bool | allowStriper ) |
Definition at line 1134 of file XrdCephPosix.cc.
References ceph_posix_nonstriper_pread(), ceph_posix_pread(), and logwrapper().
Referenced by XrdCephBuffer::CephIOAdapterRaw::read(), and XrdCephBuffer::XrdCephBufferAlgSimple::read().
Here is the call graph for this function:
Here is the caller graph for this function:| ssize_t ceph_posix_nonstriper_pread | ( | int | fd, |
| void * | buf, | ||
| size_t | count, | ||
| off64_t | offset ) |
Definition at line 1048 of file XrdCephPosix.cc.
References CephFileRef::flags, g_cephAioWaitThresh, bulkAioRead::get_results(), getFileRef(), getIoCtx(), logwrapper(), logwrapper(), CephFile::name, CephFile::nbStripes, CephFileRef::rdcount, bulkAioRead::read(), CephFileRef::statsMutex, and bulkAioRead::submit_and_wait_for_complete().
Referenced by ceph_posix_maybestriper_pread(), and XrdCephOssFile::Read().
Here is the call graph for this function:
Here is the caller graph for this function:| int ceph_posix_open | ( | XrdOucEnv * | env, |
| const char * | pathname, | ||
| int | flags, | ||
| mode_t | mode ) |
Definition at line 664 of file XrdCephPosix.cc.
References ceph_posix_unlink(), dumpClusterInfo(), getCephFileRef(), getIoCtx(), getRadosStriper(), insertFileRef(), logwrapper(), MAXDIGITSIZE, CephFile::name, CephFile::objectSize, stat, and CephFile::stripeUnit.
Referenced by XrdCephOssFile::Open().
Here is the call graph for this function:
Here is the caller graph for this function:| DIR * ceph_posix_opendir | ( | XrdOucEnv * | env, |
| const char * | pathname ) |
Definition at line 1588 of file XrdCephPosix.cc.
References getCephFile(), getIoCtx(), logwrapper(), DirIterator::m_ioctx, DirIterator::m_iterator, and CephFile::name.
Referenced by XrdCephOssDir::Opendir().
Here is the call graph for this function:
Here is the caller graph for this function:| ssize_t ceph_posix_pread | ( | int | fd, |
| void * | buf, | ||
| size_t | count, | ||
| off64_t | offset ) |
Definition at line 1110 of file XrdCephPosix.cc.
References CephFileRef::flags, getFileRef(), getRadosStriper(), CephFile::name, CephFileRef::rdcount, and CephFileRef::statsMutex.
Referenced by ceph_posix_maybestriper_pread(), ceph_striper_readv(), and XrdCephOssFile::Read().
Here is the call graph for this function:
Here is the caller graph for this function:| ssize_t ceph_posix_pwrite | ( | int | fd, |
| const void * | buf, | ||
| size_t | count, | ||
| off64_t | offset ) |
Definition at line 847 of file XrdCephPosix.cc.
References CephFileRef::bytesWritten, CephFileRef::flags, getFileRef(), getRadosStriper(), CephFileRef::maxOffsetWritten, CephFile::name, CephFileRef::statsMutex, and CephFileRef::wrcount.
Referenced by XrdCephOssFile::Write(), and XrdCephBuffer::CephIOAdapterRaw::write().
Here is the call graph for this function:
Here is the caller graph for this function:| ssize_t ceph_posix_read | ( | int | fd, |
| void * | buf, | ||
| size_t | count ) |
Definition at line 1023 of file XrdCephPosix.cc.
References CephFileRef::flags, getFileRef(), getRadosStriper(), CephFile::name, CephFileRef::offset, CephFileRef::rdcount, and CephFileRef::statsMutex.
Here is the call graph for this function:| int ceph_posix_readdir | ( | DIR * | dirp, |
| char * | buff, | ||
| int | blen ) |
Definition at line 1607 of file XrdCephPosix.cc.
References DirIterator::m_iterator.
Referenced by XrdCephOssDir::Readdir().
Here is the caller graph for this function:| int ceph_posix_removexattr | ( | XrdOucEnv * | env, |
| const char * | path, | ||
| const char * | name ) |
Definition at line 1380 of file XrdCephPosix.cc.
References ceph_posix_internal_removexattr(), getCephFile(), and logwrapper().
Referenced by XrdCephXAttr::Del().
Here is the call graph for this function:
Here is the caller graph for this function:| 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 397 of file XrdCephPosix.cc.
References fillCephFileParams(), and g_defaultParams.
Referenced by XrdOssGetStorageSystem(), and XrdSysGetXAttrObject().
Here is the call graph for this function:
Here is the caller graph for this function:| void ceph_posix_set_logfunc | ( | void(* | logfunc )(char *, va_list argp) | ) |
Definition at line 644 of file XrdCephPosix.cc.
References g_logfunc.
Referenced by XrdOssGetStorageSystem().
Here is the caller graph for this function:| ssize_t ceph_posix_setxattr | ( | XrdOucEnv * | env, |
| const char * | path, | ||
| const char * | name, | ||
| const void * | value, | ||
| size_t | size, | ||
| int | flags ) |
Definition at line 1349 of file XrdCephPosix.cc.
References ceph_posix_internal_setxattr(), getCephFile(), and logwrapper().
Referenced by XrdCephXAttr::Set().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 1243 of file XrdCephPosix.cc.
References getCephFile(), getRadosStriper(), isOpenForWrite(), logwrapper(), CephFile::name, and stat.
Referenced by XrdCephOss::Stat().
Here is the call graph for this function:
Here is the caller graph for this function:| int ceph_posix_stat_pool | ( | char const * | poolName, |
| long long * | usedSpace ) |
Return the amount of space used in a pool.
This function - Obtains the statistics that librados holds on a pool Calculates the number of bytes allocated to the pool @params poolName: (in) the name of the pool to query usedSpace: (out) the number of bytes used in the pool
Implementation: Jyothish Thomas STFC RAL, jyoth.nosp@m.ish..nosp@m.thoma.nosp@m.s@st.nosp@m.fc.ac.nosp@m..uk, 2022 Ian Johnson STFC RAL, ian.j.nosp@m.ohns.nosp@m.on@st.nosp@m.fc.a.nosp@m.c.uk, 2022, 2023
Definition at line 1491 of file XrdCephPosix.cc.
References checkAndCreateCluster(), getCephPoolIdxAndIncrease(), logwrapper(), stat, and XrdOssOK.
Referenced by XrdCephOss::StatLS().
Here is the call graph for this function:
Here is the caller graph for this function:| int ceph_posix_statfs | ( | long long * | totalSpace, |
| long long * | freeSpace ) |
Definition at line 1454 of file XrdCephPosix.cc.
References checkAndCreateCluster(), getCephPoolIdxAndIncrease(), and logwrapper().
Referenced by XrdCephOss::StatVS().
Here is the call graph for this function:
Here is the caller graph for this function:| int ceph_posix_truncate | ( | XrdOucEnv * | env, |
| const char * | pathname, | ||
| unsigned long long | size ) |
Definition at line 1535 of file XrdCephPosix.cc.
References ceph_posix_internal_truncate(), getCephFile(), and logwrapper().
Referenced by XrdCephOss::Truncate().
Here is the call graph for this function:
Here is the caller graph for this function:| int ceph_posix_unlink | ( | XrdOucEnv * | env, |
| const char * | pathname ) |
Definition at line 1542 of file XrdCephPosix.cc.
References ceph_posix_internal_removexattr(), getCephFile(), getRadosStriper(), logwrapper(), and CephFile::name.
Referenced by ceph_posix_open(), and XrdCephOss::Unlink().
Here is the call graph for this function:
Here is the caller graph for this function:| ssize_t ceph_posix_write | ( | int | fd, |
| const void * | buf, | ||
| size_t | count ) |
Definition at line 821 of file XrdCephPosix.cc.
References CephFileRef::bytesWritten, CephFileRef::flags, getFileRef(), getRadosStriper(), logwrapper(), CephFileRef::maxOffsetWritten, CephFile::name, CephFileRef::offset, CephFileRef::statsMutex, and CephFileRef::wrcount.
Here is the call graph for this function:| ssize_t ceph_striper_readv | ( | int | fd, |
| XrdOucIOVec * | readV, | ||
| int | n ) |
Sequential, striper-based readv implementation.
Definition at line 1007 of file XrdCephPosix.cc.
References ceph_posix_pread().
Referenced by XrdCephOssFile::ReadV().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 476 of file XrdCephPosix.cc.
References g_cluster, g_defaultParams, and logwrapper().
Referenced by ceph_aio_read(), ceph_aio_write(), ceph_posix_stat_pool(), ceph_posix_statfs(), and checkAndCreateStriper().
Here is the call graph for this function:
Here is the caller graph for this function:| int checkAndCreateStriper | ( | unsigned int | cephPoolIdx, |
| std::string & | userAtPool, | ||
| const CephFile & | file ) |
Definition at line 510 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().
Here is the call graph for this function:
Here is the caller graph for this function:| void deleteFileRef | ( | int | fd, |
| const CephFileRef & | fr ) |
deletes a FileRef from the global table of file descriptors
Definition at line 164 of file XrdCephPosix.cc.
References CephFileRef::flags, g_fd_mutex, g_fds, g_filesOpenForWrite, and CephFile::name.
Referenced by ceph_posix_close().
Here is the caller graph for this function:| void dumpClusterInfo | ( | ) |
Definition at line 241 of file XrdCephPosix.cc.
References g_cluster, g_fds, g_filesOpenForWrite, g_idxCntr, g_ioCtx, g_radosStripers, and logwrapper().
Referenced by ceph_posix_open().
Here is the call graph for this function:
Here is the caller graph for this function:fill a ceph file struct from a path and an environment
Definition at line 424 of file XrdCephPosix.cc.
References fillCephFileParams(), CephFile::name, and translateFileName().
Referenced by getCephFile(), and getCephFileRef().
Here is the call graph for this function:
Here is the caller graph for this function: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 385 of file XrdCephPosix.cc.
References fillCephNbStripes(), fillCephObjectSize(), fillCephPool(), fillCephStripeUnit(), and fillCephUserId().
Referenced by ceph_posix_set_defaults(), and fillCephFile().
Here is the call graph for this function:
Here is the caller graph for this function:
|
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 315 of file XrdCephPosix.cc.
References g_defaultParams, XrdOucEnv::Get(), CephFile::nbStripes, and stoui().
Referenced by fillCephFileParams().
Here is the call graph for this function:
Here is the caller graph for this function:
|
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 367 of file XrdCephPosix.cc.
References g_defaultParams, XrdOucEnv::Get(), CephFile::objectSize, and stoull().
Referenced by fillCephFileParams().
Here is the call graph for this function:
Here is the caller graph for this function:
|
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 289 of file XrdCephPosix.cc.
References g_defaultParams, XrdOucEnv::Get(), and CephFile::pool.
Referenced by fillCephFileParams().
Here is the call graph for this function:
Here is the caller graph for this function:
|
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 341 of file XrdCephPosix.cc.
References g_defaultParams, XrdOucEnv::Get(), stoull(), and CephFile::stripeUnit.
Referenced by fillCephFileParams().
Here is the call graph for this function:
Here is the caller graph for this function: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 268 of file XrdCephPosix.cc.
References g_defaultParams, XrdOucEnv::Get(), and CephFile::userId.
Referenced by fillCephFileParams().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 447 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().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 453 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().
Here is the call graph for this function:
Here is the caller graph for this function:| 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 117 of file XrdCephPosix.cc.
References g_cephPoolIdx, g_cluster, g_idxCntr, g_init_mutex, g_ioCtx, g_maxCephPoolIdx, and g_radosStripers.
Referenced by ceph_aio_read(), ceph_aio_write(), ceph_posix_stat_pool(), ceph_posix_statfs(), getIoCtx(), and getRadosStriper().
Here is the caller graph for this function:| CephFileRef * getFileRef | ( | int | fd | ) |
look for a FileRef from its file descriptor
Definition at line 149 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_nonstriper_readv(), 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_nonstriper_pread(), ceph_posix_pread(), ceph_posix_pwrite(), ceph_posix_read(), and ceph_posix_write().
Here is the caller graph for this function:
|
static |
Definition at line 611 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_nonstriper_readv(), ceph_posix_nonstriper_pread(), ceph_posix_open(), and ceph_posix_opendir().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 597 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().
Here is the call graph for this function:
Here is the caller graph for this function:| int insertFileRef | ( | CephFileRef & | fr | ) |
inserts a new FileRef into the global table of file descriptors and return the associated file descriptor
Definition at line 179 of file XrdCephPosix.cc.
References CephFileRef::flags, g_fd_mutex, g_fds, g_filesOpenForWrite, g_nextCephFd, and CephFile::name.
Referenced by ceph_posix_open().
Here is the caller graph for this function:| bool isOpenForWrite | ( | std::string & | name | ) |
check whether a file is open for write
Definition at line 143 of file XrdCephPosix.cc.
References g_fd_mutex, and g_filesOpenForWrite.
Referenced by ceph_posix_stat().
Here is the caller graph for this function:
|
static |
Definition at line 203 of file XrdCephPosix.cc.
References g_logfunc.
Referenced by ceph_nonstriper_readv(), 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_maybestriper_pread(), ceph_posix_nonstriper_pread(), ceph_posix_open(), ceph_posix_opendir(), ceph_posix_removexattr(), ceph_posix_setxattr(), ceph_posix_stat(), ceph_posix_stat_pool(), ceph_posix_statfs(), ceph_posix_truncate(), ceph_posix_unlink(), ceph_posix_write(), checkAndCreateCluster(), checkAndCreateStriper(), dumpClusterInfo(), getRadosStriper(), and translateFileName().
Here is the caller graph for this function:
|
static |
Definition at line 787 of file XrdCephPosix.cc.
References CephFileRef::offset.
Referenced by ceph_posix_lseek(), and ceph_posix_lseek64().
Here is the caller graph for this function:
|
static |
simple integer parsing, to be replaced by std::stoi when C++11 can be used
Definition at line 226 of file XrdCephPosix.cc.
Referenced by fillCephNbStripes().
Here is the caller graph for this function:
|
static |
simple integer parsing, to be replaced by std::stoll when C++11 can be used
Definition at line 212 of file XrdCephPosix.cc.
Referenced by fillCephObjectSize(), and fillCephStripeUnit().
Here is the caller graph for this function:| void translateFileName | ( | std::string & | physName, |
| std::string | logName ) |
converts a logical filename to physical one if needed
Definition at line 406 of file XrdCephPosix.cc.
References g_namelib, and logwrapper().
Referenced by fillCephFile().
Here is the call graph for this function:
Here is the caller graph for this function:| unsigned int g_cephAioWaitThresh = 15 |
If aio read operation takes longer than this value, a warning will be issued
Definition at line 91 of file XrdCephPosix.cc.
Referenced by ceph_nonstriper_readv(), ceph_posix_nonstriper_pread(), and XrdCephOss::Configure().
| unsigned int g_cephPoolIdx = 0 |
index of current Striper/IoCtx to be used
Definition at line 88 of file XrdCephPosix.cc.
Referenced by getCephPoolIdxAndIncrease().
| std::vector<librados::Rados*> g_cluster |
Definition at line 84 of file XrdCephPosix.cc.
Referenced by ceph_posix_disconnect_all(), checkAndCreateCluster(), checkAndCreateStriper(), dumpClusterInfo(), and getCephPoolIdxAndIncrease().
| CephFile g_defaultParams |
global variable containing defaults for CephFiles
Definition at line 190 of file XrdCephPosix.cc.
Referenced by ceph_posix_set_defaults(), checkAndCreateCluster(), fillCephNbStripes(), fillCephObjectSize(), fillCephPool(), fillCephStripeUnit(), and fillCephUserId().
| std::string g_defaultPool = "default" |
Definition at line 198 of file XrdCephPosix.cc.
| std::string g_defaultUserId = "admin" |
Definition at line 197 of file XrdCephPosix.cc.
| XrdSysMutex g_fd_mutex |
mutex protecting the map of file descriptors and the openForWrite multiset
Definition at line 107 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 103 of file XrdCephPosix.cc.
Referenced by deleteFileRef(), dumpClusterInfo(), getFileRef(), and insertFileRef().
| std::multiset<std::string> g_filesOpenForWrite |
global variable holding a list of files currently opened for write
Definition at line 101 of file XrdCephPosix.cc.
Referenced by deleteFileRef(), dumpClusterInfo(), insertFileRef(), and isOpenForWrite().
| std::map<unsigned int, unsigned long long> g_idxCntr |
Definition at line 112 of file XrdCephPosix.cc.
Referenced by dumpClusterInfo(), and getCephPoolIdxAndIncrease().
| XrdSysMutex g_init_mutex |
mutex protecting initialization of ceph clusters
Definition at line 109 of file XrdCephPosix.cc.
Referenced by getCephPoolIdxAndIncrease().
| std::vector<IOCtxDict> g_ioCtx |
Definition at line 83 of file XrdCephPosix.cc.
Referenced by ceph_posix_disconnect_all(), checkAndCreateStriper(), dumpClusterInfo(), getCephPoolIdxAndIncrease(), and getIoCtx().
|
static |
global variable for the log function
Definition at line 201 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 95 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 98 of file XrdCephPosix.cc.
Referenced by XrdCephOss::Configure(), m_translateFileName(), and translateFileName().
| unsigned int g_nextCephFd = 0 |
global variable remembering the next available file descriptor
Definition at line 105 of file XrdCephPosix.cc.
Referenced by insertFileRef().
| std::vector<StriperDict> g_radosStripers |
Definition at line 81 of file XrdCephPosix.cc.
Referenced by ceph_posix_disconnect_all(), checkAndCreateStriper(), dumpClusterInfo(), getCephPoolIdxAndIncrease(), and getRadosStriper().
| XrdSysMutex g_striper_mutex |
mutex protecting the striper and ioctx maps
Definition at line 86 of file XrdCephPosix.cc.
Referenced by ceph_posix_disconnect_all(), getIoCtx(), and getRadosStriper().