XRootD
Loading...
Searching...
No Matches
XrdOssSys Class Reference

#include <XrdOssApi.hh>

Inheritance diagram for XrdOssSys:
Collaboration diagram for XrdOssSys:

Public Member Functions

 XrdOssSys ()
virtual ~XrdOssSys ()
int Chmod (const char *, mode_t mode, XrdOucEnv *eP=0)
void Config_Display (XrdSysError &)
int Configure (const char *, XrdSysError &, XrdOucEnv *envP)
virtual int Create (const char *, const char *, mode_t, XrdOucEnv &, int opts=0)
uint64_t Features ()
int GenLocalPath (const char *, char *)
int GenRemotePath (const char *, char *)
int Init (XrdSysLogger *, const char *, XrdOucEnv *envP)
int Init (XrdSysLogger *lP, const char *cP)
int IsRemote (const char *path)
int Lfn2Pfn (const char *Path, char *buff, int blen)
const char * Lfn2Pfn (const char *Path, char *buff, int blen, int &rc)
int Mkdir (const char *, mode_t mode, int mkpath=0, XrdOucEnv *eP=0)
int Mkpath (const char *, mode_t mode)
int MSS_Closedir (void *)
int MSS_Create (const char *path, mode_t, XrdOucEnv &)
void * MSS_Opendir (const char *, int &rc)
int MSS_Readdir (void *fd, char *buff, int blen)
int MSS_Remdir (const char *, const char *)
int MSS_Rename (const char *, const char *)
int MSS_Stat (const char *, struct stat *buff=0)
int MSS_Unlink (const char *)
virtual XrdOssDFnewDir (const char *tident)
virtual XrdOssDFnewFile (const char *tident)
unsigned long long PathOpts (const char *path)
int Reloc (const char *tident, const char *path, const char *cgName, const char *anchor=0)
int Remdir (const char *, int Opts=0, XrdOucEnv *eP=0)
int Rename (const char *, const char *, XrdOucEnv *eP1=0, XrdOucEnv *eP2=0)
virtual int Stage (const char *, const char *, XrdOucEnv &, int, mode_t, unsigned long long)
void * Stage_In (void *carg)
int Stat (const char *, struct stat *, int opts=0, XrdOucEnv *Env=0)
int StatFS (const char *path, char *buff, int &blen, XrdOucEnv *Env=0)
int StatFS (const char *path, unsigned long long &Opt, long long &fSize, long long &fSpace)
int StatLS (XrdOucEnv &env, const char *path, char *buff, int &blen)
int StatPF (const char *, struct stat *, int)
int Stats (char *bp, int bl)
int StatVS (XrdOssVSInfo *sP, const char *sname=0, int updt=0)
int StatXA (const char *path, char *buff, int &blen, XrdOucEnv *Env=0)
int StatXP (const char *path, unsigned long long &attr, XrdOucEnv *Env=0)
int Truncate (const char *, unsigned long long Size, XrdOucEnv *eP=0)
int Unlink (const char *, int Opts=0, XrdOucEnv *eP=0)
Public Member Functions inherited from XrdOss
 XrdOss ()
 Constructor and Destructor.
virtual ~XrdOss ()
virtual void Connect (XrdOucEnv &env)
virtual void Disc (XrdOucEnv &env)
virtual void EnvInfo (XrdOucEnv *envP)
virtual int FSctl (int cmd, int alen, const char *args, char **resp=0)
virtual int StatPF (const char *path, struct stat *buff)

Static Public Member Functions

static int AioInit ()

Public Attributes

union { 
XrdOssStatInfo_t STT_Func
XrdOssStatInfo2_t STT_Fund
}; 
char * ConfigFN
unsigned long long DirFlags
OssDPathDPList
int FDFence
int FDLimit
int isMSSC
XrdOucName2Namelcl_N2N
int lenDP
char * LocalRoot
long long MaxSize
int MaxTwiddle
XrdVersionInfo * myVersion
char * N2N_Lib
char * N2N_Parms
short numCG
short numDP
int OptFlags
int prActive
int prBytes
short prDepth
long long prPBits
long long prPMask
int prPSize
short prQSize
char * RemoteRoot
XrdOucName2Namermt_N2N
XrdOucPListAnchor RPList
char * RSSCmd
int RSSTout
int Solitary
XrdOucPListAnchor SPList
char * StageAction
int StageActLen
int StageAln [MaxArgs]
int StageAnum
char * StageArg [MaxArgs]
int StageAsync
char * StageCmd
int StageCreate
char * StageEvents
int StageEvSize
int StageFormat
XrdFrcProxyStageFrm
char * StageMsg
int StageRealTime
XrdOucMsubsStageSnd
char STT_DoARE
char STT_DoN2N
char * STT_Lib
char * STT_Parms
int STT_PreOp
char STT_V2
XrdOucName2Namethe_N2N
int Trace

Static Public Attributes

static int AioAllOk = 0
static char chkMmap = 0
static const int MaxArgs = 15
static char tryMmap = 0
Static Public Attributes inherited from XrdOss
static const int PF_csVer = 0x00000001
 verified file checksums present
static const int PF_csVun = 0x00000002
 unverified file checksums present
static const int PF_dInfo = 0x00000001
static const int PF_dNums = 0x00000002
static const int PF_dStat = 0x00000008
static const int PF_isLFN = 0x00000004

Protected Member Functions

int Alloc_Cache (XrdOssCreateInfo &, XrdOucEnv &)
int Alloc_Local (XrdOssCreateInfo &, XrdOucEnv &)
int BreakLink (const char *local_path, struct stat &statbuff)
int CalcTime ()
int CalcTime (XrdOssStage_Req *req)
void ConfigCache (XrdSysError &Eroute, bool pass2=false)
void ConfigMio (XrdSysError &Eroute)
int ConfigN2N (XrdSysError &Eroute, XrdOucEnv *envP)
int ConfigProc (XrdSysError &Eroute)
void ConfigSpace (const char *Lfn)
void ConfigSpace (XrdSysError &Eroute)
void ConfigSpath (XrdSysError &Eroute, const char *Pn, unsigned long long &Fv, int noMSS)
int ConfigStage (XrdSysError &Eroute)
int ConfigStageC (XrdSysError &Eroute)
int ConfigStatLib (XrdSysError &Eroute, XrdOucEnv *envP)
void ConfigStats (dev_t Devnum, char *lP)
void ConfigStats (XrdSysError &Eroute)
int ConfigXeq (char *, XrdOucStream &, XrdSysError &)
void doScrub ()
int Find (XrdOssStage_Req *req, void *carg)
int getCname (const char *path, struct stat *sbuff, char *cgbuff)
int GetFile (XrdOssStage_Req *req)
int getID (const char *, XrdOucEnv &, char *, int)
int getStats (char *buff, int blen)
time_t HasFile (const char *fn, const char *sfx, time_t *mTime=0)
void List_Path (const char *, const char *, unsigned long long, XrdSysError &)
int MSS_Xeq (XrdOucStream **xfd, int okerr, const char *cmd, const char *arg1=0, const char *arg2=0)
int RenameLink (char *old_path, char *new_path)
int RenameLink3 (char *cPath, char *old_path, char *new_path)
int SetFattr (XrdOssCreateInfo &crInfo, int datfd, time_t mtime)
int Stage_QT (const char *, const char *, XrdOucEnv &, int, mode_t)
int Stage_RT (const char *, const char *, XrdOucEnv &, unsigned long long)
int tranmode (char *)
int xalloc (XrdOucStream &Config, XrdSysError &Eroute)
int xcache (XrdOucStream &Config, XrdSysError &Eroute)
int xcachescan (XrdOucStream &Config, XrdSysError &Eroute)
int xdefault (XrdOucStream &Config, XrdSysError &Eroute)
int xfdlimit (XrdOucStream &Config, XrdSysError &Eroute)
int xmaxsz (XrdOucStream &Config, XrdSysError &Eroute)
int xmemf (XrdOucStream &Config, XrdSysError &Eroute)
int xnml (XrdOucStream &Config, XrdSysError &Eroute)
int xpath (XrdOucStream &Config, XrdSysError &Eroute)
int xprerd (XrdOucStream &Config, XrdSysError &Eroute)
int xspace (XrdOucStream &Config, XrdSysError &Eroute, const char *grp, bool isAsgn)
int xspace (XrdOucStream &Config, XrdSysError &Eroute, int *isCD=0)
int xspaceBuild (OssSpaceConfig &sInfo, XrdSysError &Eroute)
int xstg (XrdOucStream &Config, XrdSysError &Eroute)
int xstl (XrdOucStream &Config, XrdSysError &Eroute)
int xtrace (XrdOucStream &Config, XrdSysError &Eroute)
int xusage (XrdOucStream &Config, XrdSysError &Eroute)
int xxfr (XrdOucStream &Config, XrdSysError &Eroute)

Protected Attributes

int badreqs
int cscanint
int fuzalloc
long long minalloc
int ovhalloc
bool pfcMode
long long pndbytes
char * QFile
XrdOucProgRSSProg
XrdOucProgStageProg
long long stgbytes
long long totbytes
int totreqs
char * UDir
short USync
char * xfrFdir
int xfrFdln
int xfrhold
int xfrkeep
int xfrovhd
int xfrspeed
int xfrtcount
int xfrthreads

Detailed Description

Definition at line 153 of file XrdOssApi.hh.

Constructor & Destructor Documentation

◆ XrdOssSys()

XrdOssSys::XrdOssSys ( )

Definition at line 150 of file XrdOssConfig.cc.

151{
152 static XrdVERSIONINFODEF(myVer, XrdOss, XrdVNUMBER, XrdVERSION);
153 myVersion = &myVer;
154 xfrtcount = 0;
155 pndbytes = 0;
156 stgbytes = 0;
157 totbytes = 0;
158 totreqs = 0;
159 badreqs = 0;
160 MaxTwiddle = 3;
161 tryMmap = 0;
162 chkMmap = 0;
163 lcl_N2N = rmt_N2N = the_N2N = 0;
164 N2N_Lib = N2N_Parms = 0;
165 StageCmd = 0;
166 StageMsg = 0;
167 StageSnd = 0;
168 StageFrm = 0;
169 StageRealTime = 1;
170 StageAsync = 0;
171 StageCreate = 0;
172 StageEvents = (char *)"-";
173 StageEvSize = 1;
174 StageAction = (char *)"wq ";
175 StageActLen = 3;
176 RSSCmd = 0;
177 isMSSC = 0;
178 RSSTout =15*1000;
179 DirFlags = 0;
180 OptFlags = 0;
181 LocalRoot = 0;
182 RemoteRoot = 0;
183 cscanint = 600;
184 FDFence = -1;
185 FDLimit = -1;
186 MaxSize = 0;
187 minalloc = 0;
188 ovhalloc = 0;
189 fuzalloc = 0;
190 xfrspeed = 9*1024*1024;
191 xfrovhd = 30;
192 xfrhold = 3*60*60;
193 xfrkeep = 20*60;
194 xfrthreads = 1;
195 ConfigFN = 0;
196 QFile = 0;
197 UDir = 0;
198 USync = 0;
199 Solitary = 0;
200 DPList = 0;
201 lenDP = 0;
202 numCG = numDP = 0;
203 xfrFdir = 0;
204 xfrFdln = 0;
205 pfcMode = false;
206 RSSProg = 0;
207 StageProg = 0;
208 prPBits = (long long)sysconf(_SC_PAGESIZE);
209 prPSize = static_cast<int>(prPBits);
210 prPBits--;
212 prBytes = 0;
213 prActive = 0;
214 prDepth = 0;
215 prQSize = 0;
216 STT_Lib = 0;
217 STT_Parms = 0;
218 STT_Func = 0;
219 STT_Fund = 0;
220 STT_PreOp = 0;
221 STT_DoN2N = 1;
222 STT_V2 = 0;
223 STT_DoARE = 0;
224}
static XrdVERSIONINFODEF(compiledVer, XrdHttpProtocolTest, XrdVNUMBER, XrdVERSION)
int StageCreate
Definition XrdOssApi.hh:223
char STT_DoN2N
Definition XrdOssApi.hh:270
char STT_V2
Definition XrdOssApi.hh:271
char * LocalRoot
Definition XrdOssApi.hh:218
OssDPath * DPList
Definition XrdOssApi.hh:258
int STT_PreOp
Definition XrdOssApi.hh:269
char * N2N_Parms
Definition XrdOssApi.hh:253
short numCG
Definition XrdOssApi.hh:261
long long totbytes
Definition XrdOssApi.hh:302
long long minalloc
Definition XrdOssApi.hh:290
char * StageEvents
Definition XrdOssApi.hh:230
int StageRealTime
Definition XrdOssApi.hh:221
short prDepth
Definition XrdOssApi.hh:279
static char chkMmap
Definition XrdOssApi.hh:204
int xfrthreads
Definition XrdOssApi.hh:298
char * QFile
Definition XrdOssApi.hh:310
char * ConfigFN
Definition XrdOssApi.hh:217
char * StageAction
Definition XrdOssApi.hh:233
char STT_DoARE
Definition XrdOssApi.hh:272
char * UDir
Definition XrdOssApi.hh:309
int StageActLen
Definition XrdOssApi.hh:232
short USync
Definition XrdOssApi.hh:313
XrdOucProg * StageProg
Definition XrdOssApi.hh:306
XrdOucName2Name * the_N2N
Definition XrdOssApi.hh:256
short prQSize
Definition XrdOssApi.hh:280
long long MaxSize
Definition XrdOssApi.hh:241
XrdOucName2Name * lcl_N2N
Definition XrdOssApi.hh:254
long long prPMask
Definition XrdOssApi.hh:275
long long prPBits
Definition XrdOssApi.hh:274
int StageAsync
Definition XrdOssApi.hh:222
XrdOucProg * RSSProg
Definition XrdOssApi.hh:307
char * STT_Parms
Definition XrdOssApi.hh:264
long long pndbytes
Definition XrdOssApi.hh:300
static char tryMmap
Definition XrdOssApi.hh:203
XrdVersionInfo * myVersion
Definition XrdOssApi.hh:282
char * N2N_Lib
Definition XrdOssApi.hh:252
long long stgbytes
Definition XrdOssApi.hh:301
char * STT_Lib
Definition XrdOssApi.hh:263
XrdOucMsubs * StageSnd
Definition XrdOssApi.hh:227
short numDP
Definition XrdOssApi.hh:260
XrdFrcProxy * StageFrm
Definition XrdOssApi.hh:228
unsigned long long DirFlags
Definition XrdOssApi.hh:244
int StageEvSize
Definition XrdOssApi.hh:231
bool pfcMode
Definition XrdOssApi.hh:314
int xfrtcount
Definition XrdOssApi.hh:299
char * StageCmd
Definition XrdOssApi.hh:225
char * StageMsg
Definition XrdOssApi.hh:226
char * RemoteRoot
Definition XrdOssApi.hh:219
int MaxTwiddle
Definition XrdOssApi.hh:220
char * RSSCmd
Definition XrdOssApi.hh:238
XrdOucName2Name * rmt_N2N
Definition XrdOssApi.hh:255
char * xfrFdir
Definition XrdOssApi.hh:311
XrdOss()
Constructor and Destructor.
Definition XrdOss.hh:897

References XrdOss::XrdOss(), badreqs, chkMmap, ConfigFN, cscanint, DirFlags, DPList, FDFence, FDLimit, fuzalloc, isMSSC, lcl_N2N, lenDP, LocalRoot, MaxSize, MaxTwiddle, minalloc, myVersion, N2N_Lib, N2N_Parms, numCG, numDP, OptFlags, ovhalloc, pfcMode, pndbytes, prActive, prBytes, prDepth, prPBits, prPMask, prPSize, prQSize, QFile, RemoteRoot, rmt_N2N, RSSCmd, RSSProg, RSSTout, Solitary, StageAction, StageActLen, StageAsync, StageCmd, StageCreate, StageEvents, StageEvSize, StageFrm, StageMsg, StageProg, StageRealTime, StageSnd, stgbytes, STT_DoARE, STT_DoN2N, STT_Lib, STT_Parms, STT_PreOp, STT_V2, the_N2N, totbytes, totreqs, tryMmap, UDir, USync, xfrFdir, xfrFdln, xfrhold, xfrkeep, xfrovhd, xfrspeed, xfrtcount, xfrthreads, and XrdVERSIONINFODEF().

Here is the call graph for this function:

◆ ~XrdOssSys()

virtual XrdOssSys::~XrdOssSys ( )
inlinevirtual

Definition at line 285 of file XrdOssApi.hh.

285{}

Member Function Documentation

◆ AioInit()

int XrdOssSys::AioInit ( )
static

Definition at line 281 of file XrdOssAio.cc.

282{
283#if defined(_POSIX_ASYNCHRONOUS_IO)
284 EPNAME("AioInit");
285 extern void *XrdOssAioWait(void *carg);
286 pthread_t tid;
287 int retc;
288
289#ifndef HAVE_SIGWTI
290// For those platforms that do not have sigwaitinfo(), we provide the
291// appropriate emulation using a signal handler. We actually provide for
292// two handlers since we separate reads from writes. To emulate synchronous
293// signals, we prohibit one signal hander from interrupting another one.
294//
295 struct sigaction sa;
296
297 sa.sa_sigaction = XrdOssAioRSH;
298 sa.sa_flags = SA_SIGINFO;
299 sigemptyset(&sa.sa_mask);
300 sigaddset(&sa.sa_mask, OSS_AIO_WRITE_DONE);
301 if (sigaction(OSS_AIO_READ_DONE, &sa, NULL) < 0)
302 {OssEroute.Emsg("AioInit", errno, "creating AIO read signal handler; "
303 "AIO support terminated.");
304 return 0;
305 }
306
307 sa.sa_sigaction = XrdOssAioWSH;
308 sa.sa_flags = SA_SIGINFO;
309 sigemptyset(&sa.sa_mask);
310 sigaddset(&sa.sa_mask, OSS_AIO_READ_DONE);
311 if (sigaction(OSS_AIO_WRITE_DONE, &sa, NULL) < 0)
312 {OssEroute.Emsg("AioInit", errno, "creating AIO write signal handler; "
313 "AIO support terminated.");
314 return 0;
315 }
316#endif
317
318// The AIO signal handler consists of two thread (one for read and one for
319// write) that synhronously wait for AIO events. We assume, blithely, that
320// the first two real-time signals have been blocked for all threads.
321//
322 if ((retc = XrdSysThread::Run(&tid, XrdOssAioWait,
323 (void *)(&OSS_AIO_READ_DONE))) < 0)
324 OssEroute.Emsg("AioInit", retc, "creating AIO read signal thread; "
325 "AIO support terminated.");
326#ifdef __FreeBSD__
327 else {DEBUG("started AIO read signal thread.");
328#else
329 else {DEBUG("started AIO read signal thread; tid=" <<(unsigned int)tid);
330#endif
331 if ((retc = XrdSysThread::Run(&tid, XrdOssAioWait,
332 (void *)(&OSS_AIO_WRITE_DONE))) < 0)
333 OssEroute.Emsg("AioInit", retc, "creating AIO write signal thread; "
334 "AIO support terminated.");
335#ifdef __FreeBSD__
336 else {DEBUG("started AIO write signal thread.");
337#else
338 else {DEBUG("started AIO write signal thread; tid=" <<(unsigned int)tid);
339#endif
340 AioAllOk = 1;
341 }
342 }
343
344// All done
345//
346 return AioAllOk;
347#else
348 return 1;
349#endif
350}
#define DEBUG(x)
#define EPNAME(x)
void * XrdOssAioWait(void *mySigarg)
Definition XrdOssAio.cc:356
XrdSysError OssEroute
static int AioAllOk
Definition XrdOssApi.hh:201
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
static int Run(pthread_t *, void *(*proc)(void *), void *arg, int opts=0, const char *desc=0)

References AioAllOk, DEBUG, EPNAME, OssEroute, XrdSysThread::Run(), and XrdOssAioWait().

Referenced by Configure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Alloc_Cache()

int XrdOssSys::Alloc_Cache ( XrdOssCreateInfo & crInfo,
XrdOucEnv & env )
protected

Definition at line 229 of file XrdOssCreate.cc.

230{
231 EPNAME("Alloc_Cache")
232 int datfd, rc;
233 const char *spName;
234 char pbuff[MAXPATHLEN+1], cgbuff[XrdOssSpace::minSNbsz], *tmp;
235 XrdOssCache::allocInfo aInfo(crInfo.Path, pbuff, sizeof(pbuff));
236
237// Grab the suggested size from the environment
238//
239 if ((tmp = env.Get(OSS_ASIZE))
240 && XrdOuca2x::a2sz(OssEroute,"invalid asize",tmp,&aInfo.cgSize,0))
241 return -XRDOSS_E8018;
242
243// Determine the space we should use for this allocation
244//
245 spName = env.Get(OSS_CGROUP);
246 if (!spName || (SPList.NotEmpty() && SPList.Default() == spAssign))
247 {XrdOucPList *pl = SPList.About(crInfo.LFN);
248 if (pl && (!spName || pl->Attr() == spAssign)) spName = pl->Name();
249 }
250
251// Get the correct cache group and partition path
252//
253 if ((aInfo.cgPath=XrdOssCache::Parse(spName,cgbuff,sizeof(cgbuff))))
254 aInfo.cgPlen = strlen(aInfo.cgPath);
255
256// Allocate space in the cache.
257//
258 aInfo.cgName = cgbuff;
259 aInfo.aMode = crInfo.Amode;
260 if ((datfd = XrdOssCache::Alloc(aInfo)) < 0) return datfd;
261
262// Set the pfn as the extended attribute if we are in new mode
263//
264 if (!(crInfo.pOpts & XRDEXP_NOXATTR)
265 && (rc = XrdSysFAttr::Xat->Set(XrdFrcXAttrPfn::Name(), crInfo.Path,
266 strlen(crInfo.Path)+1, pbuff, datfd)))
267 {close(datfd); return rc;}
268
269// Set extended attributes for this newly created file if allowed to do so.
270// SetFattr() alaways closes the provided file descriptor!
271//
272 if ((rc = SetFattr(crInfo, datfd, 1))) return rc;
273
274// Now create a symbolic link to the target
275//
276 if ((symlink(pbuff, crInfo.Path) && errno != EEXIST)
277 || unlink(crInfo.Path) || symlink(pbuff, crInfo.Path))
278 {rc = -errno; unlink(pbuff);}
279
280// All done
281//
282 DEBUG(aInfo.cgName <<" cache for " <<pbuff);
283 return rc;
284}
#define spAssign
Definition XrdOssApi.hh:250
#define XRDOSS_E8018
#define OSS_ASIZE
#define OSS_CGROUP
#define XRDEXP_NOXATTR
#define close(a)
Definition XrdPosix.hh:48
#define unlink(a)
Definition XrdPosix.hh:113
XrdOucString Path
if(ec< 0) ec
static const char * Name()
static int Alloc(allocInfo &aInfo)
static char * Parse(const char *token, char *cbuff, int cblen)
const char * Path
const char * LFN
unsigned long long pOpts
XrdOucPListAnchor SPList
Definition XrdOssApi.hh:249
int SetFattr(XrdOssCreateInfo &crInfo, int datfd, time_t mtime)
const char * Name()
static XrdSysXAttr * Xat
virtual int Set(const char *Aname, const void *Aval, int Avsz, const char *Path, int fd=-1, int isNew=0)=0

References XrdOuca2x::a2sz(), XrdOssCache::Alloc(), XrdOssCreateInfo::Amode, XrdOssCache::allocInfo::aMode, XrdOucPList::Attr(), XrdOssCache::allocInfo::cgName, XrdOssCache::allocInfo::cgPath, XrdOssCache::allocInfo::cgPlen, XrdOssCache::allocInfo::cgSize, close, DEBUG, EPNAME, XrdOucEnv::Get(), XrdOssCreateInfo::LFN, XrdOssSpace::minSNbsz, XrdFrcXAttrPfn::Name(), XrdOucPList::Name(), OSS_ASIZE, OSS_CGROUP, OssEroute, XrdOssCache::Parse(), XrdOssCreateInfo::Path, XrdOssCreateInfo::pOpts, SetFattr(), spAssign, SPList, unlink, XrdSysFAttr::Xat, XRDEXP_NOXATTR, and XRDOSS_E8018.

Referenced by Create().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Alloc_Local()

int XrdOssSys::Alloc_Local ( XrdOssCreateInfo & crInfo,
XrdOucEnv & env )
protected

Definition at line 290 of file XrdOssCreate.cc.

291{
292 int datfd, rc;
293
294// Simply open the file in the local filesystem, creating it if need be.
295//
296 do {datfd = open(crInfo.Path, O_RDWR|O_CREAT|O_TRUNC, crInfo.Amode);}
297 while(datfd < 0 && errno == EINTR);
298 if (datfd < 0) return -errno;
299
300// Set extended attributes for this newly created file if allowed to do so.
301// SetFattr() alaways closes the provided file descriptor!
302//
303 if ((rc = SetFattr(crInfo, datfd, 1))) return rc;
304
305// All done
306//
307 return XrdOssOK;
308}
#define XrdOssOK
Definition XrdOss.hh:50
#define open
Definition XrdPosix.hh:76

References XrdOssCreateInfo::Amode, open, XrdOssCreateInfo::Path, SetFattr(), and XrdOssOK.

Referenced by Create().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ BreakLink()

int XrdOssSys::BreakLink ( const char * local_path,
struct stat & statbuff )
protected

Definition at line 172 of file XrdOssUnlink.cc.

173{
174 EPNAME("BreakLink")
175 char *lP, lnkbuff[MAXPATHLEN+64];
176 int lnklen, retc = 0;
177
178// Read the contents of the link
179//
180 if ((lnklen = readlink(local_path, lnkbuff, sizeof(lnkbuff)-1)) < 0)
181 return -errno;
182
183// Return the actual stat information on the target (which might not exist
184//
185 lnkbuff[lnklen] = '\0';
186 if (stat(lnkbuff, &statbuff)) statbuff.st_size = 0;
187 else if (unlink(lnkbuff) && errno != ENOENT)
188 {retc = -errno;
189 OssEroute.Emsg("BreakLink",retc,"unlink symlink target",lnkbuff);
190 } else {DEBUG("broke link " <<local_path <<"->" <<lnkbuff);}
191
192// If this is a new-style cache, then we must also remove the pfn file.
193// In any case, return the appropriate cache group.
194//
195 lP = lnkbuff+lnklen-1;
196 if (*lP == XrdOssPath::xChar)
197 {if (statbuff.st_size)
199 XrdOssCache::Adjust(lnkbuff, -statbuff.st_size);
200 }
201 } else if (statbuff.st_size)
202 XrdOssCache::Adjust(statbuff.st_dev, -statbuff.st_size);
203
204// All done
205//
206 return retc;
207}
#define stat(a, b)
Definition XrdPosix.hh:101
static void Adjust(dev_t devid, off_t size)
static void Trim2Base(char *eP)
static const char xChar
Definition XrdOssPath.hh:47

References XrdOssCache::Adjust(), DEBUG, EPNAME, OssEroute, stat, XrdOssPath::Trim2Base(), unlink, and XrdOssPath::xChar.

Referenced by Unlink().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CalcTime() [1/2]

int XrdOssSys::CalcTime ( )
protected

Definition at line 384 of file XrdOssStage.cc.

385{
386
387// For queued staging we have no good way to estimate the time, as of yet.
388// So, return 60 seconds. Note that the following code, which is far more
389// elaborate, rarely returns the right estimate anyway.
390//
391 return (StageAsync ? -EINPROGRESS : 60);
392}

References StageAsync.

Referenced by Stage_QT(), and Stage_RT().

Here is the caller graph for this function:

◆ CalcTime() [2/2]

int XrdOssSys::CalcTime ( XrdOssStage_Req * req)
protected

Definition at line 394 of file XrdOssStage.cc.

395{
396 unsigned long long numq = 1;
397 unsigned long long tbytes = req->size + stgbytes/2;
398 int xfrtime;
399 time_t now;
400 XrdOssStage_Req *rqp = req;
401
402// Return an EINP{ROG if we are doing async staging
403//
404 if (StageAsync) return -EINPROGRESS;
405
406// If the request is active, recalculate the time based on previous estimate
407//
408 if (req->flags & XRDOSS_REQ_ACTV)
409 {if ((xfrtime = req->sigtod - time(0)) > xfrovhd) return xfrtime;
410 else return (xfrovhd < 4 ? 2 : xfrovhd / 2);
411 }
412
413// Calculate the number of pending bytes being transferred plus 1/2 of the
414// current number of bytes being transferred
415//
416 while ((rqp=(rqp->pendList.Next()->Item()))) {tbytes += rqp->size; numq++;}
417
418// Calculate when this request should be completed
419//
420 now = time(0);
421 req->sigtod = tbytes / xfrspeed + numq * xfrovhd + now;
422
423// Calculate the time it will take to get this file
424//
425 if ((xfrtime = req->sigtod - now) <= xfrovhd) return xfrovhd+3;
426 return xfrtime;
427}
#define XRDOSS_REQ_ACTV
XrdOucDLlist< XrdOssStage_Req > pendList
unsigned long long size
XrdOucDLlist * Next()

References XrdOssStage_Req::flags, XrdOucDLlist< T >::Item(), XrdOucDLlist< T >::Next(), XrdOssStage_Req::pendList, XrdOssStage_Req::sigtod, XrdOssStage_Req::size, StageAsync, stgbytes, xfrovhd, xfrspeed, and XRDOSS_REQ_ACTV.

Here is the call graph for this function:

◆ Chmod()

int XrdOssSys::Chmod ( const char * path,
mode_t mode,
XrdOucEnv * envP = 0 )
virtual

Change file mode settings.

Parameters
path- Pointer to the path of the file in question.
mode- The new file mode setting.
envP- Pointer to environmental information.
Returns
0 upon success or -errno or -osserr (see XrdOssError.hh).

Implements XrdOss.

Definition at line 272 of file XrdOssApi.cc.

273{
274 char actual_path[MAXPATHLEN+1], *local_path;
275 int retc;
276
277// Generate local path
278//
279 if (lcl_N2N)
280 if ((retc = lcl_N2N->lfn2pfn(path, actual_path, sizeof(actual_path))))
281 return retc;
282 else local_path = actual_path;
283 else local_path = (char *)path;
284
285// Change the file only in the local filesystem.
286//
287 return (chmod(local_path, mode) ? -errno : XrdOssOK);
288}

References lcl_N2N, and XrdOssOK.

◆ Config_Display()

void XrdOssSys::Config_Display ( XrdSysError & Eroute)

Definition at line 418 of file XrdOssConfig.cc.

419{
420 char buff[4096], *cloc;
421 XrdOucPList *fp;
422
423 // Preset some tests
424 //
425 int HaveRSSCmd = (RSSCmd && RSSCmd[0]);
426 int HaveStageCmd = (StageCmd && StageCmd[0]);
427 int HaveRemoteRoot = (RemoteRoot && RemoteRoot[0]);
428 int HaveLocalRoot = (LocalRoot && LocalRoot[0]);
429 int HaveStageMsg = (StageMsg && StageMsg[0]);
430 int HaveN2N_Lib = (N2N_Lib != 0);
431
432 if (!ConfigFN || !ConfigFN[0]) cloc = (char *)"Default";
433 else cloc = ConfigFN;
434
435 snprintf(buff, sizeof(buff), "Config effective %s oss configuration:\n"
436 " oss.alloc %lld %d %d\n"
437 " oss.spacescan %d\n"
438 " oss.fdlimit %d %d\n"
439 " oss.maxsize %lld\n"
440 "%s%s%s"
441 "%s%s%s"
442 "%s%s%s"
443 "%s%s%s%s%s"
444 "%s%s%s"
445 "%s%s%s"
446 " oss.trace %x\n"
447 " oss.xfr %d deny %d keep %d",
448 cloc,
450 cscanint,
452 XrdOssConfig_Val(N2N_Lib, namelib),
453 XrdOssConfig_Val(LocalRoot, localroot),
454 XrdOssConfig_Val(RemoteRoot, remoteroot),
455 XrdOssConfig_Vop(StageCmd, stagecmd, StageAsync, "async ","sync ",
456 StageCreate, "creates ", ""),
457 XrdOssConfig_Val(StageMsg, stagemsg),
458 XrdOssConfig_Val(RSSCmd, rsscmd),
461
462 Eroute.Say(buff);
463
464 XrdOssMio::Display(Eroute);
465
466 XrdOssCache::List(" oss.", Eroute);
467 List_Path(" oss.defaults ", "", DirFlags, Eroute);
468 fp = RPList.First();
469 while(fp)
470 {List_Path(" oss.path ", fp->Path(), fp->Flag(), Eroute);
471 fp = fp->Next();
472 }
473 fp = SPList.First();
474 while(fp)
475 {Eroute.Say(" oss.space ", fp->Name(),
476 (fp->Attr() == spAssign ? " assign " : " default "),
477 fp->Path());
478 fp = fp->Next();
479 }
480}
XrdSysTrace OssTrace
#define XrdOssConfig_Vop(base, opt, optchk0, opt1, opt2, optchk1, opt3, opt4)
#define XrdOssConfig_Val(base, opt)
static void List(const char *lname, XrdSysError &Eroute)
static void Display(XrdSysError &Eroute)
Definition XrdOssMio.cc:80
void List_Path(const char *, const char *, unsigned long long, XrdSysError &)
XrdOucPListAnchor RPList
Definition XrdOssApi.hh:257
char * Path()
XrdOucPList * Next()
unsigned long long Flag()
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)

References XrdOucPList::Attr(), ConfigFN, cscanint, DirFlags, XrdOssMio::Display(), FDFence, FDLimit, XrdOucPList::Flag(), fuzalloc, XrdOssCache::List(), List_Path(), LocalRoot, MaxSize, minalloc, N2N_Lib, XrdOucPList::Name(), XrdOucPList::Next(), OssTrace, ovhalloc, XrdOucPList::Path(), RemoteRoot, RPList, RSSCmd, XrdSysError::Say(), spAssign, SPList, StageAsync, StageCmd, StageCreate, StageMsg, xfrhold, xfrkeep, xfrthreads, XrdOssConfig_Val, and XrdOssConfig_Vop.

Referenced by Configure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConfigCache()

void XrdOssSys::ConfigCache ( XrdSysError & Eroute,
bool pass2 = false )
protected

Definition at line 489 of file XrdOssConfig.cc.

490{
491 const unsigned long long conFlags =
496
497 XrdOucPList *fp = RPList.First();
498 unsigned long long oflag, pflag;
499
500// If this is pass 2 then if we are in pfcMode, then reset r/o flag to r/w
501// to allow the pfc to actually write into the cache paths.
502//
503 if (pass2)
504 {if (pfcMode)
505 {while(fp)
506 {pflag = fp->Flag();
507 if (pflag & XRDEXP_PFCACHE) fp->Set(pflag & ~XRDEXP_NOTRW);
508 fp = fp->Next();
509 }
510 }
511 return;
512 }
513
514// Run through all the paths and resolve any conflicts with a cache
515//
516 while(fp)
517 {oflag = pflag = fp->Flag();
518 if ((pflag & XRDEXP_PFCACHE)
519 || (pfcMode && !(pflag & XRDEXP_PFCACHE_X)))
520 {if (!(pflag & XRDEXP_NOTRW)) pflag |= XRDEXP_READONLY;
521 pflag &= ~conFlags;
522 pflag |= XRDEXP_PFCACHE;
523 if (oflag != pflag) fp->Set(pflag);
524 }
525 fp = fp->Next();
526 }
527
528// Handle default settings
529//
532 DirFlags &= ~conFlags;
533 }
534}
#define XRDEXP_NOTRW
#define XRDEXP_NODREAD
#define XRDEXP_PURGE
#define XRDEXP_MMAP
#define XRDEXP_MKEEP
#define XRDEXP_PFCACHE
#define XRDEXP_MLOK
#define XRDEXP_STAGEMM
#define XRDEXP_MWMODE
#define XRDEXP_NOCHECK
#define XRDEXP_RCREATE
#define XRDEXP_READONLY
#define XRDEXP_STAGE
#define XRDEXP_MIG
#define XRDEXP_PFCACHE_X
void Set(int aval)

