XRootD
XrdCephPosix.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // Copyright (c) 2014-2015 by European Organization for Nuclear Research (CERN)
3 // Author: Sebastien Ponce <sebastien.ponce@cern.ch>
4 //------------------------------------------------------------------------------
5 // This file is part of the XRootD software suite.
6 //
7 // XRootD is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Lesser General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // XRootD is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU Lesser General Public License
18 // along with XRootD. If not, see <http://www.gnu.org/licenses/>.
19 //
20 // In applying this licence, CERN does not waive the privileges and immunities
21 // granted to it by virtue of its status as an Intergovernmental Organization
22 // or submit itself to any jurisdiction.
23 //------------------------------------------------------------------------------
24 
25 /*
26  * This interface provides wrapper methods for using ceph through a POSIX API.
27  */
28 
29 #ifndef _XRD_CEPH_POSIX_H
30 #define _XRD_CEPH_POSIX_H
31 
32 #include <sys/types.h>
33 #include <stdarg.h>
34 #include <dirent.h>
35 #include <XrdOuc/XrdOucEnv.hh>
36 #include <XrdSys/XrdSysXAttr.hh>
37 
38 class XrdSfsAio;
39 typedef void(AioCB)(XrdSfsAio*, size_t);
40 
41 void ceph_posix_set_defaults(const char* value);
43 void ceph_posix_set_logfunc(void (*logfunc) (char *, va_list argp));
44 int ceph_posix_open(XrdOucEnv* env, const char *pathname, int flags, mode_t mode);
45 int ceph_posix_close(int fd);
46 off_t ceph_posix_lseek(int fd, off_t offset, int whence);
47 off64_t ceph_posix_lseek64(int fd, off64_t offset, int whence);
48 ssize_t ceph_posix_write(int fd, const void *buf, size_t count);
49 ssize_t ceph_posix_pwrite(int fd, const void *buf, size_t count, off64_t offset);
50 ssize_t ceph_aio_write(int fd, XrdSfsAio *aiop, AioCB *cb);
51 ssize_t ceph_posix_read(int fd, void *buf, size_t count);
52 ssize_t ceph_posix_pread(int fd, void *buf, size_t count, off64_t offset);
53 ssize_t ceph_aio_read(int fd, XrdSfsAio *aiop, AioCB *cb);
54 int ceph_posix_fstat(int fd, struct stat *buf);
55 int ceph_posix_stat(XrdOucEnv* env, const char *pathname, struct stat *buf);
56 int ceph_posix_fsync(int fd);
57 int ceph_posix_fcntl(int fd, int cmd, ... /* arg */ );
58 ssize_t ceph_posix_getxattr(XrdOucEnv* env, const char* path, const char* name,
59  void* value, size_t size);
60 ssize_t ceph_posix_fgetxattr(int fd, const char* name, void* value, size_t size);
61 ssize_t ceph_posix_setxattr(XrdOucEnv* env, const char* path, const char* name,
62  const void* value, size_t size, int flags);
63 int ceph_posix_fsetxattr(int fd, const char* name, const void* value, size_t size, int flags);
64 int ceph_posix_removexattr(XrdOucEnv* env, const char* path, const char* name);
65 int ceph_posix_fremovexattr(int fd, const char* name);
66 int ceph_posix_listxattrs(XrdOucEnv* env, const char* path, XrdSysXAttr::AList **aPL, int getSz);
67 int ceph_posix_flistxattrs(int fd, XrdSysXAttr::AList **aPL, int getSz);
69 int ceph_posix_statfs(long long *totalSpace, long long *freeSpace);
70 int ceph_posix_truncate(XrdOucEnv* env, const char *pathname, unsigned long long size);
71 int ceph_posix_ftruncate(int fd, unsigned long long size);
72 int ceph_posix_unlink(XrdOucEnv* env, const char *pathname);
73 DIR* ceph_posix_opendir(XrdOucEnv* env, const char *pathname);
74 int ceph_posix_readdir(DIR* dirp, char *buff, int blen);
75 int ceph_posix_closedir(DIR *dirp);
76 
77 #endif // __XRD_CEPH_POSIX__
ssize_t ceph_posix_write(int fd, const void *buf, size_t count)
void ceph_posix_set_logfunc(void(*logfunc)(char *, va_list argp))
int ceph_posix_truncate(XrdOucEnv *env, const char *pathname, unsigned long long size)
ssize_t ceph_aio_write(int fd, XrdSfsAio *aiop, AioCB *cb)
int ceph_posix_unlink(XrdOucEnv *env, const char *pathname)
ssize_t ceph_aio_read(int fd, XrdSfsAio *aiop, AioCB *cb)
int ceph_posix_readdir(DIR *dirp, char *buff, int blen)
void() AioCB(XrdSfsAio *, size_t)
Definition: XrdCephPosix.hh:39
int ceph_posix_fcntl(int fd, int cmd,...)
ssize_t ceph_posix_getxattr(XrdOucEnv *env, const char *path, const char *name, void *value, size_t size)
DIR * ceph_posix_opendir(XrdOucEnv *env, const char *pathname)
ssize_t ceph_posix_read(int fd, void *buf, size_t count)
ssize_t ceph_posix_pread(int fd, void *buf, size_t count, off64_t offset)
int ceph_posix_listxattrs(XrdOucEnv *env, const char *path, XrdSysXAttr::AList **aPL, int getSz)
int ceph_posix_fstat(int fd, struct stat *buf)
void ceph_posix_disconnect_all()
int ceph_posix_fsync(int fd)
int ceph_posix_closedir(DIR *dirp)
int ceph_posix_statfs(long long *totalSpace, long long *freeSpace)
int ceph_posix_fremovexattr(int fd, const char *name)
int ceph_posix_close(int fd)
off_t ceph_posix_lseek(int fd, off_t offset, int whence)
void ceph_posix_set_defaults(const char *value)
int ceph_posix_fsetxattr(int fd, const char *name, const void *value, size_t size, int flags)
int ceph_posix_ftruncate(int fd, unsigned long long size)
int ceph_posix_open(XrdOucEnv *env, const char *pathname, int flags, mode_t mode)
int ceph_posix_removexattr(XrdOucEnv *env, const char *path, const char *name)
off64_t ceph_posix_lseek64(int fd, off64_t offset, int whence)
int ceph_posix_stat(XrdOucEnv *env, const char *pathname, struct stat *buf)
ssize_t ceph_posix_pwrite(int fd, const void *buf, size_t count, off64_t offset)
ssize_t ceph_posix_setxattr(XrdOucEnv *env, const char *path, const char *name, const void *value, size_t size, int flags)
int ceph_posix_flistxattrs(int fd, XrdSysXAttr::AList **aPL, int getSz)
ssize_t ceph_posix_fgetxattr(int fd, const char *name, void *value, size_t size)
void ceph_posix_freexattrlist(XrdSysXAttr::AList *aPL)
int stat(const char *path, struct stat *buf)