29 #include "XrdVersion.hh"
64 const char* config_fn,
74 }
catch (std::exception &e) {
75 XrdCephEroute.
Say(
"CephOss loading failed with exception. Check the syntax of parameters : ", parms);
99 if (configfn && *configfn) {
102 if ((cfgFD =
open(configfn, O_RDONLY, 0)) < 0) {
103 Eroute.
Emsg(
"Config", errno,
"open config file", configfn);
109 while((var =
Config.GetMyFirstWord())) {
110 if (!strncmp(var,
"ceph.nbconnections", 18)) {
113 unsigned long value = strtoul(var, 0, 10);
114 if (value > 0 and value <= 100) {
117 Eroute.
Emsg(
"Config",
"Invalid value for ceph.nbconnections in config file (must be between 1 and 100)", configfn, var);
121 Eroute.
Emsg(
"Config",
"Missing value for ceph.nbconnections in config file", configfn);
125 if (!strncmp(var,
"ceph.namelib", 12)) {
130 if (!
Config.GetRest(parms,
sizeof(parms)) || parms[0]) {
131 Eroute.
Emsg(
"Config",
"namelib parameters will be ignored");
137 Eroute.
Emsg(
"Config",
"Unable to load library given in ceph.namelib : %s", var);
140 Eroute.
Emsg(
"Config",
"Missing value for ceph.namelib in config file", configfn);
147 int retc =
Config.LastError();
149 NoGo = Eroute.
Emsg(
"Config", -retc,
"read config file",
190 if (!strcmp(path,
"/")) {
193 memset(buff, 0,
sizeof(*buff));
194 buff->st_mode = S_IFDIR | 0700;
199 }
catch (std::exception &e) {
207 int rc =
StatVS(&sP, 0, 0);
211 int percentUsedSpace = (sP.
Usage*100)/sP.
Total;
212 blen = snprintf(buff, blen,
"%d %lld %d %d %lld %d",
213 1, sP.
Free, percentUsedSpace, 0, 0LL, 0);
230 unsigned long long size,
234 }
catch (std::exception &e) {
243 }
catch (std::exception &e) {
XrdOucName2Name * g_namelib
unsigned int g_maxCephPoolIdx
static void logwrapper(char *format, va_list argp)
XrdOss * XrdOssGetStorageSystem(XrdOss *native_oss, XrdSysLogger *lp, const char *config_fn, const char *parms)
XrdVERSIONINFO(XrdOssGetStorageSystem, XrdCephOss)
XrdSysError XrdCephEroute(0)
void ceph_posix_set_logfunc(void(*logfunc)(char *, va_list argp))
int ceph_posix_truncate(XrdOucEnv *env, const char *pathname, unsigned long long size)
int ceph_posix_unlink(XrdOucEnv *env, const char *pathname)
void ceph_posix_disconnect_all()
int ceph_posix_statfs(long long *totalSpace, long long *freeSpace)
void ceph_posix_set_defaults(const char *value)
int ceph_posix_stat(XrdOucEnv *env, const char *pathname, struct stat *buf)
int stat(const char *path, struct stat *buf)
int open(const char *path, int oflag,...)
virtual int Truncate(const char *, unsigned long long, XrdOucEnv *eP=0)
virtual int Rename(const char *, const char *, XrdOucEnv *eP1=0, XrdOucEnv *eP2=0)
virtual int StatVS(XrdOssVSInfo *sP, const char *sname=0, int updt=0)
virtual int Remdir(const char *, int Opts=0, XrdOucEnv *eP=0)
virtual int Create(const char *, const char *, mode_t, XrdOucEnv &, int opts=0)
XrdCephOss(const char *, XrdSysError &)
virtual int Mkdir(const char *, mode_t mode, int mkpath=0, XrdOucEnv *eP=0)
virtual int Stat(const char *, struct stat *, int opts=0, XrdOucEnv *eP=0)
virtual XrdOssDF * newDir(const char *tident)
virtual int Chmod(const char *, mode_t mode, XrdOucEnv *eP=0)
virtual int Unlink(const char *path, int Opts=0, XrdOucEnv *eP=0)
virtual int StatFS(const char *path, char *buff, int &blen, XrdOucEnv *eP=0)
virtual int Init(XrdSysLogger *, const char *)
virtual XrdOssDF * newFile(const char *tident)
int Configure(const char *, XrdSysError &)
XrdOucName2Name * Load(const char *libName, XrdVersionInfo &urVer, XrdOucEnv *envP=0)
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
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)
XrdSysLogger * logger(XrdSysLogger *lp=0)
const char * SetPrefix(const char *prefix)
static INT to(const char *buffer)