References DirFlags, XrdOucPList::Flag(), XrdOucPList::Next(), pfcMode, RPList, XrdOucPList::Set(), XRDEXP_MIG, XRDEXP_MKEEP, XRDEXP_MLOK, XRDEXP_MMAP, XRDEXP_MWMODE, XRDEXP_NOCHECK, XRDEXP_NODREAD, XRDEXP_NOTRW, XRDEXP_PFCACHE, XRDEXP_PFCACHE_X, XRDEXP_PURGE, XRDEXP_RCREATE, XRDEXP_READONLY, XRDEXP_STAGE, and XRDEXP_STAGEMM.

Referenced by Configure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConfigMio()

void XrdOssSys::ConfigMio ( XrdSysError & Eroute)
protected

Definition at line 540 of file XrdOssConfig.cc.

541{
542 XrdOucPList *fp;
543 unsigned long long flags = 0;
544 int setoff = 0;
545
546// Initialize memory mapping setting to speed execution
547//
548 if (!(tryMmap = XrdOssMio::isOn())) return;
550
551// Run through all the paths and get the composite flags
552//
553 fp = RPList.First();
554 while(fp)
555 {flags |= fp->Flag();
556 fp = fp->Next();
557 }
558
559// Handle default settings
560//
563 flags |= DirFlags;
565
566// Produce warnings if unsupported features have been selected
567//
568#if !defined(_POSIX_MAPPED_FILES)
569 if (flags & XRDEXP_MEMAP)
570 {Eroute.Say("Config warning: memory mapped files not supported; "
571 "feature disabled.");
572 setoff = 1;
573 fp = RPList.First();
574 while(fp)
575 {fp->Set(fp->Flag() & ~XRDEXP_MEMAP);
576 fp = fp->Next();
577 }
578 DirFlags = DirFlags & ~XRDEXP_MEMAP;
579 }
580#elif !defined(_POSIX_MEMLOCK)
581 if (flags & XRDEXP_MLOK)
582 {Eroute.Say("Config warning: memory locked files not supported; "
583 "feature disabled.");
584 fp = RPList.First();
585 while(fp)
586 {fp->Set(fp->Flag() & ~XRDEXP_MLOK);
587 fp = fp->Next();
588 }
589 DirFlags = DirFlags & ~XRDEXP_MLOK;
590 }
591#endif
592
593// If no memory flags are set, turn off memory mapped files
594//
595 if (!(flags & XRDEXP_MEMAP) || setoff)
596 {XrdOssMio::Set(0, 0, 0);
597 tryMmap = 0; chkMmap = 0;
598 }
599}
#define XRDEXP_FORCERO
#define XRDEXP_MEMAP
static char isOn()
Definition XrdOssMio.hh:51
static char isAuto()
Definition XrdOssMio.hh:49
static void Set(int V_off, int V_preld, int V_check)
Definition XrdOssMio.cc:320

References chkMmap, DirFlags, XrdOucPList::Flag(), XrdOssMio::isAuto(), XrdOssMio::isOn(), XrdOucPList::Next(), RPList, XrdSysError::Say(), XrdOssMio::Set(), XrdOucPList::Set(), tryMmap, XRDEXP_FORCERO, XRDEXP_MEMAP, XRDEXP_MKEEP, XRDEXP_MLOK, XRDEXP_MMAP, and XRDEXP_NOTRW.

Referenced by Configure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConfigN2N()

int XrdOssSys::ConfigN2N ( XrdSysError & Eroute,
XrdOucEnv * envP )
protected

Definition at line 605 of file XrdOssConfig.cc.

606{
607 XrdOucN2NLoader n2nLoader(&Eroute,ConfigFN,N2N_Parms,LocalRoot,RemoteRoot);
608
609// Get the plugin
610//
611 if (!(the_N2N = n2nLoader.Load(N2N_Lib, *myVersion, envP))) return 1;
612
613// Optimize the local case
614//
616 else {if (LocalRoot) lcl_N2N = the_N2N;
618 }
619
620// All done
621//
622 return 0;
623}

References ConfigFN, lcl_N2N, XrdOucN2NLoader::Load(), LocalRoot, myVersion, N2N_Lib, N2N_Parms, RemoteRoot, rmt_N2N, and the_N2N.

Referenced by Configure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConfigProc()

int XrdOssSys::ConfigProc ( XrdSysError & Eroute)
protected

Definition at line 629 of file XrdOssConfig.cc.

630{
631 char *var;
632 int cfgFD, retc, NoGo = XrdOssOK;
633 XrdOucEnv myEnv;
634 XrdOucStream Config(&Eroute, getenv("XRDINSTANCE"), &myEnv, "=====> ");
635
636// If there is no config file, return with the defaults sets.
637//
638 if( !ConfigFN || !*ConfigFN)
639 {Eroute.Say("Config warning: config file not specified; defaults assumed.");
640 return XrdOssOK;
641 }
642
643// Try to open the configuration file.
644//
645 if ( (cfgFD = open(ConfigFN, O_RDONLY, 0)) < 0)
646 {Eroute.Emsg("Config", errno, "open config file", ConfigFN);
647 return 1;
648 }
649 Config.Attach(cfgFD);
650 static const char *cvec[] = { "*** oss plugin config:", 0 };
651 Config.Capture(cvec);
652
653// Now start reading records until eof.
654//
655 while((var = Config.GetMyFirstWord()))
656 {if (!strncmp(var, "oss.", 4))
657 {if (ConfigXeq(var+4, Config, Eroute)) {Config.Echo(); NoGo = 1;}}
658 else if (!strcmp(var,"all.export")
659 && xpath(Config, Eroute)) {Config.Echo(); NoGo = 1;}
660 }
661
662// Now check if any errors occurred during file i/o
663//
664 if ((retc = Config.LastError()))
665 NoGo = Eroute.Emsg("Config", retc, "read config file", ConfigFN);
666 Config.Close();
667
668// Return final return code
669//
670 return NoGo;
671}
int ConfigXeq(char *, XrdOucStream &, XrdSysError &)
int xpath(XrdOucStream &Config, XrdSysError &Eroute)
XrdCmsConfig Config

References ConfigFN, ConfigXeq(), XrdSysError::Emsg(), open, XrdSysError::Say(), xpath(), and XrdOssOK.

Referenced by Configure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConfigSpace() [1/2]

void XrdOssSys::ConfigSpace ( const char * Lfn)
protected

Definition at line 716 of file XrdOssConfig.cc.

717{
718 struct stat statbuff;
719 char Pfn[MAXPATHLEN+1+8], *Slash;
720
721// Get local path for this lfn
722//
723 if (GenLocalPath(Lfn, Pfn)) return;
724
725// Now try to find the actual existing base path
726//
727 while(stat(Pfn, &statbuff))
728 {if (!(Slash = rindex(Pfn, '/')) || Slash == Pfn) return;
729 *Slash = '\0';
730 }
731
732// Add this path to the file system data. We need to do this to track space
733//
735}
static int Add(const char *Path)
int GenLocalPath(const char *, char *)
Definition XrdOssApi.cc:232

References XrdOssCache_FS::Add(), GenLocalPath(), and stat.

Here is the call graph for this function:

◆ ConfigSpace() [2/2]

void XrdOssSys::ConfigSpace ( XrdSysError & Eroute)
protected

Definition at line 677 of file XrdOssConfig.cc.

678{
679 XrdOucPList *fp = RPList.First();
680 int noCacheFS = !(OptFlags & XrdOss_CacheFS);
681
682// Configure space for each non-cached exported path. We only keep track of
683// space that can actually be modified in some way.
684//
685 while(fp)
686 {if ( ((noCacheFS || (fp->Flag() & XRDEXP_INPLACE)) &&
687 (fp->Flag() & (XRDEXP_STAGE | XRDEXP_PURGE)))
688 || !(fp->Flag() & XRDEXP_NOTRW)
689 || (fp->Flag() & XRDEXP_PFCACHE) )
690 ConfigSpace(fp->Path());
691 fp = fp->Next();
692 }
693
694// If there is a space list then verify it
695//
696 if ((fp = SPList.First()))
697 {XrdOssCache_Group *fsg;
698 const char *what;
699 bool zAssign = false;
700 while(fp)
701 {if (fp->Attr() != spAssign) what = "default space ";
702 else {zAssign = true; what = "assign space ";}
703 const char *grp = fp->Name();
705 while(fsg) {if (!strcmp(fsg->group,grp)) break; fsg = fsg->next;}
706 if (!fsg) Eroute.Say("Config warning: unable to ", what, grp,
707 " to ", fp->Path(), "; space not defined.");
708 fp = fp->Next();
709 }
710 if (zAssign) SPList.Default(static_cast<unsigned long long>(spAssign));
711 }
712}
#define XrdOss_CacheFS
#define XRDEXP_INPLACE
static XrdOssCache_Group * fsgroups
XrdOssCache_Group * next
void ConfigSpace(XrdSysError &Eroute)

References XrdOucPList::Attr(), ConfigSpace(), XrdOucPList::Flag(), XrdOssCache_Group::fsgroups, XrdOssCache_Group::group, XrdOucPList::Name(), XrdOucPList::Next(), XrdOssCache_Group::next, OptFlags, XrdOucPList::Path(), RPList, XrdSysError::Say(), spAssign, SPList, XRDEXP_INPLACE, XRDEXP_NOTRW, XRDEXP_PFCACHE, XRDEXP_PURGE, XRDEXP_STAGE, and XrdOss_CacheFS.

Referenced by ConfigSpace(), and Configure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConfigSpath()

void XrdOssSys::ConfigSpath ( XrdSysError & Eroute,
const char * Pn,
unsigned long long & Fv,
int noMSS )
protected

Definition at line 741 of file XrdOssConfig.cc.

743{
744// mig+r/w -> check unless nocheck was specified
745//
746 if (!(flags & XRDEXP_CHECK_X))
747 {if ((flags & XRDEXP_MIG) && !(flags & XRDEXP_NOTRW))
748 flags &= ~XRDEXP_NOCHECK;
749 else flags |= XRDEXP_NOCHECK;
750 }
751// rsscmd -> dread unless nodread was specified
752//
753 if (!(flags & XRDEXP_DREAD_X))
754 {if (RSSCmd) flags &= ~XRDEXP_NODREAD;
755 else flags |= XRDEXP_NODREAD;
756 }
757
758// If there is no mss then turn off all mss related optionss, otherwise check
759// if the options may leave the system in an inconsistent state
760//
761 if (noMSS) flags=(flags & ~XRDEXP_RCREATE)|XRDEXP_NOCHECK|XRDEXP_NODREAD;
762 else if ((flags & XRDEXP_MIG) && (flags & XRDEXP_NOCHECK)
763 && !(flags & XRDEXP_NOTRW))
764 Eroute.Say("Config warning: 'all.export ", Path,
765 " nocheck mig r/w' allows file inconsistentcy!");
766}
#define XRDEXP_DREAD_X
#define XRDEXP_CHECK_X

References Path, RSSCmd, XrdSysError::Say(), XRDEXP_CHECK_X, XRDEXP_DREAD_X, XRDEXP_MIG, XRDEXP_NOCHECK, XRDEXP_NODREAD, XRDEXP_NOTRW, and XRDEXP_RCREATE.

Referenced by ConfigStage().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConfigStage()

int XrdOssSys::ConfigStage ( XrdSysError & Eroute)
protected

Definition at line 772 of file XrdOssConfig.cc.

