XRootD
Loading...
Searching...
No Matches
XrdSfsInterface.hh File Reference
#include <cstring>
#include <cerrno>
#include <cstdint>
#include <sys/types.h>
#include <sys/stat.h>
#include "XrdOuc/XrdOucErrInfo.hh"
#include "XrdOuc/XrdOucIOVec.hh"
#include "XrdOuc/XrdOucSFVec.hh"
#include "XrdSfs/XrdSfsGPFile.hh"
#include "XrdSys/XrdSysPageSize.hh"
+ Include dependency graph for XrdSfsInterface.hh:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  XrdSfsDirectory
 
class  XrdSfsFile
 
class  XrdSfsFileSystem
 
struct  XrdSfsFSctl
 < SFS_FSCTL_PLUGIN/PLUGIO/PLUGXC parms More...
 
union  XrdSfsFSctl.__unnamed155__
 
struct  XrdSfsPrep
 < Prepare parameters More...
 

Macros

#define Prep_CANCEL   256
 
#define Prep_COLOC   64
 
#define Prep_EVICT   1024
 
#define Prep_FRESH   128
 
#define Prep_PMASK   3
 
#define Prep_PRTY0   0
 
#define Prep_PRTY1   1
 
#define Prep_PRTY2   2
 
#define Prep_PRTY3   3
 
#define Prep_QUERY   512
 
#define Prep_SENDACK   12
 
#define Prep_SENDAOK   4
 
#define Prep_SENDERR   8
 
#define Prep_STAGE   32
 
#define Prep_WMODE   16
 
#define SFS_DATA   -1024
 
#define SFS_DATAVEC   -2048
 
#define SFS_ERROR   -1
 
#define SFS_FCTL_GETFD   1
 
#define SFS_FCTL_SPEC1   3
 
#define SFS_FCTL_STATV   2
 
#define SFS_FSCTL_CMD   255
 
#define SFS_FSCTL_LOCATE   1
 
#define SFS_FSCTL_PLUGIN   8
 
#define SFS_FSCTL_PLUGIO   16
 
#define SFS_FSCTL_PLUGXC   32
 
#define SFS_FSCTL_STATCC   5
 
#define SFS_FSCTL_STATFS   2
 
#define SFS_FSCTL_STATLS   3
 
#define SFS_FSCTL_STATXA   4
 
#define SFS_LCLPATH(x)   !strncmp(x, SFS_LCLPRFX, SFS_LCLPLEN)
 
#define SFS_LCLPLEN   3
 
#define SFS_LCLPRFX   "/=/"
 
#define SFS_LCLPRFY   "/="
 
#define SFS_LCLROOT(x)
 
#define SFS_O_CREAT   0x00000100
 
#define SFS_O_DIRLIST   0x00010000
 
#define SFS_O_FORCE   0x00200000
 
#define SFS_O_HNAME   0x00400000
 
#define SFS_O_LOCAL   0x00800000
 
#define SFS_O_LOCATE   0x10000000
 
#define SFS_O_META   0x40000000
 
#define SFS_O_MKPTH   0x00004000
 
#define SFS_O_MULTIW   0x00000400
 
#define SFS_O_NOTPC   0x00000800
 
#define SFS_O_NOWAIT   0x01000000
 
#define SFS_O_POSC   0x00100000
 
#define SFS_O_RAWIO   0x02000000
 
#define SFS_O_RDONLY   0
 
#define SFS_O_RDWR   2
 
#define SFS_O_REPLICA   0x08000000
 
#define SFS_O_RESET   0x04000000
 
#define SFS_O_SEQIO   0x10000000
 
#define SFS_O_STAT   0x20000000
 
#define SFS_O_TRUNC   0x00000200
 
#define SFS_O_WRONLY   1
 
#define SFS_OK   0
 
#define SFS_REDIRECT   -256
 
#define SFS_SFIO_FDVAL   0x80000000
 
#define SFS_STALL   1
 
#define SFS_STARTED   -512
 

Typedefs

typedef long long XrdSfsFileOffset
 
typedef int XrdSfsFileOpenMode
 
typedef XrdSfsFileSystem *(* XrdSfsFileSystem2_t) (XrdSfsFileSystem *nativeFS, XrdSysLogger *Logger, const char *configFn, XrdOucEnv *envP)
 
typedef XrdSfsFileSystem *(* XrdSfsFileSystem_t) (XrdSfsFileSystem *nativeFS, XrdSysLogger *Logger, const char *configFn)
 
typedef int XrdSfsMode
 
typedef int XrdSfsXferSize
 

Enumerations

enum  XrdSfsFileExistence {
  XrdSfsFileExistNo ,
  XrdSfsFileExistIsFile ,
  XrdSfsFileExistIsDirectory ,
  XrdSfsFileExistIsOffline ,
  XrdSfsFileExistIsOther
}
 

