40 #include <sys/param.h>
43 #include <sys/types.h>
75 #include "XrdVersion.hh"
118 int XrdSsiSfs::freeMax = 256;
128 const char *configFn,
171 einfo.
setErrInfo(ENOTSUP,
"Checksums are not supported.");
190 einfo.
setErrInfo(ENOTSUP,
"chmod is not supported for given path.");
191 }
else einfo.
setErrInfo(ENOTSUP,
"chmod is not supported.");
199 int XrdSsiSfs::Emsg(
const char *pfx,
205 char buffer[MAXPATHLEN+80];
237 return theFS->
exists(path, file_exists, einfo, client, info);
238 einfo.
setErrInfo(ENOTSUP,
"exists is not supported for given path.");
239 }
else einfo.
setErrInfo(ENOTSUP,
"exists is not supported.");
267 char pbuff[1024], rType[3] = {
'S',
'w', 0};
268 const char *Resp[2] = {rType, pbuff};
269 const char *opq, *
Path = Split(args,&opq,pbuff,
sizeof(pbuff));
281 einfo.
setErrInfo(ENOTSUP,
"Requested fsctl operation not supported.");
293 return theFS->
fsctl(cmd, args, einfo, client);
298 {
if (!
Provider)
return Emsg(epname, einfo, EHOSTUNREACH,
"locate",
Path);
302 else return Emsg(epname, einfo, ENOENT,
"locate",
Path);
315 if ((Resp1Len =
myIF->
GetDest(pbuff,
sizeof(pbuff), ifType, retHN)))
316 {einfo.
setErrInfo(Resp1Len+3, (
const char **)Resp, 2);
322 return Emsg(epname, einfo, ENETUNREACH,
"locate",
Path);
358 einfo.
setErrInfo(ENOTSUP,
"mkdir is not supported for given path.");
359 }
else einfo.
setErrInfo(ENOTSUP,
"mkdir is not supported.");
390 return theFS->
rem(path, einfo, client, info);
391 einfo.
setErrInfo(ENOTSUP,
"rem is not supported for given path.");
392 }
else einfo.
setErrInfo(ENOTSUP,
"rem is not supported.");
409 return theFS->
rem(path, einfo, client, info);
410 einfo.
setErrInfo(ENOTSUP,
"remdir is not supported for given path.");
411 }
else einfo.
setErrInfo(ENOTSUP,
"remdir is not supported.");
420 const char *new_name,
430 return theFS->
rename(old_name,new_name,einfo,client,infoO,infoN);
431 einfo.
setErrInfo(ENOTSUP,
"rename is not supported for given path.");
432 }
else einfo.
setErrInfo(ENOTSUP,
"rename is not supported.");
442 uint64_t fSet = (prevFS ? prevFS->
Features() : 0);
451 const char * XrdSsiSfs::Split(
const char *Args,
const char **Opq,
452 char *
Path,
int Plen)
455 *Opq = index(Args,
'?');
456 if (!(*Opq))
return Args;
458 if (xlen >= Plen) xlen = Plen-1;
459 strncpy(
Path, Args, xlen);
477 return theFS->
stat(path, buf, einfo, client, info);
478 einfo.
setErrInfo(ENOTSUP,
"stat is not supported for given path.");
479 }
else einfo.
setErrInfo(ENOTSUP,
"stat is not supported.");
495 return theFS->
stat(path, mode, einfo, client, info);
496 einfo.
setErrInfo(ENOTSUP,
"stat is not supported for given path.");
497 }
else einfo.
setErrInfo(ENOTSUP,
"stat is not supported.");
516 einfo.
setErrInfo(ENOTSUP,
"truncate is not supported for given path.");
517 }
else einfo.
setErrInfo(ENOTSUP,
"truncate is not supported.");
int stat(const char *path, struct stat *buf)
long long XrdSfsFileOffset
XrdSfsFileSystem * XrdSfsGetFileSystem2(XrdSfsFileSystem *nativeFS, XrdSysLogger *logger, const char *configFn, XrdOucEnv *envP)
XrdVERSIONINFO(XrdSfsGetFileSystem2, ssi)
static ifType GetIFType(bool conIPv4, bool hasIP64, bool pvtIP)
int GetDest(char *dest, int dlen, ifType ifT=PublicV6, bool prefn=false)
ifType
The enum that is used to index into ifData to get appropriate interface.
static int Format(char *buff, int blen, int ecode, const char *etxt1, const char *etxt2=0)
int setErrInfo(int code, const char *emsg)
const char * getErrUser()
unsigned long long Find(const char *pathname)
virtual int chmod(const char *path, XrdSfsMode mode, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaque=0)=0
virtual int fsctl(const int cmd, const char *args, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0)=0
virtual int rename(const char *oPath, const char *nPath, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaqueO=0, const char *opaqueN=0)=0
virtual int mkdir(const char *path, XrdSfsMode mode, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaque=0)=0
virtual int truncate(const char *path, XrdSfsFileOffset fsize, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaque=0)=0
virtual int chksum(csFunc Func, const char *csName, const char *path, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaque=0)
virtual int exists(const char *path, XrdSfsFileExistence &eFlag, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaque=0)=0
virtual int prepare(XrdSfsPrep &pargs, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0)=0
virtual int stat(const char *Name, struct stat *buf, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaque=0)=0
virtual int rem(const char *path, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaque=0)=0
virtual rStat QueryResource(const char *rName, const char *contact=0)=0
bool Configure(const char *cFN, XrdOucEnv *envP)
int getStats(char *buff, int blen)
int rem(const char *path, XrdOucErrInfo &eInfo, const XrdSecEntity *client, const char *info=0)
int stat(const char *Name, struct stat *buf, XrdOucErrInfo &eInfo, const XrdSecEntity *client, const char *opaque=0)
int chksum(csFunc Func, const char *csName, const char *path, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaque=0)
int chmod(const char *Name, XrdSfsMode Mode, XrdOucErrInfo &eInfo, const XrdSecEntity *client, const char *opaque=0)
void setFeatures(XrdSfsFileSystem *prevFS)
const char * getVersion()
int rename(const char *oldFileName, const char *newFileName, XrdOucErrInfo &eInfo, const XrdSecEntity *client, const char *infoO=0, const char *infoN=0)
int remdir(const char *dirName, XrdOucErrInfo &eInfo, const XrdSecEntity *client, const char *info=0)
int exists(const char *fileName, XrdSfsFileExistence &exists_flag, XrdOucErrInfo &eInfo, const XrdSecEntity *client, const char *opaque=0)
int mkdir(const char *dirName, XrdSfsMode Mode, XrdOucErrInfo &eInfo, const XrdSecEntity *client, const char *opaque=0)
int prepare(XrdSfsPrep &pargs, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0)
int truncate(const char *Name, XrdSfsFileOffset fileOffset, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaque=0)
int fsctl(const int cmd, const char *args, XrdOucErrInfo &eInfo, const XrdSecEntity *client)
int Stats(char *buff, int blen)
void setFS(XrdSfsFileSystem *fsp)
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
XrdSysLogger * logger(XrdSysLogger *lp=0)
const char * SetPrefix(const char *prefix)
void SetLogger(XrdSysLogger *logp)
static const uint64_t hasSXIO
Feature: Supports SfsXio.
XrdSsiProvider * Provider
static const int uIPv64
ucap: Supports only IPv4 info
static const int uIPv4
ucap: Supports read redirects