773{
774 const char *What;
775 char *tp, *stgp = 0;
776 unsigned long long flags;
777 int noMSS, needRSS = 0, NoGo = 0;
778 XrdOucPList *fp;
779
780// Determine if we are a manager/supervisor. These never stage files so we
781// really don't need (nor want) a stagecmd or an msscmd.
782//
783 noMSS = ((tp = getenv("XRDREDIRECT"))
784 && (!strcmp(tp, "R") || !strcmp(tp, "M"))) | Solitary;
785
786// A rsscmd implies check+dread. Note that nostage is now always the default.
787//
788 flags = (RSSCmd ? 0 : XRDEXP_NOCHECK | XRDEXP_NODREAD);
789 DirFlags = DirFlags | (flags & (~(DirFlags >> XRDEXP_MASKSHIFT)));
790
791// Set default flags
792//
793 RPList.Default(DirFlags);
794
795// Reprocess the paths to set correct defaults
796//
797 fp = RPList.First();
798 while(fp)
799 {flags = fp->Flag(); ConfigSpath(Eroute, fp->Path(), flags, noMSS);
800
801 // Record the fact that we have a stageable path
802 //
803 if (flags & XRDEXP_STAGE) stgp = fp->Path();
804
805 // Check if path requires rsscmd and complain if we don't have one
806 //
807 if (!(flags & XRDEXP_NOCHECK)) What = "has check";
808 else if (!(flags & XRDEXP_NODREAD)) What = "has dread";
809 else if (flags & XRDEXP_RCREATE) What = "has recreate";
810 else What = 0;
811 if (!noMSS && !RSSCmd && What)
812 {Eroute.Emsg("Config", fp->Path(), What,
813 "export attribute but rsscmd not specified.");
814 NoGo = 1;
815 } else if (What) needRSS = 1;
816
817 // Update flags and proceed to next path
818 //
819 fp->Set(flags); fp = fp->Next();
820 }
821
822// If we are a manager/supervisor, short circuit MSS initialization
823//
824 if (noMSS)
825 {if (RSSCmd) {free(RSSCmd); RSSCmd = 0;}
826 if (StageCmd) {free(StageCmd); StageCmd = 0;}
827 RSSProg = 0; StageCreate = 0;
828 return NoGo;
829 }
830
831// Check if we don't need the stagecmd but one was specified
832//
833 if (StageCmd && !stgp)
834 {Eroute.Say("Config warning: 'stagecmd' ignored; no stageable paths present.");
835 free(StageCmd); StageCmd = 0;
836 }
837
838// Check if we don't need a remote storage service but one was specified
839//
840 if (RSSCmd && !needRSS)
841 {Eroute.Say("Config warning: 'rsscmd' ignored; no path exported with "
842 "check, dread, or rcreate.");
843 free(RSSCmd); RSSCmd = 0;
844 }
845
846// If we have any errors at this point, just return failure
847//
848 if (NoGo) return 1;
849 if (!RSSCmd && !StageCmd && !stgp) return 0;
850 Eroute.Say("++++++ Remote Storage System interface initialization started.");
851
852// Allocate a pr0gram object for the gateway command
853//
854 if (RSSCmd)
855 {RSSProg = new XrdOucProg(&Eroute);
856 if (RSSProg->Setup(RSSCmd)) NoGo = 1;
857 }
858
859// Initialize staging if we need to
860//
861 if (!NoGo && (StageCmd || stgp))
862 {const int AMode = S_IRWXU|S_IRWXG|S_IROTH|S_IXOTH; // 775
863 if (StageCmd && *StageCmd) NoGo = ConfigStageC(Eroute);
864 else {StageFrm = new XrdFrcProxy(Eroute.logger(),
866 NoGo = !StageFrm->Init(XrdFrcProxy::opStg,
867 getenv("XRDADMINPATH"), AMode);
868 StageRealTime = 0; StageAsync = 1;
869 }
870
871 // Set up the event path
872 //
873 StageAction = (char *)"wfn "; StageActLen = 4;
874 if ((tp = getenv("XRDOFSEVENTS")))
875 {char sebuff[MAXPATHLEN+8];
876 StageEvSize = sprintf(sebuff, "file:///%s", tp);
877 StageEvents = strdup(sebuff);
878 } else {StageEvents = (char *)"-"; StageEvSize = 1;}
879 }
880
881// All done
882//
883 tp = (NoGo ? (char *)"failed." : (char *)"completed.");
884 Eroute.Say("------ Remote Storage System interface initialization ", tp);
885 return NoGo;
886}
#define TRACE_Debug
#define XRDEXP_MASKSHIFT
static const int opStg
void ConfigSpath(XrdSysError &Eroute, const char *Pn, unsigned long long &Fv, int noMSS)
int ConfigStageC(XrdSysError &Eroute)
static const char * InstName(int TranOpt=0)
XrdSysLogger * logger(XrdSysLogger *lp=0)

References ConfigSpath(), ConfigStageC(), DirFlags, XrdSysError::Emsg(), XrdOucPList::Flag(), XrdOucUtils::InstName(), XrdSysError::logger(), XrdOucPList::Next(), XrdFrcProxy::opStg, OssTrace, XrdOucPList::Path(), RPList, RSSCmd, RSSProg, XrdSysError::Say(), XrdOucPList::Set(), Solitary, StageAction, StageActLen, StageAsync, StageCmd, StageCreate, StageEvents, StageEvSize, StageFrm, StageRealTime, TRACE_Debug, XRDEXP_MASKSHIFT, XRDEXP_NOCHECK, XRDEXP_NODREAD, XRDEXP_RCREATE, and XRDEXP_STAGE.

Referenced by Configure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConfigStageC()

int XrdOssSys::ConfigStageC ( XrdSysError & Eroute)
protected

Definition at line 892 of file XrdOssConfig.cc.

893{
894 pthread_t tid;
895 char *sp, *tp;
896 int numt, retc, NoGo = 0;
897
898// The stage command is interactive if it starts with an | (i.e., pipe in)
899//
900 tp = StageCmd;
901 while(*tp && *tp == ' ') tp++;
902 if (*tp == '|') {StageRealTime = 0;
903 do {tp++;} while(*tp == ' ');
904 }
905 StageCmd = tp;
906
907// This is a bit of hackery to get the traceid sent over to the
908// new file residency manager (frm). Keeps the config simple.
909//
910 if ((sp = index(StageCmd, ' '))) *sp = '\0';
911 if (!(tp = rindex (StageCmd, '/'))) tp = StageCmd;
912 else tp++;
913 if (!strncmp("frm_", tp, 4)) StageFormat = 1;
914 if (sp) *sp = ' ';
915
916// Set up a program object for the command
917//
918 StageProg = new XrdOucProg(&Eroute);
919 if (StageProg->Setup(StageCmd)) NoGo = 1;
920
921// For old-style real-time staging, create threads to handle the staging
922// For queue-style staging, start the program that handles the queue
923//
924 if (!NoGo)
925 {if (StageRealTime)
926 {if ((numt = xfrthreads - xfrtcount) > 0) while(numt--)
927 {if ((retc = XrdSysThread::Run(&tid,XrdOssxfr,(void *)0,0,"staging")))
928 Eroute.Emsg("Config", retc, "create staging thread");
929 else xfrtcount++;
930 }
931 } else NoGo = StageProg->Start();
932 }
933
934// Setup the additional stage information vector. Variable substitution:
935// <data>$var;<data>.... (max of MaxArgs substitutions). This is only relevant
936// when using an actual stagecmd.
937//
938 if (!NoGo && !StageRealTime && StageMsg)
939 {XrdOucMsubs *msubs = new XrdOucMsubs(&Eroute);
940 if (msubs->Parse("stagemsg", StageMsg)) StageSnd = msubs;
941 else NoGo = 1; // We will exit no need to delete msubs
942 }
943
944// All done
945//
946 return NoGo;
947}
void * XrdOssxfr(void *carg)
int StageFormat
Definition XrdOssApi.hh:224
int Parse(const char *oname, char *msg)

References XrdSysError::Emsg(), XrdOucMsubs::Parse(), XrdSysThread::Run(), StageCmd, StageFormat, StageMsg, StageProg, StageRealTime, StageSnd, xfrtcount, xfrthreads, and XrdOssxfr().

Referenced by ConfigStage().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConfigStatLib()

int XrdOssSys::ConfigStatLib ( XrdSysError & Eroute,
XrdOucEnv * envP )
protected

Definition at line 953 of file XrdOssConfig.cc.

954{
955 XrdOucPinLoader myLib(&Eroute, myVersion, "statlib", STT_Lib);
956 const char *stName2 = "?XrdOssStatInfoInit2";
957
958// Get the plugin and stat function. Let's try version 2 first
959//
961 if (STT_V2) stName2++;
962 if ((siGet2=(XrdOssStatInfoInit2_t)myLib.Resolve(stName2)))
963 {if (!(STT_Fund = siGet2(this,Eroute.logger(),ConfigFN,STT_Parms,envP)))
964 return 1;
965 if (STT_DoARE) envP->PutPtr("XrdOssStatInfo2*", (void *)STT_Fund);
966 STT_V2 = 1;
967 return 0;
968 }
969
970// If we are here but the -2 was specified on the config then we fail
971//
972 if (STT_V2) return 1;
973
974// OK, so we better find version 1 in the shared library
975//
977 if (!(siGet = (XrdOssStatInfoInit_t)myLib.Resolve("XrdOssStatInfoInit"))
978 || !(STT_Func = siGet (this,Eroute.logger(),ConfigFN,STT_Parms)))
979 return 1;
980
981// Return success
982//
983 return 0;
984}
XrdOssStatInfo_t(* XrdOssStatInfoInit_t)(XrdOss *native_oss, XrdSysLogger *Logger, const char *config_fn, const char *parms)
The typedef that describes the XRdOssStatInfoInit external.
XrdOssStatInfo2_t(* XrdOssStatInfoInit2_t)(XrdOss *native_oss, XrdSysLogger *Logger, const char *config_fn, const char *parms, XrdOucEnv *envP)
void PutPtr(const char *varname, void *value)
Definition XrdOucEnv.cc:298
XrdOucEnv * envP
Definition XrdPss.cc:109

References ConfigFN, XrdSysError::logger(), myVersion, XrdOucEnv::PutPtr(), XrdOucPinLoader::Resolve(), STT_DoARE, STT_Lib, STT_Parms, and STT_V2.

Referenced by Configure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConfigStats() [1/2]

void XrdOssSys::ConfigStats ( dev_t Devnum,
char * lP )
protected

Definition at line 1042 of file XrdOssConfig.cc.

1043{
1044 struct stat Stat;
1045 char *Slash, pP[MAXPATHLEN+1];
1046
1047// Minimize the path
1048//
1049 while((Slash = rindex(lP+1, '/')))
1050 {*Slash = '\0';
1051 if (GenLocalPath(lP, pP) || stat(pP, &Stat) || Stat.st_dev != Devnum)
1052 break;
1053 }
1054
1055// Extend path if need be and return
1056//
1057 if (Slash) *Slash = '/';
1058}
int Stat(const char *, struct stat *, int opts=0, XrdOucEnv *Env=0)
Definition XrdOssStat.cc:70

References GenLocalPath(), Stat(), and stat.

Here is the call graph for this function:

◆ ConfigStats() [2/2]

void XrdOssSys::ConfigStats ( XrdSysError & Eroute)
protected

Definition at line 990 of file XrdOssConfig.cc.

991{
992 struct StatsDev
993 {StatsDev *Next;
994 dev_t st_dev;
995 StatsDev(StatsDev *dP, dev_t dn) : Next(dP), st_dev(dn) {}
996 };
997
998 XrdOssCache_Group *fsg = XrdOssCache_Group::fsgroups;
999 XrdOucPList *fP = RPList.First();
1000 StatsDev *dP1st = 0, *dP, *dPp;
1001 struct stat Stat;
1002 char LPath[MAXPATHLEN+1], PPath[MAXPATHLEN+1], *cP;
1003
1004// Count actual cache groups
1005//
1006 while(fsg) {numCG++; fsg = fsg->next;}
1007
1008// Develop the list of paths that we will report on
1009//
1010 if (fP) do
1011 {strcpy(LPath, fP->Path());
1012 if (GenLocalPath(LPath, PPath)) continue;
1013 if (stat(PPath, &Stat) && (cP = rindex(LPath, '/')))
1014 {*cP = '\0';
1015 if (GenLocalPath(LPath, PPath) || stat(PPath, &Stat)) continue;
1016 }
1017 dP = dP1st;
1018 while(dP && dP->st_dev != Stat.st_dev) dP = dP->Next;
1019 if (dP) continue;
1020 ConfigStats(Stat.st_dev, LPath);
1021 if (GenLocalPath(LPath, PPath)) continue;
1022 DPList = new OssDPath(DPList, strdup(LPath), strdup(PPath));
1023 lenDP += strlen(LPath) + strlen(PPath); numDP++;
1024 dP1st = new StatsDev(dP1st, Stat.st_dev);
1025 } while ((fP = fP->Next()));
1026
1027// If we have no exported paths then create a simple /tmp object
1028//
1029 if (!numDP)
1030 {DPList = new OssDPath(0, strdup("/tmp"), strdup("/tmp"));
1031 lenDP = 4; numDP = 1;
1032 }
1033
1034// Now delete all of the device objects
1035//
1036 dP = dP1st;
1037 while(dP) {dPp = dP; dP = dP->Next; delete dPp;}
1038}
void ConfigStats(XrdSysError &Eroute)

References ConfigStats(), DPList, XrdOssCache_Group::fsgroups, GenLocalPath(), lenDP, XrdOucPList::Next(), XrdOssCache_Group::next, numCG, numDP, XrdOucPList::Path(), RPList, Stat(), and stat.

Referenced by ConfigStats(), and Configure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Configure()

int XrdOssSys::Configure ( const char * configfn,
XrdSysError & Eroute,
XrdOucEnv * envP )

Definition at line 230 of file XrdOssConfig.cc.

232{
233/*
234 Function: Establish default values using a configuration file.
235
236 Input: None.
237
238 Output: 0 upon success or !0 otherwise.
239*/
240 XrdSysError_Table *ETab = new XrdSysError_Table(XRDOSS_EBASE, XRDOSS_ELAST,
242 static const int maxFD = 1048576;
243 struct rlimit rlim;
244 char *val;
245 int retc, NoGo = XrdOssOK;
246 pthread_t tid;
247 bool setfd = false;
248
249// Do the herald thing
250//
251 Eroute.Say("++++++ Storage system initialization started.");
252 Eroute.addTable(ETab);
253 if (getenv("XRDDEBUG")) OssTrace.What = TRACE_ALL;
254
255// Preset all variables with common defaults
256//
257 ConfigFN = (configfn && *configfn ? strdup(configfn) : 0);
258
259// Establish the FD limit and the fence (half way)
260//
261 if (getrlimit(RLIMIT_NOFILE, &rlim))
262 {Eroute.Emsg("Config", errno, "get fd limit");
263 rlim.rlim_cur = maxFD;
264 }
265 else {if (rlim.rlim_max == RLIM_INFINITY)
266 {rlim.rlim_cur = maxFD;
267 setfd = true;
268 } else {
269 if (rlim.rlim_cur != rlim.rlim_max)
270 {rlim.rlim_cur = rlim.rlim_max;
271 setfd = true;
272 }
273 }
274 if (setfd)
275 {if (setrlimit(RLIMIT_NOFILE, &rlim))
276 Eroute.Emsg("Config", errno, "set fd limit");
277 else
278 {
279#ifdef __APPLE__
280//
281// As of macOS Sequoia 15.6, setrlimit above will be successful but the limit on the
282// file descriptor table size may still be lower than RLIMIT_NOFILE. Calls to
283// `fcntl(fd, F_DUPFD, arg)` as is done in `XrdSysFD_Dup1` will fail if the provided
284// `arg` is greater than `getdtablesize()` per the online man pages. After testing,
285// it seems the two limits exist independently.
286//
287// One can verify this by (a) testing `getrlimit()` again to see the larger limit and
288// then doing a `XrdSysFD_Dup1` that's below `rlim.rlim_cur` and above `getdtablesize()`;
289// it will fail with "Invalid Argument".
290//
291// On Linux, the man pages note that `getdtablesize()` is implemented via the equivalent
292// `getrlimit` call; hence, there's no need for this extra check.
293//
294 FDLimit = static_cast<rlim_t>(getdtablesize()) < rlim.rlim_cur ? getdtablesize() : rlim.rlim_cur;
295#else
296 FDLimit = rlim.rlim_cur;
297#endif
298 }
299 } else {FDFence = static_cast<int>(rlim.rlim_cur)>>1;
300 FDLimit = rlim.rlim_cur;
301 }
302 }
304
305// Configure devices
306//
308
309// Process the configuration file
310//
311 NoGo = ConfigProc(Eroute);
312
313// Configure dependent plugins
314//
315 if (!NoGo)
316 {if (N2N_Lib || LocalRoot || RemoteRoot) NoGo |= ConfigN2N(Eroute, envP);
317 if (STT_Lib && !NoGo) NoGo |= ConfigStatLib(Eroute, envP);
318 }
319
320// If the export list is empty, add at least "/tmp" to it otherwise we will
321// fail to correctly track space.
322//
323 if (RPList.First() == 0)
324 RPList.Insert(new XrdOucPList("/tmp", (unsigned long long)0));
325
326// Establish usage tracking and quotas, if need be. Note that if we are not
327// a true data server, those services will be initialized but then disabled.
328//
329 Solitary = ((val = getenv("XRDREDIRECT")) && !strcmp(val, "Q"));
330 pfcMode = (envP && (val = envP->Get("oss.runmode")) && !strcmp(val,"pfc"));
331 {const char *m1 = (Solitary ? "standalone " : 0);
332 const char *m2 = (pfcMode ? "pfc " : 0);
333 if (m1 || m2) Eroute.Say("++++++ Configuring ", m1, m2, "mode . . .");
334 }
337
338// Configure the MSS interface including staging
339//
340 if (!NoGo) NoGo = ConfigStage(Eroute);
341
342// Configure async I/O
343//
344 if (!NoGo) NoGo = !AioInit();
345
346// Initialize memory mapping setting to speed execution
347//
348 if (!NoGo) ConfigMio(Eroute);
349
350// Provide support for the PFC. This also resolve cache attribute conflicts.
351//
352 if (!NoGo) ConfigCache(Eroute);
353
354// Establish the actual default path settings (modified by the above)
355//
356 RPList.Set(DirFlags);
357
358// Configure space (final pass)
359//
360 ConfigSpace(Eroute);
361
362// Set the prefix for files in cache file systems
363 if ( OptFlags & XrdOss_CacheFS )
364 if (!NoGo) {
365 NoGo = XrdOssPath::InitPrefix();
366 if (NoGo) Eroute.Emsg("Config", "space initialization failed");
367 }
368
369// Configure statiscal reporting
370//
371 if (!NoGo) ConfigStats(Eroute);
372
373// Start up the space scan thread unless specifically told not to. Some programs
374// like the cmsd manually handle space updates.
375//
376 if (!(val = getenv("XRDOSSCSCAN")) || strcmp(val, "off"))
377 {if ((retc = XrdSysThread::Run(&tid, XrdOssCacheScan,
378 (void *)&cscanint, 0, "space scan")))
379 Eroute.Emsg("Config", retc, "create space scan thread");
380 }
381
382// Display the final config if we can continue
383//
384 if (!NoGo) Config_Display(Eroute);
385
386// Do final reset of paths if we are in proxy file cache mode
387//
388 if (pfcMode && !NoGo) ConfigCache(Eroute, true);
389
390// Export the real path list (for frm et. al.)
391//
393 if (envP) envP->PutPtr("XrdOssRPList*", &RPList);
394
395// All done, close the stream and return the return code.
396//
397 val = (NoGo ? (char *)"failed." : (char *)"completed.");
398 Eroute.Say("------ Storage system initialization ", val);
399 return NoGo;
400}
void * XrdOssCacheScan(void *carg)
const char * XrdOssErrorText[]
XrdOucPListAnchor * XrdOssRPList
#define XRDOSS_ELAST
#define XRDOSS_EBASE
#define TRACE_ALL
Definition XrdTrace.hh:35
static int Init(const char *UDir, const char *Qfile, int isSOL, int usync=0)
static void MapDevs(bool dBug=false)
static int InitPrefix()
void Config_Display(XrdSysError &)
int ConfigStage(XrdSysError &Eroute)
static int AioInit()
Definition XrdOssAio.cc:281
void ConfigMio(XrdSysError &Eroute)
int ConfigN2N(XrdSysError &Eroute, XrdOucEnv *envP)
int ConfigStatLib(XrdSysError &Eroute, XrdOucEnv *envP)
int ConfigProc(XrdSysError &Eroute)
void ConfigCache(XrdSysError &Eroute, bool pass2=false)
char * Get(const char *varname)
Definition XrdOucEnv.hh:69
static void addTable(XrdSysError_Table *etp)

References XrdSysError::addTable(), AioInit(), Config_Display(), ConfigCache(), ConfigFN, ConfigMio(), ConfigN2N(), ConfigProc(), ConfigSpace(), ConfigStage(), ConfigStatLib(), ConfigStats(), cscanint, DirFlags, XrdSysError::Emsg(), FDFence, FDLimit, fuzalloc, XrdOucEnv::Get(), XrdOssCache::Init(), XrdOssPath::InitPrefix(), LocalRoot, XrdOssCache::MapDevs(), minalloc, N2N_Lib, OptFlags, OssTrace, ovhalloc, pfcMode, XrdOucEnv::PutPtr(), QFile, RemoteRoot, RPList, XrdSysThread::Run(), XrdSysError::Say(), Solitary, STT_Lib, TRACE_ALL, UDir, USync, XrdOss_CacheFS, XRDOSS_EBASE, XRDOSS_ELAST, XrdOssCacheScan(), XrdOssErrorText, XrdOssOK, and XrdOssRPList.

Referenced by Init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConfigXeq()

int XrdOssSys::ConfigXeq ( char * var,
XrdOucStream & Config,
XrdSysError & Eroute )
protected

Definition at line 1064 of file XrdOssConfig.cc.

1065{
1066 char myVar[80], buff[2048], *val;
1067 int nosubs;
1068 XrdOucEnv *myEnv = 0;
1069
1070 TS_Xeq("alloc", xalloc);
1071 TS_Xeq("cache", xcache);
1072 TS_Xeq("cachescan", xcachescan); // Backward compatibility
1073 TS_Xeq("spacescan", xcachescan);
1074 TS_Xeq("defaults", xdefault);
1075 TS_Xeq("fdlimit", xfdlimit);
1076 TS_Xeq("maxsize", xmaxsz);
1077 TS_Xeq("memfile", xmemf);
1078 TS_Xeq("namelib", xnml);
1079 TS_Xeq("path", xpath);
1080 TS_Xeq("preread", xprerd);
1081 TS_Xeq("space", xspace);
1082 TS_Xeq("stagecmd", xstg);
1083 TS_Xeq("statlib", xstl);
1084 TS_Xeq("trace", xtrace);
1085 TS_Xeq("usage", xusage);
1086 TS_Xeq("xfr", xxfr);
1087
1088 // Check if var substitutions are prohibited (e.g., stagemsg). Note that
1089 // TS_String() returns upon success so be careful when adding new opts.
1090 //
1091 if ((nosubs = !strcmp(var, "stagemsg"))) myEnv = Config.SetEnv(0);
1092
1093 // Copy the variable name as this may change because it points to an
1094 // internal buffer in Config. The vagaries of effeciency.
1095 //
1096 strlcpy(myVar, var, sizeof(myVar));
1097 var = myVar;
1098
1099 // We need to suck all the tokens to the end of the line for remaining
1100 // options. Do so, until we run out of space in the buffer.
1101 //
1102 if (!Config.GetRest(buff, sizeof(buff)))
1103 {Eroute.Emsg("Config", "arguments too long for", var);
1104 if (nosubs) Config.SetEnv(myEnv);
1105 return 1;
1106 }
1107 val = buff;
1108
1109 // Restore substititions at this point if need be
1110 //
1111 if (nosubs) Config.SetEnv(myEnv);
1112
1113 // At this point, make sure we have a value
1114 //
1115 if (!(*val))
1116 {Eroute.Emsg("Config", "no value for directive", var);
1117 return 1;
1118 }
1119
1120 // Check for tokens taking a variable number of parameters
1121 //
1122 TS_String("localroot", LocalRoot);
1123 TS_String("remoteroot", RemoteRoot);
1124 TS_String("stagemsg", StageMsg);
1125
1126 // The following differentiates between a deprecated and a preferred command
1127 //
1128 if (!strcmp("msscmd", var)) {isMSSC = 1; Duplicate(val, RSSCmd); return 0;}
1129 if (!strcmp("rsscmd", var)) {isMSSC = 0; Duplicate(val, RSSCmd); return 0;}
1130
1131 // No match found, complain.
1132 //
1133 Eroute.Say("Config warning: ignoring unknown directive '",var,"'.");
1134 Config.Echo();
1135 return 0;
1136}
#define TS_String(x, m)
#define TS_Xeq(x, m)
Definition XrdConfig.cc:160
#define Duplicate(x, y)
size_t strlcpy(char *dst, const char *src, size_t sz)
int xstg(XrdOucStream &Config, XrdSysError &Eroute)
int xtrace(XrdOucStream &Config, XrdSysError &Eroute)
int xstl(XrdOucStream &Config, XrdSysError &Eroute)
int xusage(XrdOucStream &Config, XrdSysError &Eroute)
int xspace(XrdOucStream &Config, XrdSysError &Eroute, int *isCD=0)
int xmemf(XrdOucStream &Config, XrdSysError &Eroute)
int xcachescan(XrdOucStream &Config, XrdSysError &Eroute)
int xfdlimit(XrdOucStream &Config, XrdSysError &Eroute)
int xprerd(XrdOucStream &Config, XrdSysError &Eroute)
int xcache(XrdOucStream &Config, XrdSysError &Eroute)
int xxfr(XrdOucStream &Config, XrdSysError &Eroute)
int xmaxsz(XrdOucStream &Config, XrdSysError &Eroute)
int xdefault(XrdOucStream &Config, XrdSysError &Eroute)
int xnml(XrdOucStream &Config, XrdSysError &Eroute)
int xalloc(XrdOucStream &Config, XrdSysError &Eroute)

References Duplicate, XrdSysError::Emsg(), isMSSC, LocalRoot, RemoteRoot, RSSCmd, XrdSysError::Say(), StageMsg, strlcpy(), TS_String, TS_Xeq, xalloc(), xcache(), xcachescan(), xdefault(), xfdlimit(), xmaxsz(), xmemf(), xnml(), xpath(), xprerd(), xspace(), xstg(), xstl(), xtrace(), xusage(), and xxfr().

Referenced by ConfigProc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Create()

int XrdOssSys::Create ( const char * tid,
const char * path,
mode_t mode,
XrdOucEnv & env,
int opts = 0 )
virtual

Create file.

Parameters
tid- Pointer to the trace identifier.
path- Pointer to the path of the file to create.
mode- The new file mode setting.
env- Reference to environmental information.
opts- Create options: XRDOSS_mkpath - create dir path if it does not exist. XRDOSS_new - the file must not already exist. oflags<<8 - open flags shifted 8 bits to the left/
Returns
0 upon success or -errno or -osserr (see XrdOssError.hh).

Implements XrdOss.

Definition at line 113 of file XrdOssCreate.cc.

115{
116 EPNAME("Create")
117 const int AMode = S_IRWXU|S_IRWXG|S_IROTH|S_IXOTH; // 775
118 char local_path[MAXPATHLEN+1], *p, pc;
119 local_path[0] = '\0';
120 unsigned long long remotefs;
121 int isLink = 0, Missing = 1, retc = 0, datfd;
122 XrdOssCreateInfo crInfo(local_path, path, access_mode, Opts);
123 struct stat buf;
124
125// Get options associated with this path and check if it's r/w
126//
127 remotefs = Check_RO(Create, crInfo.pOpts, path, "create");
128
129// Generate the actual local path for this file.
130//
131 if ((retc = GenLocalPath(path, local_path))) return retc;
132
133// Determine the state of the file. We will need this information as we go on.
134//
135 if ((Missing = lstat(local_path, &buf))) retc = errno;
136 else {if ((isLink = ((buf.st_mode & S_IFMT) == S_IFLNK)))
137 {if (stat(local_path, &buf))
138 {if (errno != ENOENT) return -errno;
139 OssEroute.Emsg("Create","removing dangling link",local_path);
140 if (unlink(local_path)) retc = errno;
141 Missing = 1; isLink = 0;
142 }
143 }
144 }
145 if (retc && retc != ENOENT) return -retc;
146
147// At this point, creation requests may need to be routed via the stagecmd.
148// This is done if the file/link do not exist. Otherwise, we drop through.
149//
150 if (StageCreate && Missing)
151 return XrdOssSS->Stage(tident, path, env, Opts>>8,
152 access_mode, crInfo.pOpts);
153
154// The file must not exist if it's declared "new". Otherwise, reuse the space.
155// SetFattr() alaways closes the provided file descriptor!
156//
157 if (!Missing)
158 {if (Opts & XRDOSS_new) return -EEXIST;
159 if ((buf.st_mode & S_IFMT) == S_IFDIR) return -EISDIR;
160 do {datfd = open(local_path, Opts>>8, access_mode);}
161 while(datfd < 0 && errno == EINTR);
162 if (datfd < 0) return -errno;
163 if ((retc = SetFattr(crInfo, datfd, buf.st_mtime))) return retc;
164 if (Opts>>8 & O_TRUNC && buf.st_size)
165 {off_t theSize = buf.st_size;
166 if (isLink) {buf.st_mode = (buf.st_mode & ~S_IFMT) | S_IFLNK;
167 XrdOssCache::Adjust(local_path, -theSize, &buf);
168 }
169 }
170 return 0;
171 }
172
173// If the path is to be created, make sure the path exists at this point
174//
175 if ((Opts & XRDOSS_mkpath) && (p = rindex(local_path, '/')))
176 {p++; pc = *p; *p = '\0';
177 XrdOucUtils::makePath(local_path, AMode);
178 *p = pc;
179 }
180
181// If this is a staging filesystem then we have lots more work to do.
182//
183 if (remotefs)
184 {char remote_path[MAXPATHLEN+1];
185
186 // Generate the remote path for this file
187 //
188 if ((retc = GenRemotePath(path,remote_path))) return retc;
189
190 // Create the file in remote system unless not wanted so
191 //
192 if (crInfo.pOpts & XRDEXP_RCREATE)
193 {if ((retc = MSS_Create(remote_path, access_mode, env)) < 0)
194 {DEBUG("rc" <<retc <<" mode=" <<Xrd::oct1 <<access_mode
195 <<" remote path=" <<remote_path);
196 return retc;
197 }
198 } else if (!(crInfo.pOpts & XRDEXP_NOCHECK))
199 {if (!(retc = MSS_Stat(remote_path))) return -EEXIST;
200 else if (retc != -ENOENT) return retc;
201 }
202 }
203
204// Created file in the extended cache or the local name space
205//
206 if (XrdOssCache::fsfirst && !(crInfo.pOpts & XRDEXP_INPLACE))
207 retc = Alloc_Cache(crInfo, env);
208 else retc = Alloc_Local(crInfo, env);
209
210// If successful then check if xattrs were actually set
211//
212 if (retc == XrdOssOK && crInfo.cOpts & XRDOSS_setnoxa)
213 {XrdOucPList *plP = RPList.About(path);
214 if (plP) plP->Set(plP->Flag() | XRDEXP_NOXATTR);
215 }
216
217// All done.
218//
219 return retc;
220}
#define tident
XrdOssSys * XrdOssSS
Definition XrdOssApi.cc:77
#define Check_RO(act, flags, path, opname)
Definition XrdOssApi.hh:387
#define XRDOSS_setnoxa
Definition XrdOss.hh:471
#define XRDOSS_new
Definition XrdOss.hh:467
#define XRDOSS_mkpath
Definition XrdOss.hh:466
static XrdOssCache_FS * fsfirst
int GenRemotePath(const char *, char *)
Definition XrdOssApi.cc:249
virtual int Stage(const char *, const char *, XrdOucEnv &, int, mode_t, unsigned long long)
int Alloc_Cache(XrdOssCreateInfo &, XrdOucEnv &)
virtual int Create(const char *, const char *, mode_t, XrdOucEnv &, int opts=0)
int MSS_Stat(const char *, struct stat *buff=0)
Definition XrdOssMSS.cc:253
int MSS_Create(const char *path, mode_t, XrdOucEnv &)
Definition XrdOssMSS.cc:206
int Alloc_Local(XrdOssCreateInfo &, XrdOucEnv &)
static int makePath(char *path, mode_t mode, bool reset=false)

References XrdOssCache::Adjust(), Alloc_Cache(), Alloc_Local(), Check_RO, XrdOssCreateInfo::cOpts, Create(), DEBUG, EPNAME, XrdOucPList::Flag(), XrdOssCache::fsfirst, GenLocalPath(), GenRemotePath(), XrdOucUtils::makePath(), MSS_Create(), MSS_Stat(), Xrd::oct1, open, OssEroute, XrdOssCreateInfo::pOpts, RPList, XrdOucPList::Set(), SetFattr(), StageCreate, stat, tident, unlink, XRDEXP_INPLACE, XRDEXP_NOCHECK, XRDEXP_NOXATTR, XRDEXP_RCREATE, XRDOSS_mkpath, XRDOSS_new, XRDOSS_setnoxa, XrdOssOK, and XrdOssSS.

Referenced by Create().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ doScrub()

void XrdOssSys::doScrub ( )
protected

◆ Features()

uint64_t XrdOssSys::Features ( )
inlinevirtual

Return storage system features.

Returns
Storage system features (see XRDOSS_HASxxx flags).

Reimplemented from XrdOss.

Definition at line 166 of file XrdOssApi.hh.

166{return XRDOSS_HASNAIO;} // Turn async I/O off for disk
#define XRDOSS_HASNAIO
Definition XrdOss.hh:480

References XRDOSS_HASNAIO.

◆ Find()

int XrdOssSys::Find ( XrdOssStage_Req * req,
void * carg )
protected

References stat.

◆ GenLocalPath()

int XrdOssSys::GenLocalPath ( const char * oldp,
char * newp )

Definition at line 232 of file XrdOssApi.cc.

233{
234 if (lcl_N2N) return -(lcl_N2N->lfn2pfn(oldp, newp, MAXPATHLEN));
235 if (strlen(oldp) >= MAXPATHLEN) return -ENAMETOOLONG;
236 strcpy(newp, oldp);
237 return 0;
238}

References lcl_N2N.

Referenced by ConfigSpace(), ConfigStats(), ConfigStats(), Create(), GetFile(), HasFile(), Reloc(), Remdir(), Rename(), and Unlink().

Here is the caller graph for this function:

◆ GenRemotePath()

int XrdOssSys::GenRemotePath ( const char * oldp,
char * newp )

Definition at line 249 of file XrdOssApi.cc.

250{
251 if (rmt_N2N) return -(rmt_N2N->lfn2rfn(oldp, newp, MAXPATHLEN));
252 if (strlen(oldp) >= MAXPATHLEN) return -ENAMETOOLONG;
253 strcpy(newp, oldp);
254 return 0;
255}

References rmt_N2N.

Referenced by Create(), GetFile(), Rename(), and Unlink().

Here is the caller graph for this function:

◆ getCname()

int XrdOssSys::getCname ( const char * path,
struct stat * sbuff,
char * cgbuff )
protected

Definition at line 455 of file XrdOssStat.cc.

456{
457 const char *thePath;
458 char actual_path[MAXPATHLEN+1];
459 int retc;
460
461// Get the pfn for this path
462//
463 if (lcl_N2N)
464 if ((retc = lcl_N2N->lfn2pfn(path, actual_path, sizeof(actual_path))))
465 return retc;
466 else thePath = actual_path;
467 else thePath = path;
468
469// Get regular stat informtion for this file
470//
471 if ((retc = stat(thePath, sbuff))) return -errno;
472
473// Now determine if we should get the cache group name. There is none
474// for offline files and it's always public for directories.
475//
476 if (S_ISDIR(sbuff->st_mode)) strcpy(cgbuff, "public");
477 else if (S_ISBLK(sbuff->st_mode)) strcpy(cgbuff, "*");
478 else XrdOssPath::getCname(thePath, cgbuff);
479
480// All done
481//
482 return 0;
483}
static int getCname(const char *path, char *Cache, char *lbuf=0, int lbsz=0)

References XrdOssPath::getCname(), lcl_N2N, and stat.

Referenced by StatLS(), and StatXA().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetFile()

int XrdOssSys::GetFile ( XrdOssStage_Req * req)
protected

Definition at line 433 of file XrdOssStage.cc.

434{
435 char rfs_fn[MAXPATHLEN+1];
436 char lfs_fn[MAXPATHLEN+1];
437 int retc;
438
439// Convert the local filename and generate the corresponding remote name.
440//
441 if ( (retc = GenLocalPath(req->path, lfs_fn)) ) return retc;
442 if ( (retc = GenRemotePath(req->path, rfs_fn)) ) return retc;
443
444// Run the command to get the file
445//
446 if ((retc = StageProg->Run(rfs_fn, lfs_fn)))
447 {OssEroute.Emsg("Stage", retc, "stage", req->path);
448 return (retc == 2 ? -ENOENT : -XRDOSS_E8009);
449 }
450
451// All went well
452//
453 return 0;
454}
#define XRDOSS_E8009
const char * path

References GenLocalPath(), GenRemotePath(), OssEroute, XrdOssStage_Req::path, StageProg, and XRDOSS_E8009.

Referenced by Stage_In().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getID()

int XrdOssSys::getID ( const char * Tid,
XrdOucEnv & Env,
char * buff,
int bsz )
protected

Definition at line 460 of file XrdOssStage.cc.

461{
462 char *bP;
463 int n;
464
465// The buffer always starts with a '+'
466//
467 *buff = '+'; bP = buff+1; bsz -= 3;
468
469// Get the trace id
470//
471 if (Tid && (n = strlen(Tid)) <= bsz) {strcpy(bP, Tid); bP += n;}
472
473// Insert space
474//
475 *bP++ = ' '; *bP = '\0';
476 return bP - buff;
477}

Referenced by Stage_QT().

Here is the caller graph for this function:

◆ getStats()

int XrdOssSys::getStats ( char * buff,
int blen )
protected

Definition at line 489 of file XrdOssStat.cc.

490{
491 static const char ptag1[] = "<paths>%d";
492 static const char ptag2[] = "<stats id=\"%d\"><lp>\"%s\"</lp><rp>\"%s\"</rp>"
493 "<tot>%lld</tot><free>%lld</free><ino>%lld</ino><ifr>%lld</ifr></stats>";
494 static const char ptag3[] = "</paths>";
495
496 static const int ptag1sz = sizeof(ptag1);
497 static const int ptag2sz = sizeof(ptag2) + (16*4);
498 static const int ptag3sz = sizeof(ptag3);
499
500 static const char stag1[] = "<space>%d";
501 static const char stag2[] = "<stats id=\"%d\"><name>%s</name>"
502 "<tot>%lld</tot><free>%lld</free><maxf>%lld</maxf>"
503 "<fsn>%d</fsn><usg>%lld</usg>";
504 static const char stagq[] = "<qta>%lld</qta>";
505 static const char stags[] = "</stats>";
506 static const char stag3[] = "</space>";
507
508 static const int stag1sz = sizeof(stag1);
509 static const int stag2sz = sizeof(stag2) + XrdOssSpace::maxSNlen + (16*5);
510 static const int stagqsz = sizeof(stagq) + 16;
511 static const int stagssz = sizeof(stags);
512 static const int stag3sz = sizeof(stag3);
513
514 static const int stagsz = ptag1sz + ptag2sz + ptag3sz + 1024 +
515 + stag1sz + stag2sz + stag3sz
516 + stagqsz + stagssz;
517
518 XrdOssCache_Group *fsg = XrdOssCache_Group::fsgroups;
519 OssDPath *dpP = DPList;
520 char *bp = buff;
521 int dpNum = 0, spNum = 0, n, flen;
522
523// If no buffer spupplied, return how much data we will generate. We also
524// do one-time initialization here.
525//
526 if (!buff) return ptag1sz + (ptag2sz * numDP) + stag3sz + lenDP
527 + stag1sz + (stag2sz * numCG) + stag3sz
528 + stagqsz + stagssz;
529
530// Make sure we have enough space for one entry
531//
532 if (blen <= stagsz) return 0;
533
534// Output first header (we know we have one path, at least)
535//
536 flen = sprintf(bp, ptag1, numDP); bp += flen; blen -= flen;
537
538// Output individual entries
539//
540 while(dpP && blen > 0)
541 {XrdOssCache_Space CSpace;
542 XrdOssCache_FS::freeSpace(CSpace, dpP->Path2);
543 flen = snprintf(bp, blen, ptag2, dpNum, dpP->Path1, dpP->Path2,
544 CSpace.Total>>10, CSpace.Free>>10,
545 CSpace.Inodes, CSpace.Inleft);
546 dpP = dpP->Next; bp += flen; blen -= flen; dpNum++;
547 }
548
549// Output closing tag
550//
551 if (blen <= ptag3sz) return 0;
552 strcpy(bp, ptag3); bp += (ptag3sz-1); blen -= (ptag3sz-1);
553 dpNum = bp - buff;
554
555// Output header
556//
557 if (blen <= stag1sz) return (blen < 0 ? 0 : dpNum);
558 flen = snprintf(bp, blen, stag1, numCG); bp += flen; blen -= flen;
559 if (blen <= stag1sz) return dpNum;
560
561// Generate info for each path
562//
563 while(fsg && blen > 0)
564 {XrdOssCache_Space CSpace;
565 n = XrdOssCache_FS::getSpace(CSpace, fsg);
566 flen = snprintf(bp, blen, stag2, spNum, fsg->group, CSpace.Total>>10,
567 CSpace.Free>>10, CSpace.Maxfree>>10, n, CSpace.Usage>>10);
568 bp += flen; blen -= flen; spNum++;
569 if (CSpace.Quota >= 0 && blen > stagqsz)
570 {flen = sprintf(bp, stagq, CSpace.Quota); bp += flen; blen -= flen;}
571 if (blen < stagssz) return dpNum;
572 strcpy(bp, stags); bp += (stagssz-1); blen -= (stagssz-1);
573 fsg = fsg->next;
574 }
575
576// Insert trailer
577//
578 if (blen >= stag3sz) {strcpy(bp, stag3); bp += (stag3sz-1);}
579 else return dpNum;
580
581// All done
582//
583 return bp - buff;
584}
static int getSpace(XrdOssCache_Space &Space, const char *sname, XrdOssVSPart **vsPart=0)
static long long freeSpace(long long &Size, const char *path=0)
static const int maxSNlen
char * Path2
OssDPath * Next
char * Path1

References DPList, XrdOssCache_Space::Free, XrdOssCache_FS::freeSpace(), XrdOssCache_Group::fsgroups, XrdOssCache_FS::getSpace(), XrdOssCache_Group::group, XrdOssCache_Space::Inleft, XrdOssCache_Space::Inodes, lenDP, XrdOssCache_Space::Maxfree, XrdOssSpace::maxSNlen, OssDPath::Next, XrdOssCache_Group::next, numCG, numDP, OssDPath::Path1, OssDPath::Path2, XrdOssCache_Space::Quota, XrdOssCache_Space::Total, and XrdOssCache_Space::Usage.

Referenced by Stats().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HasFile()

time_t XrdOssSys::HasFile ( const char * fn,
const char * sfx,
time_t * mTime = 0 )
protected

Definition at line 483 of file XrdOssStage.cc.

484{
485 struct stat statbuff;
486 int fnlen;
487 char path[MAXPATHLEN+8];
488 char *pp = path;
489
490// Copy the path with possible conversion
491//
492 if (xfrFdir)
493 {strcpy(path, xfrFdir);
494 pp = path + xfrFdln;
495 }
496 if (GenLocalPath(fn, pp)) return 0;
497 fnlen = strlen(path);
498
499// Add the suffix
500//
501 if ((fnlen + strlen(fsfx)) >= sizeof(path)) return 0;
502 strcpy(path+fnlen, fsfx);
503
504// Now check if the file actually exists
505//
506 if (stat(path, &statbuff)) return 0;
507 if (mTime) *mTime = statbuff.st_mtime;
508 return statbuff.st_ctime;
509}

References GenLocalPath(), stat, xfrFdir, and xfrFdln.

Referenced by Stage_QT(), and Stage_RT().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Init() [1/2]

int XrdOssSys::Init ( XrdSysLogger * lp,
const char * cfn,
XrdOucEnv * envP )
virtual

Initialize the storage system V2.

Parameters
lp- Pointer to the message logging object.
cfn- Pointer to the configuration file.
envP- Pointer to environmental information.
Returns
0 upon success or -errno or -osserr (see XrdOssError.hh).

Reimplemented from XrdOss.

Definition at line 186 of file XrdOssApi.cc.

187{
188 int retc;
189
190// No need to do the herald thing as we are the default storage system
191//
192 OssEroute.logger(lp);
193
194// Initialize the subsystems
195//
196 XrdOssSS = this;
197 if ( (retc = Configure(configfn, OssEroute, envP)) ) return retc;
198
199// All done.
200//
201 return XrdOssOK;
202}
int Configure(const char *, XrdSysError &, XrdOucEnv *envP)

References Configure(), OssEroute, XrdOssOK, and XrdOssSS.

Referenced by XrdOssGetSS().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Init() [2/2]

int XrdOssSys::Init ( XrdSysLogger * lp,
const char * cfn )
inlinevirtual

Initialize the storage system V1 (deprecated).

Parameters
lp- Pointer to the message logging object.
cfn- Pointer to the configuration file.
Returns
0 upon success or -errno or -osserr (see XrdOssError.hh).

Implements XrdOss.

Definition at line 170 of file XrdOssApi.hh.

170{return Init(lP, cP, 0);}
int Init(XrdSysLogger *, const char *, XrdOucEnv *envP)
Definition XrdOssApi.cc:186

References Init().

Referenced by Init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsRemote()

int XrdOssSys::IsRemote ( const char * path)
inline

Definition at line 171 of file XrdOssApi.hh.

172 {return (RPList.Find(path) & XRDEXP_REMOTE) != 0;}
#define XRDEXP_REMOTE

References RPList, and XRDEXP_REMOTE.

Referenced by Stat().

Here is the caller graph for this function:

◆ Lfn2Pfn() [1/2]

int XrdOssSys::Lfn2Pfn ( const char * Path,
char * buff,
int blen )
virtual

Translate logical name to physical name V1 (deprecated).

Parameters
Path- Path in whose information is wanted.
buff- Pointer to the buffer to hold the new path.
blen- Length of the buffer.
Returns
0 upon success or -errno or -osserr (see XrdOssError.hh).

Reimplemented from XrdOss.

Definition at line 208 of file XrdOssApi.cc.

209{
210 if (lcl_N2N) return -(lcl_N2N->lfn2pfn(oldp, newp, blen));
211 if ((int)strlen(oldp) >= blen) return -ENAMETOOLONG;
212 strcpy(newp, oldp);
213 return 0;
214}

References lcl_N2N.

◆ Lfn2Pfn() [2/2]

const char * XrdOssSys::Lfn2Pfn ( const char * Path,
char * buff,
int blen,
int & rc )
virtual

Translate logical name to physical name V2.

Parameters
Path- Path in whose information is wanted.
buff- Pointer to the buffer to hold the new path.
blen- Length of the buffer.
rc- Place where failure return code is to be returned: -errno or -osserr (see XrdOssError.hh).
Returns
Pointer to the translated path upon success or nil on failure.

Reimplemented from XrdOss.

Definition at line 216 of file XrdOssApi.cc.

217{
218 if (!lcl_N2N) {rc = 0; return oldp;}
219 if ((rc = -(lcl_N2N->lfn2pfn(oldp, newp, blen)))) return 0;
220 return newp;
221}

References lcl_N2N.

◆ List_Path()

void XrdOssSys::List_Path ( const char * pfx,
const char * pname,
unsigned long long flags,
XrdSysError & Eroute )
protected

Definition at line 2108 of file XrdOssConfig.cc.

2110{
2111 std::string ss;
2112 const char *rwmode;
2113
2114 if (flags & XRDEXP_FORCERO) rwmode = " forcero";
2115 else if (flags & XRDEXP_READONLY) rwmode = " r/o";
2116 else rwmode = " r/w";
2117
2118 if (flags & XRDEXP_INPLACE) ss += " inplace";
2119 if (flags & XRDEXP_LOCAL) ss += " local";
2120 if (flags & XRDEXP_GLBLRO) ss += " globalro";
2121
2122 if (!(flags & XRDEXP_PFCACHE))
2123 {if (flags & XRDEXP_PFCACHE_X) ss += " nocache";
2124 ss += (flags & XRDEXP_NOCHECK ? " nocheck" : " check");
2125 ss += (flags & XRDEXP_NODREAD ? " nodread" : " dread");
2126 ss += (flags & XRDEXP_MIG ? " mig" : " nomig");
2127 ss += (flags & XRDEXP_PURGE ? " purge" : " nopurge");
2128 ss += (flags & XRDEXP_RCREATE ? " rcreate" : " norcreate");
2129 ss += (flags & XRDEXP_STAGE ? " stage" : " nostage");
2130 } else ss += " cache";
2131
2132
2133 if (flags & XRDEXP_MMAP)
2134 {ss += " mmap";
2135 ss += (flags & XRDEXP_MKEEP ? " mkeep" : " nomkeep");
2136 ss += (flags & XRDEXP_MLOK ? " mlock" : " nomlock");
2137 }
2138
2139 Eroute.Say(pfx, pname, rwmode, ss.c_str());
2140}
#define XRDEXP_GLBLRO
#define XRDEXP_LOCAL

References XrdSysError::Say(), XRDEXP_FORCERO, XRDEXP_GLBLRO, XRDEXP_INPLACE, XRDEXP_LOCAL, XRDEXP_MIG, XRDEXP_MKEEP, XRDEXP_MLOK, XRDEXP_MMAP, XRDEXP_NOCHECK, XRDEXP_NODREAD, XRDEXP_PFCACHE, XRDEXP_PFCACHE_X, XRDEXP_PURGE, XRDEXP_RCREATE, XRDEXP_READONLY, and XRDEXP_STAGE.

Referenced by Config_Display().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Mkdir()

int XrdOssSys::Mkdir ( const char * path,
mode_t mode,
int mkpath = 0,
XrdOucEnv * envP = 0 )
virtual

Create a directory.

Parameters
path- Pointer to the path of the directory to be created.
mode- The directory mode setting.
mkpath- When true the path is created if it does not exist.
envP- Pointer to environmental information.
Returns
0 upon success or -errno or -osserr (see XrdOssError.hh).

Implements XrdOss.

Definition at line 306 of file XrdOssApi.cc.

307{
308 char actual_path[MAXPATHLEN+1], *local_path;
309 int retc;
310
311// Make sure we can modify this path
312//
313 Check_RW(Mkdir, path, "create directory");
314
315// Generate local path
316//
317 if (lcl_N2N)
318 if ((retc = lcl_N2N->lfn2pfn(path, actual_path, sizeof(actual_path))))
319 return retc;
320 else local_path = actual_path;
321 else local_path = (char *)path;
322
323// Create the directory or full path only in the loal file system
324//
325 if (!mkdir(local_path, mode)) return XrdOssOK;
326 if (mkpath && errno == ENOENT){return Mkpath(local_path, mode);}
327 if (errno != EEXIST) return -errno;
328
329// Check if this is a duplicate request
330//
331 struct stat Stat;
332 static const mode_t accBits = (S_IRWXU|S_IRWXG|S_IRWXO);
333
334 if (!stat(local_path, &Stat) && S_ISDIR(Stat.st_mode)
335 && mode == (Stat.st_mode & accBits)) return XrdOssOK;
336 return -EEXIST;
337}
#define Check_RW(act, path, opname)
Definition XrdOssApi.hh:392
#define mkdir(a, b)
Definition XrdPosix.hh:74
int Mkdir(const char *, mode_t mode, int mkpath=0, XrdOucEnv *eP=0)
Definition XrdOssApi.cc:306
int Mkpath(const char *, mode_t mode)
Definition XrdOssApi.cc:353

References Check_RW, lcl_N2N, Mkdir(), mkdir, Mkpath(), Stat(), stat, and XrdOssOK.

Referenced by Mkdir().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Mkpath()

int XrdOssSys::Mkpath ( const char * path,
mode_t mode )

Definition at line 353 of file XrdOssApi.cc.

354{
355 char local_path[MAXPATHLEN+1], *next_path;
356 int i = strlen(path);
357
358// Copy the path so we can modify it
359//
360 strcpy(local_path, path);
361
362// Trim off the trailing slashes so we can have predictable behaviour
363//
364 while(i && local_path[--i] == '/') local_path[i] = '\0';
365 if (!i) return -ENOENT;
366
367// Start creating directories starting with the root
368//
369 next_path = local_path;
370 while((next_path = index(next_path+1, int('/'))))
371 {*next_path = '\0';
372 if (mkdir(local_path, mode) && errno != EEXIST) return -errno;
373 *next_path = '/';
374 }
375
376// Create last component and return
377//
378 if (mkdir(local_path, mode) && errno != EEXIST) return -errno;
379 return XrdOssOK;
380}

References mkdir, and XrdOssOK.

Referenced by Mkdir().

Here is the caller graph for this function:

◆ MSS_Closedir()

int XrdOssSys::MSS_Closedir ( void * dir_handle)

Definition at line 185 of file XrdOssMSS.cc.

185 {
186/*
187 Function: Close the directory associated with handle "dir_handle".
188
189 Input: dir_handle - The handle returned by opendir().
190
191 Output: Returns 0 upon success and (-errno) upon failure.
192*/
193 const char *epname = "MSS_Closedir";
194 struct XrdOssHandle *oh = (struct XrdOssHandle *)dir_handle;
195
196 if ( !(oh->hflag & XRDOSS_HT_DIR) )
197 {OssEroute.Emsg(epname, "invalid mss handle"); return -EBADF;}
198 delete oh;
199 return XrdOssOK;
200}
#define XRDOSS_HT_DIR
Definition XrdOssMSS.cc:92

References XrdOssHandle::hflag, OssEroute, XRDOSS_HT_DIR, and XrdOssOK.

◆ MSS_Create()

int XrdOssSys::MSS_Create ( const char * path,
mode_t file_mode,
XrdOucEnv & env )

Definition at line 206 of file XrdOssMSS.cc.

218{
219 const char *epname = "MSS_Create";
220 char myMode[16];
221
222 // Make sure the path is not too long.
223 //
224 if (strlen(path) > MAXPATHLEN)
225 {OssEroute.Emsg(epname, "mss path too long - ", path);
226 return -ENAMETOOLONG;
227 }
228
229 // Construct the cmd to create the file. We currently don't support cosid.
230 //
231 sprintf(myMode, "%o", static_cast<int>(file_mode));
232
233 // Create the file in in the mass store system
234 //
235 return MSS_Xeq(0, 0, "create", path, myMode);
236}
int MSS_Xeq(XrdOucStream **xfd, int okerr, const char *cmd, const char *arg1=0, const char *arg2=0)
Definition XrdOssMSS.cc:383

References MSS_Xeq(), and OssEroute.

Referenced by Create().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MSS_Opendir()

void * XrdOssSys::MSS_Opendir ( const char * dir_path,
int & rc )

Definition at line 102 of file XrdOssMSS.cc.

102 {
103/*
104 Function: Open the directory `path' and prepare for reading.
105
106 Input: path - The fully qualified name of the directory to open.
107
108 Output: Returns a directory handle to be used for subsequent
109 operations. If an error occurs, (-errno) is returned.
110*/
111 const char *epname = "MSS_Opendir";
112 struct XrdOssHandle *oh;
113 XrdOucStream *sp;
114
115 // Make sure the path is not too long.
116 //
117 if (strlen(dir_path) > MAXPATHLEN)
118 {OssEroute.Emsg(epname, "mss path too long - ", dir_path);
119 rc = -ENAMETOOLONG;
120 return (void *)0;
121 }
122
123 // Issue it now to trap any errors but defer reading the result until
124 // readdir() is called. This does tie up a process, sigh.
125 //
126 if ( (rc = MSS_Xeq(&sp, ENOENT, "dlist", dir_path)))
127 return (void *)0;
128
129 // Allocate storage for the handle and return a copy of it.
130 //
131 if (!(oh = new XrdOssHandle(XRDOSS_HT_DIR, sp)))
132 {delete sp; rc = -ENOMEM; return (void *)0;}
133 return (void *)oh;
134}

References MSS_Xeq(), OssEroute, and XRDOSS_HT_DIR.

Here is the call graph for this function:

◆ MSS_Readdir()

int XrdOssSys::MSS_Readdir ( void * fd,
char * buff,
int blen )

Definition at line 140 of file XrdOssMSS.cc.

140 {
141/*
142 Function: Read the next entry if directory 'dir_handle'.
143
144 Input: dir_handle - The value returned by a successful opendir() call.
145 buff - Buffer to hold directory name.
146 blen - Size of the buffer.
147
148 Output: Upon success, places the contents of the next directory entry
149 in buff. When the end of the directory is encountered buff
150 will be set to a null string.
151
152 Upon failure, returns a (-errno).
153*/
154 const char *epname = "MSS_Readdir";
155 int retc;
156 struct XrdOssHandle *oh = (struct XrdOssHandle *)dir_handle;
157 char *resp;
158
159 // Verify that the handle is correct.
160 //
161 if ( !(oh->hflag & XRDOSS_HT_DIR) )
162 {OssEroute.Emsg(epname, "invalid mss handle"); return -EBADF;}
163
164 // Read a record from the directory, if possible.
165 //
166 if (oh->hflag & XRDOSS_HT_EOF) *buff = '\0';
167 else if ((resp = oh->sp->GetLine()))
168 {if ( ((int)strlen(resp)) >= blen )
169 {*buff = '\0';
170 return OssEroute.Emsg(epname, -EOVERFLOW,
171 "readdir rmt", resp);
172 }
173 strlcpy(buff, resp, blen);
174 } else {
175 if ((retc = oh->sp->LastError())) return NegVal(retc);
176 else {*buff = '\0'; oh->hflag |= XRDOSS_HT_EOF;}
177 }
178 return XrdOssOK;
179}
#define NegVal(x)
Definition XrdOssMSS.cc:72
#define XRDOSS_HT_EOF
Definition XrdOssMSS.cc:91
char * GetLine()
XrdOucStream * sp
Definition XrdOssMSS.cc:84

References XrdOucStream::GetLine(), XrdOssHandle::hflag, XrdOucStream::LastError(), NegVal, OssEroute, XrdOssHandle::sp, strlcpy(), XRDOSS_HT_DIR, XRDOSS_HT_EOF, and XrdOssOK.

Here is the call graph for this function:

◆ MSS_Remdir()

int XrdOssSys::MSS_Remdir ( const char * ,
const char *  )
inline

Definition at line 210 of file XrdOssApi.hh.

210{return -ENOTSUP;}

◆ MSS_Rename()

int XrdOssSys::MSS_Rename ( const char * oldname,
const char * newname )

Definition at line 360 of file XrdOssMSS.cc.

360 {
361 const char *epname = "MSS_Rename";
362
363 // Make sure the path is not too long.
364 //
365 if (strlen(oldname) > MAXPATHLEN
366 || strlen(newname) > MAXPATHLEN)
367 {OssEroute.Emsg(epname,"mss path too long - ", oldname, newname);
368 return -ENAMETOOLONG;
369 }
370
371 // Rename the file in Mass Store System
372 //
373 return MSS_Xeq(0, 0, "mv", oldname, newname);
374}

References MSS_Xeq(), and OssEroute.

Referenced by Rename().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MSS_Stat()

int XrdOssSys::MSS_Stat ( const char * path,
struct stat * buff = 0 )

Definition at line 253 of file XrdOssMSS.cc.

254{
255 const char *epname = "MSS_Stat";
256 char ftype, mtype[10], *resp;
257 int retc, xt_nlink;
258 long xt_uid, xt_gid, atime, ctime, mtime, xt_blksize, xt_blocks;
259 long long xt_size;
260 XrdOucStream *sfd;
261
262 // Make sure the path is not too long.
263 //
264 if (strlen(path) > MAXPATHLEN)
265 {OssEroute.Emsg(epname, "mss path too long - ", path);
266 return -ENAMETOOLONG;
267 }
268
269 // Issue the command. This may be an immediate exists a or full statx.
270 //
271 if (!buff) return MSS_Xeq(0, ENOENT, (isMSSC ? "statx" : "exists"), path);
272 if ((retc = MSS_Xeq(&sfd, ENOENT, "statx", path))) return retc;
273
274 // Read in the results.
275 //
276 if ( !(resp = sfd ->GetLine()))
277 return OssEroute.Emsg(epname,-XRDOSS_E8012,"process ",path);
278
279 // Extract data from the response.
280 //
281 sscanf(resp, "%c %9s %d %ld %ld %ld %ld %ld %lld %ld %ld", &ftype, mtype,
282 &xt_nlink, &xt_uid, &xt_gid, &atime, &ctime, &mtime,
283 &xt_size, &xt_blksize, &xt_blocks);
284
285 // Set the stat buffer, appropriately.
286 //
287 memset( (char *)buff, 0, sizeof(struct stat) );
288 buff->st_nlink = static_cast<nlink_t>(xt_nlink);
289 buff->st_uid = static_cast<uid_t>(xt_uid);
290 buff->st_gid = static_cast<gid_t>(xt_gid);
291 buff->st_atime = static_cast<time_t>(atime);
292 buff->st_ctime = static_cast<time_t>(ctime);
293 buff->st_mtime = static_cast<time_t>(mtime);
294 buff->st_size = static_cast<off_t>(xt_size);
295 buff->st_blksize=static_cast<long>(xt_blksize);
296#ifdef __APPLE__
297 buff->st_blocks = xt_blocks;
298#else
299 buff->st_blocks =static_cast<blkcnt_t>(xt_blocks);
300#endif
301
302 if (ftype == 'd') buff->st_mode |= S_IFDIR;
303 else if (ftype == 'l') buff->st_mode |= S_IFLNK;
304 else buff->st_mode |= S_IFREG;
305
306 buff->st_mode |= tranmode(&mtype[0]) << 6;
307 buff->st_mode |= tranmode(&mtype[3]) << 3;
308 buff->st_mode |= tranmode(&mtype[6]);
309
310 delete sfd;
311 return 0;
312}
#define XRDOSS_E8012
int tranmode(char *)
Definition XrdOssMSS.cc:314

References isMSSC, MSS_Xeq(), OssEroute, stat, tranmode(), and XRDOSS_E8012.

Referenced by Create(), Stage_RT(), and Stat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MSS_Unlink()

int XrdOssSys::MSS_Unlink ( const char * path)

Definition at line 333 of file XrdOssMSS.cc.

333 {
334 const char *epname = "MSS_Unlink";
335
336 // Make sure the path is not too long.
337 //
338 if (strlen(path) > MAXPATHLEN)
339 {OssEroute.Emsg(epname, "mss path too long - ", path);
340 return -ENAMETOOLONG;
341 }
342
343 // Remove the file in Mass Store System.
344 //
345 return MSS_Xeq(0, ENOENT, "rm", path);
346}

References MSS_Xeq(), and OssEroute.

Referenced by Unlink().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MSS_Xeq()

int XrdOssSys::MSS_Xeq ( XrdOucStream ** xfd,
int okerr,
const char * cmd,
const char * arg1 = 0,
const char * arg2 = 0 )
protected

Definition at line 383 of file XrdOssMSS.cc.

385{
386 EPNAME("MSS_Xeq")
387 static int NoResp = 0;
388 char *resp;
389 int retc;
390 XrdOucStream *sp;
391
392// If we have no gateway command, return an error
393//
394 if (!RSSProg) return -XRDOSS_E8013;
395
396// Allocate a stream for this command
397//
398 if (!(sp = new XrdOucStream(&OssEroute)))
399 return OssEroute.Emsg("MSS_Xeq",-ENOMEM,"create stream for",RSSCmd);
400
401// Run the command
402//
403 DEBUG("Invoking '" <<RSSCmd <<' ' <<cmd <<' ' <<(arg1 ? arg1 : "")
404 <<' ' <<(arg2 ? arg2 : ""));
405 if ((retc = RSSProg->Run(sp, cmd, arg1, arg2)))
406 {delete sp; return NegVal(retc);}
407
408// Wait for data to appear. We do this to avoid hanging up and chewing through
409// all of the threads while clients retry the requests with a new connection.
410//
411 if ((retc = sp->Wait4Data(RSSTout)))
412 {if (retc < 0)
413 {if (!(0xff & NoResp++))
414 OssEroute.Emsg("MSS_Xeq", -ETIMEDOUT, "execute", cmd);
415 retc = ETIMEDOUT;
416 }
417 delete sp; return NegVal(retc);
418 }
419
420// Read back the first record. The first records must be the return code
421// from the command followed by any output. Make sure that this is the case.
422//
423 if ( !(resp = sp->GetLine()) ) retc = XRDOSS_E8023;
424 else
425 {DEBUG("received '" <<resp <<"'");
426 if (sscanf(resp, "%d", &retc) <= 0) retc = XRDOSS_E8024;
427 }
428 if (retc)
429 {if (retc != -okerr)
430 OssEroute.Emsg("MSS_Xeq", NegVal(retc), "execute", cmd);
431 delete sp;
432 return NegVal(retc);
433 }
434
435// If the caller wants the stream pointer; return it. Otherwise close it.
436//
437 if (xfd) *xfd = sp;
438 else delete sp;
439 return 0;
440}
#define XRDOSS_E8013
#define XRDOSS_E8023
#define XRDOSS_E8024

References DEBUG, EPNAME, XrdOucStream::GetLine(), NegVal, OssEroute, RSSCmd, RSSProg, RSSTout, XrdOucStream::Wait4Data(), XRDOSS_E8013, XRDOSS_E8023, and XRDOSS_E8024.

Referenced by MSS_Create(), MSS_Opendir(), MSS_Rename(), MSS_Stat(), and MSS_Unlink().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ newDir()

virtual XrdOssDF * XrdOssSys::newDir ( const char * tident)
inlinevirtual

Obtain a new director object to be used for future directory requests.

Parameters
tident- The trace identifier.
Returns
pointer- Pointer to an XrdOssDF object.
nil - Insufficient memory to allocate an object.

Implements XrdOss.

Definition at line 156 of file XrdOssApi.hh.

157 {return (XrdOssDF *)new XrdOssDir(tident);}

References tident.

◆ newFile()

virtual XrdOssDF * XrdOssSys::newFile ( const char * tident)
inlinevirtual

Obtain a new file object to be used for a future file requests.

Parameters
tident- The trace identifier.
Returns
pointer- Pointer to an XrdOssDF object.
nil - Insufficient memory to allocate an object.

Implements XrdOss.

Definition at line 158 of file XrdOssApi.hh.

159 {return (XrdOssDF *)new XrdOssFile(tident);}

References tident.

◆ PathOpts()

unsigned long long XrdOssSys::PathOpts ( const char * path)
inline

Definition at line 177 of file XrdOssApi.hh.

177{return RPList.Find(path);}

References RPList.

Referenced by Stat(), StatFS(), and StatXP().

Here is the caller graph for this function:

◆ Reloc()

int XrdOssSys::Reloc ( const char * tident,
const char * path,
const char * cgName,
const char * anchor = 0 )
virtual

Relocate/Copy the file at ‘path’ to a new location.

Parameters
tident- -> trace identifier for this operation.
path- -> fully qualified name of the file to relocate.
cgName- -> target space name[:path]
anchor- Processing directions (see XrdOssReloc.cc example).
Returns
0 upon success or -errno or -osserr (see XrdOssError.hh).

Reimplemented from XrdOss.

Definition at line 83 of file XrdOssReloc.cc.

85{
86 EPNAME("Reloc")
87 const int AMode = S_IRWXU|S_IRWXG|S_IROTH|S_IXOTH; // 775
88 class pendFiles
89 {public:
90 char *pbuff;
91 char *tbuff;
92 int datfd;
93 pendFiles(char *pb, char *tb) : datfd(-1)
94 {pbuff = pb; *pb = '\0';
95 tbuff = tb; *tb = '\0';
96 }
97 ~pendFiles() {if (datfd >= 0) close(datfd);
98 if (pbuff && *pbuff) unlink(pbuff);
99 if (tbuff && *tbuff) unlink(tbuff);
100 }
101 };
102 char cgNow[XrdOssSpace::minSNbsz], cgbuff[XrdOssSpace::minSNbsz];
103 char lbuff[MAXPATHLEN+8];
104 char pbuff[MAXPATHLEN+8];
105 char tbuff[MAXPATHLEN+8];
106 char local_path[MAXPATHLEN+8];
107 pendFiles PF(pbuff, tbuff);
108 XrdOssCache::allocInfo aInfo(path, pbuff, sizeof(pbuff));
109 int rc, lblen, datfd, Pure = (anchor && !strcmp(anchor, "."));
110 off_t rc_c;
111 struct stat buf;
112
113// Generate the actual local path for this file.
114//
115 if (Pure) {strcpy(local_path, path); anchor = 0;}
116 else if ((rc = GenLocalPath(path, local_path))) return rc;
117
118// Determine the state of the file.
119//
120 if (stat(local_path, &buf)) return -errno;
121 if ((buf.st_mode & S_IFMT) == S_IFDIR) return -EISDIR;
122 if ((buf.st_mode & S_IFMT) != S_IFREG) return -ENOTBLK;
123
124// Get the correct cache group and partition path
125//
126 if ((aInfo.cgPath = XrdOssCache::Parse(cgName, cgbuff, sizeof(cgbuff))))
127 aInfo.cgPlen = strlen(aInfo.cgPath);
128
129// Verify that this file will go someplace other than where it is now
130//
131 lblen = XrdOssPath::getCname(local_path, cgNow, lbuff, sizeof(lbuff)-7);
132 lbuff[lblen] = '\0';
133 if (!Pure && !strcmp(cgbuff, cgNow)
134 && (!aInfo.cgPath || !strncmp(aInfo.cgPath, lbuff, aInfo.cgPlen)))
135 return -EEXIST;
136
137// Allocate space in the cache. Note that the target must be an xa cache
138//
139 aInfo.aMode = buf.st_mode & S_IAMB;
140 aInfo.cgSize = (Pure ? 0 : buf.st_size);
141 aInfo.cgName = cgbuff;
142 if ((PF.datfd = datfd = XrdOssCache::Alloc(aInfo)) < 0) return datfd;
143 if (!aInfo.cgPsfx) return -ENOTSUP;
144
145// Copy the original file to the new location. Copy() always closes the fd.
146//
147 PF.datfd = -1;
148 if ((rc_c = XrdOssCopy::Copy(local_path, pbuff, datfd)) < 0) return (int)rc_c;
149
150// If the file is to be merely copied, substitute the desired destination
151//
152 if (!anchor) {strcpy(tbuff, local_path); strcat(tbuff, ".anew");}
153 else {struct stat sbuf;
154 char *Slash;
155 if (strlen(anchor)+strlen(path) >= sizeof(local_path))
156 return -ENAMETOOLONG;
157 strcpy(local_path, anchor); strcat(local_path, path);
158 if (!(Slash = rindex(local_path, '/'))) return -ENOTDIR;
159 *Slash = '\0'; rc = stat(local_path, &sbuf); *Slash = '/';
160 if (rc && (rc = XrdOucUtils::makePath(local_path, AMode)))
161 return rc;
162 strcpy(tbuff, local_path);
163 }
164
165// Now create a symbolic link to the target
166//
167 if ((symlink(pbuff, tbuff) && errno != EEXIST)
168 || unlink(tbuff) || symlink(pbuff, tbuff)) return -errno;
169
170// Rename the link atomically over the existing name
171//
172 if (!anchor && rename(tbuff, local_path) < 0) return -errno;
173 PF.tbuff = 0; PF.pbuff = 0; rc = 0;
174
175// Issue warning if the pfn file could not be created (very very rare).
176// At this point we can't do much about it.
177//
178 if (rc) OssEroute.Emsg("Reloc", rc, "create symlink", pbuff);
179 *(aInfo.cgPsfx) = '\0';
180
181// If this was a copy operation, we are done
182//
183 DEBUG(cgNow <<':' <<local_path <<" -> " <<aInfo.cgName <<':' <<pbuff);
184 if (anchor) return XrdOssOK;
185
186// Check if the original file was a symlink and that has to be deleted
187// Adjust the space usage numbers at this point as well.
188//
189 if (*lbuff)
190 {if (unlink(lbuff)) OssEroute.Emsg("Reloc",errno,"removing",lbuff);
191 XrdOssCache::Adjust(XrdOssCache::Find(lbuff, lblen), -buf.st_size);
192 } else XrdOssCache::Adjust(buf.st_dev, -buf.st_size);
193
194// All done (permanently adjust usage for the target)
195//
196 XrdOssCache::Adjust(aInfo.cgFSp, buf.st_size);
197 return XrdOssOK;
198}
#define S_IAMB
Definition XrdConfig.cc:163
#define rename(a, b)
Definition XrdPosix.hh:92
static XrdOssCache_FS * Find(const char *Path, int lklen=0)
static off_t Copy(const char *inFn, const char *outFn, int outFD)
Definition XrdOssCopy.cc:59
static const int minSNbsz

References XrdOssCache::Adjust(), XrdOssCache::Alloc(), XrdOssCache::allocInfo::aMode, XrdOssCache::allocInfo::cgFSp, XrdOssCache::allocInfo::cgName, XrdOssCache::allocInfo::cgPath, XrdOssCache::allocInfo::cgPlen, XrdOssCache::allocInfo::cgPsfx, XrdOssCache::allocInfo::cgSize, close, XrdOssCopy::Copy(), DEBUG, EPNAME, XrdOssCache::Find(), GenLocalPath(), XrdOssPath::getCname(), XrdOucUtils::makePath(), XrdOssSpace::minSNbsz, OssEroute, XrdOssCache::Parse(), rename, S_IAMB, stat, tident, unlink, and XrdOssOK.

Here is the call graph for this function:

◆ Remdir()

int XrdOssSys::Remdir ( const char * path,
int Opts = 0,
XrdOucEnv * envP = 0 )
virtual

Remove a directory.

Parameters
path- Pointer to the path of the directory to be removed.
Opts- The processing options: XRDOSS_Online - only remove online copy XRDOSS_isPFN - path is already translated.
envP- Pointer to environmental information.
Returns
0 upon success or -errno or -osserr (see XrdOssError.hh).

Implements XrdOss.

Definition at line 70 of file XrdOssUnlink.cc.

71{
72 unsigned long long opts;
73 int retc;
74 struct stat statbuff;
75 char local_path[MAXPATHLEN+1+8];
76
77// Build the right local and remote paths.
78//
79 if (Opts & XRDOSS_isPFN) strcpy(local_path, path);
80 else {retc = Check_RO(Unlink, opts, path, "remove");
81 if ( (retc = GenLocalPath( path, local_path))) return retc;
82 }
83
84// Check if this path is really a directory
85//
86 if (lstat(local_path, &statbuff)) return (errno == ENOENT ? 0 : -errno);
87 if ((statbuff.st_mode & S_IFMT) != S_IFDIR) return -ENOTDIR;
88
89// Complete by calling Unlink()
90//
91 return Unlink(path, Opts);
92}
#define XRDOSS_isPFN
Definition XrdOss.hh:469
struct myOpts opts
int Unlink(const char *, int Opts=0, XrdOucEnv *eP=0)

References Check_RO, GenLocalPath(), opts, stat, Unlink(), and XRDOSS_isPFN.

Here is the call graph for this function:

◆ Rename()

int XrdOssSys::Rename ( const char * oPath,
const char * nPath,
XrdOucEnv * oEnvP = 0,
XrdOucEnv * nEnvP = 0 )
virtual

Rename a file or directory.

Parameters
oPath- Pointer to the path to be renamed.
nPath- Pointer to the path oPath is to have.
oEnvP- Environmental information for oPath.
nEnvP- Environmental information for nPath.
Returns
0 upon success or -errno or -osserr (see XrdOssError.hh).

Implements XrdOss.

Definition at line 74 of file XrdOssRename.cc.

76{
77 EPNAME("Rename")
78 static const mode_t pMode = S_IRWXU | S_IRWXG;
79 unsigned long long remotefs_Old, remotefs_New, remotefs;
80 unsigned long long old_popts, new_popts;
81 int retc2, retc = XrdOssOK;
82 struct stat statbuff;
83 char *slashPlus, sPChar;
84 char local_path_Old[MAXPATHLEN+8];
85 char local_path_New[MAXPATHLEN+8];
86 char remote_path_Old[MAXPATHLEN+1];
87 char remote_path_New[MAXPATHLEN+1];
88
89// Determine whether we can actually rename a file on this server.
90//
91 remotefs_Old = Check_RO(Rename, old_popts, oldname, "rename");
92 remotefs_New = Check_RO(Rename, new_popts, newname, "rename to");
93
94// Make sure we are renaming within compatible file systems
95//
96 if (remotefs_Old ^ remotefs_New
97 || ((old_popts & XRDEXP_MIG) ^ (new_popts & XRDEXP_MIG)))
98 {char buff[MAXPATHLEN+128];
99 snprintf(buff, sizeof(buff), "rename %s to ", oldname);
100 return OssEroute.Emsg("Rename",-XRDOSS_E8011,buff,(char *)newname);
101 }
102 remotefs = remotefs_Old | remotefs_New;
103
104// Construct the filename that we will be dealing with.
105//
106 if ( (retc = GenLocalPath( oldname, local_path_Old))
107 || (retc = GenLocalPath( newname, local_path_New)) ) return retc;
108 if (remotefs
109 && (((retc = GenRemotePath(oldname, remote_path_Old))
110 || (retc = GenRemotePath(newname, remote_path_New)))) ) return retc;
111
112// If on a remote FS or symlink, make sure that the target path does not exist
113//
114 if (!(retc2 = lstat(local_path_New, &statbuff)))
115 { if (remotefs || (statbuff.st_mode & S_IFMT) == S_IFLNK) return -EEXIST;
116 }
117
118// We need to create the directory path if it does not exist.
119//
120 if (!(slashPlus = rindex(local_path_New, '/'))) return -EINVAL;
121 slashPlus++; sPChar = *slashPlus; *slashPlus = '\0';
122 retc2 = XrdOucUtils::makePath(local_path_New, pMode);
123 *slashPlus = sPChar;
124 if (retc2) return retc2;
125
126// Check if this path is really a symbolic link elsewhere
127//
128 if (lstat(local_path_Old, &statbuff)) retc = -errno;
129 else if ((statbuff.st_mode & S_IFMT) == S_IFLNK)
130 retc = RenameLink(local_path_Old, local_path_New);
131 else if (rename(local_path_Old, local_path_New)) retc = -errno;
132 DEBUG("lcl rc=" <<retc <<" op=" <<local_path_Old <<" np=" <<local_path_New);
133
134// Now rename the data file in the remote system if the local rename "worked".
135// Do not do this if we really should not use the MSS.
136//
137 if (remotefs)
138 {if (remotefs && (!retc || retc == -ENOENT) && RSSCmd)
139 {if ( (retc2 = MSS_Rename(remote_path_Old, remote_path_New))
140 != -ENOENT) retc = retc2;
141 DEBUG("rmt rc=" <<retc2 <<" op=" <<remote_path_Old <<" np=" <<remote_path_New);
142 }
143 }
144
145// All done.
146//
147 return retc;
148}
#define XRDOSS_E8011
int MSS_Rename(const char *, const char *)
Definition XrdOssMSS.cc:360
int Rename(const char *, const char *, XrdOucEnv *eP1=0, XrdOucEnv *eP2=0)
int RenameLink(char *old_path, char *new_path)

References Check_RO, DEBUG, EPNAME, GenLocalPath(), GenRemotePath(), XrdOucUtils::makePath(), MSS_Rename(), OssEroute, Rename(), rename, RenameLink(), RSSCmd, stat, XRDEXP_MIG, XRDOSS_E8011, and XrdOssOK.

Referenced by Rename().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RenameLink()

int XrdOssSys::RenameLink ( char * old_path,
char * new_path )
protected

Definition at line 157 of file XrdOssRename.cc.

158{
159 struct stat statbuff;
160 char oldlnk[MAXPATHLEN+32], newlnk[MAXPATHLEN+32];
161 int lnklen, n, rc = 0;
162
163// Read the contents of the link
164//
165 if ((lnklen = readlink(old_path,oldlnk,sizeof(oldlnk)-1)) < 0) return -errno;
166 oldlnk[lnklen] = '\0';
167
168// Check if this is new or old style cache. Check if this is an offline rename
169// and if so, add the space to the usage to account for stage-ins
170//
171 if (oldlnk[lnklen-1] == XrdOssPath::xChar)
172 {rc = RenameLink3(oldlnk, old_path, new_path);
173 if (rc) return rc;
174 if (Solitary && UDir)
175 {n = strlen(old_path);
176 if (n < 6 || strcmp(old_path+n-5, ".anew")
177 || stat(new_path, &statbuff) || !statbuff.st_size) return 0;
178 XrdOssPath::Trim2Base(oldlnk+lnklen-1);
179 XrdOssCache::Adjust(oldlnk, statbuff.st_size);
180 }
181 return 0;
182 }
183
184// Convert old name to the new name
185//
186 if ((rc = XrdOssPath::Convert(newlnk, sizeof(newlnk), oldlnk, new_path)))
187 {OssEroute.Emsg("RenameLink", rc, "convert", oldlnk);
188 return rc;
189 }
190
191// Make sure that the target name does not exist
192//
193 if (!lstat(newlnk, &statbuff))
194 {OssEroute.Emsg("RenameLink",-EEXIST,"check new target", newlnk);
195 return -EEXIST;
196 }
197
198// Insert a new link in the target cache
199//
200 if (symlink(newlnk, new_path))
201 {rc = errno;
202 OssEroute.Emsg("RenameLink", rc, "symlink to", newlnk);
203 return -rc;
204 }
205
206// Rename the actual target file
207//
208 if (rename(oldlnk, newlnk))
209 {rc = errno;
210 OssEroute.Emsg("RenameLink", rc, "rename", oldlnk);
211 unlink(new_path);
212 return -rc;
213 }
214
215// Now, unlink the source path
216//
217 if (unlink(old_path))
218 OssEroute.Emsg("RenameLink", rc, "unlink", old_path);
219
220// All done
221//
222 return 0;
223}
static int Convert(char *dst, int dln, const char *oldP, const char *newP)
Definition XrdOssPath.cc:75
int RenameLink3(char *cPath, char *old_path, char *new_path)

References XrdOssCache::Adjust(), XrdOssPath::Convert(), OssEroute, rename, RenameLink3(), Solitary, stat, XrdOssPath::Trim2Base(), UDir, unlink, and XrdOssPath::xChar.

Referenced by Rename().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RenameLink3()

int XrdOssSys::RenameLink3 ( char * cPath,
char * old_path,
char * new_path )
protected

Definition at line 229 of file XrdOssRename.cc.

230{
231 int rc;
232
233// First set the new extended attribute on this file
234//
235 if ((rc = XrdSysFAttr::Xat->Set(XrdFrcXAttrPfn::Name(), new_path,
236 strlen(new_path)+1, cPath))) return rc;
237
238// Now merely rename the old to the new
239//
240 if (!rename(old_path, new_path)) return 0;
241
242// Rename failed, restore old attribute
243//
244 rc = -errno;
245 XrdSysFAttr::Xat->Set(XrdFrcXAttrPfn::Name(),old_path,strlen(old_path)+1,cPath);
246 OssEroute.Emsg("RenameLink", rc, "rename", old_path);
247 return rc;
248}

References XrdFrcXAttrPfn::Name(), OssEroute, rename, and XrdSysFAttr::Xat.

Referenced by RenameLink().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetFattr()

int XrdOssSys::SetFattr ( XrdOssCreateInfo & crInfo,
int datfd,
time_t mtime )
protected

Definition at line 314 of file XrdOssCreate.cc.

315{
316 class fdCloser
317 {public:
318 const char *Path;
319 int theFD;
320 int Done(int rc) {if (rc) unlink(Path); return rc;}
321 fdCloser(const char *pn, int fd) : Path(pn), theFD(fd) {}
322 ~fdCloser() {close(theFD);}
323 } Act(crInfo.Path, fd);
324
325 XrdOucXAttr<XrdFrcXAttrCpy> crX;
326 int rc;
327
328// Check if we need or can record the create time
329//
330 if (!(XRDEXP_MIGPRG & crInfo.pOpts)
331 || (crInfo.pOpts & XRDEXP_NOXATTR)) return Act.Done(0);
332
333// Set copy time
334//
335 crX.Attr.cpyTime = static_cast<long long>(mtime);
336 rc = crX.Set(crInfo.Path, fd);
337
338// Check if extended attribute were set and indicate whether it is supported
339//
340 if (rc == -ENOTSUP) {rc = 0; crInfo.cOpts |= XRDOSS_setnoxa;}
341 return Act.Done(rc);
342}
#define XRDEXP_MIGPRG
int Set(const char *Path, int fd=-1)

References XrdOucXAttr< T >::Attr, close, XrdOssCreateInfo::cOpts, Path, XrdOssCreateInfo::Path, XrdOssCreateInfo::pOpts, XrdOucXAttr< T >::Set(), unlink, XRDEXP_MIGPRG, XRDEXP_NOXATTR, and XRDOSS_setnoxa.

Referenced by Alloc_Cache(), Alloc_Local(), and Create().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Stage()

int XrdOssSys::Stage ( const char * Tid,
const char * fn,
XrdOucEnv & env,
int Oflag,
mode_t Mode,
unsigned long long Popts )
virtual

Definition at line 110 of file XrdOssStage.cc.

112{
113// Use the appropriate method here: queued staging or real-time staging
114//
115 return (StageRealTime ? Stage_RT(Tid, fn, env, Popts)
116 : Stage_QT(Tid, fn, env, Oflag, Mode));
117}
int Mode
int Stage_RT(const char *, const char *, XrdOucEnv &, unsigned long long)
int Stage_QT(const char *, const char *, XrdOucEnv &, int, mode_t)

References Mode, Stage_QT(), Stage_RT(), and StageRealTime.

Here is the call graph for this function:

◆ Stage_In()

void * XrdOssSys::Stage_In ( void * carg)

Definition at line 303 of file XrdOssStage.cc.

304{
305 XrdOucDLlist<XrdOssStage_Req> *rnode;
306 XrdOssStage_Req *req;
307 int rc, alldone = 0;
308 time_t etime;
309
310 // Wait until something shows up in the ready queue and process
311 //
313
314 // Obtain exclusive control over the queues
315 //
317
318 // Check if we really have something in the queue
319 //
320 if (XrdOssStage_Req::StageQ.pendList.Singleton())
322 continue;
323 }
324
325 // Remove the last entry in the queue
326 //
328 req = rnode->Item();
329 rnode->Remove();
330 req->flags |= XRDOSS_REQ_ACTV;
331
332 // Account for bytes being moved
333 //
334 pndbytes -= req->size;
335 stgbytes += req->size;
336
337 // Bring in the file (don't hold the stage lock while doing so)
338 //
340 etime = time(0);
341 rc = GetFile(req);
342 etime = time(0) - etime;
344
345 // Account for resources and adjust xfr rate
346 //
347 stgbytes -= req->size;
348 if (!rc)
349 {if (etime > 1)
350 {xfrspeed=((xfrspeed*(totreqs+1))+(req->size/etime))/(totreqs+1);
351 if (xfrspeed < 512000) xfrspeed = 512000;
352 }
353 totreqs++; // Successful requests
354 totbytes += req->size;
355 delete req;
356 }
357 else {req->flags &= ~XRDOSS_REQ_ACTV;
358 req->flags |= (rc == 2 ? XRDOSS_REQ_ENOF : XRDOSS_REQ_FAIL);
359 req->sigtod = xfrhold + time(0);
360 badreqs++;
361 }
362
363 // Check if we should continue or be terminated and unlock staging
364 //
365 if ((alldone = (xfrthreads < xfrtcount)))
366 xfrtcount--;
368
369 } while (!alldone);
370
371// Notmally we would never get here
372//
373 return (void *)0;
374}
#define XRDOSS_REQ_FAIL
#define XRDOSS_REQ_ENOF
static XrdSysSemaphore ReadyRequest
static XrdOssStage_Req StageQ
static XrdSysMutex StageMutex
int GetFile(XrdOssStage_Req *req)
XrdOucDLlist * Prev()

