XRootD
XrdCephOssDir Class Reference

#include <XrdCephOssDir.hh>

+ Inheritance diagram for XrdCephOssDir:
+ Collaboration diagram for XrdCephOssDir:

Public Member Functions

 XrdCephOssDir (XrdCephOss *cephoss)
 
virtual ~XrdCephOssDir ()
 
virtual int Close (long long *retsz=0)
 
virtual int Opendir (const char *, XrdOucEnv &)
 
virtual int Readdir (char *buff, int blen)
 
- Public Member Functions inherited from XrdOssDF
 XrdOssDF (const char *tid="", uint16_t dftype=0, int fdnum=-1)
 
virtual ~XrdOssDF ()
 
uint16_t DFType ()
 
virtual int Fchmod (mode_t mode)
 
virtual int Fctl (int cmd, int alen, const char *args, char **resp=0)
 
virtual void Flush ()
 Flush filesystem cached pages for this file (used for checksums). More...
 
virtual int Fstat (struct stat *buf)
 
virtual int Fsync ()
 
virtual int Fsync (XrdSfsAio *aiop)
 
virtual int Ftruncate (unsigned long long flen)
 
virtual int getFD ()
 
virtual off_t getMmap (void **addr)
 
virtual const char * getTID ()
 
virtual int isCompressed (char *cxidp=0)
 
virtual int Open (const char *path, int Oflag, mode_t Mode, XrdOucEnv &env)
 
virtual ssize_t pgRead (void *buffer, off_t offset, size_t rdlen, uint32_t *csvec, uint64_t opts)
 
virtual int pgRead (XrdSfsAio *aioparm, uint64_t opts)
 
virtual ssize_t pgWrite (void *buffer, off_t offset, size_t wrlen, uint32_t *csvec, uint64_t opts)
 
virtual int pgWrite (XrdSfsAio *aioparm, uint64_t opts)
 
virtual ssize_t Read (off_t offset, size_t size)
 
virtual ssize_t Read (void *buffer, off_t offset, size_t size)
 
virtual int Read (XrdSfsAio *aiop)
 
virtual ssize_t ReadRaw (void *buffer, off_t offset, size_t size)
 
virtual ssize_t ReadV (XrdOucIOVec *readV, int rdvcnt)
 
virtual int StatRet (struct stat *buff)
 
virtual ssize_t Write (const void *buffer, off_t offset, size_t size)
 
virtual int Write (XrdSfsAio *aiop)
 
virtual ssize_t WriteV (XrdOucIOVec *writeV, int wrvcnt)
 

Additional Inherited Members

- Static Public Attributes inherited from XrdOssDF
static const uint16_t DF_isDir = 0x0001
 Object is for a directory. More...
 
static const uint16_t DF_isFile = 0x0002
 Object is for a file. More...
 
static const uint16_t DF_isProxy = 0x0010
 Object is a proxy object. More...
 
static const uint64_t doCalc = 0x4000000000000000ULL
 pgw: Calculate checksums More...
 
static const int Fctl_ckpObj = 0
 
static const int Fctl_utimes = 1
 
static const uint64_t Verify = 0x8000000000000000ULL
 all: Verify checksums More...
 
- Protected Attributes inherited from XrdOssDF
uint16_t dfType
 
int fd
 
off_t pgwEOF
 
short rsvd
 
const char * tident
 

Detailed Description

This class implements XrdOssDF interface for usage with a CEPH storage. It has a very restricted usage as the only valid path for opendir is '/'. The reason is that ceph is an object store where you can only list all objects, and that has no notion of hierarchy

This plugin is able to use any pool of ceph with any userId. There are several ways to provide the pool and userId to be used for a given operation. Here is the ordered list of possibilities. First one defined wins :

  • the path can be prepended with userId and pool. Syntax is : [[userId@]pool:]<actual path>
  • the XrdOucEnv parameter, when existing, can have 'cephUserId' and/or 'cephPool' entries
  • the ofs.osslib directive can provide an argument with format : [userID@]pool
  • default are 'admin' and 'default' for userId and pool respectively

Note that the definition of a default via the ofs.osslib directive may clash with one used in a ofs.xattrlib directive. In case both directives have a default and they are different, the behavior is not defined. In case one of the two only has a default, it will be applied for both plugins.

Definition at line 55 of file XrdCephOssDir.hh.

Constructor & Destructor Documentation

◆ XrdCephOssDir()

XrdCephOssDir::XrdCephOssDir ( XrdCephOss cephoss)

Definition at line 32 of file XrdCephOssDir.cc.

32 : m_dirp(0), m_cephOss(cephOss) {}

◆ ~XrdCephOssDir()

virtual XrdCephOssDir::~XrdCephOssDir ( )
inlinevirtual

Definition at line 60 of file XrdCephOssDir.hh.

60 {};

Member Function Documentation

◆ Close()

int XrdCephOssDir::Close ( long long *  retsz = 0)
virtual

Close a directory or file.

Parameters
retszIf not nil, where the size of the file is to be returned.
Returns
0 upon success or -errno or -osserr (see XrdOssError.hh).

Implements XrdOssDF.

Definition at line 47 of file XrdCephOssDir.cc.

47  {
48  ceph_posix_closedir(m_dirp);
49  return XrdOssOK;
50 }
int ceph_posix_closedir(DIR *dirp)
#define XrdOssOK
Definition: XrdOss.hh:50

References ceph_posix_closedir(), and XrdOssOK.

+ Here is the call graph for this function:

◆ Opendir()

int XrdCephOssDir::Opendir ( const char *  path,
XrdOucEnv env 
)
virtual

Open a directory.

Parameters
path- Pointer to the path of the directory to be opened.
env- Reference to environmental information.
Returns
0 upon success or -errno or -osserr (see XrdOssError.hh).

Reimplemented from XrdOssDF.

Definition at line 34 of file XrdCephOssDir.cc.

34  {
35  try {
36  m_dirp = ceph_posix_opendir(&env, path);
37  if (0 == m_dirp) {
38  return -errno;
39  }
40  return XrdOssOK;
41  } catch (std::exception &e) {
42  XrdCephEroute.Say("opendir : invalid syntax in file parameters");
43  return -EINVAL;
44  }
45 }
XrdSysError XrdCephEroute
DIR * ceph_posix_opendir(XrdOucEnv *env, const char *pathname)
void Say(const char *text1, const char *text2=0, const char *txt3=0, const char *text4=0, const char *text5=0, const char *txt6=0)
Definition: XrdSysError.cc:141

References ceph_posix_opendir(), XrdSysError::Say(), XrdCephEroute, and XrdOssOK.

+ Here is the call graph for this function:

◆ Readdir()

int XrdCephOssDir::Readdir ( char *  buff,
int  blen 
)
virtual

Get the next directory entry.

Parameters
buff- Pointer to buffer where a null terminated string of the entry name is to be returned. If no more entries exist, a null string is returned.
blen- Length of the buffer.
Returns
0 upon success or -errno or -osserr (see XrdOssError.hh).

Reimplemented from XrdOssDF.

Definition at line 52 of file XrdCephOssDir.cc.

52  {
53  return ceph_posix_readdir(m_dirp, buff, blen);
54 }
int ceph_posix_readdir(DIR *dirp, char *buff, int blen)

References ceph_posix_readdir().

+ Here is the call graph for this function:

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