XRootD
Loading...
Searching...
No Matches
XrdSfsInterface.hh
Go to the documentation of this file.
1#ifndef __SFS_INTERFACE_H__
2#define __SFS_INTERFACE_H__
3/******************************************************************************/
4/* */
5/* X r d S f s I n t e r f a c e . h h */
6/* */
7/* (c) 2026 by the Board of Trustees of the Leland Stanford, Jr., University */
8/* Produced by Andrew Hanushevsky for Stanford University under contract */
9/* DE-AC02-76-SFO0515 with the Department of Energy */
10/* */
11/* This file is part of the XRootD software suite. */
12/* */
13/* XRootD is free software: you can redistribute it and/or modify it under */
14/* the terms of the GNU Lesser General Public License as published by the */
15/* Free Software Foundation, either version 3 of the License, or (at your */
16/* option) any later version. */
17/* */
18/* XRootD is distributed in the hope that it will be useful, but WITHOUT */
19/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
20/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
21/* License for more details. */
22/* */
23/* You should have received a copy of the GNU Lesser General Public License */
24/* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
25/* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
26/* */
27/* The copyright holder's institutional names and contributor's names may not */
28/* be used to endorse or promote products derived from this software without */
29/* specific prior written permission of the institution or contributor. */
30/******************************************************************************/
31
32#include <cstring> // For strlcpy()
33#include <cerrno>
34#include <cstdint>
35#include <string>
36#include <sys/types.h>
37#include <sys/stat.h>
38#include <vector>
39
41#include "XrdOuc/XrdOucIOVec.hh"
42#include "XrdOuc/XrdOucRange.hh"
43
45
47
48/******************************************************************************/
49/* O p e n M o d e s */
50/******************************************************************************/
51
52#define SFS_O_RDONLY 0 // open read/only
53#define SFS_O_WRONLY 1 // open write/only
54#define SFS_O_RDWR 2 // open read/write
55#define SFS_O_CREAT 0x00000100 // used for file creation
56#define SFS_O_TRUNC 0x00000200 // used for file truncation
57#define SFS_O_MULTIW 0x00000400 // used for multi-write locations
58#define SFS_O_NOTPC 0x00000800 // used to suppress TPC opens
59#define SFS_O_CREATAT 0x00001100 // used for file creation at FS
60#define SFS_O_DIRLIST 0x00010000 // used for locate only
61#define SFS_O_POSC 0x00100000 // persist on successful close
62#define SFS_O_FORCE 0x00200000 // used for locate only
63#define SFS_O_HNAME 0x00400000 // used for locate only
64#define SFS_O_LOCAL 0x00800000 // used for locate only (local cmd)
65#define SFS_O_NOWAIT 0x01000000 // do not impose operational delays
66#define SFS_O_RAWIO 0x02000000 // allow client-side decompression
67#define SFS_O_RESET 0x04000000 // Reset any cached information
68#define SFS_O_REPLICA 0x08000000 // Open for replication
69#define SFS_O_SEQIO 0x10000000 // Open for sequential I/O
70
71// The following flag may be set in the access mode arg for open() & mkdir()
72// Note that on some systems mode_t is 16-bits so we use a careful value!
73//
74#define SFS_O_MKPTH 0x00004000 // Make directory path if missing
75
76// The following options are here to provide a uniform clustering interface.
77// They may be passed through open/locate/stat, as applicable.
78//
79#define SFS_O_LOCATE 0x10000000 // This request generated by locate()
80#define SFS_O_STAT 0x20000000 // This request generated by stat()
81#define SFS_O_META 0x40000000 // This request generated by metaop
82
83/******************************************************************************/
84/* D e f i n e s */
85/******************************************************************************/
86
87// Common fctl command values (0 to 255)
88//
89#define SFS_FCTL_GETFD 1 // Return file descriptor if possible
90#define SFS_FCTL_STATV 2 // Return visa information
91#define SFS_FCTL_SPEC1 3 // Return implementation defined information V1
92#define SFS_FCTL_QFINFO 4 // Return implementation defined file info
93
94#define SFS_SFIO_FDVAL 0x80000000 // Use SendData() method GETFD response value
95
96// Common fsctl command values (0 to 255)
97//
98#define SFS_FSCTL_CMD 255
99
100#define SFS_FSCTL_LOCATE 1 // Locate a file
101#define SFS_FSCTL_STATFS 2 // Return FS data
102#define SFS_FSCTL_STATLS 3 // Return LS data
103#define SFS_FSCTL_STATXA 4 // Return XA data
104#define SFS_FSCTL_STATCC 5 // Return Cluster Config status
105#define SFS_FSCTL_PLUGFS 7 // Perform filesystem oriented operation
106#define SFS_FSCTL_PLUGIN 8 // Return Implementation Dependent Data
107#define SFS_FSCTL_PLUGIO 16 // Return Implementation Dependent Data
108#define SFS_FSCTL_PLUGXC 32 // Perform cache oriented operation
109
110// Return values for integer & XrdSfsXferSize returning XrdSfs methods
111//
112#define SFS_STALL 1 // Return value -> Seconds to stall client
113#define SFS_OK 0 // ErrInfo code -> All is well
114#define SFS_ERROR -1 // ErrInfo code -> Error occurred
115#define SFS_REDIRECT -256 // ErrInfo code -> Port number to redirect to
116#define SFS_STARTED -512 // ErrInfo code -> Estimated seconds to completion
117#define SFS_DATA -1024 // ErrInfo code -> Length of data
118#define SFS_DATAVEC -2048 // ErrInfo code -> Num iovec elements in msgbuff
119
120// The following macros are used for dealing with special local paths
121//
122#define SFS_LCLPRFX "/=/"
123#define SFS_LCLPLEN 3
124#define SFS_LCLPATH(x) !strncmp(x, SFS_LCLPRFX, SFS_LCLPLEN)
125#define SFS_LCLPRFY "/="
126#define SFS_LCLROOT(x) !strncmp(x, SFS_LCLPRFX, SFS_LCLPLEN-1) \
127 && (*(x+SFS_LCLPLEN-1) == '/' || *(x+SFS_LCLPLEN-1) == 0)
128
129/******************************************************************************/
130/* S t r u c t u r e s & T y p e d e f s */
131/******************************************************************************/
132
133typedef long long XrdSfsFileOffset;
135typedef int XrdSfsMode;
136typedef int XrdSfsXferSize;
137
146//------------------------------------------------
147
148#define Prep_PRTY0 0
149#define Prep_PRTY1 1
150#define Prep_PRTY2 2
151#define Prep_PRTY3 3
152#define Prep_PMASK 3
153#define Prep_SENDAOK 4
154#define Prep_SENDERR 8
155#define Prep_SENDACK 12
156#define Prep_WMODE 16
157#define Prep_STAGE 32
158#define Prep_COLOC 64
159#define Prep_FRESH 128
160#define Prep_CANCEL 256
161#define Prep_QUERY 512
162#define Prep_EVICT 1024
163
164class XrdOucTList;
165
167{
168 const char *Arg1;
171 union{
172 const char *Arg2;
173 const char **ArgP;
174 };
175};
176
185
186/******************************************************************************/
187/* F o r w a r d D e c l a r a t i o n s */
188/******************************************************************************/
189
190class XrdOucEnv;
191struct XrdOucCloneSeg;
192class XrdSecEntity;
193struct XrdSfsFACtl;
194
195/******************************************************************************/
196/* O b j e c t W r a p p i n g G u i d e */
197/******************************************************************************/
198
199/* The XrdSfsDirectory and XrdSfsFile objects can be wrapped. Wraping can be
200 used to add functionality. The process is common and pretty muche rote.
201 There is only one caveat: all wrappers must use the same XrdOucErrInfo
202 object. This is because the ErrInfo object contains client parameters that
203 are used to control how things are done to be backward compatible. Newer
204 client can then use more efficient internal processing. The SFS provides
205 two ways to make sure the same ErrInfo object is used by all objects in
206 the wrapped chain. Forward propagation (the one typically used) and
207 backward propagation (used in certain unusual cases). In forward mode,
208 the ErrInfo object of the last object in the chain is propagated to the
209 front of the chain. In backward mode the reverse happens. Let's assume
210 the following scenarion. Object-A wraps object-B (the object here can be
211 directory or file object). In forward mode weneed to create objects in
212 reverse order (bottom to top) which is typically what you would do anyway
213 as you need to capture the pinter to the object your wrapping. So, using
214 newFile() as an example where sfsP points to the Interface being wrapped:
215
216 XrdSfsFile *newFile(const char *user, int MonID)
217 {
218 XrdSfsFile *wrapped_file = sfsP->newFile(user, MonID);
219 if (!wrapped_file) return 0;
220 return new mySfsFile(wrapped_file,...);
221 }
222 class mySfsFile : public XrdSfsFile
223 {public:
224 mySfsFile(XrdSfsFile *wrapped_file,...) : XrdSfsFile(*wrapped_file)
225 {....}
226 ....
227 };
228
229 Notice we are allocating the wrapped file ahead of the wrapper so that
230 the wrapper can use the ErrInfo object of the wrapped file.
231
232 In backward mode we want to use the ErrInfo object of the front-most
233 wrapper for all wrappers after it. This mechanism is far more complicated
234 due to error handling requirements. However, it's useful when a wrapped
235 object is not necessarily instantiated to accomplish the needs of the
236 wrapper. An example of this is the newFile and newDir implementations for
237 XrdSsi where wrapped object creation is subject to the resource name.
238*/
239
240/******************************************************************************/
241/* X r d S f s D i r e c t o r y */
242/******************************************************************************/
243
244//------------------------------------------------------------------------------
247//------------------------------------------------------------------------------
248
250{
251public:
252
253//-----------------------------------------------------------------------------
256//-----------------------------------------------------------------------------
257
259
260//-----------------------------------------------------------------------------
268//-----------------------------------------------------------------------------
269
270virtual int open(const char *path,
271 const XrdSecEntity *client = 0,
272 const char *opaque = 0) = 0;
273
274//-----------------------------------------------------------------------------
282//-----------------------------------------------------------------------------
283
284virtual const char *nextEntry() = 0;
285
286//-----------------------------------------------------------------------------
290//-----------------------------------------------------------------------------
291
292virtual int close() = 0;
293
294//-----------------------------------------------------------------------------
298//-----------------------------------------------------------------------------
299
300virtual const char *FName() = 0;
301
302//-----------------------------------------------------------------------------
311//-----------------------------------------------------------------------------
312
313virtual int autoStat(struct stat *buf);
314
315//-----------------------------------------------------------------------------
324//-----------------------------------------------------------------------------
325
326 XrdSfsDirectory(const char *user=0, int MonID=0)
327 : error(*(new XrdOucErrInfo(user, MonID)))
328 {lclEI = &error;}
329
330//-----------------------------------------------------------------------------
336//-----------------------------------------------------------------------------
337
339 : error(wrapD.error), lclEI(0) {}
340
341//-----------------------------------------------------------------------------
346//-----------------------------------------------------------------------------
347
349 : error(eInfo), lclEI(0) {}
350
351//-----------------------------------------------------------------------------
353//-----------------------------------------------------------------------------
354
355virtual ~XrdSfsDirectory() {if (lclEI) delete lclEI;}
356
357private:
358XrdOucErrInfo* lclEI;
359
360}; // class XrdSfsDirectory
361
362/******************************************************************************/
363/* X r d S f s F i l e */
364/******************************************************************************/
365
366//------------------------------------------------------------------------------
369//------------------------------------------------------------------------------
370
371class XrdSfsAio;
372class XrdSfsDio;
373class XrdSfsXio;
374
376{
377public:
378
379//-----------------------------------------------------------------------------
382//-----------------------------------------------------------------------------
383
385
386//-----------------------------------------------------------------------------
413//-----------------------------------------------------------------------------
414
415virtual int open(const char *fileName,
416 XrdSfsFileOpenMode openMode,
417 mode_t createMode,
418 const XrdSecEntity *client = 0,
419 const char *opaque = 0) = 0;
420
421//-----------------------------------------------------------------------------
442//-----------------------------------------------------------------------------
443
451
452virtual int checkpoint(cpAct act, struct iov *range=0, int n=0);
453
454//-----------------------------------------------------------------------------
460//-----------------------------------------------------------------------------
461
462virtual int Clone(XrdSfsFile& srcFile);
463
464//-----------------------------------------------------------------------------
470//-----------------------------------------------------------------------------
471
472virtual int Clone(const std::vector<XrdOucCloneSeg> &cVec);
473
474//-----------------------------------------------------------------------------
478//-----------------------------------------------------------------------------
479
480virtual int close() = 0;
481
482//-----------------------------------------------------------------------------
499//-----------------------------------------------------------------------------
500
501virtual int fctl(const int cmd,
502 const char *args,
503 XrdOucErrInfo &eInfo) = 0;
504
505//-----------------------------------------------------------------------------
519//-----------------------------------------------------------------------------
520
521virtual int fctl(const int cmd,
522 int alen,
523 const char *args,
524 const XrdSecEntity *client = 0);
525
526//-----------------------------------------------------------------------------
530//-----------------------------------------------------------------------------
531
532virtual const char *FName() = 0;
533
534//-----------------------------------------------------------------------------
541//-----------------------------------------------------------------------------
542
543virtual int getMmap(void **Addr, off_t &Size) = 0;
544
545//-----------------------------------------------------------------------------
547//-----------------------------------------------------------------------------
548
549static const uint64_t
550Verify = 0x8000000000000000ULL;
551
552//-----------------------------------------------------------------------------
571//-----------------------------------------------------------------------------
572
574 char *buffer,
575 XrdSfsXferSize rdlen,
576 uint32_t *csvec,
577 uint64_t opts=0);
578
579//-----------------------------------------------------------------------------
587//-----------------------------------------------------------------------------
588
589virtual int pgRead(XrdSfsAio *aioparm, uint64_t opts=0);
590
591//-----------------------------------------------------------------------------
611//-----------------------------------------------------------------------------
612
614 char *buffer,
615 XrdSfsXferSize wrlen,
616 uint32_t *csvec,
617 uint64_t opts=0);
618
619//-----------------------------------------------------------------------------
627//-----------------------------------------------------------------------------
628
629virtual int pgWrite(XrdSfsAio *aioparm, uint64_t opts=0);
630
631//-----------------------------------------------------------------------------
639//-----------------------------------------------------------------------------
640
642 XrdSfsXferSize size) = 0;
643
644//-----------------------------------------------------------------------------
651//-----------------------------------------------------------------------------
652
653virtual XrdSfsXferSize read(XrdOucRangeList& rlist);
654
655//-----------------------------------------------------------------------------
664//-----------------------------------------------------------------------------
665
667 char *buffer,
668 XrdSfsXferSize size) = 0;
669
670//-----------------------------------------------------------------------------
677//-----------------------------------------------------------------------------
678
679virtual int read(XrdSfsAio *aioparm) = 0;
680
681//-----------------------------------------------------------------------------
691//-----------------------------------------------------------------------------
692
693virtual XrdSfsXferSize readv(XrdOucIOVec *readV,
694 int rdvCnt);
695
696//-----------------------------------------------------------------------------
706//-----------------------------------------------------------------------------
707
708virtual int SendData(XrdSfsDio *sfDio,
709 XrdSfsFileOffset offset,
710 XrdSfsXferSize size);
711
712//-----------------------------------------------------------------------------
721//-----------------------------------------------------------------------------
722
724 const char *buffer,
725 XrdSfsXferSize size) = 0;
726
727//-----------------------------------------------------------------------------
734//-----------------------------------------------------------------------------
735
736virtual int write(XrdSfsAio *aioparm) = 0;
737
738//-----------------------------------------------------------------------------
748//-----------------------------------------------------------------------------
749
750virtual XrdSfsXferSize writev(XrdOucIOVec *writeV,
751 int wdvCnt);
752
753//-----------------------------------------------------------------------------
760//-----------------------------------------------------------------------------
761
762virtual int stat(struct stat *buf) = 0;
763
764//-----------------------------------------------------------------------------
768//-----------------------------------------------------------------------------
769
770virtual int sync() = 0;
771
772//-----------------------------------------------------------------------------
777//-----------------------------------------------------------------------------
778
779virtual int sync(XrdSfsAio *aiop) = 0;
780
781//-----------------------------------------------------------------------------
787//-----------------------------------------------------------------------------
788
789virtual int truncate(XrdSfsFileOffset fsize) = 0;
790
791//-----------------------------------------------------------------------------
799//-----------------------------------------------------------------------------
800
801virtual int getCXinfo(char cxtype[4], int &cxrsz) = 0;
802
803//-----------------------------------------------------------------------------
807//-----------------------------------------------------------------------------
808
809virtual void setXio(XrdSfsXio *xioP) { (void)xioP; }
810
811//-----------------------------------------------------------------------------
820//-----------------------------------------------------------------------------
821
822 XrdSfsFile(const char *user=0, int MonID=0)
823 : error(*(new XrdOucErrInfo(user, MonID)))
824 {lclEI = &error; pgwrEOF = 0;}
825
826//-----------------------------------------------------------------------------
832//-----------------------------------------------------------------------------
833
835 : error(wrapF.error), lclEI(0), pgwrEOF(0) {}
836
837//-----------------------------------------------------------------------------
842//-----------------------------------------------------------------------------
843
845 : error(eInfo), lclEI(0), pgwrEOF(0) {}
846
847//-----------------------------------------------------------------------------
849//-----------------------------------------------------------------------------
850
851virtual ~XrdSfsFile() {if (lclEI) delete lclEI;}
852
853private:
854XrdOucErrInfo* lclEI;
855XrdSfsFileOffset pgwrEOF;
856}; // class XrdSfsFile
857
858/******************************************************************************/
859/* X r d S f s F i l e S y s t e m */
860/******************************************************************************/
861
862//-----------------------------------------------------------------------------
886//-----------------------------------------------------------------------------
887
889{
890public:
891
892//-----------------------------------------------------------------------------
902//-----------------------------------------------------------------------------
903
904virtual XrdSfsDirectory *newDir(char *user=0, int MonID=0) = 0;
905
906//-----------------------------------------------------------------------------
917//-----------------------------------------------------------------------------
918
919virtual XrdSfsDirectory *newDir(XrdOucErrInfo &eInfo) {(void)eInfo; return 0;}
920
921//-----------------------------------------------------------------------------
931//-----------------------------------------------------------------------------
932
933virtual XrdSfsFile *newFile(char *user=0, int MonID=0) = 0;
934
935//-----------------------------------------------------------------------------
946//-----------------------------------------------------------------------------
947
948virtual XrdSfsFile *newFile(XrdOucErrInfo &eInfo) {(void)eInfo; return 0;}
949
950//-----------------------------------------------------------------------------
969//-----------------------------------------------------------------------------
970
972
973virtual int chksum( csFunc Func,
974 const char *csName,
975 const char *path,
976 XrdOucErrInfo &eInfo,
977 const XrdSecEntity *client = 0,
978 const char *opaque = 0);
979
980//-----------------------------------------------------------------------------
990//-----------------------------------------------------------------------------
991
992virtual int chmod(const char *path,
993 XrdSfsMode mode,
994 XrdOucErrInfo &eInfo,
995 const XrdSecEntity *client = 0,
996 const char *opaque = 0) = 0;
997
998//-----------------------------------------------------------------------------
1002//-----------------------------------------------------------------------------
1003
1004virtual void Connect(const XrdSecEntity *client = 0)
1005{
1006 (void)client;
1007}
1008
1009//-----------------------------------------------------------------------------
1013//-----------------------------------------------------------------------------
1014
1015virtual void Disc(const XrdSecEntity *client = 0) {(void)client;}
1016
1017//-----------------------------------------------------------------------------
1022//-----------------------------------------------------------------------------
1023
1024virtual void EnvInfo(XrdOucEnv *envP) {(void)envP;}
1025
1026//-----------------------------------------------------------------------------
1042//-----------------------------------------------------------------------------
1043
1044virtual int exists(const char *path,
1045 XrdSfsFileExistence &eFlag,
1046 XrdOucErrInfo &eInfo,
1047 const XrdSecEntity *client = 0,
1048 const char *opaque = 0) = 0;
1049
1050//-----------------------------------------------------------------------------
1064//-----------------------------------------------------------------------------
1065
1066virtual int FAttr( XrdSfsFACtl *faReq,
1067 XrdOucErrInfo &eInfo,
1068 const XrdSecEntity *client = 0);
1069
1070//-----------------------------------------------------------------------------
1075//-----------------------------------------------------------------------------
1076
1077 uint64_t Features() {return FeatureSet;}
1078
1079//-----------------------------------------------------------------------------
1098//-----------------------------------------------------------------------------
1099
1100virtual int FSctl(const int cmd,
1101 XrdSfsFSctl &args,
1102 XrdOucErrInfo &eInfo,
1103 const XrdSecEntity *client = 0);
1104
1105//-----------------------------------------------------------------------------
1133//-----------------------------------------------------------------------------
1134
1135virtual int fsctl(const int cmd,
1136 const char *args,
1137 XrdOucErrInfo &eInfo,
1138 const XrdSecEntity *client = 0) = 0;
1139
1140//-----------------------------------------------------------------------------
1144//-----------------------------------------------------------------------------
1145
1146virtual int getChkPSize() {return 0;}
1147
1148//-----------------------------------------------------------------------------
1158//-----------------------------------------------------------------------------
1159
1160virtual int getStats(char *buff, int blen) = 0;
1161
1162//-----------------------------------------------------------------------------
1166//-----------------------------------------------------------------------------
1167
1168virtual const char *getVersion() = 0;
1169
1170//-----------------------------------------------------------------------------
1181//-----------------------------------------------------------------------------
1182
1186 };
1187
1188virtual int gpFile( gpfFunc &gpAct,
1189 XrdSfsGPFile &gpReq,
1190 XrdOucErrInfo &eInfo,
1191 const XrdSecEntity *client = 0);
1192
1193//-----------------------------------------------------------------------------
1203//-----------------------------------------------------------------------------
1204
1205virtual int mkdir(const char *path,
1206 XrdSfsMode mode,
1207 XrdOucErrInfo &eInfo,
1208 const XrdSecEntity *client = 0,
1209 const char *opaque = 0) = 0;
1210
1211//-----------------------------------------------------------------------------
1219//-----------------------------------------------------------------------------
1220
1221virtual int prepare( XrdSfsPrep &pargs,
1222 XrdOucErrInfo &eInfo,
1223 const XrdSecEntity *client = 0) = 0;
1224
1225//-----------------------------------------------------------------------------
1234//-----------------------------------------------------------------------------
1235
1236virtual int rem(const char *path,
1237 XrdOucErrInfo &eInfo,
1238 const XrdSecEntity *client = 0,
1239 const char *opaque = 0) = 0;
1240
1241//-----------------------------------------------------------------------------
1250//-----------------------------------------------------------------------------
1251
1252virtual int remdir(const char *path,
1253 XrdOucErrInfo &eInfo,
1254 const XrdSecEntity *client = 0,
1255 const char *opaque = 0) = 0;
1256
1257//-----------------------------------------------------------------------------
1268//-----------------------------------------------------------------------------
1269
1270virtual int rename(const char *oPath,
1271 const char *nPath,
1272 XrdOucErrInfo &eInfo,
1273 const XrdSecEntity *client = 0,
1274 const char *opaqueO = 0,
1275 const char *opaqueN = 0) = 0;
1276
1277//-----------------------------------------------------------------------------
1288//-----------------------------------------------------------------------------
1289
1290virtual int stat(const char *Name,
1291 struct stat *buf,
1292 XrdOucErrInfo &eInfo,
1293 const XrdSecEntity *client = 0,
1294 const char *opaque = 0) = 0;
1295
1296//-----------------------------------------------------------------------------
1308//-----------------------------------------------------------------------------
1309
1310virtual int stat(const char *path,
1311 mode_t &mode,
1312 XrdOucErrInfo &eInfo,
1313 const XrdSecEntity *client = 0,
1314 const char *opaque = 0) = 0;
1315
1316//-----------------------------------------------------------------------------
1326//-----------------------------------------------------------------------------
1327
1328virtual int truncate(const char *path,
1329 XrdSfsFileOffset fsize,
1330 XrdOucErrInfo &eInfo,
1331 const XrdSecEntity *client = 0,
1332 const char *opaque = 0) = 0;
1333
1334//-----------------------------------------------------------------------------
1336//-----------------------------------------------------------------------------
1337
1340
1341protected:
1342
1343uint64_t FeatureSet;
1344};
1345
1346/******************************************************************************/
1347/* F i l e S y s t e m I n s t a n t i a t o r */
1348/******************************************************************************/
1349
1350//-----------------------------------------------------------------------------
1372
1373typedef XrdSfsFileSystem *(*XrdSfsFileSystem2_t)(XrdSfsFileSystem *nativeFS,
1375 const char *configFn,
1376 XrdOucEnv *envP);
1377
1378//-----------------------------------------------------------------------------
1389
1390typedef XrdSfsFileSystem *(*XrdSfsFileSystem_t) (XrdSfsFileSystem *nativeFS,
1392 const char *configFn);
1393
1394//------------------------------------------------------------------------------
1406//------------------------------------------------------------------------------
1407#endif
static XrdSysLogger Logger
std::vector< XrdOucRange > XrdOucRangeList
#define writev(a, b, c)
Definition XrdPosix.hh:117
#define readv(a, b, c)
Definition XrdPosix.hh:84
#define stat(a, b)
Definition XrdPosix.hh:101
#define read(a, b, c)
Definition XrdPosix.hh:82
struct myOpts opts
int XrdSfsMode
const char * Arg1
PLUGFS, PLUGIN, PLUGIO, PLUGXC.
const char * Arg2
PLUGFS, PLUGIN opaque string.
int Arg2Len
Length or -count of args in extension.
const char ** ArgP
PLUGXC argument list extension.
char * notify
Notification path or 0.
XrdOucTList * paths
List of paths.
XrdOucTList * oinfo
1-to-1 correspondence of opaque info
XrdSfsFileExistence
@ XrdSfsFileExistIsOther
@ XrdSfsFileExistIsFile
@ XrdSfsFileExistNo
@ XrdSfsFileExistIsOffline
@ XrdSfsFileExistIsDirectory
char * reqid
Request ID.
int XrdSfsFileOpenMode
int Arg1Len
Length.
long long XrdSfsFileOffset
int opts
Prep_xxx.
int XrdSfsXferSize
< Prepare parameters
< SFS_FSCTL_PLUGIN/PLUGIO/PLUGXC/PLUGFS parms
virtual int autoStat(struct stat *buf)
XrdSfsDirectory(XrdOucErrInfo &eInfo)
XrdSfsDirectory(const char *user=0, int MonID=0)
XrdSfsDirectory(XrdSfsDirectory &wrapD)
virtual ~XrdSfsDirectory()
Destructor.
virtual int open(const char *path, const XrdSecEntity *client=0, const char *opaque=0)=0
virtual const char * FName()=0
XrdOucErrInfo & error
virtual const char * nextEntry()=0
virtual int close()=0
virtual void Connect(const XrdSecEntity *client=0)
XrdSfsFileSystem()
Constructor and Destructor.
virtual int chmod(const char *path, XrdSfsMode mode, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaque=0)=0
virtual void EnvInfo(XrdOucEnv *envP)
virtual int stat(const char *path, mode_t &mode, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaque=0)=0
virtual void Disc(const XrdSecEntity *client=0)
virtual int getStats(char *buff, int blen)=0
virtual int fsctl(const int cmd, const char *args, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0)=0
virtual int rename(const char *oPath, const char *nPath, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaqueO=0, const char *opaqueN=0)=0
virtual int mkdir(const char *path, XrdSfsMode mode, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaque=0)=0
virtual const char * getVersion()=0
virtual int FSctl(const int cmd, XrdSfsFSctl &args, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0)
virtual XrdSfsFile * newFile(char *user=0, int MonID=0)=0
virtual int truncate(const char *path, XrdSfsFileOffset fsize, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaque=0)=0
virtual int chksum(csFunc Func, const char *csName, const char *path, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaque=0)
virtual int remdir(const char *path, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaque=0)=0
virtual int getChkPSize()
uint64_t FeatureSet
Adjust features at initialization.
virtual int exists(const char *path, XrdSfsFileExistence &eFlag, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaque=0)=0
virtual int prepare(XrdSfsPrep &pargs, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0)=0
virtual int gpFile(gpfFunc &gpAct, XrdSfsGPFile &gpReq, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0)
virtual XrdSfsDirectory * newDir(XrdOucErrInfo &eInfo)
virtual int stat(const char *Name, struct stat *buf, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaque=0)=0
virtual int FAttr(XrdSfsFACtl *faReq, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0)
virtual int rem(const char *path, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaque=0)=0
virtual XrdSfsDirectory * newDir(char *user=0, int MonID=0)=0
@ gpfGet
Perform a file retrieval.
@ gpfCancel
Cancel this request.
@ gpfPut
Perform a file push.
virtual XrdSfsFile * newFile(XrdOucErrInfo &eInfo)
static const uint64_t Verify
Options for pgRead() and pgWrite() as noted below.
virtual int sync()=0
XrdOucErrInfo & error
virtual int SendData(XrdSfsDio *sfDio, XrdSfsFileOffset offset, XrdSfsXferSize size)
virtual int getMmap(void **Addr, off_t &Size)=0
virtual int open(const char *fileName, XrdSfsFileOpenMode openMode, mode_t createMode, const XrdSecEntity *client=0, const char *opaque=0)=0
virtual int sync(XrdSfsAio *aiop)=0
virtual int write(XrdSfsAio *aioparm)=0
virtual XrdSfsXferSize read(XrdSfsFileOffset offset, XrdSfsXferSize size)=0
virtual int Clone(XrdSfsFile &srcFile)
virtual int checkpoint(cpAct act, struct iov *range=0, int n=0)
virtual int truncate(XrdSfsFileOffset fsize)=0
virtual ~XrdSfsFile()
Destructor.
virtual XrdSfsXferSize read(XrdSfsFileOffset offset, char *buffer, XrdSfsXferSize size)=0
@ cpTrunc
Truncate a file within checkpoint.
@ cpDelete
Delete an existing checkpoint.
@ cpRestore
Restore an active checkpoint and delete it.
@ cpWrite
Add data to an existing checkpoint.
@ cpQuery
Return checkpoint limits.
@ cpCreate
Create a checkpoint, one must not be active.
virtual const char * FName()=0
virtual int getCXinfo(char cxtype[4], int &cxrsz)=0
XrdSfsFile(XrdSfsFile &wrapF)
XrdSfsFile(const char *user=0, int MonID=0)
XrdSfsFile(XrdOucErrInfo &eInfo)
virtual int stat(struct stat *buf)=0
virtual void setXio(XrdSfsXio *xioP)
virtual int fctl(const int cmd, const char *args, XrdOucErrInfo &eInfo)=0
virtual XrdSfsXferSize pgRead(XrdSfsFileOffset offset, char *buffer, XrdSfsXferSize rdlen, uint32_t *csvec, uint64_t opts=0)
virtual XrdSfsXferSize write(XrdSfsFileOffset offset, const char *buffer, XrdSfsXferSize size)=0
virtual int close()=0
virtual int read(XrdSfsAio *aioparm)=0
virtual XrdSfsXferSize pgWrite(XrdSfsFileOffset offset, char *buffer, XrdSfsXferSize wrlen, uint32_t *csvec, uint64_t opts=0)