References badreqs, XrdOssStage_Req::flags, GetFile(), XrdOucDLlist< T >::Item(), pndbytes, XrdOssStage_Req::ReadyRequest, XrdOucDLlist< T >::Remove(), XrdOssStage_Req::sigtod, XrdOssStage_Req::size, XrdOssStage_Req::StageMutex, XrdOssStage_Req::StageQ, stgbytes, totbytes, totreqs, xfrhold, xfrspeed, xfrtcount, xfrthreads, XRDOSS_REQ_ACTV, XRDOSS_REQ_ENOF, and XRDOSS_REQ_FAIL.

Here is the call graph for this function:

◆ Stage_QT()

int XrdOssSys::Stage_QT ( const char * Tid,
const char * fn,
XrdOucEnv & env,
int Oflag,
mode_t Mode )
protected

Definition at line 123 of file XrdOssStage.cc.

125{
126 static XrdOucReqID ReqID;
127 static XrdSysMutex PTMutex;
128 static XrdOucHash<char> PTable;
129 static time_t nextScrub = xfrkeep + time(0);
130 char *Found, *pdata[XrdOucMsubs::maxElem + 2];
131 int pdlen[XrdOucMsubs::maxElem + 2];
132 time_t cTime, mTime, tNow = time(0);
133
134// If there is a fail file and the error occurred within the hold time,
135// fail the request. Otherwise, try it again. This avoids tight loops.
136//
137 if ((cTime = HasFile(fn, XRDOSS_FAIL_FILE, &mTime))
138 && xfrhold && (tNow - cTime) < xfrhold)
139 return (mTime != 2 ? -XRDOSS_E8009 : -ENOENT);
140
141// If enough time has gone by between the last scrub, do it now
142//
143 if (nextScrub < tNow)
144 {PTMutex.Lock();
145 if (nextScrub < tNow)
146 {PTable.Apply(XrdOssScrubScan, (void *)0);
147 nextScrub = xfrkeep + tNow;
148 }
149 PTMutex.UnLock();
150 }
151
152// Check if this file is already being brought in. If so, return calculated
153// wait time for this file.
154//
155 PTMutex.Lock();
156 Found = PTable.Add(fn, 0, xfrkeep, Hash_data_is_key);
157 PTMutex.UnLock();
158 if (Found) return CalcTime();
159
160// Check if we should use our built-in frm interface
161//
162 if (StageFrm)
163 {char idbuff[64];
164 ReqID.ID(idbuff, sizeof(idbuff));
165 int n;
166 return (n = StageFrm->Add('+', fn, env.Env(n), Tid, idbuff,
168 }
169
170// If a stagemsg template was not defined; use our default template
171//
172 if (!StageSnd)
173 {char idbuff[64], usrbuff[512];
174 ReqID.ID(idbuff, sizeof(idbuff));
175 if (!StageFormat)
176 {pdata[0] = (char *)"+ "; pdlen[0] = 2;}
177else {pdlen[0] = getID(Tid,env,usrbuff,sizeof(usrbuff)); pdata[0] = usrbuff;}
178 pdata[1] = idbuff; pdlen[1] = strlen(idbuff); // Request ID
179 pdata[2] = (char *)" "; pdlen[2] = 1;
180 pdata[3] = StageEvents; pdlen[3] = StageEvSize; // notification
181 pdata[4] = (char *)" "; pdlen[4] = 1;
182 pdata[5] = (char *)"0 "; pdlen[5] = 2; // prty
183 pdata[6] = StageAction; pdlen[6] = StageActLen; // action
184 pdata[7] = (char *)fn; pdlen[7] = strlen(fn);
185 pdata[8] = (char *)"\n"; pdlen[8] = 1;
186 pdata[9] = 0; pdlen[9] = 0;
187 if (StageProg->Feed((const char **)pdata, pdlen)) return -XRDOSS_E8025;
188 } else {
189 XrdOucMsubsInfo Info(Tid, &env, lcl_N2N, fn, 0,
190 Mode, Oflag, StageAction, "n/a");
191 int k = StageSnd->Subs(Info, pdata, pdlen);
192 pdata[k] = (char *)"\n"; pdlen[k++] = 1;
193 pdata[k] = 0; pdlen[k] = 0;
194 if (StageProg->Feed((const char **)pdata, pdlen)) return -XRDOSS_E8025;
195 }
196
197// All done
198//
199 return CalcTime();
200}
#define XRDOSS_E8025
int XrdOssScrubScan(const char *key, char *cip, void *xargp)
#define XRDOSS_FAIL_FILE
@ Hash_data_is_key
Definition XrdOucHash.hh:52
time_t HasFile(const char *fn, const char *sfx, time_t *mTime=0)
int CalcTime()
int getID(const char *, XrdOucEnv &, char *, int)
char * Env(int &envlen)
Definition XrdOucEnv.hh:48
T * Apply(int(*func)(const char *, T *, void *), void *Arg)
T * Add(const char *KeyVal, T *KeyData, const int LifeTime=0, XrdOucHash_Options opt=Hash_default)
static const int maxElem
char * ID(char *buff, int blen)

References XrdOucHash< T >::Add(), XrdOucHash< T >::Apply(), CalcTime(), XrdOucEnv::Env(), getID(), HasFile(), Hash_data_is_key, XrdOucReqID::ID(), lcl_N2N, XrdSysMutex::Lock(), XrdOucMsubs::maxElem, Mode, StageAction, StageActLen, StageEvents, StageEvSize, StageFormat, StageFrm, StageProg, StageSnd, XrdSysMutex::UnLock(), xfrhold, xfrkeep, XRDOSS_E8009, XRDOSS_E8025, XRDOSS_FAIL_FILE, and XrdOssScrubScan().

Referenced by Stage().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Stage_RT()

int XrdOssSys::Stage_RT ( const char * Tid,
const char * fn,
XrdOucEnv & env,
unsigned long long Popts )
protected

Definition at line 206 of file XrdOssStage.cc.

208{
209 extern int XrdOssFind_Prty(XrdOssStage_Req *req, void *carg);
210 XrdSysMutexHelper StageAccess(XrdOssStage_Req::StageMutex);
211 XrdOssStage_Req req, *newreq, *oldreq;
212 struct stat statbuff;
213 extern int XrdOssFind_Req(XrdOssStage_Req *req, void *carg);
214 char actual_path[MAXPATHLEN+1], *remote_path;
215 char *val;
216 int rc, prty;
217
218// If there is no stagecmd then return an error
219//
220 if (!StageCmd) return -XRDOSS_E8006;
221
222// Set up the minimal new request structure
223//
224 req.hash = XrdOucHashVal(fn);
225 req.path = strdup(fn);
226
227// Check if this file is already being brought in. If it's in the chain but
228// has an error associated with it. If the error window is still in effect,
229// check if a fail file exists. If one does exist, fail the request. If it
230// doesn't exist or if the window has expired, delete the error element and
231// retry the request. This keeps us from getting into tight loops.
232//
233 if ((oldreq = XrdOssStage_Req::StageQ.fullList.Apply(XrdOssFind_Req,(void *)&req)))
234 {if (!(oldreq->flags & XRDOSS_REQ_FAIL)) return CalcTime(oldreq);
235 if (oldreq->sigtod > time(0) && HasFile(fn, XRDOSS_FAIL_FILE))
236 return (oldreq->flags & XRDOSS_REQ_ENOF ? -ENOENT : -XRDOSS_E8009);
237 delete oldreq;
238 }
239
240// Generate remote path
241//
242 if (rmt_N2N)
243 if ((rc = rmt_N2N->lfn2rfn(fn, actual_path, sizeof(actual_path))))
244 return rc;
245 else remote_path = actual_path;
246 else remote_path = (char *)fn;
247
248// Obtain the size of this file, if possible. Note that an exposure exists in
249// that a request for the file may come in again before we have the size. This
250// is ok, it just means that we'll be off in our time estimate
251//
252 if (Popts & XRDEXP_NOCHECK) statbuff.st_size = 1024*1024*1024;
253 else {StageAccess.UnLock();
254 if ((rc = MSS_Stat(remote_path, &statbuff))) return rc;
255 StageAccess.Lock(&XrdOssStage_Req::StageMutex);
256 }
257
258// Create a new request
259//
260 if (!(newreq = new XrdOssStage_Req(req.hash, fn)))
261 return OssEroute.Emsg("Stage",-ENOMEM,"create req for",fn);
262
263// Add this request to the list of requests
264//
266
267// Recalculate the cumalitive pending stage queue and
268//
269 newreq->size = statbuff.st_size;
270 pndbytes += statbuff.st_size;
271
272// Calculate the system priority
273//
274 if (!(val = env.Get(OSS_SYSPRTY))) prty = OSS_USE_PRTY;
275 else if (XrdOuca2x::a2i(OssEroute,"system prty",val,&prty,0)
276 || prty > OSS_MAX_PRTY) return -XRDOSS_E8010;
277 else prty = prty << 8;
278
279// Calculate the user priority
280//
281 if (OptFlags & XrdOss_USRPRTY && (val = env.Get(OSS_USRPRTY)))
282 {if (XrdOuca2x::a2i(OssEroute,"user prty",val,&rc,0)
283 || rc > OSS_MAX_PRTY) return -XRDOSS_E8010;
284 prty |= rc;
285 }
286
287// Queue the request at the right position and signal an xfr thread
288//
289 if ((oldreq = XrdOssStage_Req::StageQ.pendList.Apply(XrdOssFind_Prty,(void *)&prty)))
290 oldreq->pendList.Insert(&newreq->pendList);
293
294// Return the estimated time to arrival
295//
296 return CalcTime(newreq);
297}
#define XrdOss_USRPRTY
#define XRDOSS_E8006
#define XRDOSS_E8010
#define OSS_SYSPRTY
#define OSS_MAX_PRTY
#define OSS_USE_PRTY
#define OSS_USRPRTY
int XrdOssFind_Prty(XrdOssStage_Req *req, void *carg)
int XrdOssFind_Req(XrdOssStage_Req *req, void *carg)
unsigned long XrdOucHashVal(const char *KeyVal)
unsigned long hash
XrdOucDLlist< XrdOssStage_Req > fullList
void Insert(XrdOucDLlist *Node, T *Item=0)
static int a2i(XrdSysError &, const char *emsg, const char *item, int *val, int minv=-1, int maxv=-1)
Definition XrdOuca2x.cc:45

References XrdOuca2x::a2i(), CalcTime(), XrdOssStage_Req::flags, XrdOssStage_Req::fullList, XrdOucEnv::Get(), HasFile(), XrdOssStage_Req::hash, XrdOucDLlist< T >::Insert(), XrdSysMutexHelper::Lock(), MSS_Stat(), OptFlags, OSS_MAX_PRTY, OSS_SYSPRTY, OSS_USE_PRTY, OSS_USRPRTY, OssEroute, XrdOssStage_Req::path, XrdOssStage_Req::pendList, pndbytes, XrdOssStage_Req::ReadyRequest, rmt_N2N, XrdOssStage_Req::sigtod, XrdOssStage_Req::size, StageCmd, XrdOssStage_Req::StageMutex, XrdOssStage_Req::StageQ, stat, XrdSysMutexHelper::UnLock(), XRDEXP_NOCHECK, XRDOSS_E8006, XRDOSS_E8009, XRDOSS_E8010, XRDOSS_FAIL_FILE, XRDOSS_REQ_ENOF, XRDOSS_REQ_FAIL, XrdOss_USRPRTY, XrdOssFind_Prty(), XrdOssFind_Req(), and XrdOucHashVal().

Referenced by Stage().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Stat()

int XrdOssSys::Stat ( const char * path,
struct stat * buff,
int opts = 0,
XrdOucEnv * envP = 0 )
virtual

Return state information on a file or directory.

Parameters
path- Pointer to the path in question.
buff- Pointer to the structure where info it to be returned.
opts- Options: XRDOSS_preop - this is a stat prior to open. XRDOSS_resonly - only look for resident files. XRDOSS_updtatm - update file access time.
envP- Pointer to environmental information.
Returns
0 upon success or -errno or -osserr (see XrdOssError.hh).

Implements XrdOss.

Definition at line 70 of file XrdOssStat.cc.

72{
73 const int ro_Mode = ~(S_IWUSR | S_IWGRP | S_IWOTH);
74 char actual_path[MAXPATHLEN+1], *local_path, *remote_path;
75 unsigned long long popts;
76 int retc;
77
78// Construct the processing options for this path
79//
80 popts = PathOpts(path);
81
82// Generate local path
83//
84 if (lcl_N2N && STT_DoN2N)
85 if ((retc = lcl_N2N->lfn2pfn(path, actual_path, sizeof(actual_path))))
86 return retc;
87 else local_path = actual_path;
88 else local_path = (char *)path;
89
90// Stat the file in the local filesystem first. If there. make sure the mode
91// bits correspond to our reality and update access time if so requested.
92//
93 if (STT_Func)
94 {retc = (STT_V2 ? (*STT_Fund)(local_path, buff, opts, EnvP, path)
95 : (*STT_Func)(local_path, buff, opts, EnvP));
96 } else retc = stat(local_path, buff);
97 if (!retc)
98 {if (popts & XRDEXP_NOTRW) buff->st_mode &= ro_Mode;
99 if (opts & XRDOSS_updtatm && (buff->st_mode & S_IFMT) == S_IFREG)
100 {struct utimbuf times;
101 times.actime = time(0);
102 times.modtime = buff->st_mtime;
103 utime(local_path, &times);
104 }
105 return XrdOssOK;
106 } else if (errno != ENOENT) return (errno ? -errno : -ENOMSG);
107
108// The file may be offline in a mass storage system, check if this is possible
109//
110 if (!IsRemote(path) || opts & XRDOSS_resonly
111 || (EnvP && EnvP->Get("oss.lcl"))) return -errno;
112 if (!RSSCmd) return (popts & XRDEXP_NOCHECK ? -ENOENT : -ENOMSG);
113
114// Generate remote path
115//
116 if (rmt_N2N)
117 if ((retc = rmt_N2N->lfn2rfn(path, actual_path, sizeof(actual_path))))
118 return retc;
119 else remote_path = actual_path;
120 else remote_path = (char *)path;
121
122// Now stat the file in the remote system (it doesn't exist locally)
123//
124 if ((retc = MSS_Stat(remote_path, buff))) return retc;
125 if (popts & XRDEXP_NOTRW) buff->st_mode &= ro_Mode;
126 return XrdOssOK;
127}
#define XRDOSS_resonly
Definition XrdOss.hh:486
#define XRDOSS_updtatm
Definition XrdOss.hh:487
int IsRemote(const char *path)
Definition XrdOssApi.hh:171
unsigned long long PathOpts(const char *path)
Definition XrdOssApi.hh:177

References XrdOucEnv::Get(), IsRemote(), lcl_N2N, MSS_Stat(), opts, PathOpts(), rmt_N2N, RSSCmd, stat, STT_DoN2N, STT_V2, XRDEXP_NOCHECK, XRDEXP_NOTRW, XRDOSS_resonly, XRDOSS_updtatm, and XrdOssOK.

Referenced by ConfigStats(), ConfigStats(), Mkdir(), xspace(), and xspaceBuild().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StatFS() [1/2]

int XrdOssSys::StatFS ( const char * path,
char * buff,
int & blen,
XrdOucEnv * envP = 0 )
virtual

Return filesystem physical space information associated with a path.

Parameters
path- Path in the partition in question.
buff- Pointer to the buffer to hold the information.
blen- Length of the buffer. This is updated with the actual number of bytes placed in the buffer as in snprintf().
envP- Pointer to environmental information.
Returns
"<wval> <fsp> <utl> <sval> <fsp> <utl>" where: <wval> is "0" if XRDEXP_NOTRW specified, otherwise "1" <fsp> is free space in megabytes. <utl> is percentage utilization (i.e. allocated space) <sval> is "1' if XRDEXP_STAGE specified, otherwise "0" Upon failure -errno or -osserr (see XrdOssError.hh) returned.

Reimplemented from XrdOss.

Definition at line 145 of file XrdOssStat.cc.

146{
147 int sVal, wVal, Util;
148 long long fSpace, fSize;
149 unsigned long long Opt;
150
151// Get the values for this file system
152//
153 StatFS(path, Opt, fSize, fSpace);
154 sVal = (Opt & XRDEXP_STAGE ? 1 : 0);
155 wVal = (Opt & XRDEXP_NOTRW ? 0 : 1);
156
157// Size the value to fit in an int
158//
159 if (fSpace <= 0) {fSize = fSpace = 0; Util = 0;}
160 else {Util = (fSize ? (fSize - fSpace)*100LL/fSize : 0);
161 fSpace = fSpace >> 20LL;
162 if ((fSpace >> 31LL)) fSpace = 0x7fffffff;
163 }
164
165// Return the result
166//
167 blen = snprintf(buff, blen, "%d %lld %d %d %lld %d",
168 wVal, (wVal ? fSpace : 0LL), (wVal ? Util : 0),
169 sVal, (sVal ? fSpace : 0LL), (sVal ? Util : 0));
170 return XrdOssOK;
171}
int StatFS(const char *path, char *buff, int &blen, XrdOucEnv *Env=0)

References StatFS(), XRDEXP_NOTRW, XRDEXP_STAGE, and XrdOssOK.

Referenced by StatFS(), and StatLS().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StatFS() [2/2]

int XrdOssSys::StatFS ( const char * path,
unsigned long long & Opt,
long long & fSize,
long long & fSpace )

Definition at line 187 of file XrdOssStat.cc.

189{
190// Establish the path options
191//
192 Opt = PathOpts(path);
193
194// For in-place paths we just get the free space in that partition, otherwise
195// get the maximum available in any partition.
196//
197 if ((Opt & XRDEXP_STAGE) || !(Opt & XRDEXP_NOTRW))
199 {char lcl_path[MAXPATHLEN+1];
200 if (lcl_N2N)
201 if (lcl_N2N->lfn2pfn(path, lcl_path, sizeof(lcl_path)))
202 fSpace = -1;
203 else fSpace = XrdOssCache_FS::freeSpace(fSize, lcl_path);
204 else fSpace = XrdOssCache_FS::freeSpace(fSize, path);
205 } else {fSpace = XrdOssCache_FS::freeSpace(fSize);}
206 else {fSpace = 0; fSize = 0;}
207 return XrdOssOK;
208}

References XrdOssCache_FS::freeSpace(), XrdOssCache_Group::fsgroups, lcl_N2N, PathOpts(), XRDEXP_INPLACE, XRDEXP_NOTRW, XRDEXP_STAGE, and XrdOssOK.

Here is the call graph for this function:

◆ StatLS()

int XrdOssSys::StatLS ( XrdOucEnv & env,
const char * path,
char * buff,
int & blen )
virtual

Return filesystem physical space information associated with a space name.

Parameters
env- Ref to environmental information. If the environment has the key oss.cgroup defined, the associated value is used as the space name and the path is ignored.
path- Path in the name space in question. The space name associated with gthe path is used unless overridden.
buff- Pointer to the buffer to hold the information.
blen- Length of the buffer. This is updated with the actual number of bytes placed in the buffer as in snprintf().
Returns
"oss.cgroup=<name>&oss.space=<totbytes>&oss.free=<freebytes> &oss.maxf=<maxcontigbytes>&oss.used=<bytesused> &oss.quota=<quotabytes>" in buff upon success. Upon failure -errno or -osserr (see XrdOssError.hh) returned.

Reimplemented from XrdOss.

Definition at line 225 of file XrdOssStat.cc.

226{
227 static const char *Resp="oss.cgroup=%s&oss.space=%lld&oss.free=%lld"
228 "&oss.maxf=%lld&oss.used=%lld&oss.quota=%lld";
229 struct stat sbuff;
230 XrdOssCache_Space CSpace;
231 char *cgrp, cgbuff[XrdOssSpace::minSNbsz];
232 int retc;
233
234// We provide pseudo support whould be not have a cache
235//
237 {unsigned long long Opt;
238 long long fSpace, fSize;
239 StatFS(path, Opt, fSize, fSpace);
240 if (fSpace < 0) fSpace = 0;
241 blen = snprintf(buff, blen, Resp, "public", fSize, fSpace, fSpace,
242 fSize-fSpace, XrdOssCache_Group::PubQuota);
243 return XrdOssOK;
244 }
245
246// Find the cache group. We provide pseudo support should we not have a cache
247//
248 if (!(cgrp = env.Get(OSS_CGROUP)))
249 {if ((retc = getCname(path, &sbuff, cgbuff))) return retc;
250 else cgrp = cgbuff;
251 }
252
253// Accumulate the stats and format the result
254//
255 blen = (XrdOssCache_FS::getSpace(CSpace, cgrp)
256 ? snprintf(buff,blen,Resp,cgrp,CSpace.Total,CSpace.Free,CSpace.Maxfree,
257 CSpace.Usage,CSpace.Quota)
258 : snprintf(buff, blen, Resp, cgrp, 0LL, 0LL, 0LL, 0LL, -1LL));
259 return XrdOssOK;
260}
static long long PubQuota
int getCname(const char *path, struct stat *sbuff, char *cgbuff)

References XrdOssCache_Group::fsgroups, XrdOucEnv::Get(), getCname(), XrdOssCache_FS::getSpace(), XrdOssSpace::minSNbsz, OSS_CGROUP, XrdOssCache_Group::PubQuota, stat, StatFS(), and XrdOssOK.

Here is the call graph for this function:

◆ StatPF()

int XrdOssSys::StatPF ( const char * path,
struct stat * buff,
int opts )
virtual

Reimplemented from XrdOss.

Definition at line 276 of file XrdOssStat.cc.

277{
278 char lcl_path[MAXPATHLEN+1];
279 int retc;
280
281// If just the maximum values wanted then we can return these right away
282//
283 if (opts & PF_dNums)
284 {XrdOssCache::DevInfo(*buff, true);
285 return 0;
286 }
287
288// Check if path is nil and do he appropriate thing
289//
290 if (!path)
291 {if (opts & PF_dInfo) XrdOssCache::DevInfo(*buff, false);
292 else return -EINVAL;
293 return 0;
294 }
295
296// Check if we should do lfn2pfn conversion (previously we didn't allow it)
297//
298 if (lcl_N2N && (opts & PF_isLFN))
299 {if ((retc = lcl_N2N->lfn2pfn(path, lcl_path, sizeof(lcl_path))))
300 return retc;
301 path = lcl_path;
302 }
303
304// We no longer use the custom stat plug-in for this function. It never
305// worked in the first place, anyway.
306//
307 if (stat(path, buff)) return (errno ? -errno : -ENOMSG);
308
309// Check of general stat information is to be returned
310//
311 if (opts % PF_dStat)
312 {buff->st_rdev = 0;
313 return XrdOssOK;
314 }
315
316// Check if device info is to be returned
317//
318 if (opts & PF_dInfo) XrdOssCache::DevInfo(*buff);
319
320// All done
321//
322 return XrdOssOK;
323}
static void DevInfo(struct stat &buf, bool limits=false)
static const int PF_dStat
Definition XrdOss.hh:773
static const int PF_dNums
Definition XrdOss.hh:771
static const int PF_dInfo
Definition XrdOss.hh:770
static const int PF_isLFN
Definition XrdOss.hh:772

References XrdOssCache::DevInfo(), lcl_N2N, opts, XrdOss::PF_dInfo, XrdOss::PF_dNums, XrdOss::PF_dStat, XrdOss::PF_isLFN, stat, and XrdOssOK.

Here is the call graph for this function:

◆ Stats()

int XrdOssSys::Stats ( char * buff,
int blen )
virtual

Return statistics.

Parameters
buff- Pointer to the buffer to hold statistics.
blen- Length of the buffer.
Returns
The number of bytes placed in the buffer excluding null byte.

Reimplemented from XrdOss.

Definition at line 396 of file XrdOssApi.cc.

397{
398 static const char statfmt1[] = "<stats id=\"oss\" v=\"2\">";
399 static const char statfmt2[] = "</stats>";
400 static const int statflen = sizeof(statfmt1) + sizeof(statfmt2);
401 char *bp = buff;
402 int n;
403
404// If only size wanted, return what size we need
405//
406 if (!buff) return statflen + getStats(0,0);
407
408// Make sure we have enough space
409//
410 if (blen < statflen) return 0;
411 strcpy(bp, statfmt1);
412 bp += sizeof(statfmt1)-1; blen -= sizeof(statfmt1)-1;
413
414// Generate space statistics
415//
416 n = getStats(bp, blen);
417 bp += n; blen -= n;
418
419// Add trailer
420//
421 if (blen >= (int)sizeof(statfmt2))
422 {strcpy(bp, statfmt2); bp += (sizeof(statfmt2)-1);}
423 return bp - buff;
424}
int getStats(char *buff, int blen)

References getStats().

Here is the call graph for this function:

◆ StatVS()

int XrdOssSys::StatVS ( XrdOssVSInfo * vsP,
const char * sname = 0,
int updt = 0 )
virtual

Return space information for a space name.

Parameters
vsP- Pointer to the XrdOssVSInfo object to hold results. It should be fully initialized (i.e. a new copy).
sname- Pointer to the space name. If the name starts with a plus (e.g. "+public"), partition information is returned, should it exist. If nil, space information for all spaces is returned. See, XrdOssVS.hh for more info.
updt- When true, a space update occurrs prior to a query.
Returns
0 upon success or -errno or -osserr (see XrdOssError.hh).

Reimplemented from XrdOss.

Definition at line 339 of file XrdOssStat.cc.

340{
341 XrdOssCache_Space CSpace;
342 XrdOssVSPart **vsP;
343
344// Check if we should update the statistics
345//
346 if (updt) XrdOssCache::Scan(0);
347
348// If no space name present or no spaces defined and the space is public then
349// return information on all spaces.
350//
351 if (!sname || (!XrdOssCache_Group::fsgroups && !strcmp("public", sname)))
353 sP->Total = XrdOssCache::fsTotal;
354 sP->Free = XrdOssCache::fsTotFr;
355 sP->LFree = XrdOssCache::fsFree;
356 sP->Large = XrdOssCache::fsLarge;
357 sP->Extents= XrdOssCache::fsCount;
359 return XrdOssOK;
360 }
361
362// Check if partition table wanted
363//
364 if (*sname != '+') vsP = 0;
365 else {sname++;
366 vsP = &(sP->vsPart);
367 }
368
369// Get the space stats
370//
371 if (!(sP->Extents=XrdOssCache_FS::getSpace(CSpace, sname, vsP)))
372 return -ENOENT;
373
374// Return the result
375//
376 sP->Total = CSpace.Total;
377 sP->Free = CSpace.Free;
378 sP->LFree = CSpace.Maxfree;
379 sP->Large = CSpace.Largest;
380 sP->Usage = CSpace.Usage;
381 sP->Quota = CSpace.Quota;
382 return XrdOssOK;
383}
static void * Scan(int cscanint)
static long long fsLarge
static long long fsTotal
static long long fsTotFr
static int fsCount
static long long fsFree
static XrdSysMutex Mutex
long long Total
Definition XrdOssVS.hh:68

References XrdOssVSInfo::Extents, XrdOssCache_Space::Free, XrdOssVSInfo::Free, XrdOssCache::fsCount, XrdOssCache::fsFree, XrdOssCache_Group::fsgroups, XrdOssCache::fsLarge, XrdOssCache::fsTotal, XrdOssCache::fsTotFr, XrdOssCache_FS::getSpace(), XrdOssVSInfo::Large, XrdOssCache_Space::Largest, XrdOssVSInfo::LFree, XrdOssCache_Space::Maxfree, XrdOssCache::Mutex, XrdOssCache_Space::Quota, XrdOssVSInfo::Quota, XrdOssCache::Scan(), XrdOssCache_Space::Total, XrdOssVSInfo::Total, XrdOssCache_Space::Usage, XrdOssVSInfo::Usage, XrdOssVSInfo::vsPart, and XrdOssOK.

Here is the call graph for this function:

◆ StatXA()

int XrdOssSys::StatXA ( const char * path,
char * buff,
int & blen,
XrdOucEnv * envP = 0 )
virtual

Return logical extended attributes associated with a path.

Parameters
path- Path in whose information is wanted.
buff- Pointer to the buffer to hold the information.
blen- Length of the buffer. This is updated with the actual number of bytes placed in the buffer as in snprintf().
envP- Pointer to environmental information.
Returns
"oss.cgroup=<name>&oss.type={'f'|'d'|'o'}&oss.used=<totbytes> &oss.mt=<mtime>&oss.ct=<ctime>&oss.at=<atime>&oss.u=*&oss.g=* &oss.fs={'w'|'r'}" Upon failure -errno or -osserr (see XrdOssError.hh) returned.

Reimplemented from XrdOss.

Definition at line 401 of file XrdOssStat.cc.

402{
403 struct stat sbuff;
404 char cgbuff[XrdOssSpace::minSNbsz], fType;
405 long long Size, Mtime, Ctime, Atime;
406 int retc;
407
408// Get the cache group and stat info for the file
409//
410 if ((retc = getCname(path, &sbuff, cgbuff))) return retc;
411 if (S_ISREG(sbuff.st_mode)) fType = 'f';
412 else if (S_ISDIR(sbuff.st_mode)) fType = 'd';
413 else fType = 'o';
414
415// Format the result
416//
417 Size = sbuff.st_size;
418 Mtime = sbuff.st_mtime; Ctime = sbuff.st_ctime; Atime = sbuff.st_atime;
419 blen = snprintf(buff, blen,
420 "oss.cgroup=%s&oss.type=%c&oss.used=%lld&oss.mt=%lld"
421 "&oss.ct=%lld&oss.at=%lld&oss.u=*&oss.g=*&oss.fs=%c",
422 cgbuff, fType, Size, Mtime, Ctime, Atime,
423 (sbuff.st_mode & S_IWUSR ? 'w':'r'));
424 return XrdOssOK;
425}

References getCname(), XrdOssSpace::minSNbsz, stat, and XrdOssOK.

Here is the call graph for this function:

◆ StatXP()

int XrdOssSys::StatXP ( const char * path,
unsigned long long & attr,
XrdOucEnv * envP = 0 )
virtual

Return export attributes associated with a path.

Parameters
path- Path in whose information is wanted.
attr- Reference to where the inforamation is to be stored.
envP- Pointer to environmental information.
Returns
0 upon success or -errno or -osserr (see XrdOssError.hh).

Reimplemented from XrdOss.

Definition at line 441 of file XrdOssStat.cc.

443{
444
445// Construct the processing options for this path
446//
447 attr = PathOpts(path);
448 return XrdOssOK;
449}

References PathOpts(), and XrdOssOK.

Here is the call graph for this function:

◆ tranmode()

int XrdOssSys::tranmode ( char * mode)
protected

Definition at line 314 of file XrdOssMSS.cc.

314 {
315 int mbits = 0;
316 if (mode[0] == 'r') mbits |= S_IROTH;
317 if (mode[1] == 'w') mbits |= S_IWOTH;
318 if (mode[2] == 'x') mbits |= S_IXOTH;
319 return mbits;
320}

Referenced by MSS_Stat().

Here is the caller graph for this function:

◆ Truncate()

int XrdOssSys::Truncate ( const char * path,
unsigned long long fsize,
XrdOucEnv * envP = 0 )
virtual

Truncate a file.

Parameters
path- Pointer to the path of the file to be truncated.
fsize- The size that the file is to have.
envP- Pointer to environmental information.
Returns
0 upon success or -errno or -osserr (see XrdOssError.hh).

Implements XrdOss.

Definition at line 442 of file XrdOssApi.cc.

444{
445 struct stat statbuff;
446 char actual_path[MAXPATHLEN+1], *local_path;
447 long long oldsz;
448 int retc;
449
450// Make sure we can modify this path
451//
452 Check_RW(Truncate, path, "truncate");
453
454// Generate local path
455//
456 if (lcl_N2N)
457 if ((retc = lcl_N2N->lfn2pfn(path, actual_path, sizeof(actual_path))))
458 return retc;
459 else local_path = actual_path;
460 else local_path = (char *)path;
461
462// Get file info to do the correct adjustment
463//
464 if (lstat(local_path, &statbuff)) return -errno;
465 else if ((statbuff.st_mode & S_IFMT) == S_IFDIR) return -EISDIR;
466 else if ((statbuff.st_mode & S_IFMT) == S_IFLNK)
467 {struct stat buff;
468 if (stat(local_path, &buff)) return -errno;
469 oldsz = buff.st_size;
470 } else oldsz = statbuff.st_size;
471
472// Change the file only in the local filesystem and make space adjustemt
473//
474 if (truncate(local_path, size)) return -errno;
475 XrdOssCache::Adjust(local_path,static_cast<long long>(size)-oldsz,&statbuff);
476 return XrdOssOK;
477}
#define truncate(a, b)
Definition XrdPosix.hh:111
int Truncate(const char *, unsigned long long Size, XrdOucEnv *eP=0)
Definition XrdOssApi.cc:442

References XrdOssCache::Adjust(), Check_RW, lcl_N2N, stat, Truncate(), truncate, and XrdOssOK.

Referenced by Truncate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Unlink()

int XrdOssSys::Unlink ( const char * path,
int Opts = 0,
XrdOucEnv * envP = 0 )
virtual

Remove a file.

Parameters
path- Pointer to the path of the file to be removed.
Opts- Options: XRDOSS_isMIG - this is a migratable path. XRDOSS_isPFN - do not apply name2name to path. XRDOSS_Online - remove only the online copy.
envP- Pointer to environmental information.
Returns
0 upon success or -errno or -osserr (see XrdOssError.hh).

Implements XrdOss.

Definition at line 106 of file XrdOssUnlink.cc.

107{
108 EPNAME("Unlink")
109 unsigned long long dummy, remotefs;
110 int i, retc2, doAdjust = 0, retc = XrdOssOK;
111 struct stat statbuff;
112 //char *fnp;
113 char local_path[MAXPATHLEN+1+8];
114 char remote_path[MAXPATHLEN+1];
115
116// Build the right local and remote paths.
117//
118 if (Opts & XRDOSS_isPFN)
119 {strcpy(local_path, path),
120 *remote_path = '\0';
121 remotefs = 0;
122 } else {
123 remotefs = Check_RO(Unlink, dummy, path, "remove");
124 if ( (retc = GenLocalPath( path, local_path))
125 || (retc = GenRemotePath(path, remote_path)) ) return retc;
126 }
127
128// Check if this path is really a directory of a symbolic link elsewhere
129//
130 if (lstat(local_path, &statbuff)) retc = (errno == ENOENT ? 0 : -errno);
131 else if ((statbuff.st_mode & S_IFMT) == S_IFLNK)
132 retc = BreakLink(local_path, statbuff);
133 else if ((statbuff.st_mode & S_IFMT) == S_IFDIR)
134 {i = strlen(local_path);
135 if (local_path[i-1] != '/') strcpy(local_path+i, "/");
136 if ((retc = rmdir(local_path))) retc = -errno;
137 DEBUG("dir rc=" <<retc <<" path=" <<local_path);
138 return retc;
139 } else doAdjust = 1;
140
141// Delete the local copy and adjust usage
142//
143 if (!retc)
144 {if (unlink(local_path)) retc = -errno;
145 else {i = strlen(local_path); //fnp = &local_path[i];
146 if (doAdjust && statbuff.st_size)
147 XrdOssCache::Adjust(statbuff.st_dev, -statbuff.st_size);
148 }
149 DEBUG("lcl rc=" <<retc <<" path=" <<local_path);
150 }
151
152// If local copy effectively deleted. delete the remote copy if need be
153//
154 if (remotefs && !(Opts & XRDOSS_Online)
155 && (!retc || retc == -ENOENT) && RSSCmd)
156 {if ((retc2 = MSS_Unlink(remote_path)) != -ENOENT) retc = retc2;
157 DEBUG("rmt rc=" <<retc2 <<" path=" <<remote_path);
158 }
159
160// All done
161//
162 return retc;
163}
#define XRDOSS_Online
Definition XrdOss.hh:468
#define rmdir(a)
Definition XrdPosix.hh:97
int MSS_Unlink(const char *)
Definition XrdOssMSS.cc:333
int BreakLink(const char *local_path, struct stat &statbuff)

References XrdOssCache::Adjust(), BreakLink(), Check_RO, DEBUG, EPNAME, GenLocalPath(), GenRemotePath(), MSS_Unlink(), rmdir, RSSCmd, stat, Unlink(), unlink, XRDOSS_isPFN, XRDOSS_Online, and XrdOssOK.

Referenced by Remdir(), and Unlink().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xalloc()

int XrdOssSys::xalloc ( XrdOucStream & Config,
XrdSysError & Eroute )
protected

Definition at line 1158 of file XrdOssConfig.cc.

1159{
1160 char *val;
1161 long long mina = 0;
1162 int fuzz = 0;
1163 int hdrm = 0;
1164
1165 if (!(val = Config.GetWord()))
1166 {Eroute.Emsg("Config", "alloc minfree not specified"); return 1;}
1167 if (strcmp(val, "*") &&
1168 XrdOuca2x::a2sz(Eroute, "alloc minfree", val, &mina, 0)) return 1;
1169
1170 if ((val = Config.GetWord()))
1171 {if (strcmp(val, "*") &&
1172 XrdOuca2x::a2i(Eroute,"alloc headroom",val,&hdrm,0,100)) return 1;
1173
1174 if ((val = Config.GetWord()))
1175 {if (strcmp(val, "*") &&
1176 XrdOuca2x::a2i(Eroute, "alloc fuzz", val, &fuzz, 0, 100)) return 1;
1177 }
1178 }
1179
1180 minalloc = mina;
1181 ovhalloc = hdrm;
1182 fuzalloc = fuzz;
1183 return 0;
1184}
static int a2sz(XrdSysError &, const char *emsg, const char *item, long long *val, long long minv=-1, long long maxv=-1)
Definition XrdOuca2x.cc:257

References XrdOuca2x::a2i(), XrdOuca2x::a2sz(), XrdSysError::Emsg(), fuzalloc, minalloc, and ovhalloc.

Referenced by ConfigXeq().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xcache()

int XrdOssSys::xcache ( XrdOucStream & Config,
XrdSysError & Eroute )
protected

Definition at line 1201 of file XrdOssConfig.cc.

1202{
1203 int rc, isXA = 0;
1204
1205// Skip out to process this entry and upon success indicate that it is
1206// deprecated and "space" should be used instead if an XA-style space defined.
1207//
1208 if (!(rc = xspace(Config, Eroute, &isXA)))
1209 {if (isXA) Eroute.Say("Config warning: 'oss.cache' is deprecated; "
1210 "use 'oss.space' instead!");
1211 else {Eroute.Say("Config failure: non-xa spaces are no longer "
1212 "supported!");
1213 rc = 1;
1214 }
1215 }
1216 return rc;
1217}

References XrdSysError::Say(), and xspace().

Referenced by ConfigXeq().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xcachescan()

int XrdOssSys::xcachescan ( XrdOucStream & Config,
XrdSysError & Eroute )
protected

Definition at line 1231 of file XrdOssConfig.cc.

1232{ int cscan = 0;
1233 char *val;
1234
1235 if (!(val = Config.GetWord()))
1236 {Eroute.Emsg("Config", "cachescan not specified"); return 1;}
1237 if (XrdOuca2x::a2tm(Eroute, "cachescan", val, &cscan, 30)) return 1;
1238 cscanint = cscan;
1239 return 0;
1240}
static int a2tm(XrdSysError &, const char *emsg, const char *item, int *val, int minv=-1, int maxv=-1)
Definition XrdOuca2x.cc:288

References XrdOuca2x::a2tm(), cscanint, and XrdSysError::Emsg().

Referenced by ConfigXeq().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xdefault()

int XrdOssSys::xdefault ( XrdOucStream & Config,
XrdSysError & Eroute )
protected

Definition at line 1256 of file XrdOssConfig.cc.

1257{
1258 DirFlags = XrdOucExport::ParseDefs(Config, Eroute, DirFlags);
1259 return 0;
1260}
static unsigned long long ParseDefs(XrdOucStream &Config, XrdSysError &Eroute, unsigned long long Flags)

References DirFlags, and XrdOucExport::ParseDefs().

Referenced by ConfigXeq().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xfdlimit()

int XrdOssSys::xfdlimit ( XrdOucStream & Config,
XrdSysError & Eroute )
protected

Definition at line 1279 of file XrdOssConfig.cc.

1280{
1281 char *val;
1282 int fence = 0, FDHalf = FDLimit>>1;
1283
1284 if (!(val = Config.GetWord()))
1285 {Eroute.Emsg("Config", "fdlimit fence not specified"); return 1;}
1286
1287 if (!strcmp(val, "*")) FDFence = FDHalf;
1288 else {if (XrdOuca2x::a2i(Eroute,"fdlimit fence",val,&fence,0)) return 1;
1289 FDFence = (fence < FDHalf ? fence : FDHalf);
1290 }
1291
1292 while(Config.GetWord()) {}
1293
1294// Eroute.Say("Config warning: ", "fdlimit directive no longer supported.");
1295
1296 return 0;
1297}

References XrdOuca2x::a2i(), XrdSysError::Emsg(), FDFence, and FDLimit.

Referenced by ConfigXeq().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xmaxsz()

int XrdOssSys::xmaxsz ( XrdOucStream & Config,
XrdSysError & Eroute )
protected

Definition at line 1312 of file XrdOssConfig.cc.

1313{ long long msz;
1314 char *val;
1315
1316 if (!(val = Config.GetWord()))
1317 {Eroute.Emsg("Config", "maxsize value not specified"); return 1;}
1318 if (XrdOuca2x::a2sz(Eroute, "maxsize", val, &msz, 1024*1024)) return 1;
1319 MaxSize = msz;
1320 return 0;
1321}

References XrdOuca2x::a2sz(), XrdSysError::Emsg(), and MaxSize.

Referenced by ConfigXeq().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xmemf()

int XrdOssSys::xmemf ( XrdOucStream & Config,
XrdSysError & Eroute )
protected

Definition at line 1344 of file XrdOssConfig.cc.

1345{
1346 char *val;
1347 int i, j, V_check=-1, V_preld = -1, V_on=-1;
1348 long long V_max = 0;
1349
1350 static struct mmapopts {const char *opname; int otyp;
1351 const char *opmsg;} mmopts[] =
1352 {
1353 {"off", 0, ""},
1354 {"preload", 1, "memfile preload"},
1355 {"check", 2, "memfile check"},
1356 {"max", 3, "memfile max"}};
1357 int numopts = sizeof(mmopts)/sizeof(struct mmapopts);
1358
1359 if (!(val = Config.GetWord()))
1360 {Eroute.Emsg("Config", "memfile option not specified"); return 1;}
1361
1362 while (val)
1363 {for (i = 0; i < numopts; i++)
1364 if (!strcmp(val, mmopts[i].opname)) break;
1365 if (i >= numopts)
1366 Eroute.Say("Config warning: ignoring invalid memfile option '",val,"'.");
1367 else {if (mmopts[i].otyp > 1 && !(val = Config.GetWord()))
1368 {Eroute.Emsg("Config","memfile",mmopts[i].opname,
1369 "value not specified");
1370 return 1;
1371 }
1372 switch(mmopts[i].otyp)
1373 {case 1: V_preld = 1;
1374 break;
1375 case 2: if (!strcmp("xattr",val)
1376 || !strcmp("lock", val)
1377 || !strcmp("map", val)
1378 || !strcmp("keep", val)) V_check=1;
1379 else {Eroute.Emsg("Config",
1380 "mmap check argument not xattr");
1381 return 1;
1382 }
1383 break;
1384 case 3: j = strlen(val);
1385 if (val[j-1] == '%')
1386 {val[j-1] = '\0';
1387 if (XrdOuca2x::a2i(Eroute,mmopts[i].opmsg,
1388 val, &j, 1, 1000)) return 1;
1389 V_max = -j;
1390 } else if (XrdOuca2x::a2sz(Eroute,
1391 mmopts[i].opmsg, val, &V_max,
1392 10*1024*1024)) return 1;
1393 break;
1394 default: V_on = 0; break;
1395 }
1396 val = Config.GetWord();
1397 }
1398 }
1399
1400// Set the values
1401//
1402 XrdOssMio::Set(V_on, V_preld, V_check);
1403 XrdOssMio::Set(V_max);
1404 return 0;
1405}

References XrdOuca2x::a2i(), XrdOuca2x::a2sz(), XrdSysError::Emsg(), XrdSysError::Say(), and XrdOssMio::Set().

Referenced by ConfigXeq().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xnml()

int XrdOssSys::xnml ( XrdOucStream & Config,
XrdSysError & Eroute )
protected

Definition at line 1421 of file XrdOssConfig.cc.

1422{
1423 char *val, parms[1040];
1424
1425// Get the path
1426//
1427 if (!(val = Config.GetWord()) || !val[0])
1428 {Eroute.Emsg("Config", "namelib not specified"); return 1;}
1429
1430// Record the path
1431//
1432 if (N2N_Lib) free(N2N_Lib);
1433 N2N_Lib = strdup(val);
1434
1435// Record any parms
1436//
1437 if (!Config.GetRest(parms, sizeof(parms)))
1438 {Eroute.Emsg("Config", "namelib parameters too long"); return 1;}
1439 if (N2N_Parms) free(N2N_Parms);
1440 N2N_Parms = (*parms ? strdup(parms) : 0);
1441 return 0;
1442}

References XrdSysError::Emsg(), N2N_Lib, and N2N_Parms.

Referenced by ConfigXeq().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xpath()

int XrdOssSys::xpath ( XrdOucStream & Config,
XrdSysError & Eroute )
protected

Definition at line 1458 of file XrdOssConfig.cc.

1459{
1460 XrdOucPList *pP;
1461
1462// Parse the arguments
1463//
1464 pP = XrdOucExport::ParsePath(Config, Eroute, RPList, DirFlags);
1465 if (!pP) return 1;
1466
1467// If this is an absolute path, we are done
1468//
1469 if (*(pP->Path()) == '/') return 0;
1470
1471// If this is an objectid path then make sure to set the default for these
1472//
1473 if (*(pP->Path()) == '*')
1474 {RPList.Defstar(pP->Flag());
1475 return 0;
1476 }
1477
1478// We do not (yet) support exporting specific object ID's
1479//
1480 Eroute.Emsg("Config", "Unsupported export -", pP->Path());
1481 return 1;
1482}
static XrdOucPList * ParsePath(XrdOucStream &Config, XrdSysError &Eroute, XrdOucPListAnchor &Export, unsigned long long Defopts)

References DirFlags, XrdSysError::Emsg(), XrdOucPList::Flag(), XrdOucExport::ParsePath(), XrdOucPList::Path(), and RPList.

Referenced by ConfigProc(), and ConfigXeq().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xprerd()

int XrdOssSys::xprerd ( XrdOucStream & Config,
XrdSysError & Eroute )
protected

Definition at line 1508 of file XrdOssConfig.cc.

1509{
1510 static const long long m16 = 16777216LL;
1511 char *val;
1512 long long lim = 1048576;
1513 int depth, qeq = 0, qsz = 128;
1514
1515 if (!(val = Config.GetWord()))
1516 {Eroute.Emsg("Config", "preread depth not specified"); return 1;}
1517
1518 if (!strcmp(val, "on")) depth = 3;
1519 else if (XrdOuca2x::a2i(Eroute,"preread depth",val,&depth,0, 1024))
1520 return 1;
1521
1522 while((val = Config.GetWord()))
1523 { if (!strcmp(val, "limit"))
1524 {if (!(val = Config.GetWord()))
1525 {Eroute.Emsg("Config","preread limit not specified");
1526 return 1;
1527 }
1528 if (XrdOuca2x::a2sz(Eroute,"preread limit",val,&lim,0,m16))
1529 return 1;
1530 }
1531 else if (!strcmp(val, "qsize"))
1532 {if (!(val = Config.GetWord()))
1533 {Eroute.Emsg("Config","preread qsize not specified");
1534 return 1;
1535 }
1536 if (XrdOuca2x::a2i(Eroute,"preread qsize",val,&qsz,0,1024))
1537 return 1;
1538 if (qsz < depth)
1539 {Eroute.Emsg("Config","preread qsize must be >= depth");
1540 return 1;
1541 }
1542 }
1543 else {Eroute.Emsg("Config","invalid preread option -",val); return 1;}
1544 }
1545
1546 if (lim < prPSize || !qsz) depth = 0;
1547 if (!qeq && depth)
1548 {qsz = qsz/(depth/2+1);
1549 if (qsz < depth) qsz = depth;
1550 }
1551
1552 prDepth = depth;
1553 prQSize = qsz;
1554 prBytes = lim;
1555 return 0;
1556}

References XrdOuca2x::a2i(), XrdOuca2x::a2sz(), XrdSysError::Emsg(), prBytes, prDepth, prPSize, and prQSize.

Referenced by ConfigXeq().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xspace() [1/2]

int XrdOssSys::xspace ( XrdOucStream & Config,
XrdSysError & Eroute,
const char * grp,
bool isAsgn )
protected

Definition at line 1703 of file XrdOssConfig.cc.

1705{
1706 XrdOucPList *pl;
1707 char *path;
1708
1709// Get the path
1710//
1711 path = Config.GetWord();
1712 if (!path || !path[0])
1713 {Eroute.Emsg("Config", "space path not specified"); return 1;}
1714
1715// Create a new path list object and add it to list of paths
1716//
1717do{if ((pl = SPList.Match(path))) pl->Set(path, grp);
1718 else {pl = new XrdOucPList(path, grp);
1719 SPList.Insert(pl);
1720 }
1721 pl->Set((isAsgn ? spAssign : 0));
1722 } while((path = Config.GetWord()));
1723
1724// All done
1725//
1726 return 0;
1727}

References XrdSysError::Emsg(), XrdOucPList::Set(), spAssign, and SPList.

Here is the call graph for this function:

◆ xspace() [2/2]

int XrdOssSys::xspace ( XrdOucStream & Config,
XrdSysError & Eroute,
int * isCD = 0 )
protected

Definition at line 1576 of file XrdOssConfig.cc.

1577{
1578 XrdOucString grp, fn, mn;
1579 OssSpaceConfig sInfo(grp, fn, mn);
1580 char *val;
1581 int k;
1582 bool isAsgn, isStar;
1583
1584// Get the space name
1585//
1586 if (!(val = Config.GetWord()))
1587 {Eroute.Emsg("Config", "space name not specified"); return 1;}
1588 if ((int)strlen(val) > XrdOssSpace::maxSNlen)
1589 {Eroute.Emsg("Config","excessively long space name - ",val); return 1;}
1590 grp = val;
1591
1592// Get the path to the space
1593//
1594 if (!(val = Config.GetWord()) || !(*val))
1595 {Eroute.Emsg("Config", "space path not specified"); return 1;}
1596
1597// Check if assignment
1598//
1599 if (((isAsgn = !strcmp("assign",val)) || ! strcmp("default",val)) && !isCD)
1600 return xspace(Config, Eroute, grp.c_str(), isAsgn);
1601
1602// Preprocess this path and validate it
1603//
1604 k = strlen(val)-1;
1605 if ((isStar = val[k] == '*')) val[k--] = 0;
1606 else while(k > 0 && val[k] == '/') val[k--] = 0;
1607
1608 if (k >= MAXPATHLEN || val[0] != '/' || (k < 2 && !isStar))
1609 {Eroute.Emsg("Config", "invalid space path - ", val); return 1;}
1610 fn = val;
1611
1612// Sanitize the path as we are sensitive to proper placement of slashes
1613//
1614 do {k = fn.replace("/./", "/");} while(k);
1615 do {k = fn.replace("//", "/");} while(k);
1616
1617// Additional options (for now) are only available to the old-style cache
1618// directive. So, ignore any unless we entered via the directive.
1619//
1620 if (isCD)
1621 {if ((val = Config.GetWord()))
1622 {if (strcmp("xa", val))
1623 {Eroute.Emsg("Config","invalid cache option - ",val); return 1;}
1624 else *isCD = 1;
1625 } else {*isCD = 0; sInfo.isXA = false;}
1626 } else {
1627 if ((val = Config.GetWord()) && !strcmp("chkmount", val))
1628 {if (!(val = Config.GetWord()))
1629 {Eroute.Emsg("Config","chkmount ID not specified"); return 1;}
1630 if ((int)strlen(val) > XrdOssSpace::maxSNlen)
1631 {Eroute.Emsg("Config","excessively long mount name - ",val);
1632 return 1;
1633 }
1634 mn = val;
1635 sInfo.chkMnt = true;
1636 if ((val = Config.GetWord()))
1637 {if (!strcmp("nofail", val)) sInfo.noFail = true;
1638 else {Eroute.Emsg("Config","invalid space option - ",val);
1639 return 1;
1640 }
1641 }
1642 }
1643 }
1644
1645// Check if this directory in the parent is only to be used for the space
1646//
1647 if (!isStar)
1648 {if (!fn.endswith('/')) fn += '/';
1649 return !xspaceBuild(sInfo, Eroute);
1650 }
1651
1652// We now need to build a space for each directory in the parent
1653//
1654 struct dirent *dp;
1655 struct stat Stat;
1656 XrdOucString pfx, basepath(fn);
1657 DIR *dirP;
1658 int dFD, rc, snum = 0;
1659 bool chkPfx, failed = false;
1660
1661 if (basepath.endswith('/')) chkPfx = false;
1662 else {int pos = basepath.rfind('/');
1663 pfx = &basepath[pos+1];
1664 basepath.keep(0, pos+1);
1665 chkPfx = true;
1666 }
1667
1668 if ((dFD=open(basepath.c_str(),O_DIRECTORY)) < 0 || !(dirP=fdopendir(dFD)))
1669 {Eroute.Emsg("Config",errno,"open space directory",fn.c_str()); return 1;}
1670
1671 errno = 0;
1672 while((dp = readdir(dirP)))
1673 {if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, "..")
1674 || (chkPfx && strncmp(dp->d_name,pfx.c_str(),pfx.length()))) continue;
1675
1676 if (fstatat(dFD, dp->d_name, &Stat, AT_SYMLINK_NOFOLLOW))
1677 {basepath += dp->d_name;
1678 break;
1679 }
1680
1681 if ((Stat.st_mode & S_IFMT) == S_IFDIR)
1682 {fn = basepath; fn += dp->d_name; fn += '/';
1683 if (!xspaceBuild(sInfo, Eroute)) failed = true;
1684 snum++;
1685 }
1686 errno = 0;
1687 }
1688
1689// Make sure we built all space successfully and have at least one space
1690//
1691 if ((rc = errno))
1692 Eroute.Emsg("Config", errno, "process space directory", fn.c_str());
1693 else if (!snum)
1694 Eroute.Say("Config warning: no space directories found in ",
1695 fn.c_str());
1696
1697 closedir(dirP);
1698 return rc != 0 || failed;
1699}
#define closedir(a)
Definition XrdPosix.hh:50
#define readdir(a)
Definition XrdPosix.hh:86
int xspaceBuild(OssSpaceConfig &sInfo, XrdSysError &Eroute)
bool endswith(char c)
int replace(const char *s1, const char *s2, int from=0, int to=-1)
const char * c_str() const