Class Documentation

◆ XrdSfsFSctl

struct XrdSfsFSctl

< SFS_FSCTL_PLUGIN/PLUGIO/PLUGXC parms

Definition at line 161 of file XrdSfsInterface.hh.

+ Collaboration diagram for XrdSfsFSctl:
Class Members
union XrdSfsFSctl.__unnamed155__ __unnamed__
const char * Arg1 PLUGINO, PLUGION, PLUGXC.
int Arg1Len Length.
int Arg2Len Length or -count of args in extension.

◆ XrdSfsFSctl.__unnamed155__

union XrdSfsFSctl.__unnamed155__

Definition at line 166 of file XrdSfsInterface.hh.

+ Collaboration diagram for XrdSfsFSctl.__unnamed155__:
Class Members
const char * Arg2 PLUGIN opaque string.
const char ** ArgP PLUGXC argument list extension.

◆ XrdSfsPrep

struct XrdSfsPrep

< Prepare parameters

Definition at line 172 of file XrdSfsInterface.hh.

+ Collaboration diagram for XrdSfsPrep:
Class Members
char * notify Notification path or 0.
XrdOucTList * oinfo 1-to-1 correspondence of opaque info
int opts Prep_xxx.
XrdOucTList * paths List of paths.
char * reqid Request ID.

Macro Definition Documentation

◆ Prep_CANCEL

#define Prep_CANCEL   256

Definition at line 155 of file XrdSfsInterface.hh.

◆ Prep_COLOC

#define Prep_COLOC   64

Definition at line 153 of file XrdSfsInterface.hh.

◆ Prep_EVICT

#define Prep_EVICT   1024

Definition at line 157 of file XrdSfsInterface.hh.

◆ Prep_FRESH

#define Prep_FRESH   128

Definition at line 154 of file XrdSfsInterface.hh.

◆ Prep_PMASK

#define Prep_PMASK   3

Definition at line 147 of file XrdSfsInterface.hh.

◆ Prep_PRTY0

#define Prep_PRTY0   0

Definition at line 143 of file XrdSfsInterface.hh.

◆ Prep_PRTY1

#define Prep_PRTY1   1

Definition at line 144 of file XrdSfsInterface.hh.

◆ Prep_PRTY2

#define Prep_PRTY2   2

Definition at line 145 of file XrdSfsInterface.hh.

◆ Prep_PRTY3

#define Prep_PRTY3   3

Definition at line 146 of file XrdSfsInterface.hh.

◆ Prep_QUERY

#define Prep_QUERY   512

Definition at line 156 of file XrdSfsInterface.hh.

◆ Prep_SENDACK

#define Prep_SENDACK   12

Definition at line 150 of file XrdSfsInterface.hh.

◆ Prep_SENDAOK

#define Prep_SENDAOK   4

Definition at line 148 of file XrdSfsInterface.hh.

◆ Prep_SENDERR

#define Prep_SENDERR   8

Definition at line 149 of file XrdSfsInterface.hh.

◆ Prep_STAGE

#define Prep_STAGE   32

Definition at line 152 of file XrdSfsInterface.hh.

◆ Prep_WMODE

#define Prep_WMODE   16

Definition at line 151 of file XrdSfsInterface.hh.

◆ SFS_DATA

#define SFS_DATA   -1024

Definition at line 112 of file XrdSfsInterface.hh.

◆ SFS_DATAVEC

#define SFS_DATAVEC   -2048

Definition at line 113 of file XrdSfsInterface.hh.

◆ SFS_ERROR

#define SFS_ERROR   -1

Definition at line 109 of file XrdSfsInterface.hh.

◆ SFS_FCTL_GETFD

#define SFS_FCTL_GETFD   1

Definition at line 86 of file XrdSfsInterface.hh.

◆ SFS_FCTL_SPEC1

#define SFS_FCTL_SPEC1   3

Definition at line 88 of file XrdSfsInterface.hh.

◆ SFS_FCTL_STATV

#define SFS_FCTL_STATV   2

Definition at line 87 of file XrdSfsInterface.hh.

◆ SFS_FSCTL_CMD

#define SFS_FSCTL_CMD   255

Definition at line 94 of file XrdSfsInterface.hh.

◆ SFS_FSCTL_LOCATE

#define SFS_FSCTL_LOCATE   1

Definition at line 96 of file XrdSfsInterface.hh.

◆ SFS_FSCTL_PLUGIN

#define SFS_FSCTL_PLUGIN   8

Definition at line 101 of file XrdSfsInterface.hh.

◆ SFS_FSCTL_PLUGIO

#define SFS_FSCTL_PLUGIO   16

Definition at line 102 of file XrdSfsInterface.hh.

◆ SFS_FSCTL_PLUGXC

#define SFS_FSCTL_PLUGXC   32

Definition at line 103 of file XrdSfsInterface.hh.

