xrootd
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) 2018 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 <string.h> // For strlcpy()
33 #include <errno.h>
34 #include <cstdint>
35 #include <sys/types.h>
36 #include <sys/stat.h>
37 
38 #include "XrdOuc/XrdOucErrInfo.hh"
39 #include "XrdOuc/XrdOucIOVec.hh"
40 #include "XrdOuc/XrdOucSFVec.hh"
41 
42 #include "XrdSfs/XrdSfsGPFile.hh"
43 
44 #include "XrdSys/XrdSysPageSize.hh"
45 
46 /******************************************************************************/
47 /* O p e n M o d e s */
48 /******************************************************************************/
49 
50 #define SFS_O_RDONLY 0 // open read/only
51 #define SFS_O_WRONLY 1 // open write/only
52 #define SFS_O_RDWR 2 // open read/write
53 #define SFS_O_CREAT 0x00000100 // used for file creation
54 #define SFS_O_TRUNC 0x00000200 // used for file truncation
55 #define SFS_O_MULTIW 0x00000400 // used for multi-write locations
56 #define SFS_O_NOTPC 0x00000800 // used to suppress TPC opens
57 #define SFS_O_DIRLIST 0x00010000 // used for locate only
58 #define SFS_O_POSC 0x00100000 // persist on successful close
59 #define SFS_O_FORCE 0x00200000 // used for locate only
60 #define SFS_O_HNAME 0x00400000 // used for locate only
61 #define SFS_O_LOCAL 0x00800000 // used for locate only (local cmd)
62 #define SFS_O_NOWAIT 0x01000000 // do not impose operational delays
63 #define SFS_O_RAWIO 0x02000000 // allow client-side decompression
64 #define SFS_O_RESET 0x04000000 // Reset any cached information
65 #define SFS_O_REPLICA 0x08000000 // Open for replication
66 
67 // The following flag may be set in the access mode arg for open() & mkdir()
68 // Note that on some systems mode_t is 16-bits so we use a careful value!
69 //
70 #define SFS_O_MKPTH 0x00004000 // Make directory path if missing
71 
72 // The following options are here to provide a uniform clustering interface.
73 // They may be passed through open/locate/stat, as applicable.
74 //
75 #define SFS_O_LOCATE 0x10000000 // This request generated by locate()
76 #define SFS_O_STAT 0x20000000 // This request generated by stat()
77 #define SFS_O_META 0x40000000 // This request generated by metaop
78 
79 /******************************************************************************/
80 /* D e f i n e s */
81 /******************************************************************************/
82 
83 // Common fctl command values (0 to 255)
84 //
85 #define SFS_FCTL_GETFD 1 // Return file descriptor if possible
86 #define SFS_FCTL_STATV 2 // Return visa information
87 #define SFS_FCTL_SPEC1 3 // Return implementation defined information
88 
89 #define SFS_SFIO_FDVAL 0x80000000 // Use SendData() method GETFD response value
90 
91 // Common fsctl command values (0 to 255)
92 //
93 #define SFS_FSCTL_CMD 255
94 
95 #define SFS_FSCTL_LOCATE 1 // Locate a file
96 #define SFS_FSCTL_STATFS 2 // Return FS data
97 #define SFS_FSCTL_STATLS 3 // Return LS data
98 #define SFS_FSCTL_STATXA 4 // Return XA data
99 #define SFS_FSCTL_STATCC 5 // Return Cluster Config status
100 #define SFS_FSCTL_PLUGIN 8 // Return Implementation Dependent Data
101 #define SFS_FSCTL_PLUGIO 16 // Return Implementation Dependent Data
102 
103 // Return values for integer & XrdSfsXferSize returning XrdSfs methods
104 //
105 #define SFS_STALL 1 // Return value -> Seconds to stall client
106 #define SFS_OK 0 // ErrInfo code -> All is well
107 #define SFS_ERROR -1 // ErrInfo code -> Error occurred
108 #define SFS_REDIRECT -256 // ErrInfo code -> Port number to redirect to
109 #define SFS_STARTED -512 // ErrInfo code -> Estimated seconds to completion
110 #define SFS_DATA -1024 // ErrInfo code -> Length of data
111 #define SFS_DATAVEC -2048 // ErrInfo code -> Num iovec elements in msgbuff
112 
113 // The following macros are used for dealing with special local paths
114 //
115 #define SFS_LCLPRFX "/=/"
116 #define SFS_LCLPLEN 3
117 #define SFS_LCLPATH(x) !strncmp(x, SFS_LCLPRFX, SFS_LCLPLEN)
118 #define SFS_LCLPRFY "/="
119 #define SFS_LCLROOT(x) !strncmp(x, SFS_LCLPRFX, SFS_LCLPLEN-1) \
120  && (*(x+SFS_LCLPLEN-1) == '/' || *(x+SFS_LCLPLEN-1) == 0)
121 
122 /******************************************************************************/
123 /* S t r u c t u r e s & T y p e d e f s */
124 /******************************************************************************/
125 
126 typedef long long XrdSfsFileOffset;
127 typedef int XrdSfsFileOpenMode;
128 typedef int XrdSfsMode;
129 typedef int XrdSfsXferSize;
130 
132 {
138 };
139 //------------------------------------------------
140 
141 #define Prep_PRTY0 0
142 #define Prep_PRTY1 1
143 #define Prep_PRTY2 2
144 #define Prep_PRTY3 3
145 #define Prep_PMASK 3
146 #define Prep_SENDAOK 4
147 #define Prep_SENDERR 8
148 #define Prep_SENDACK 12
149 #define Prep_WMODE 16
150 #define Prep_STAGE 32
151 #define Prep_COLOC 64
152 #define Prep_FRESH 128
153 #define Prep_CANCEL 256
154 #define Prep_QUERY 512
155 #define Prep_EVICT 1024
156 
157 class XrdOucTList;
158 
159 struct XrdSfsFSctl
160 {
161  const char *Arg1;
162  int Arg1Len;
163  int Arg2Len;
164  const char *Arg2;
165 };
166 
167 struct XrdSfsPrep
168 {
169  char *reqid;
170  char *notify;
171  int opts;
174 };
175 
176 /******************************************************************************/
177 /* F o r w a r d D e c l a r a t i o n s */
178 /******************************************************************************/
179 
180 class XrdOucEnv;
181 class XrdSecEntity;
182 struct XrdSfsFACtl;
183 
184 /******************************************************************************/
185 /* O b j e c t W r a p p i n g G u i d e */
186 /******************************************************************************/
187 
188 /* The XrdSfsDirectory and XrdSfsFile objects can be wrapped. Wraping can be
189  used to add functionality. The process is common and pretty muche rote.
190  There is only one caveat: all wrappers must use the same XrdOucErrInfo
191  object. This is because the ErrInfo object contains client parameters that
192  are used to control how things are done to be backward compatible. Newer
193  client can then use more efficient internal processing. The SFS provides
194  two ways to make sure the same ErrInfo object is used by all objects in
195  the wrapped chain. Forward propagation (the one typically used) and
196  backward propagation (used in certain unusual cases). In forward mode,
197  the ErrInfo object of the last object in the chain is propagated to the
198  front of the chain. In backward mode the reverse happens. Let's assume
199  the following scenarion. Object-A wraps object-B (the object here can be
200  directory or file object). In forward mode weneed to create objects in
201  reverse order (bottom to top) which is typically what you would do anyway
202  as you need to capture the pinter to the object your wrapping. So, using
203  newFile() as an example where sfsP points to the Interface being wrapped:
204 
205  XrdSfsFile *newFile(const char *user, int MonID)
206  {
207  XrdSfsFile *wrapped_file = sfsP->newFile(user, MonID);
208  if (!wrapped_file) return 0;
209  return new mySfsFile(wrapped_file,...);
210  }
211  class mySfsFile : public XrdSfsFile
212  {public:
213  mySfsFile(XrdSfsFile *wrapped_file,...) : XrdSfsFile(*wrapped_file)
214  {....}
215  ....
216  };
217 
218  Notice we are allocating the wrapped file ahead of the wrapper so that
219  the wrapper can use the ErrInfo object of the wrapped file.
220 
221  In backward mode we want to use the ErrInfo object of the front-most
222  wrapper for all wrappers after it. This mechanism is far more complicated
223  due to error handling requirements. However, it's useful when a wrapped
224  object is not necessarily instantiated to accomplish the needs of the
225  wrapper. An example of this is the newFile and newDir implementations for
226  XrdSsi where wrapped object creation is subject to the resource name.
227 */
228 
229 /******************************************************************************/
230 /* X r d S f s D i r e c t o r y */
231 /******************************************************************************/
232 
233 //------------------------------------------------------------------------------
236 //------------------------------------------------------------------------------
237 
239 {
240 public:
241 
242 //-----------------------------------------------------------------------------
245 //-----------------------------------------------------------------------------
246 
248 
249 //-----------------------------------------------------------------------------
257 //-----------------------------------------------------------------------------
258 
259 virtual int open(const char *path,
260  const XrdSecEntity *client = 0,
261  const char *opaque = 0) = 0;
262 
263 //-----------------------------------------------------------------------------
271 //-----------------------------------------------------------------------------
272 
273 virtual const char *nextEntry() = 0;
274 
275 //-----------------------------------------------------------------------------
279 //-----------------------------------------------------------------------------
280 
281 virtual int close() = 0;
282 
283 //-----------------------------------------------------------------------------
287 //-----------------------------------------------------------------------------
288 
289 virtual const char *FName() = 0;
290 
291 //-----------------------------------------------------------------------------
300 //-----------------------------------------------------------------------------
301 
302 virtual int autoStat(struct stat *buf);
303 
304 //-----------------------------------------------------------------------------
313 //-----------------------------------------------------------------------------
314 
315  XrdSfsDirectory(const char *user=0, int MonID=0)
316  : error(*(new XrdOucErrInfo(user, MonID)))
317  {lclEI = &error;}
318 
319 //-----------------------------------------------------------------------------
325 //-----------------------------------------------------------------------------
326 
328  : error(wrapD.error), lclEI(0) {}
329 
330 //-----------------------------------------------------------------------------
335 //-----------------------------------------------------------------------------
336 
338  : error(eInfo), lclEI(0) {}
339 
340 //-----------------------------------------------------------------------------
342 //-----------------------------------------------------------------------------
343 
344 virtual ~XrdSfsDirectory() {if (lclEI) delete lclEI;}
345 
346 private:
348 
349 }; // class XrdSfsDirectory
350 
351 /******************************************************************************/
352 /* X r d S f s F i l e */
353 /******************************************************************************/
354 
355 //------------------------------------------------------------------------------
358 //------------------------------------------------------------------------------
359 
360 class XrdSfsAio;
361 class XrdSfsDio;
362 class XrdSfsXio;
363 
365 {
366 public:
367 
368 //-----------------------------------------------------------------------------
371 //-----------------------------------------------------------------------------
372 
374 
375 //-----------------------------------------------------------------------------
397 //-----------------------------------------------------------------------------
398 
399 virtual int open(const char *fileName,
400  XrdSfsFileOpenMode openMode,
401  mode_t createMode,
402  const XrdSecEntity *client = 0,
403  const char *opaque = 0) = 0;
404 
405 //-----------------------------------------------------------------------------
426 //-----------------------------------------------------------------------------
427 
428 enum cpAct {cpCreate=0,
433  cpWrite
434  };
435 
436 virtual int checkpoint(cpAct act, struct iov *range=0, int n=0);
437 
438 //-----------------------------------------------------------------------------
442 //-----------------------------------------------------------------------------
443 
444 virtual int close() = 0;
445 
446 //-----------------------------------------------------------------------------
463 //-----------------------------------------------------------------------------
464 
465 virtual int fctl(const int cmd,
466  const char *args,
467  XrdOucErrInfo &eInfo) = 0;
468 
469 //-----------------------------------------------------------------------------
482 //-----------------------------------------------------------------------------
483 
484 virtual int fctl(const int cmd,
485  int alen,
486  const char *args,
487  const XrdSecEntity *client = 0);
488 
489 //-----------------------------------------------------------------------------
493 //-----------------------------------------------------------------------------
494 
495 virtual const char *FName() = 0;
496 
497 //-----------------------------------------------------------------------------
504 //-----------------------------------------------------------------------------
505 
506 virtual int getMmap(void **Addr, off_t &Size) = 0;
507 
508 //-----------------------------------------------------------------------------
510 //-----------------------------------------------------------------------------
511 
512 static const uint64_t
513 Verify = 0x8000000000000000ULL;
514 static const uint64_t
515 NetOrder = 0x4000000000000000ULL;
516 
517 //-----------------------------------------------------------------------------
532 //-----------------------------------------------------------------------------
533 
535  char *buffer,
536  XrdSfsXferSize rdlen,
537  uint32_t *csvec,
538  uint64_t opts=0);
539 
540 //-----------------------------------------------------------------------------
548 //-----------------------------------------------------------------------------
549 
550 virtual int pgRead(XrdSfsAio *aioparm, uint64_t opts=0);
551 
552 //-----------------------------------------------------------------------------
568 //-----------------------------------------------------------------------------
569 
571  char *buffer,
572  XrdSfsXferSize wrlen,
573  uint32_t *csvec,
574  uint64_t opts=0);
575 
576 //-----------------------------------------------------------------------------
584 //-----------------------------------------------------------------------------
585 
586 virtual int pgWrite(XrdSfsAio *aioparm, uint64_t opts=0);
587 
588 //-----------------------------------------------------------------------------
596 //-----------------------------------------------------------------------------
597 
599  XrdSfsXferSize size) = 0;
600 
601 //-----------------------------------------------------------------------------
610 //-----------------------------------------------------------------------------
611 
613  char *buffer,
614  XrdSfsXferSize size) = 0;
615 
616 //-----------------------------------------------------------------------------
623 //-----------------------------------------------------------------------------
624 
625 virtual int read(XrdSfsAio *aioparm) = 0;
626 
627 //-----------------------------------------------------------------------------
637 //-----------------------------------------------------------------------------
638 
640  int rdvCnt);
641 
642 //-----------------------------------------------------------------------------
652 //-----------------------------------------------------------------------------
653 
654 virtual int SendData(XrdSfsDio *sfDio,
655  XrdSfsFileOffset offset,
656  XrdSfsXferSize size);
657 
658 //-----------------------------------------------------------------------------
667 //-----------------------------------------------------------------------------
668 
670  const char *buffer,
671  XrdSfsXferSize size) = 0;
672 
673 //-----------------------------------------------------------------------------
680 //-----------------------------------------------------------------------------
681 
682 virtual int write(XrdSfsAio *aioparm) = 0;
683 
684 //-----------------------------------------------------------------------------
694 //-----------------------------------------------------------------------------
695 
697  int wdvCnt);
698 
699 //-----------------------------------------------------------------------------
706 //-----------------------------------------------------------------------------
707 
708 virtual int stat(struct stat *buf) = 0;
709 
710 //-----------------------------------------------------------------------------
714 //-----------------------------------------------------------------------------
715 
716 virtual int sync() = 0;
717 
718 //-----------------------------------------------------------------------------
723 //-----------------------------------------------------------------------------
724 
725 virtual int sync(XrdSfsAio *aiop) = 0;
726 
727 //-----------------------------------------------------------------------------
733 //-----------------------------------------------------------------------------
734 
735 virtual int truncate(XrdSfsFileOffset fsize) = 0;
736 
737 //-----------------------------------------------------------------------------
745 //-----------------------------------------------------------------------------
746 
747 virtual int getCXinfo(char cxtype[4], int &cxrsz) = 0;
748 
749 //-----------------------------------------------------------------------------
753 //-----------------------------------------------------------------------------
754 
755 virtual void setXio(XrdSfsXio *xioP) { (void)xioP; }
756 
757 //-----------------------------------------------------------------------------
766 //-----------------------------------------------------------------------------
767 
768  XrdSfsFile(const char *user=0, int MonID=0)
769  : error(*(new XrdOucErrInfo(user, MonID)))
770  {lclEI = &error; pgwrEOF = 0;}
771 
772 //-----------------------------------------------------------------------------
778 //-----------------------------------------------------------------------------
779 
781  : error(wrapF.error), lclEI(0), pgwrEOF(0) {}
782 
783 //-----------------------------------------------------------------------------
788 //-----------------------------------------------------------------------------
789 
791  : error(eInfo), lclEI(0), pgwrEOF(0) {}
792 
793 //-----------------------------------------------------------------------------
795 //-----------------------------------------------------------------------------
796 
797 virtual ~XrdSfsFile() {if (lclEI) delete lclEI;}
798 
799 private:
802 }; // class XrdSfsFile
803 
804 /******************************************************************************/
805 /* X r d S f s F i l e S y s t e m */
806 /******************************************************************************/
807 
808 //-----------------------------------------------------------------------------
832 //-----------------------------------------------------------------------------
833 
835 {
836 public:
837 
838 //-----------------------------------------------------------------------------
848 //-----------------------------------------------------------------------------
849 
850 virtual XrdSfsDirectory *newDir(char *user=0, int MonID=0) = 0;
851 
852 //-----------------------------------------------------------------------------
863 //-----------------------------------------------------------------------------
864 
865 virtual XrdSfsDirectory *newDir(XrdOucErrInfo &eInfo) {(void)eInfo; return 0;}
866 
867 //-----------------------------------------------------------------------------
877 //-----------------------------------------------------------------------------
878 
879 virtual XrdSfsFile *newFile(char *user=0, int MonID=0) = 0;
880 
881 //-----------------------------------------------------------------------------
892 //-----------------------------------------------------------------------------
893 
894 virtual XrdSfsFile *newFile(XrdOucErrInfo &eInfo) {(void)eInfo; return 0;}
895 
896 //-----------------------------------------------------------------------------
915 //-----------------------------------------------------------------------------
916 
917 enum csFunc {csCalc = 0, csGet, csSize};
918 
919 virtual int chksum( csFunc Func,
920  const char *csName,
921  const char *path,
922  XrdOucErrInfo &eInfo,
923  const XrdSecEntity *client = 0,
924  const char *opaque = 0);
925 
926 //-----------------------------------------------------------------------------
936 //-----------------------------------------------------------------------------
937 
938 virtual int chmod(const char *path,
939  XrdSfsMode mode,
940  XrdOucErrInfo &eInfo,
941  const XrdSecEntity *client = 0,
942  const char *opaque = 0) = 0;
943 
944 //-----------------------------------------------------------------------------
948 //-----------------------------------------------------------------------------
949 
950 virtual void Connect(const XrdSecEntity *client = 0)
951 {
952  (void)client;
953 }
954 
955 //-----------------------------------------------------------------------------
959 //-----------------------------------------------------------------------------
960 
961 virtual void Disc(const XrdSecEntity *client = 0) {(void)client;}
962 
963 //-----------------------------------------------------------------------------
968 //-----------------------------------------------------------------------------
969 
970 virtual void EnvInfo(XrdOucEnv *envP) {(void)envP;}
971 
972 //-----------------------------------------------------------------------------
988 //-----------------------------------------------------------------------------
989 
990 virtual int exists(const char *path,
991  XrdSfsFileExistence &eFlag,
992  XrdOucErrInfo &eInfo,
993  const XrdSecEntity *client = 0,
994  const char *opaque = 0) = 0;
995 
996 //-----------------------------------------------------------------------------
1010 //-----------------------------------------------------------------------------
1011 
1012 virtual int FAttr( XrdSfsFACtl *faReq,
1013  XrdOucErrInfo &eInfo,
1014  const XrdSecEntity *client = 0);
1015 
1016 //-----------------------------------------------------------------------------
1021 //-----------------------------------------------------------------------------
1022 
1023  uint64_t Features() {return FeatureSet;}
1024 
1025 //-----------------------------------------------------------------------------
1041 //-----------------------------------------------------------------------------
1042 
1043 virtual int FSctl(const int cmd,
1044  XrdSfsFSctl &args,
1045  XrdOucErrInfo &eInfo,
1046  const XrdSecEntity *client = 0);
1047 
1048 //-----------------------------------------------------------------------------
1076 //-----------------------------------------------------------------------------
1077 
1078 virtual int fsctl(const int cmd,
1079  const char *args,
1080  XrdOucErrInfo &eInfo,
1081  const XrdSecEntity *client = 0) = 0;
1082 
1083 //-----------------------------------------------------------------------------
1087 //-----------------------------------------------------------------------------
1088 
1089 virtual int getChkPSize() {return 0;}
1090 
1091 //-----------------------------------------------------------------------------
1101 //-----------------------------------------------------------------------------
1102 
1103 virtual int getStats(char *buff, int blen) = 0;
1104 
1105 //-----------------------------------------------------------------------------
1109 //-----------------------------------------------------------------------------
1110 
1111 virtual const char *getVersion() = 0;
1112 
1113 //-----------------------------------------------------------------------------
1124 //-----------------------------------------------------------------------------
1125 
1128  gpfPut
1129  };
1130 
1131 virtual int gpFile( gpfFunc &gpAct,
1132  XrdSfsGPFile &gpReq,
1133  XrdOucErrInfo &eInfo,
1134  const XrdSecEntity *client = 0);
1135 
1136 //-----------------------------------------------------------------------------
1146 //-----------------------------------------------------------------------------
1147 
1148 virtual int mkdir(const char *path,
1149  XrdSfsMode mode,
1150  XrdOucErrInfo &eInfo,
1151  const XrdSecEntity *client = 0,
1152  const char *opaque = 0) = 0;
1153 
1154 //-----------------------------------------------------------------------------
1162 //-----------------------------------------------------------------------------
1163 
1164 virtual int prepare( XrdSfsPrep &pargs,
1165  XrdOucErrInfo &eInfo,
1166  const XrdSecEntity *client = 0) = 0;
1167 
1168 //-----------------------------------------------------------------------------
1177 //-----------------------------------------------------------------------------
1178 
1179 virtual int rem(const char *path,
1180  XrdOucErrInfo &eInfo,
1181  const XrdSecEntity *client = 0,
1182  const char *opaque = 0) = 0;
1183 
1184 //-----------------------------------------------------------------------------
1193 //-----------------------------------------------------------------------------
1194 
1195 virtual int remdir(const char *path,
1196  XrdOucErrInfo &eInfo,
1197  const XrdSecEntity *client = 0,
1198  const char *opaque = 0) = 0;
1199 
1200 //-----------------------------------------------------------------------------
1211 //-----------------------------------------------------------------------------
1212 
1213 virtual int rename(const char *oPath,
1214  const char *nPath,
1215  XrdOucErrInfo &eInfo,
1216  const XrdSecEntity *client = 0,
1217  const char *opaqueO = 0,
1218  const char *opaqueN = 0) = 0;
1219 
1220 //-----------------------------------------------------------------------------
1231 //-----------------------------------------------------------------------------
1232 
1233 virtual int stat(const char *Name,
1234  struct stat *buf,
1235  XrdOucErrInfo &eInfo,
1236  const XrdSecEntity *client = 0,
1237  const char *opaque = 0) = 0;
1238 
1239 //-----------------------------------------------------------------------------
1251 //-----------------------------------------------------------------------------
1252 
1253 virtual int stat(const char *path,
1254  mode_t &mode,
1255  XrdOucErrInfo &eInfo,
1256  const XrdSecEntity *client = 0,
1257  const char *opaque = 0) = 0;
1258 
1259 //-----------------------------------------------------------------------------
1269 //-----------------------------------------------------------------------------
1270 
1271 virtual int truncate(const char *path,
1272  XrdSfsFileOffset fsize,
1273  XrdOucErrInfo &eInfo,
1274  const XrdSecEntity *client = 0,
1275  const char *opaque = 0) = 0;
1276 
1277 //-----------------------------------------------------------------------------
1279 //-----------------------------------------------------------------------------
1280 
1282 virtual ~XrdSfsFileSystem() {}
1283 
1284 protected:
1285 
1286 uint64_t FeatureSet;
1287 };
1288 
1289 /******************************************************************************/
1290 /* F i l e S y s t e m I n s t a n t i a t o r */
1291 /******************************************************************************/
1292 
1293 //-----------------------------------------------------------------------------
1316 typedef XrdSfsFileSystem *(*XrdSfsFileSystem2_t)(XrdSfsFileSystem *nativeFS,
1317  XrdSysLogger *Logger,
1318  const char *configFn,
1319  XrdOucEnv *envP);
1320 
1321 //-----------------------------------------------------------------------------
1333 typedef XrdSfsFileSystem *(*XrdSfsFileSystem_t) (XrdSfsFileSystem *nativeFS,
1334  XrdSysLogger *Logger,
1335  const char *configFn);
1336 
1337 //------------------------------------------------------------------------------
1349 //------------------------------------------------------------------------------
1350 #endif
XrdSfsPrep::opts
int opts
Prep_xxx.
Definition: XrdSfsInterface.hh:171
XrdSfsFileSystem::getChkPSize
virtual int getChkPSize()
Definition: XrdSfsInterface.hh:1089
XrdSfsDirectory::FName
virtual const char * FName()=0
XrdSfsFileSystem::csSize
@ csSize
Definition: XrdSfsInterface.hh:917
XrdSfsXio
Definition: XrdSfsXio.hh:55
XrdSfsFileSystem::gpFile
virtual int gpFile(gpfFunc &gpAct, XrdSfsGPFile &gpReq, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0)
XrdSfsFileSystem::stat
virtual int stat(const char *path, mode_t &mode, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaque=0)=0
XrdSfsFileExistIsDirectory
@ XrdSfsFileExistIsDirectory
Definition: XrdSfsInterface.hh:135
XrdSfsDirectory::nextEntry
virtual const char * nextEntry()=0
XrdSfsFile::cpWrite
@ cpWrite
Add data to an existing checkpoint.
Definition: XrdSfsInterface.hh:433
XrdSfsFile::readv
virtual XrdSfsXferSize readv(XrdOucIOVec *readV, int rdvCnt)
XrdSfsFileSystem::truncate
virtual int truncate(const char *path, XrdSfsFileOffset fsize, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaque=0)=0
XrdSfsFileSystem::rename
virtual int rename(const char *oPath, const char *nPath, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaqueO=0, const char *opaqueN=0)=0
XrdSfsFile::cpDelete
@ cpDelete
Delete an existing checkpoint.
Definition: XrdSfsInterface.hh:429
XrdSfsFileSystem
Definition: XrdSfsInterface.hh:835
XrdSfsFile::sync
virtual int sync()=0
XrdSfsFile::pgRead
virtual int pgRead(XrdSfsAio *aioparm, uint64_t opts=0)
XrdSfsFile::cpRestore
@ cpRestore
Restore an active checkpoint and delete it.
Definition: XrdSfsInterface.hh:430
XrdSfsFileSystem::csFunc
csFunc
Definition: XrdSfsInterface.hh:917
XrdSfsFileSystem::Disc
virtual void Disc(const XrdSecEntity *client=0)
Definition: XrdSfsInterface.hh:961
XrdSfsFileSystem::csCalc
@ csCalc
Definition: XrdSfsInterface.hh:917
XrdSfsFileSystem::getVersion
virtual const char * getVersion()=0
XrdSfsPrep::notify
char * notify
Notification path or 0.
Definition: XrdSfsInterface.hh:170
XrdSfsFile::write
virtual XrdSfsXferSize write(XrdSfsFileOffset offset, const char *buffer, XrdSfsXferSize size)=0
XrdSfsFileSystem::mkdir
virtual int mkdir(const char *path, XrdSfsMode mode, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaque=0)=0
XrdSfsXferSize
int XrdSfsXferSize
Definition: XrdSfsInterface.hh:129
XrdSfsFileSystem::csGet
@ csGet
Definition: XrdSfsInterface.hh:917
XrdSfsFileExistence
XrdSfsFileExistence
Definition: XrdSfsInterface.hh:132
XrdSfsDirectory::~XrdSfsDirectory
virtual ~XrdSfsDirectory()
Destructor.
Definition: XrdSfsInterface.hh:344
XrdSfsFile::XrdSfsFile
XrdSfsFile(const char *user=0, int MonID=0)
Definition: XrdSfsInterface.hh:768
XrdSfsFile::pgRead
virtual XrdSfsXferSize pgRead(XrdSfsFileOffset offset, char *buffer, XrdSfsXferSize rdlen, uint32_t *csvec, uint64_t opts=0)
XrdOucErrInfo.hh
XrdSfsFileSystem::remdir
virtual int remdir(const char *path, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaque=0)=0
XrdSfsFile
Definition: XrdSfsInterface.hh:365
XrdSfsFileOffset
long long XrdSfsFileOffset
Definition: XrdSfsInterface.hh:126
XrdSfsFile::NetOrder
static const uint64_t NetOrder
all: bytes in/out in net byte order
Definition: XrdSfsInterface.hh:515
XrdSfsFileSystem::Features
uint64_t Features()
Definition: XrdSfsInterface.hh:1023
XrdOucIOVec
Definition: XrdOucIOVec.hh:41
XrdSfsFile::Verify
static const uint64_t Verify
Options for pgRead() and pgWrite() as noted below.
Definition: XrdSfsInterface.hh:513
XrdSfsFile::XrdSfsFile
XrdSfsFile(XrdSfsFile &wrapF)
Definition: XrdSfsInterface.hh:780
XrdSfsFileExistIsFile
@ XrdSfsFileExistIsFile
Definition: XrdSfsInterface.hh:134
XrdSfsDirectory::close
virtual int close()=0
XrdSfsFile::cpTrunc
@ cpTrunc
Truncate a file within checkpoint.
Definition: XrdSfsInterface.hh:432
XrdSfsFileSystem::FAttr
virtual int FAttr(XrdSfsFACtl *faReq, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0)
XrdSfsFile::error
XrdOucErrInfo & error
Definition: XrdSfsInterface.hh:373
XrdSfsFileSystem::fsctl
virtual int fsctl(const int cmd, const char *args, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0)=0
XrdSfsDirectory::XrdSfsDirectory
XrdSfsDirectory(const char *user=0, int MonID=0)
Definition: XrdSfsInterface.hh:315
XrdSfsFileSystem::FeatureSet
uint64_t FeatureSet
Adjust features at initialization.
Definition: XrdSfsInterface.hh:1286
XrdSfsFile::~XrdSfsFile
virtual ~XrdSfsFile()
Destructor.
Definition: XrdSfsInterface.hh:797
XrdSfsFSctl::Arg1
const char * Arg1
PLUGIO, PLUGIN.
Definition: XrdSfsInterface.hh:161
XrdSfsDirectory::autoStat
virtual int autoStat(struct stat *buf)
XrdSfsFile::cpCreate
@ cpCreate
Create a checkpoint, one must not be active.
Definition: XrdSfsInterface.hh:428
XrdSfsFile::stat
virtual int stat(struct stat *buf)=0
XrdOucSFVec.hh
XrdSfsDirectory
Definition: XrdSfsInterface.hh:239
XrdSfsFileSystem::gpfGet
@ gpfGet
Perform a file retrieval.
Definition: XrdSfsInterface.hh:1127
XrdSfsFileSystem::chmod
virtual int chmod(const char *path, XrdSfsMode mode, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaque=0)=0
XrdSfsGPFile
Definition: XrdSfsGPFile.hh:35
XrdOucEnv
Definition: XrdOucEnv.hh:42
XrdSfsFSctl::Arg2
const char * Arg2
PLUGIN opaque string.
Definition: XrdSfsInterface.hh:164
XrdOucIOVec.hh
XrdSfsFile::writev
virtual XrdSfsXferSize writev(XrdOucIOVec *writeV, int wdvCnt)
XrdSfsFileSystem::gpfPut
@ gpfPut
Perform a file push.
Definition: XrdSfsInterface.hh:1128
XrdSfsFileSystem::XrdSfsFileSystem
XrdSfsFileSystem()
Constructor and Destructor.
XrdSfsFile::SendData
virtual int SendData(XrdSfsDio *sfDio, XrdSfsFileOffset offset, XrdSfsXferSize size)
XrdSfsFileSystem::~XrdSfsFileSystem
virtual ~XrdSfsFileSystem()
Definition: XrdSfsInterface.hh:1282
XrdSfsFileSystem::exists
virtual int exists(const char *path, XrdSfsFileExistence &eFlag, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaque=0)=0
XrdSfsFSctl::Arg2Len
int Arg2Len
Length.
Definition: XrdSfsInterface.hh:163
XrdSfsFileSystem::newDir
virtual XrdSfsDirectory * newDir(XrdOucErrInfo &eInfo)
Definition: XrdSfsInterface.hh:865
XrdSfsFileExistIsOffline
@ XrdSfsFileExistIsOffline
Definition: XrdSfsInterface.hh:136
XrdSysLogger
Definition: XrdSysLogger.hh:53
XrdSfsFile::setXio
virtual void setXio(XrdSfsXio *xioP)
Definition: XrdSfsInterface.hh:755
XrdSfsFileExistNo
@ XrdSfsFileExistNo
Definition: XrdSfsInterface.hh:133
XrdSfsDirectory::XrdSfsDirectory
XrdSfsDirectory(XrdSfsDirectory &wrapD)
Definition: XrdSfsInterface.hh:327
XrdSfsFileSystem::newFile
virtual XrdSfsFile * newFile(XrdOucErrInfo &eInfo)
Definition: XrdSfsInterface.hh:894
XrdSfsFile::fctl
virtual int fctl(const int cmd, const char *args, XrdOucErrInfo &eInfo)=0
iov
Definition: XrdOucIOVec.hh:65
XrdSfsFileSystem::rem
virtual int rem(const char *path, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaque=0)=0
XrdSfsMode
int XrdSfsMode
Definition: XrdSfsInterface.hh:128
XrdSfsFile::read
virtual int read(XrdSfsAio *aioparm)=0
XrdSysPageSize.hh
XrdSfsFile::write
virtual int write(XrdSfsAio *aioparm)=0
XrdSfsFile::pgwrEOF
XrdSfsFileOffset pgwrEOF
Definition: XrdSfsInterface.hh:801
XrdSfsFACtl
Definition: XrdSfsFAttr.hh:73
XrdSfsPrep::paths
XrdOucTList * paths
List of paths.
Definition: XrdSfsInterface.hh:172
XrdSfsDirectory::open
virtual int open(const char *path, const XrdSecEntity *client=0, const char *opaque=0)=0
XrdSfsFile::cpAct
cpAct
Definition: XrdSfsInterface.hh:428
XrdSfsFile::sync
virtual int sync(XrdSfsAio *aiop)=0
XrdSfsFileSystem::chksum
virtual int chksum(csFunc Func, const char *csName, const char *path, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaque=0)
XrdSfsPrep
< Prepare parameters
Definition: XrdSfsInterface.hh:168
XrdSfsFile::read
virtual XrdSfsXferSize read(XrdSfsFileOffset offset, XrdSfsXferSize size)=0
XrdSfsFileSystem::stat
virtual int stat(const char *Name, struct stat *buf, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaque=0)=0
XrdSfsFile::checkpoint
virtual int checkpoint(cpAct act, struct iov *range=0, int n=0)
XrdSfsPrep::reqid
char * reqid
Request ID.
Definition: XrdSfsInterface.hh:169
XrdSfsGPFile.hh
XrdSfsFileSystem::newDir
virtual XrdSfsDirectory * newDir(char *user=0, int MonID=0)=0
XrdSfsFileOpenMode
int XrdSfsFileOpenMode
Definition: XrdSfsInterface.hh:127
XrdSfsFSctl::Arg1Len
int Arg1Len
Length.
Definition: XrdSfsInterface.hh:162
XrdSfsDio
Definition: XrdSfsDio.hh:47
XrdSfsFileSystem::getStats
virtual int getStats(char *buff, int blen)=0
XrdSecEntity
Definition: XrdSecEntity.hh:64
XrdSfsFile::XrdSfsFile
XrdSfsFile(XrdOucErrInfo &eInfo)
Definition: XrdSfsInterface.hh:790
XrdSfsAio
Definition: XrdSfsAio.hh:59
XrdSfsFSctl
< SFS_FSCTL_PLUGIN/PLUGIO parms
Definition: XrdSfsInterface.hh:160
XrdOucErrInfo
Definition: XrdOucErrInfo.hh:99
XrdSfsFileSystem::newFile
virtual XrdSfsFile * newFile(char *user=0, int MonID=0)=0
XrdSfsFile::truncate
virtual int truncate(XrdSfsFileOffset fsize)=0
stat
#define stat(a, b)
Definition: XrdPosix.hh:96
XrdSfsFile::pgWrite
virtual XrdSfsXferSize pgWrite(XrdSfsFileOffset offset, char *buffer, XrdSfsXferSize wrlen, uint32_t *csvec, uint64_t opts=0)
XrdSfsFile::getCXinfo
virtual int getCXinfo(char cxtype[4], int &cxrsz)=0
XrdSfsFileSystem::EnvInfo
virtual void EnvInfo(XrdOucEnv *envP)
Definition: XrdSfsInterface.hh:970
XrdSfsFile::cpQuery
@ cpQuery
Return checkpoint limits.
Definition: XrdSfsInterface.hh:431
XrdSfsDirectory::XrdSfsDirectory
XrdSfsDirectory(XrdOucErrInfo &eInfo)
Definition: XrdSfsInterface.hh:337
XrdSfsFile::close
virtual int close()=0
XrdSfsFileSystem::prepare
virtual int prepare(XrdSfsPrep &pargs, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0)=0
XrdSfsDirectory::error
XrdOucErrInfo & error
Definition: XrdSfsInterface.hh:247
XrdSfsFile::read
virtual XrdSfsXferSize read(XrdSfsFileOffset offset, char *buffer, XrdSfsXferSize size)=0
XrdSfsFile::FName
virtual const char * FName()=0
XrdSfsFile::lclEI
XrdOucErrInfo * lclEI
Definition: XrdSfsInterface.hh:800
XrdSfsFileExistIsOther
@ XrdSfsFileExistIsOther
Definition: XrdSfsInterface.hh:137
XrdSfsPrep::oinfo
XrdOucTList * oinfo
1-to-1 correspondence of opaque info
Definition: XrdSfsInterface.hh:173
XrdSfsFile::getMmap
virtual int getMmap(void **Addr, off_t &Size)=0
XrdSfsFileSystem::gpfCancel
@ gpfCancel
Cancel this request.
Definition: XrdSfsInterface.hh:1126
XrdSfsDirectory::lclEI
XrdOucErrInfo * lclEI
Definition: XrdSfsInterface.hh:347
XrdSfsFileSystem::gpfFunc
gpfFunc
Definition: XrdSfsInterface.hh:1126
XrdSfsFileSystem::FSctl
virtual int FSctl(const int cmd, XrdSfsFSctl &args, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0)
XrdSfsFile::pgWrite
virtual int pgWrite(XrdSfsAio *aioparm, uint64_t opts=0)
XrdSfsFile::open
virtual int open(const char *fileName, XrdSfsFileOpenMode openMode, mode_t createMode, const XrdSecEntity *client=0, const char *opaque=0)=0
XrdOucTList
Definition: XrdOucTList.hh:42
XrdSfsFileSystem::Connect
virtual void Connect(const XrdSecEntity *client=0)
Definition: XrdSfsInterface.hh:950