References XrdOucString::c_str(), OssSpaceConfig::chkMnt, closedir, XrdSysError::Emsg(), XrdOucString::endswith(), OssSpaceConfig::isXA, XrdOssSpace::maxSNlen, OssSpaceConfig::noFail, open, readdir, XrdOucString::replace(), XrdSysError::Say(), Stat(), stat, xspace(), and xspaceBuild().

Referenced by ConfigXeq(), xcache(), and xspace().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xspaceBuild()

int XrdOssSys::xspaceBuild ( OssSpaceConfig & sInfo,
XrdSysError & Eroute )
protected

Definition at line 1731 of file XrdOssConfig.cc.

1732{
1735 int rc = 0;
1736
1737// Check if we need to verify the mount. Note: sPath must end with a '/'!
1738//
1739 if (sInfo.chkMnt)
1740 {XrdOucString mFile(sInfo.mName), mPath(sInfo.sPath);
1741 struct stat Stat;
1742 mPath.erasefromend(1);
1743 mFile += '.';
1744 mFile += rindex(mPath.c_str(), '/')+1;
1745 mPath += '/'; mPath += mFile;
1746 if (stat(mPath.c_str(), &Stat))
1747 {char buff[2048];
1748 snprintf(buff, sizeof(buff), "%s@%s; ",
1749 mFile.c_str(), sInfo.sPath.c_str());
1750 Eroute.Say((sInfo.noFail ? "Config warning:" : "Config failure:"),
1751 " Unable to verify mount point ", buff, XrdSysE2T(errno));
1752 return (sInfo.noFail ? 1 : 0);
1753 }
1754 }
1755
1756// Add the space to the configuration
1757
1758 XrdOssCache_FS *fsp = new XrdOssCache_FS(rc, sInfo.sName.c_str(),
1759 sInfo.sPath.c_str(), fopts);
1760 if (rc)
1761 {char buff[256];
1762 snprintf(buff, sizeof(buff), "create %s space at", sInfo.sName.c_str());
1763 Eroute.Emsg("Config", rc, buff, sInfo.sPath.c_str());
1764 if (fsp) delete fsp;
1765 return 0;
1766 }
1768 return 1;
1769}
const char * XrdSysE2T(int errcode)
Definition XrdSysE2T.cc:104
const XrdOucString & sPath
const XrdOucString & mName
const XrdOucString & sName