◆ SFS_FSCTL_STATCC

#define SFS_FSCTL_STATCC   5

Definition at line 100 of file XrdSfsInterface.hh.

◆ SFS_FSCTL_STATFS

#define SFS_FSCTL_STATFS   2

Definition at line 97 of file XrdSfsInterface.hh.

◆ SFS_FSCTL_STATLS

#define SFS_FSCTL_STATLS   3

Definition at line 98 of file XrdSfsInterface.hh.

◆ SFS_FSCTL_STATXA

#define SFS_FSCTL_STATXA   4

Definition at line 99 of file XrdSfsInterface.hh.

◆ SFS_LCLPATH

#define SFS_LCLPATH (   x)    !strncmp(x, SFS_LCLPRFX, SFS_LCLPLEN)

Definition at line 119 of file XrdSfsInterface.hh.

◆ SFS_LCLPLEN

#define SFS_LCLPLEN   3

Definition at line 118 of file XrdSfsInterface.hh.

◆ SFS_LCLPRFX

#define SFS_LCLPRFX   "/=/"

Definition at line 117 of file XrdSfsInterface.hh.

◆ SFS_LCLPRFY

#define SFS_LCLPRFY   "/="

Definition at line 120 of file XrdSfsInterface.hh.

◆ SFS_LCLROOT

#define SFS_LCLROOT (   x)
Value:
!strncmp(x, SFS_LCLPRFX, SFS_LCLPLEN-1) \
&& (*(x+SFS_LCLPLEN-1) == '/' || *(x+SFS_LCLPLEN-1) == 0)
#define SFS_LCLPRFX
#define SFS_LCLPLEN

Definition at line 121 of file XrdSfsInterface.hh.

