![]() |
XRootD
|
#include <sys/types.h>
#include <stdarg.h>
#include <string>
#include <dirent.h>
#include <cstdint>
#include <XrdOuc/XrdOucEnv.hh>
#include <XrdSys/XrdSysXAttr.hh>
#include "XrdSys/XrdSysPthread.hh"
#include "XrdOuc/XrdOucIOVec.hh"
Go to the source code of this file.
Classes | |
struct | CephFile |
small structs to store file metadata More... | |
struct | CephFileRef |
Macros | |
#define | LOGCEPH(x) {std::stringstream _s; _s << x; std::clog << _s.str() << std::endl; _s.clear(); } |
#define | MAXDIGITSIZE 32 |
#define | XRDCEPHLOGLEVEL 1 |
Typedefs | |
typedef void() | AioCB(XrdSfsAio *, size_t) |
Functions | |
ssize_t | ceph_aio_read (int fd, XrdSfsAio *aiop, AioCB *cb) |
ssize_t | ceph_aio_write (int fd, XrdSfsAio *aiop, AioCB *cb) |
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) |
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=true) |
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. More... | |
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) |
#define LOGCEPH | ( | x | ) | {std::stringstream _s; _s << x; std::clog << _s.str() << std::endl; _s.clear(); } |
Definition at line 51 of file XrdCephPosix.hh.
#define MAXDIGITSIZE 32 |
Definition at line 45 of file XrdCephPosix.hh.
#define XRDCEPHLOGLEVEL 1 |
Definition at line 44 of file XrdCephPosix.hh.
typedef void() AioCB(XrdSfsAio *, size_t) |
Definition at line 58 of file XrdCephPosix.hh.
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 XrdCephBuffer::CephIOAdapterAIORaw::read(), and XrdCephOssFile::Read().
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(), if(), CephFileRef::lastAsyncSubmission, CephFile::name, XrdSfsAio::sfsAio, and CephFileRef::statsMutex.
Referenced by XrdCephBuffer::CephIOAdapterAIORaw::write(), and XrdCephOssFile::Write().
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(), CephFile::name, CephFile::nbStripes, CephFileRef::rdcount, bulkAioRead::read(), CephFileRef::statsMutex, and bulkAioRead::submit_and_wait_for_complete().
Referenced by XrdCephOssFile::ReadV().
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().
int ceph_posix_closedir | ( | DIR * | dirp | ) |
Definition at line 1626 of file XrdCephPosix.cc.
Referenced by XrdCephOssDir::Close().
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().
int ceph_posix_fcntl | ( | int | fd, |
int | cmd, | ||
... | |||
) |
Definition at line 1286 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 1323 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 1435 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 1445 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 1386 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 1356 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 1215 of file XrdCephPosix.cc.
References getFileRef(), getRadosStriper(), logwrapper(), and CephFile::name.
Referenced by XrdCephOssFile::Fstat().
int ceph_posix_fsync | ( | int | fd | ) |
Definition at line 1275 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 1525 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 1316 of file XrdCephPosix.cc.
References ceph_posix_internal_getxattr(), getCephFile(), and logwrapper().
Referenced by XrdCephXAttr::Get(), and getNumericAttr().
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().
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().
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().
ssize_t ceph_posix_maybestriper_pread | ( | int | fd, |
void * | buf, | ||
size_t | count, | ||
off64_t | offset, | ||
bool | allowStriper = true |
||
) |
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().
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(), 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().
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(), stoull(), and CephFile::stripeUnit.
Referenced by XrdCephOssFile::Open().
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().
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().
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().
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.
int ceph_posix_readdir | ( | DIR * | dirp, |
char * | buff, | ||
int | blen | ||
) |
Definition at line 1607 of file XrdCephPosix.cc.
Referenced by XrdCephOssDir::Readdir().
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().
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().
void ceph_posix_set_logfunc | ( | void(*)(char *, va_list argp) | logfunc | ) |
Definition at line 644 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 1349 of file XrdCephPosix.cc.
References ceph_posix_internal_setxattr(), getCephFile(), and logwrapper().
Referenced by XrdCephXAttr::Set().
Definition at line 1243 of file XrdCephPosix.cc.
References getCephFile(), getRadosStriper(), isOpenForWrite(), logwrapper(), and CephFile::name.
Referenced by XrdCephOss::Stat().
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, 2022 Ian Johnson STFC RAL, ish. thoma s@st fc.ac .ukian.j, 2022, 2023 ohns on@st fc.a c.uk
Definition at line 1491 of file XrdCephPosix.cc.
References checkAndCreateCluster(), getCephPoolIdxAndIncrease(), logwrapper(), stat(), and XrdOssOK.
Referenced by XrdCephOss::StatLS().
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().
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().
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().
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.
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().