References XrdOucString::c_str(), OssSpaceConfig::chkMnt, XrdSysError::Emsg(), XrdOucString::erasefromend(), OssSpaceConfig::isXA, XrdOssCache_FS::isXA, OssSpaceConfig::mName, OssSpaceConfig::noFail, XrdOssCache_FS::None, OptFlags, XrdSysError::Say(), OssSpaceConfig::sName, OssSpaceConfig::sPath, Stat(), stat, XrdOss_CacheFS, and XrdSysE2T().

Referenced by xspace().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xstg()

int XrdOssSys::xstg ( XrdOucStream & Config,
XrdSysError & Eroute )
protected

Definition at line 1789 of file XrdOssConfig.cc.

1790{
1791 char *val, buff[2048], *bp = buff;
1792 int vlen, blen = sizeof(buff)-1, isAsync = 0, isCreate = 0;
1793
1794// Get the aync or async option
1795//
1796 if ((val = Config.GetWord()))
1797 if ((isAsync = !strcmp(val, "async")) || !strcmp(val, "sync"))
1798 val = Config.GetWord();
1799
1800// Get the create option
1801//
1802 if (val)
1803 if ((isCreate = !strcmp(val, "creates"))) val = Config.GetWord();
1804
1805// Get the command
1806//
1807 if (!val) {Eroute.Emsg("Config", "stagecmd not specified"); return 1;}
1808
1809// Copy the command and all of it's arguments
1810//
1811 do {if ((vlen = strlen(val)) >= blen)
1812 {Eroute.Emsg("Config", "stagecmd arguments too long"); break;}
1813 *bp = ' '; bp++; strcpy(bp, val); bp += vlen; blen -= vlen;
1814 } while((val = Config.GetWord()));
1815
1816 if (val) return 1;
1817 *bp = '\0'; val = buff+1;
1818
1819// Record the command and operating mode
1820//
1821 StageAsync = (isAsync ? 1 : 0);
1822 StageCreate= isCreate;
1823 if (StageCmd) free(StageCmd);
1824 StageCmd = strdup(val);
1825 return 0;
1826}