133{
139};
140//------------------------------------------------
141
142#define Prep_PRTY0 0
143#define Prep_PRTY1 1
144#define Prep_PRTY2 2
145#define Prep_PRTY3 3
146#define Prep_PMASK 3
147#define Prep_SENDAOK 4
148#define Prep_SENDERR 8
149#define Prep_SENDACK 12
150#define Prep_WMODE 16
151#define Prep_STAGE 32
152#define Prep_COLOC 64
153#define Prep_FRESH 128
154#define Prep_CANCEL 256
155#define Prep_QUERY 512
156#define Prep_EVICT 1024
157
158class XrdOucTList;
159
160struct XrdSfsFSctl
161{
162 const char *Arg1;
163 int Arg1Len;
164 int Arg2Len;
165 union{
166 const char *Arg2;
167 const char **ArgP;
168 };
169};
170
171struct XrdSfsPrep
172{
173 char *reqid;
174 char *notify;
175 int opts;
178};
179
180/******************************************************************************/
181/* F o r w a r d D e c l a r a t i o n s */
182/******************************************************************************/
183
184class XrdOucEnv;
185class XrdSecEntity;
186struct XrdSfsFACtl;
187
188/******************************************************************************/
189/* O b j e c t W r a p p i n g G u i d e */
190/******************************************************************************/
191
192/* The XrdSfsDirectory and XrdSfsFile objects can be wrapped. Wraping can be
193 used to add functionality. The process is common and pretty muche rote.
194 There is only one caveat: all wrappers must use the same XrdOucErrInfo
195 object. This is because the ErrInfo object contains client parameters that
196 are used to control how things are done to be backward compatible. Newer
197 client can then use more efficient internal processing. The SFS provides
198 two ways to make sure the same ErrInfo object is used by all objects in
199 the wrapped chain. Forward propagation (the one typically used) and
200 backward propagation (used in certain unusual cases). In forward mode,
201 the ErrInfo object of the last object in the chain is propagated to the
202 front of the chain. In backward mode the reverse happens. Let's assume
203 the following scenarion. Object-A wraps object-B (the object here can be
204 directory or file object). In forward mode weneed to create objects in
205 reverse order (bottom to top) which is typically what you would do anyway
206 as you need to capture the pinter to the object your wrapping. So, using
207 newFile() as an example where sfsP points to the Interface being wrapped:
208
209 XrdSfsFile *newFile(const char *user, int MonID)
210 {
211 XrdSfsFile *wrapped_file = sfsP->newFile(user, MonID);
212 if (!wrapped_file) return 0;
213 return new mySfsFile(wrapped_file,...);
214 }
215 class mySfsFile : public XrdSfsFile
216 {public:
217 mySfsFile(XrdSfsFile *wrapped_file,...) : XrdSfsFile(*wrapped_file)
218 {....}
219 ....
220 };
221
222 Notice we are allocating the wrapped file ahead of the wrapper so that
223 the wrapper can use the ErrInfo object of the wrapped file.
224
225 In backward mode we want to use the ErrInfo object of the front-most
226 wrapper for all wrappers after it. This mechanism is far more complicated
227 due to error handling requirements. However, it's useful when a wrapped
228 object is not necessarily instantiated to accomplish the needs of the
229 wrapper. An example of this is the newFile and newDir implementations for
230 XrdSsi where wrapped object creation is subject to the resource name.
231*/
232
233/******************************************************************************/
234/* X r d S f s D i r e c t o r y */
235/******************************************************************************/
236
237//------------------------------------------------------------------------------
240//------------------------------------------------------------------------------
241
242class XrdSfsDirectory
243{
244public:
245
246//-----------------------------------------------------------------------------
249//-----------------------------------------------------------------------------
250
252
253//-----------------------------------------------------------------------------
261//-----------------------------------------------------------------------------
262
263virtual int open(const char *path,
264 const XrdSecEntity *client = 0,
265 const char *opaque = 0) = 0;
266
267//-----------------------------------------------------------------------------
275//-----------------------------------------------------------------------------
276
277virtual const char *nextEntry() = 0;
278
279//-----------------------------------------------------------------------------
283//-----------------------------------------------------------------------------
284
285virtual int close() = 0;
286
287//-----------------------------------------------------------------------------
291//-----------------------------------------------------------------------------
292
293virtual const char *FName() = 0;
294
295//-----------------------------------------------------------------------------
304//-----------------------------------------------------------------------------
305
306virtual int autoStat(struct stat *buf);
307
308//-----------------------------------------------------------------------------
317//-----------------------------------------------------------------------------
318
319 XrdSfsDirectory(const char *user=0, int MonID=0)
320 : error(*(new XrdOucErrInfo(user, MonID)))
321 {lclEI = &error;}
322
323//-----------------------------------------------------------------------------
329//-----------------------------------------------------------------------------
330
332 : error(wrapD.error), lclEI(0) {}
333
334//-----------------------------------------------------------------------------
339//-----------------------------------------------------------------------------
340
342 : error(eInfo), lclEI(0) {}
343
344//-----------------------------------------------------------------------------
346//-----------------------------------------------------------------------------
347
348virtual ~XrdSfsDirectory() {if (lclEI) delete lclEI;}
349
350private:
351XrdOucErrInfo* lclEI;
352
353}; // class XrdSfsDirectory
354
355/******************************************************************************/
356/* X r d S f s F i l e */
357/******************************************************************************/
358
359//------------------------------------------------------------------------------
362//------------------------------------------------------------------------------
363
364class XrdSfsAio;
365class XrdSfsDio;
366class XrdSfsXio;
367
368class XrdSfsFile
369{
370public:
371
372//-----------------------------------------------------------------------------
375//-----------------------------------------------------------------------------
376
378
379//-----------------------------------------------------------------------------
401//-----------------------------------------------------------------------------
402
403virtual int open(const char *fileName,
404 XrdSfsFileOpenMode openMode,
405 mode_t createMode,
406 const XrdSecEntity *client = 0,
407 const char *opaque = 0) = 0;
408
409//-----------------------------------------------------------------------------
430//-----------------------------------------------------------------------------
431
432enum cpAct {cpCreate=0,
433 cpDelete,
434 cpRestore,
435 cpQuery,
436 cpTrunc,
437 cpWrite
438 };
439
440virtual int checkpoint(cpAct act, struct iov *range=0, int n=0);
441
442//-----------------------------------------------------------------------------
446//-----------------------------------------------------------------------------
447
448virtual int close() = 0;
449
450//-----------------------------------------------------------------------------
467//-----------------------------------------------------------------------------
468
469virtual int fctl(const int cmd,
470 const char *args,
471 XrdOucErrInfo &eInfo) = 0;
472
473//-----------------------------------------------------------------------------
486//-----------------------------------------------------------------------------
487
488virtual int fctl(const int cmd,
489 int alen,
490 const char *args,
491 const XrdSecEntity *client = 0);
492
493//-----------------------------------------------------------------------------
497//-----------------------------------------------------------------------------
498
499virtual const char *FName() = 0;
500
501//-----------------------------------------------------------------------------
508//-----------------------------------------------------------------------------
509
510virtual int getMmap(void **Addr, off_t &Size) = 0;
511
512//-----------------------------------------------------------------------------
514//-----------------------------------------------------------------------------
515
516static const uint64_t
517Verify = 0x8000000000000000ULL;
518
519//-----------------------------------------------------------------------------
538//-----------------------------------------------------------------------------
539
541 char *buffer,
542 XrdSfsXferSize rdlen,
543 uint32_t *csvec,
544 uint64_t opts=0);
545
546//-----------------------------------------------------------------------------
554//-----------------------------------------------------------------------------
555
556virtual int pgRead(XrdSfsAio *aioparm, uint64_t opts=0);
557
558//-----------------------------------------------------------------------------
578//-----------------------------------------------------------------------------
579
581 char *buffer,
582 XrdSfsXferSize wrlen,
583 uint32_t *csvec,
584 uint64_t opts=0);
585
586//-----------------------------------------------------------------------------
594//-----------------------------------------------------------------------------
595
596virtual int pgWrite(XrdSfsAio *aioparm, uint64_t opts=0);
597
598//-----------------------------------------------------------------------------
606//-----------------------------------------------------------------------------
607
609 XrdSfsXferSize size) = 0;
610
611//-----------------------------------------------------------------------------
620//-----------------------------------------------------------------------------
621
623 char *buffer,
624 XrdSfsXferSize size) = 0;
625
626//-----------------------------------------------------------------------------
633//-----------------------------------------------------------------------------
634
635virtual int read(XrdSfsAio *aioparm) = 0;
636
637//-----------------------------------------------------------------------------
647//-----------------------------------------------------------------------------
648
649virtual XrdSfsXferSize readv(XrdOucIOVec *readV,
650 int rdvCnt);
651
652//-----------------------------------------------------------------------------
662//-----------------------------------------------------------------------------
663
664virtual int SendData(XrdSfsDio *sfDio,
665 XrdSfsFileOffset offset,
666 XrdSfsXferSize size);
667
668//-----------------------------------------------------------------------------
677//-----------------------------------------------------------------------------
678
680 const char *buffer,
681 XrdSfsXferSize size) = 0;
682
683//-----------------------------------------------------------------------------
690//-----------------------------------------------------------------------------
691
692virtual int write(XrdSfsAio *aioparm) = 0;
693
694//-----------------------------------------------------------------------------
704//-----------------------------------------------------------------------------
705
706virtual XrdSfsXferSize writev(XrdOucIOVec *writeV,
707 int wdvCnt);
708
709//-----------------------------------------------------------------------------
716//-----------------------------------------------------------------------------
717
718virtual int stat(struct stat *buf) = 0;
719
720//-----------------------------------------------------------------------------
724//-----------------------------------------------------------------------------
725
726virtual int sync() = 0;
727
728//-----------------------------------------------------------------------------
733//-----------------------------------------------------------------------------
734
735virtual int sync(XrdSfsAio *aiop) = 0;
736
737//-----------------------------------------------------------------------------
743//-----------------------------------------------------------------------------
744
745virtual int truncate(XrdSfsFileOffset fsize) = 0;
746
747//-----------------------------------------------------------------------------
755//-----------------------------------------------------------------------------
756
757virtual int getCXinfo(char cxtype[4], int &cxrsz) = 0;
758
759//-----------------------------------------------------------------------------
763//-----------------------------------------------------------------------------
764
765virtual void setXio(XrdSfsXio *xioP) { (void)xioP; }
766
767//-----------------------------------------------------------------------------
776//-----------------------------------------------------------------------------
777
778 XrdSfsFile(const char *user=0, int MonID=0)
779 : error(*(new XrdOucErrInfo(user, MonID)))
780 {lclEI = &error; pgwrEOF = 0;}
781
782//-----------------------------------------------------------------------------
788//-----------------------------------------------------------------------------
789
790 XrdSfsFile(XrdSfsFile &wrapF)
791 : error(wrapF.error), lclEI(0), pgwrEOF(0) {}
792
793//-----------------------------------------------------------------------------
798//-----------------------------------------------------------------------------
799
801 : error(eInfo), lclEI(0), pgwrEOF(0) {}
802
803//-----------------------------------------------------------------------------
805//-----------------------------------------------------------------------------
806
807virtual ~XrdSfsFile() {if (lclEI) delete lclEI;}
808
809private:
810XrdOucErrInfo* lclEI;
811XrdSfsFileOffset pgwrEOF;
812}; // class XrdSfsFile
813
814/******************************************************************************/
815/* X r d S f s F i l e S y s t e m */
816/******************************************************************************/
817
818//-----------------------------------------------------------------------------
842//-----------------------------------------------------------------------------
843
845{
846public:
847
848//-----------------------------------------------------------------------------
858//-----------------------------------------------------------------------------
859
860virtual XrdSfsDirectory *newDir(char *user=0, int MonID=0) = 0;
861
862//-----------------------------------------------------------------------------
873//-----------------------------------------------------------------------------
874
875virtual XrdSfsDirectory *newDir(XrdOucErrInfo &eInfo) {(void)eInfo; return 0;}
876
877//-----------------------------------------------------------------------------
887//-----------------------------------------------------------------------------
888
889virtual XrdSfsFile *newFile(char *user=0, int MonID=0) = 0;
890
891//-----------------------------------------------------------------------------
902//-----------------------------------------------------------------------------
903
904virtual XrdSfsFile *newFile(XrdOucErrInfo &eInfo) {(void)eInfo; return 0;}
905
906//-----------------------------------------------------------------------------
925//-----------------------------------------------------------------------------
926
927enum csFunc {csCalc = 0, csGet, csSize};
928
929virtual int chksum( csFunc Func,
930 const char *csName,
931 const char *path,
932 XrdOucErrInfo &eInfo,
933 const XrdSecEntity *client = 0,
934 const char *opaque = 0);
935
936//-----------------------------------------------------------------------------
946//-----------------------------------------------------------------------------
947
948virtual int chmod(const char *path,
949 XrdSfsMode mode,
950 XrdOucErrInfo &eInfo,
951 const XrdSecEntity *client = 0,
952 const char *opaque = 0) = 0;
953
954//-----------------------------------------------------------------------------
958//-----------------------------------------------------------------------------
959
960virtual void Connect(const XrdSecEntity *client = 0)
961{
962 (void)client;
963}
964
965//-----------------------------------------------------------------------------
969//-----------------------------------------------------------------------------
970
971virtual void Disc(const XrdSecEntity *client = 0) {(void)client;}
972
973//-----------------------------------------------------------------------------
978//-----------------------------------------------------------------------------
979
980virtual void EnvInfo(XrdOucEnv *envP) {(void)envP;}
981
982//-----------------------------------------------------------------------------
998//-----------------------------------------------------------------------------
999
1000virtual int exists(const char *path,
1001 XrdSfsFileExistence &eFlag,
1002 XrdOucErrInfo &eInfo,
1003 const XrdSecEntity *client = 0,
1004 const char *opaque = 0) = 0;
1005
1006//-----------------------------------------------------------------------------
1020//-----------------------------------------------------------------------------
1021
1022virtual int FAttr( XrdSfsFACtl *faReq,
1023 XrdOucErrInfo &eInfo,
1024 const XrdSecEntity *client = 0);
1025
1026//-----------------------------------------------------------------------------
1031//-----------------------------------------------------------------------------
1032
1033 uint64_t Features() {return FeatureSet;}
1034
1035//-----------------------------------------------------------------------------
1051//-----------------------------------------------------------------------------
1052
1053virtual int FSctl(const int cmd,
1054 XrdSfsFSctl &args,
1055 XrdOucErrInfo &eInfo,
1056 const XrdSecEntity *client = 0);
1057
1058//-----------------------------------------------------------------------------
1086//-----------------------------------------------------------------------------
1087
1088virtual int fsctl(const int cmd,
1089 const char *args,
1090 XrdOucErrInfo &eInfo,
1091 const XrdSecEntity *client = 0) = 0;
1092
1093//-----------------------------------------------------------------------------
1097//-----------------------------------------------------------------------------
1098
1099virtual int getChkPSize() {return 0;}
1100
1101//-----------------------------------------------------------------------------
1111//-----------------------------------------------------------------------------
1112
1113virtual int getStats(char *buff, int blen) = 0;
1114
1115//-----------------------------------------------------------------------------
1119//-----------------------------------------------------------------------------
1120
1121virtual const char *getVersion() = 0;
1122
1123//-----------------------------------------------------------------------------
1134//-----------------------------------------------------------------------------
1135
1136enum gpfFunc {gpfCancel=0,
1137 gpfGet,
1138 gpfPut
1139 };
1140
1141virtual int gpFile( gpfFunc &gpAct,
1142 XrdSfsGPFile &gpReq,
1143 XrdOucErrInfo &eInfo,
1144 const XrdSecEntity *client = 0);
1145
1146//-----------------------------------------------------------------------------
1156//-----------------------------------------------------------------------------
1157
1158virtual int mkdir(const char *path,
1159 XrdSfsMode mode,
1160 XrdOucErrInfo &eInfo,
1161 const XrdSecEntity *client = 0,
1162 const char *opaque = 0) = 0;
1163
1164//-----------------------------------------------------------------------------
1172//-----------------------------------------------------------------------------
1173
1174virtual int prepare( XrdSfsPrep &pargs,
1175 XrdOucErrInfo &eInfo,
1176 const XrdSecEntity *client = 0) = 0;
1177
1178//-----------------------------------------------------------------------------
1187//-----------------------------------------------------------------------------
1188
1189virtual int rem(const char *path,
1190 XrdOucErrInfo &eInfo,
1191 const XrdSecEntity *client = 0,
1192 const char *opaque = 0) = 0;
1193
1194//-----------------------------------------------------------------------------
1203//-----------------------------------------------------------------------------
1204
1205virtual int remdir(const char *path,
1206 XrdOucErrInfo &eInfo,
1207 const XrdSecEntity *client = 0,
1208 const char *opaque = 0) = 0;
1209
1210//-----------------------------------------------------------------------------
1221//-----------------------------------------------------------------------------
1222
1223virtual int rename(const char *oPath,
1224 const char *nPath,
1225 XrdOucErrInfo &eInfo,
1226 const XrdSecEntity *client = 0,
1227 const char *opaqueO = 0,
1228 const char *opaqueN = 0) = 0;
1229
1230//-----------------------------------------------------------------------------
1241//-----------------------------------------------------------------------------
1242
1243virtual int stat(const char *Name,
1244 struct stat *buf,
1245 XrdOucErrInfo &eInfo,
1246 const XrdSecEntity *client = 0,
1247 const char *opaque = 0) = 0;
1248
1249//-----------------------------------------------------------------------------
1261//-----------------------------------------------------------------------------
1262
1263virtual int stat(const char *path,
1264 mode_t &mode,
1265 XrdOucErrInfo &eInfo,
1266 const XrdSecEntity *client = 0,
1267 const char *opaque = 0) = 0;
1268
1269//-----------------------------------------------------------------------------
1279//-----------------------------------------------------------------------------
1280
1281virtual int truncate(const char *path,
1282 XrdSfsFileOffset fsize,
1283 XrdOucErrInfo &eInfo,
1284 const XrdSecEntity *client = 0,
1285 const char *opaque = 0) = 0;
1286
1287//-----------------------------------------------------------------------------
1289//-----------------------------------------------------------------------------
1290
1292virtual ~XrdSfsFileSystem() {}
1293
1294protected:
1295
1296uint64_t FeatureSet;
1297};
1298
1299/******************************************************************************/
1300/* F i l e S y s t e m I n s t a n t i a t o r */
1301/******************************************************************************/
1302
1303//-----------------------------------------------------------------------------
1326typedef XrdSfsFileSystem *(*XrdSfsFileSystem2_t)(XrdSfsFileSystem *nativeFS,
1328 const char *configFn,
1329 XrdOucEnv *envP);
1330
1331//-----------------------------------------------------------------------------
1343typedef XrdSfsFileSystem *(*XrdSfsFileSystem_t) (XrdSfsFileSystem *nativeFS,
1345 const char *configFn);
1346
1347//------------------------------------------------------------------------------
1359//------------------------------------------------------------------------------
1360#endif
static void prepare()
static XrdSysLogger Logger
#define write(a, b, c)
Definition XrdPosix.hh:110
#define mkdir(a, b)
Definition XrdPosix.hh:69
#define open
Definition XrdPosix.hh:71
#define writev(a, b, c)
Definition XrdPosix.hh:112
#define readv(a, b, c)
Definition XrdPosix.hh:79
#define stat(a, b)
Definition XrdPosix.hh:96
#define rename(a, b)
Definition XrdPosix.hh:87
#define truncate(a, b)
Definition XrdPosix.hh:106
#define read(a, b, c)
Definition XrdPosix.hh:77
struct myOpts opts
int XrdSfsMode
const char * Arg1
PLUGINO, PLUGION, PLUGXC.
int Arg2Len
Length or -count of args in 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 parms
virtual int autoStat(struct stat *buf)
virtual ~XrdSfsDirectory()
Destructor.
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 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 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 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 gpFile(gpfFunc &gpAct, XrdSfsGPFile &gpReq, XrdOucErrInfo &eInfo, const XrdSecEntity *client=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.
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 checkpoint(cpAct act, struct iov *range=0, int n=0)
virtual ~XrdSfsFile()
Destructor.
@ 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
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 int close()=0
virtual XrdSfsXferSize pgWrite(XrdSfsFileOffset offset, char *buffer, XrdSfsXferSize wrlen, uint32_t *csvec, uint64_t opts=0)
XrdOucEnv * envP
Definition XrdPss.cc:108

◆ SFS_O_CREAT

#define SFS_O_CREAT   0x00000100

Definition at line 53 of file XrdSfsInterface.hh.

◆ SFS_O_DIRLIST

#define SFS_O_DIRLIST   0x00010000

Definition at line 57 of file XrdSfsInterface.hh.

◆ SFS_O_FORCE

#define SFS_O_FORCE   0x00200000

Definition at line 59 of file XrdSfsInterface.hh.

◆ SFS_O_HNAME

#define SFS_O_HNAME   0x00400000

Definition at line 60 of file XrdSfsInterface.hh.

◆ SFS_O_LOCAL

#define SFS_O_LOCAL   0x00800000

Definition at line 61 of file XrdSfsInterface.hh.

◆ SFS_O_LOCATE

#define SFS_O_LOCATE   0x10000000

Definition at line 76 of file XrdSfsInterface.hh.

◆ SFS_O_META

#define SFS_O_META   0x40000000

Definition at line 78 of file XrdSfsInterface.hh.

◆ SFS_O_MKPTH

#define SFS_O_MKPTH   0x00004000

Definition at line 71 of file XrdSfsInterface.hh.

◆ SFS_O_MULTIW

#define SFS_O_MULTIW   0x00000400

Definition at line 55 of file XrdSfsInterface.hh.

◆ SFS_O_NOTPC

#define SFS_O_NOTPC   0x00000800

Definition at line 56 of file XrdSfsInterface.hh.

◆ SFS_O_NOWAIT

#define SFS_O_NOWAIT   0x01000000

Definition at line 62 of file XrdSfsInterface.hh.

◆ SFS_O_POSC

#define SFS_O_POSC   0x00100000

Definition at line 58 of file XrdSfsInterface.hh.

◆ SFS_O_RAWIO

#define SFS_O_RAWIO   0x02000000

Definition at line 63 of file XrdSfsInterface.hh.

◆ SFS_O_RDONLY

#define SFS_O_RDONLY   0

Definition at line 50 of file XrdSfsInterface.hh.

◆ SFS_O_RDWR

#define SFS_O_RDWR   2

Definition at line 52 of file XrdSfsInterface.hh.

◆ SFS_O_REPLICA

#define SFS_O_REPLICA   0x08000000

Definition at line 65 of file XrdSfsInterface.hh.

◆ SFS_O_RESET

#define SFS_O_RESET   0x04000000

Definition at line 64 of file XrdSfsInterface.hh.

◆ SFS_O_SEQIO

#define SFS_O_SEQIO   0x10000000

Definition at line 66 of file XrdSfsInterface.hh.

◆ SFS_O_STAT

#define SFS_O_STAT   0x20000000

Definition at line 77 of file XrdSfsInterface.hh.

◆ SFS_O_TRUNC

#define SFS_O_TRUNC   0x00000200

Definition at line 54 of file XrdSfsInterface.hh.

◆ SFS_O_WRONLY

#define SFS_O_WRONLY   1

Definition at line 51 of file XrdSfsInterface.hh.

◆ SFS_OK

#define SFS_OK   0

Definition at line 108 of file XrdSfsInterface.hh.

◆ SFS_REDIRECT

#define SFS_REDIRECT   -256

Definition at line 110 of file XrdSfsInterface.hh.

◆ SFS_SFIO_FDVAL

#define SFS_SFIO_FDVAL   0x80000000

Definition at line 90 of file XrdSfsInterface.hh.

◆ SFS_STALL

#define SFS_STALL   1

Definition at line 107 of file XrdSfsInterface.hh.

◆ SFS_STARTED

#define SFS_STARTED   -512

Definition at line 111 of file XrdSfsInterface.hh.

Typedef Documentation

◆ XrdSfsFileOffset

typedef long long XrdSfsFileOffset

Definition at line 128 of file XrdSfsInterface.hh.

◆ XrdSfsFileOpenMode

typedef int XrdSfsFileOpenMode

Definition at line 129 of file XrdSfsInterface.hh.

◆ XrdSfsFileSystem2_t

typedef XrdSfsFileSystem *(* XrdSfsFileSystem2_t) (XrdSfsFileSystem *nativeFS, XrdSysLogger *Logger, const char *configFn, XrdOucEnv *envP)

When building a shared library plugin, the following "C" entry point must exist in the library:

Parameters
nativeFS- the filesystem that would have been used. You may return this pointer if you wish.
Logger- The message logging object to be used for messages.
configFn- pointer to the path of the configuration file. If nil there is no configuration file.
envP- Pointer to the environment containing implementation specific information.
Returns
Pointer to the file system object to be used or nil if an error occurred.

extern "C" {XrdSfsFileSystem *XrdSfsGetFileSystem2(XrdSfsFileSystem *nativeFS, XrdSysLogger *Logger, const char *configFn, XrdOucEnv *envP); }

Definition at line 1327 of file XrdSfsInterface.hh.

◆ XrdSfsFileSystem_t

typedef XrdSfsFileSystem *(* XrdSfsFileSystem_t) (XrdSfsFileSystem *nativeFS, XrdSysLogger *Logger, const char *configFn)

The old-style entry-point is still supported as a fallback. Should the version '2' entry point is not found, the system attempts to use the version '1' entry point.

extern "C" {XrdSfsFileSystem *XrdSfsGetFileSystem(XrdSfsFileSystem *nativeFS, XrdSysLogger *Logger, const char *configFn); }

Definition at line 1344 of file XrdSfsInterface.hh.

◆ XrdSfsMode

typedef int XrdSfsMode

Definition at line 130 of file XrdSfsInterface.hh.

◆ XrdSfsXferSize

typedef int XrdSfsXferSize

Definition at line 131 of file XrdSfsInterface.hh.

Enumeration Type Documentation

◆ XrdSfsFileExistence

Enumerator
XrdSfsFileExistNo 
XrdSfsFileExistIsFile 
XrdSfsFileExistIsDirectory 
XrdSfsFileExistIsOffline 
XrdSfsFileExistIsOther 

Definition at line 133 of file XrdSfsInterface.hh.