References XrdSysError::Emsg(), StageAsync, StageCmd, and StageCreate.

Referenced by ConfigXeq().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xstl()

int XrdOssSys::xstl ( XrdOucStream & Config,
XrdSysError & Eroute )
protected

Definition at line 1847 of file XrdOssConfig.cc.

1848{
1849 char *val, parms[1040];
1850
1851// Get the path or preopen option
1852//
1853 if (!(val = Config.GetWord()) || !val[0])
1854 {Eroute.Emsg("Config", "statlib not specified"); return 1;}
1855
1856// Check for options we support the old and new versions here
1857//
1858 STT_V2 = 0; STT_PreOp = 0; STT_DoN2N = 1; STT_DoARE = 0;
1859do{ if (!strcmp(val, "-2")) STT_V2 = 1;
1860 else if (!strcmp(val, "arevents") || !strcmp(val, "-arevents")) STT_DoARE=1;
1861 else if (!strcmp(val, "non2n") || !strcmp(val, "-non2n")) STT_DoN2N=0;
1862 else if (!strcmp(val, "preopen") || !strcmp(val, "-preopen")) STT_PreOp=1;
1863 else break;
1864 } while((val = Config.GetWord()) && val[0]);
1865
1866// Make sure we have a statlib
1867//
1868 if (!val || !(*val))
1869 {Eroute.Emsg("Config", "statlib not specified"); return 1;}
1870
1871// Record the path
1872//
1873 if (STT_Lib) free(STT_Lib);
1874 STT_Lib = strdup(val);
1875
1876// Record any parms
1877//
1878 if (!Config.GetRest(parms, sizeof(parms)))
1879 {Eroute.Emsg("Config", "statlib parameters too long"); return 1;}
1880 if (STT_Parms) free(STT_Parms);
1881 STT_Parms = (*parms ? strdup(parms) : 0);
1882 return 0;
1883}

References XrdSysError::Emsg(), STT_DoARE, STT_DoN2N, STT_Lib, STT_Parms, STT_PreOp, and STT_V2.

Referenced by ConfigXeq().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xtrace()

int XrdOssSys::xtrace ( XrdOucStream & Config,
XrdSysError & Eroute )
protected

Definition at line 1899 of file XrdOssConfig.cc.

1900{
1901 char *val;
1902 static struct traceopts {const char *opname; int opval;} tropts[] =
1903 {
1904 {"all", TRACE_ALL},
1905 {"debug", TRACE_Debug},
1906 {"open", TRACE_Open},
1907 {"opendir", TRACE_Opendir}
1908 };
1909 int i, neg, trval = 0, numopts = sizeof(tropts)/sizeof(struct traceopts);
1910
1911 if (!(val = Config.GetWord()))
1912 {Eroute.Emsg("Config", "trace option not specified"); return 1;}
1913 while (val)
1914 {if (!strcmp(val, "off")) trval = 0;
1915 else {if ((neg = (val[0] == '-' && val[1]))) val++;
1916 for (i = 0; i < numopts; i++)
1917 {if (!strcmp(val, tropts[i].opname))
1918 {if (neg) trval &= ~tropts[i].opval;
1919 else trval |= tropts[i].opval;
1920 break;
1921 }
1922 }
1923 if (i >= numopts)
1924 Eroute.Say("Config warning: ignoring invalid trace option '",val,"'.");
1925 }
1926 val = Config.GetWord();
1927 }
1928 OssTrace.What = trval;
1929 return 0;
1930}
#define TRACE_Opendir
#define TRACE_Open

References XrdSysError::Emsg(), OssTrace, XrdSysError::Say(), TRACE_ALL, TRACE_Debug, TRACE_Open, and TRACE_Opendir.

Referenced by ConfigXeq().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xusage()

int XrdOssSys::xusage ( XrdOucStream & Config,
XrdSysError & Eroute )
protected

Definition at line 1951 of file XrdOssConfig.cc.

1952{
1953 char *val;
1954 int usval;
1955
1956 if (!(val = Config.GetWord()))
1957 {Eroute.Emsg("Config", "usage option not specified"); return 1;}
1958
1959 while(val)
1960 { if (!strcmp("nolog", val))
1961 {if (UDir) {free(UDir); UDir = 0;}}
1962 else if (!strcmp("log" , val))
1963 {if (UDir) {free(UDir); UDir = 0;}
1964 if (!(val = Config.GetWord()))
1965 {Eroute.Emsg("Config", "usage log path not specified");
1966 return 1;
1967 }
1968 if (*val != '/')
1969 {Eroute.Emsg("Config", "usage log path not absolute");
1970 return 1;
1971 }
1972 UDir = strdup(val);
1973 if (!(val = Config.GetWord()) || strcmp("sync", val))
1974 continue;
1975 if (!(val = Config.GetWord()))
1976 {Eroute.Emsg("Config", "log sync value not specified");
1977 return 1;
1978 }
1979 if (XrdOuca2x::a2i(Eroute,"sync value",val,&usval,1,32767))
1980 return 1;
1981 USync = usval;
1982 }
1983 else if (!strcmp("noquotafile",val))
1984 {if (QFile) {free(QFile); QFile= 0;}}
1985 else if (!strcmp("quotafile",val))
1986 {if (QFile) {free(QFile); QFile= 0;}
1987 if (!(val = Config.GetWord()))
1988 {Eroute.Emsg("Config", "quota file not specified");
1989 return 1;
1990 }
1991 QFile = strdup(val);
1992 }
1993 else {Eroute.Emsg("Config", "invalid usage option -",val); return 1;}
1994
1995 val = Config.GetWord();
1996 }
1997 return 0;
1998}

References XrdOuca2x::a2i(), XrdSysError::Emsg(), QFile, UDir, and USync.

Referenced by ConfigXeq().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xxfr()

int XrdOssSys::xxfr ( XrdOucStream & Config,
XrdSysError & Eroute )
protected

Definition at line 2025 of file XrdOssConfig.cc.

2026{
2027 static const int maxfdln = 256;
2028 const char *wantParm = 0;
2029 char *val;
2030 int thrds = 1;
2031 long long speed = 9*1024*1024;
2032 int ovhd = 30;
2033 int htime = 3*60*60;
2034 int ktime;
2035 int upon = 0;
2036
2037 while((val = Config.GetWord())) // deny |fdir | keep | up
2038 { if (!strcmp("deny", val))
2039 {wantParm = "xfr deny";
2040 if ((val = Config.GetWord())) // keep time
2041 {if (XrdOuca2x::a2tm(Eroute,wantParm,val,&htime,0))
2042 return 1;
2043 wantParm=0;
2044 }
2045 }
2046 else if (!strcmp("fdir", val))
2047 {wantParm = "xfr fdir";
2048 if ((val = Config.GetWord())) // fdir path
2049 {if (xfrFdir) free(xfrFdir);
2050 xfrFdln = strlen(val);
2051 if (xfrFdln > maxfdln)
2052 {Eroute.Emsg("Config","xfr fdir path too long");
2053 xfrFdir = 0; xfrFdln = 0; return 1;
2054 }
2055 xfrFdir = strdup(val);
2056 wantParm = 0;
2057 }
2058 }
2059 else if (!strcmp("keep", val))
2060 {wantParm = "xfr keep";
2061 if ((val = Config.GetWord())) // keep time
2062 {if (XrdOuca2x::a2tm(Eroute,wantParm,val,&ktime,0))
2063 return 1;
2064 xfrkeep=ktime; wantParm=0;
2065 }
2066 }
2067 else if (!strcmp("up", val)) {upon = 1; wantParm = 0;}
2068 else break;
2069 };
2070
2071 xfrhold = htime;
2072 if (upon) OptFlags |= XrdOss_USRPRTY;
2073
2074 if (!val) {if (!wantParm) return 0;
2075 else {Eroute.Emsg("Config", wantParm, "value not specified");
2076 return 1;
2077 }
2078 }
2079
2080 if (strcmp(val, "*") && XrdOuca2x::a2i(Eroute,"xfr threads",val,&thrds,1))
2081 return 1;
2082
2083 if ((val = Config.GetWord())) // <speed>
2084 {if (strcmp(val, "*") &&
2085 XrdOuca2x::a2sz(Eroute,"xfr speed",val,&speed,1024)) return 1;
2086
2087 if ((val = Config.GetWord())) // <ovhd>
2088 {if (strcmp(val, "*") &&
2089 XrdOuca2x::a2tm(Eroute,"xfr overhead",val,&ovhd,0)) return 1;
2090
2091 if ((val = Config.GetWord())) // <hold>
2092 if (strcmp(val, "*") &&
2093 XrdOuca2x::a2tm(Eroute,"xfr hold",val,&htime,0)) return 1;
2094 }
2095 }
2096
2097 xfrhold = htime;
2098 xfrthreads = thrds;
2099 xfrspeed = speed;
2100 xfrovhd = ovhd;
2101 return 0;
2102}

References XrdOuca2x::a2i(), XrdOuca2x::a2sz(), XrdOuca2x::a2tm(), XrdSysError::Emsg(), OptFlags, xfrFdir, xfrFdln, xfrhold, xfrkeep, xfrovhd, xfrspeed, xfrthreads, and XrdOss_USRPRTY.

Referenced by ConfigXeq().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ [union]

union { ... } XrdOssSys

◆ AioAllOk

int XrdOssSys::AioAllOk = 0
static

◆ badreqs

int XrdOssSys::badreqs
protected

Definition at line 304 of file XrdOssApi.hh.

Referenced by XrdOssSys(), and Stage_In().

◆ chkMmap

char XrdOssSys::chkMmap = 0
static

Definition at line 204 of file XrdOssApi.hh.

Referenced by XrdOssSys(), and ConfigMio().

◆ ConfigFN

char* XrdOssSys::ConfigFN

Definition at line 217 of file XrdOssApi.hh.

Referenced by XrdOssSys(), Config_Display(), ConfigN2N(), ConfigProc(), ConfigStatLib(), and Configure().

◆ cscanint

int XrdOssSys::cscanint
protected

Definition at line 293 of file XrdOssApi.hh.

Referenced by XrdOssSys(), Config_Display(), Configure(), and xcachescan().

◆ DirFlags

unsigned long long XrdOssSys::DirFlags

◆ DPList

OssDPath* XrdOssSys::DPList

Definition at line 258 of file XrdOssApi.hh.

Referenced by XrdOssSys(), ConfigStats(), and getStats().

◆ FDFence

int XrdOssSys::FDFence

Definition at line 242 of file XrdOssApi.hh.

Referenced by XrdOssSys(), Config_Display(), Configure(), and xfdlimit().

◆ FDLimit

int XrdOssSys::FDLimit

Definition at line 243 of file XrdOssApi.hh.

Referenced by XrdOssSys(), Config_Display(), Configure(), and xfdlimit().

◆ fuzalloc

int XrdOssSys::fuzalloc
protected

Definition at line 292 of file XrdOssApi.hh.

Referenced by XrdOssSys(), Config_Display(), Configure(), and xalloc().

◆ isMSSC

int XrdOssSys::isMSSC

Definition at line 239 of file XrdOssApi.hh.

Referenced by XrdOssSys(), ConfigXeq(), and MSS_Stat().

◆ lcl_N2N

◆ lenDP

int XrdOssSys::lenDP

Definition at line 259 of file XrdOssApi.hh.

Referenced by XrdOssSys(), ConfigStats(), and getStats().

◆ LocalRoot

char* XrdOssSys::LocalRoot

Definition at line 218 of file XrdOssApi.hh.

Referenced by XrdOssSys(), Config_Display(), ConfigN2N(), Configure(), and ConfigXeq().

◆ MaxArgs

const int XrdOssSys::MaxArgs = 15
static

Definition at line 215 of file XrdOssApi.hh.

◆ MaxSize

long long XrdOssSys::MaxSize

Definition at line 241 of file XrdOssApi.hh.

Referenced by XrdOssSys(), Config_Display(), and xmaxsz().

◆ MaxTwiddle

int XrdOssSys::MaxTwiddle

Definition at line 220 of file XrdOssApi.hh.

Referenced by XrdOssSys().

◆ minalloc

long long XrdOssSys::minalloc
protected

Definition at line 290 of file XrdOssApi.hh.

Referenced by XrdOssSys(), Config_Display(), Configure(), and xalloc().

◆ myVersion

XrdVersionInfo* XrdOssSys::myVersion

Definition at line 282 of file XrdOssApi.hh.

Referenced by XrdOssSys(), ConfigN2N(), ConfigStatLib(), and XrdOssGetSS().

◆ N2N_Lib

char* XrdOssSys::N2N_Lib

Definition at line 252 of file XrdOssApi.hh.

Referenced by XrdOssSys(), Config_Display(), ConfigN2N(), Configure(), and xnml().

◆ N2N_Parms

char* XrdOssSys::N2N_Parms

Definition at line 253 of file XrdOssApi.hh.

Referenced by XrdOssSys(), ConfigN2N(), and xnml().

◆ numCG

short XrdOssSys::numCG

Definition at line 261 of file XrdOssApi.hh.

Referenced by XrdOssSys(), ConfigStats(), and getStats().

◆ numDP

short XrdOssSys::numDP

Definition at line 260 of file XrdOssApi.hh.

Referenced by XrdOssSys(), ConfigStats(), and getStats().

◆ OptFlags

int XrdOssSys::OptFlags

Definition at line 247 of file XrdOssApi.hh.

Referenced by XrdOssSys(), ConfigSpace(), Configure(), Stage_RT(), xspaceBuild(), and xxfr().

◆ ovhalloc

int XrdOssSys::ovhalloc
protected

Definition at line 291 of file XrdOssApi.hh.

Referenced by XrdOssSys(), Config_Display(), Configure(), and xalloc().

◆ pfcMode

bool XrdOssSys::pfcMode
protected

Definition at line 314 of file XrdOssApi.hh.

Referenced by XrdOssSys(), ConfigCache(), and Configure().

◆ pndbytes

long long XrdOssSys::pndbytes
protected

Definition at line 300 of file XrdOssApi.hh.

Referenced by XrdOssSys(), Stage_In(), and Stage_RT().

◆ prActive

int XrdOssSys::prActive

Definition at line 278 of file XrdOssApi.hh.

Referenced by XrdOssSys().

◆ prBytes

int XrdOssSys::prBytes

Definition at line 277 of file XrdOssApi.hh.

Referenced by XrdOssSys(), and xprerd().

◆ prDepth

short XrdOssSys::prDepth

Definition at line 279 of file XrdOssApi.hh.

Referenced by XrdOssSys(), and xprerd().

◆ prPBits

long long XrdOssSys::prPBits

Definition at line 274 of file XrdOssApi.hh.

Referenced by XrdOssSys().

◆ prPMask

long long XrdOssSys::prPMask

Definition at line 275 of file XrdOssApi.hh.

Referenced by XrdOssSys().

◆ prPSize

int XrdOssSys::prPSize

Definition at line 276 of file XrdOssApi.hh.

Referenced by XrdOssSys(), and xprerd().

◆ prQSize

short XrdOssSys::prQSize

Definition at line 280 of file XrdOssApi.hh.

Referenced by XrdOssSys(), and xprerd().

◆ QFile

char* XrdOssSys::QFile
protected

Definition at line 310 of file XrdOssApi.hh.

Referenced by XrdOssSys(), Configure(), and xusage().

◆ RemoteRoot

char* XrdOssSys::RemoteRoot

Definition at line 219 of file XrdOssApi.hh.

Referenced by XrdOssSys(), Config_Display(), ConfigN2N(), Configure(), and ConfigXeq().

◆ rmt_N2N

XrdOucName2Name* XrdOssSys::rmt_N2N

Definition at line 255 of file XrdOssApi.hh.

Referenced by XrdOssSys(), ConfigN2N(), GenRemotePath(), Stage_RT(), and Stat().

◆ RPList

◆ RSSCmd

char* XrdOssSys::RSSCmd

◆ RSSProg

XrdOucProg* XrdOssSys::RSSProg
protected

Definition at line 307 of file XrdOssApi.hh.

Referenced by XrdOssSys(), ConfigStage(), and MSS_Xeq().

◆ RSSTout

int XrdOssSys::RSSTout

Definition at line 240 of file XrdOssApi.hh.

Referenced by XrdOssSys(), and MSS_Xeq().

◆ Solitary

int XrdOssSys::Solitary

Definition at line 246 of file XrdOssApi.hh.

Referenced by XrdOssSys(), ConfigStage(), Configure(), and RenameLink().

◆ SPList

XrdOucPListAnchor XrdOssSys::SPList

Definition at line 249 of file XrdOssApi.hh.

Referenced by Alloc_Cache(), Config_Display(), ConfigSpace(), and xspace().

◆ StageAction

char* XrdOssSys::StageAction

Definition at line 233 of file XrdOssApi.hh.

Referenced by XrdOssSys(), ConfigStage(), and Stage_QT().

◆ StageActLen

int XrdOssSys::StageActLen

Definition at line 232 of file XrdOssApi.hh.

Referenced by XrdOssSys(), ConfigStage(), and Stage_QT().

◆ StageAln

int XrdOssSys::StageAln[MaxArgs]

Definition at line 236 of file XrdOssApi.hh.

◆ StageAnum

int XrdOssSys::StageAnum

Definition at line 237 of file XrdOssApi.hh.

◆ StageArg

char* XrdOssSys::StageArg[MaxArgs]

Definition at line 235 of file XrdOssApi.hh.

◆ StageAsync

int XrdOssSys::StageAsync

Definition at line 222 of file XrdOssApi.hh.

Referenced by XrdOssSys(), CalcTime(), CalcTime(), Config_Display(), ConfigStage(), and xstg().

◆ StageCmd

char* XrdOssSys::StageCmd

Definition at line 225 of file XrdOssApi.hh.

Referenced by XrdOssSys(), Config_Display(), ConfigStage(), ConfigStageC(), Stage_RT(), and xstg().

◆ StageCreate

int XrdOssSys::StageCreate

Definition at line 223 of file XrdOssApi.hh.

Referenced by XrdOssSys(), Config_Display(), ConfigStage(), Create(), and xstg().

◆ StageEvents

char* XrdOssSys::StageEvents

Definition at line 230 of file XrdOssApi.hh.

Referenced by XrdOssSys(), ConfigStage(), and Stage_QT().

◆ StageEvSize

int XrdOssSys::StageEvSize

Definition at line 231 of file XrdOssApi.hh.

Referenced by XrdOssSys(), ConfigStage(), and Stage_QT().

◆ StageFormat

int XrdOssSys::StageFormat

Definition at line 224 of file XrdOssApi.hh.

Referenced by ConfigStageC(), and Stage_QT().

◆ StageFrm

XrdFrcProxy* XrdOssSys::StageFrm

Definition at line 228 of file XrdOssApi.hh.

Referenced by XrdOssSys(), ConfigStage(), and Stage_QT().

◆ StageMsg

char* XrdOssSys::StageMsg

Definition at line 226 of file XrdOssApi.hh.

Referenced by XrdOssSys(), Config_Display(), ConfigStageC(), and ConfigXeq().

◆ StageProg

XrdOucProg* XrdOssSys::StageProg
protected

Definition at line 306 of file XrdOssApi.hh.

Referenced by XrdOssSys(), ConfigStageC(), GetFile(), and Stage_QT().

◆ StageRealTime

int XrdOssSys::StageRealTime

Definition at line 221 of file XrdOssApi.hh.

Referenced by XrdOssSys(), ConfigStage(), ConfigStageC(), and Stage().

◆ StageSnd

XrdOucMsubs* XrdOssSys::StageSnd

Definition at line 227 of file XrdOssApi.hh.

Referenced by XrdOssSys(), ConfigStageC(), and Stage_QT().

◆ stgbytes

long long XrdOssSys::stgbytes
protected

Definition at line 301 of file XrdOssApi.hh.

Referenced by XrdOssSys(), CalcTime(), and Stage_In().

◆ STT_DoARE

char XrdOssSys::STT_DoARE

Definition at line 272 of file XrdOssApi.hh.

Referenced by XrdOssSys(), ConfigStatLib(), and xstl().

◆ STT_DoN2N

char XrdOssSys::STT_DoN2N

Definition at line 270 of file XrdOssApi.hh.

Referenced by XrdOssSys(), Stat(), and xstl().

◆ STT_Lib

char* XrdOssSys::STT_Lib

Definition at line 263 of file XrdOssApi.hh.

Referenced by XrdOssSys(), ConfigStatLib(), Configure(), and xstl().

◆ STT_Parms

char* XrdOssSys::STT_Parms

Definition at line 264 of file XrdOssApi.hh.

Referenced by XrdOssSys(), ConfigStatLib(), and xstl().

◆ STT_PreOp

int XrdOssSys::STT_PreOp

Definition at line 269 of file XrdOssApi.hh.

Referenced by XrdOssSys(), and xstl().

◆ STT_V2

char XrdOssSys::STT_V2

Definition at line 271 of file XrdOssApi.hh.

Referenced by XrdOssSys(), ConfigStatLib(), Stat(), and xstl().

◆ the_N2N

XrdOucName2Name* XrdOssSys::the_N2N

Definition at line 256 of file XrdOssApi.hh.

Referenced by XrdOssSys(), and ConfigN2N().

◆ totbytes

long long XrdOssSys::totbytes
protected

Definition at line 302 of file XrdOssApi.hh.

Referenced by XrdOssSys(), and Stage_In().

◆ totreqs

int XrdOssSys::totreqs
protected

Definition at line 303 of file XrdOssApi.hh.

Referenced by XrdOssSys(), and Stage_In().

◆ Trace

int XrdOssSys::Trace

Definition at line 245 of file XrdOssApi.hh.

◆ tryMmap

char XrdOssSys::tryMmap = 0
static

Definition at line 203 of file XrdOssApi.hh.

Referenced by XrdOssSys(), and ConfigMio().

◆ UDir

char* XrdOssSys::UDir
protected

Definition at line 309 of file XrdOssApi.hh.

Referenced by XrdOssSys(), Configure(), RenameLink(), and xusage().

◆ USync

short XrdOssSys::USync
protected

Definition at line 313 of file XrdOssApi.hh.

Referenced by XrdOssSys(), Configure(), and xusage().

◆ xfrFdir

char* XrdOssSys::xfrFdir
protected

Definition at line 311 of file XrdOssApi.hh.

Referenced by XrdOssSys(), HasFile(), and xxfr().

◆ xfrFdln

int XrdOssSys::xfrFdln
protected

Definition at line 312 of file XrdOssApi.hh.

Referenced by XrdOssSys(), HasFile(), and xxfr().

◆ xfrhold

int XrdOssSys::xfrhold
protected

Definition at line 296 of file XrdOssApi.hh.

Referenced by XrdOssSys(), Config_Display(), Stage_In(), Stage_QT(), and xxfr().

◆ xfrkeep

int XrdOssSys::xfrkeep
protected

Definition at line 297 of file XrdOssApi.hh.

Referenced by XrdOssSys(), Config_Display(), Stage_QT(), and xxfr().

◆ xfrovhd

int XrdOssSys::xfrovhd
protected

Definition at line 295 of file XrdOssApi.hh.

Referenced by XrdOssSys(), CalcTime(), and xxfr().

◆ xfrspeed

int XrdOssSys::xfrspeed
protected

Definition at line 294 of file XrdOssApi.hh.

Referenced by XrdOssSys(), CalcTime(), Stage_In(), and xxfr().

◆ xfrtcount

int XrdOssSys::xfrtcount
protected

Definition at line 299 of file XrdOssApi.hh.

Referenced by XrdOssSys(), ConfigStageC(), and Stage_In().

◆ xfrthreads

int XrdOssSys::xfrthreads
protected

Definition at line 298 of file XrdOssApi.hh.

Referenced by XrdOssSys(), Config_Display(), ConfigStageC(), Stage_In(), and xxfr().


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