00001 #ifndef __SFS_INTERFACE_H__ 00002 #define __SFS_INTERFACE_H__ 00003 /******************************************************************************/ 00004 /* */ 00005 /* X r d S f s I n t e r f a c e . h h */ 00006 /* */ 00007 /* (c) 2018 by the Board of Trustees of the Leland Stanford, Jr., University */ 00008 /* Produced by Andrew Hanushevsky for Stanford University under contract */ 00009 /* DE-AC02-76-SFO0515 with the Department of Energy */ 00010 /* */ 00011 /* This file is part of the XRootD software suite. */ 00012 /* */ 00013 /* XRootD is free software: you can redistribute it and/or modify it under */ 00014 /* the terms of the GNU Lesser General Public License as published by the */ 00015 /* Free Software Foundation, either version 3 of the License, or (at your */ 00016 /* option) any later version. */ 00017 /* */ 00018 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */ 00019 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */ 00020 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */ 00021 /* License for more details. */ 00022 /* */ 00023 /* You should have received a copy of the GNU Lesser General Public License */ 00024 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */ 00025 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */ 00026 /* */ 00027 /* The copyright holder's institutional names and contributor's names may not */ 00028 /* be used to endorse or promote products derived from this software without */ 00029 /* specific prior written permission of the institution or contributor. */ 00030 /******************************************************************************/ 00031 00032 #include <string.h> // For strlcpy() 00033 #include <errno.h> 00034 #include <cstdint> 00035 #include <sys/types.h> 00036 #include <sys/stat.h> 00037 00038 #include "XrdOuc/XrdOucErrInfo.hh" 00039 #include "XrdOuc/XrdOucIOVec.hh" 00040 #include "XrdOuc/XrdOucSFVec.hh" 00041 00042 #include "XrdSfs/XrdSfsGPFile.hh" 00043 00044 #include "XrdSys/XrdSysPageSize.hh" 00045 00046 /******************************************************************************/ 00047 /* O p e n M o d e s */ 00048 /******************************************************************************/ 00049 00050 #define SFS_O_RDONLY 0 // open read/only 00051 #define SFS_O_WRONLY 1 // open write/only 00052 #define SFS_O_RDWR 2 // open read/write 00053 #define SFS_O_CREAT 0x00000100 // used for file creation 00054 #define SFS_O_TRUNC 0x00000200 // used for file truncation 00055 #define SFS_O_MULTIW 0x00000400 // used for multi-write locations 00056 #define SFS_O_NOTPC 0x00000800 // used to suppress TPC opens 00057 #define SFS_O_DIRLIST 0x00010000 // used for locate only 00058 #define SFS_O_POSC 0x00100000 // persist on successful close 00059 #define SFS_O_FORCE 0x00200000 // used for locate only 00060 #define SFS_O_HNAME 0x00400000 // used for locate only 00061 #define SFS_O_LOCAL 0x00800000 // used for locate only (local cmd) 00062 #define SFS_O_NOWAIT 0x01000000 // do not impose operational delays 00063 #define SFS_O_RAWIO 0x02000000 // allow client-side decompression 00064 #define SFS_O_RESET 0x04000000 // Reset any cached information 00065 #define SFS_O_REPLICA 0x08000000 // Open for replication 00066 00067 // The following flag may be set in the access mode arg for open() & mkdir() 00068 // Note that on some systems mode_t is 16-bits so we use a careful value! 00069 // 00070 #define SFS_O_MKPTH 0x00004000 // Make directory path if missing 00071 00072 // The following options are here to provide a uniform clustering interface. 00073 // They may be passed through open/locate/stat, as applicable. 00074 // 00075 #define SFS_O_LOCATE 0x10000000 // This request generated by locate() 00076 #define SFS_O_STAT 0x20000000 // This request generated by stat() 00077 #define SFS_O_META 0x40000000 // This request generated by metaop 00078 00079 /******************************************************************************/ 00080 /* D e f i n e s */ 00081 /******************************************************************************/ 00082 00083 // Common fctl command values (0 to 255) 00084 // 00085 #define SFS_FCTL_GETFD 1 // Return file descriptor if possible 00086 #define SFS_FCTL_STATV 2 // Return visa information 00087 #define SFS_FCTL_SPEC1 3 // Return implementation defined information 00088 00089 #define SFS_SFIO_FDVAL 0x80000000 // Use SendData() method GETFD response value 00090 00091 // Common fsctl command values (0 to 255) 00092 // 00093 #define SFS_FSCTL_CMD 255 00094 00095 #define SFS_FSCTL_LOCATE 1 // Locate a file 00096 #define SFS_FSCTL_STATFS 2 // Return FS data 00097 #define SFS_FSCTL_STATLS 3 // Return LS data 00098 #define SFS_FSCTL_STATXA 4 // Return XA data 00099 #define SFS_FSCTL_STATCC 5 // Return Cluster Config status 00100 #define SFS_FSCTL_PLUGIN 8 // Return Implementation Dependent Data 00101 #define SFS_FSCTL_PLUGIO 16 // Return Implementation Dependent Data 00102 00103 // Return values for integer & XrdSfsXferSize returning XrdSfs methods 00104 // 00105 #define SFS_STALL 1 // Return value -> Seconds to stall client 00106 #define SFS_OK 0 // ErrInfo code -> All is well 00107 #define SFS_ERROR -1 // ErrInfo code -> Error occurred 00108 #define SFS_REDIRECT -256 // ErrInfo code -> Port number to redirect to 00109 #define SFS_STARTED -512 // ErrInfo code -> Estimated seconds to completion 00110 #define SFS_DATA -1024 // ErrInfo code -> Length of data 00111 #define SFS_DATAVEC -2048 // ErrInfo code -> Num iovec elements in msgbuff 00112 00113 // The following macros are used for dealing with special local paths 00114 // 00115 #define SFS_LCLPRFX "/=/" 00116 #define SFS_LCLPLEN 3 00117 #define SFS_LCLPATH(x) !strncmp(x, SFS_LCLPRFX, SFS_LCLPLEN) 00118 #define SFS_LCLPRFY "/=" 00119 #define SFS_LCLROOT(x) !strncmp(x, SFS_LCLPRFX, SFS_LCLPLEN-1) \ 00120 && (*(x+SFS_LCLPLEN-1) == '/' || *(x+SFS_LCLPLEN-1) == 0) 00121 00122 /******************************************************************************/ 00123 /* S t r u c t u r e s & T y p e d e f s */ 00124 /******************************************************************************/ 00125 00126 typedef long long XrdSfsFileOffset; 00127 typedef int XrdSfsFileOpenMode; 00128 typedef int XrdSfsMode; 00129 typedef int XrdSfsXferSize; 00130 00131 enum XrdSfsFileExistence 00132 { 00133 XrdSfsFileExistNo, 00134 XrdSfsFileExistIsFile, 00135 XrdSfsFileExistIsDirectory, 00136 XrdSfsFileExistIsOffline, 00137 XrdSfsFileExistIsOther 00138 }; 00139 //------------------------------------------------ 00140 00141 #define Prep_PRTY0 0 00142 #define Prep_PRTY1 1 00143 #define Prep_PRTY2 2 00144 #define Prep_PRTY3 3 00145 #define Prep_PMASK 3 00146 #define Prep_SENDAOK 4 00147 #define Prep_SENDERR 8 00148 #define Prep_SENDACK 12 00149 #define Prep_WMODE 16 00150 #define Prep_STAGE 32 00151 #define Prep_COLOC 64 00152 #define Prep_FRESH 128 00153 #define Prep_CANCEL 256 00154 #define Prep_QUERY 512 00155 #define Prep_EVICT 1024 00156 00157 class XrdOucTList; 00158 00159 struct XrdSfsFSctl 00160 { 00161 const char *Arg1; 00162 int Arg1Len; 00163 int Arg2Len; 00164 const char *Arg2; 00165 }; 00166 00167 struct XrdSfsPrep 00168 { 00169 char *reqid; 00170 char *notify; 00171 int opts; 00172 XrdOucTList *paths; 00173 XrdOucTList *oinfo; 00174 }; 00175 00176 /******************************************************************************/ 00177 /* F o r w a r d D e c l a r a t i o n s */ 00178 /******************************************************************************/ 00179 00180 class XrdOucEnv; 00181 class XrdSecEntity; 00182 struct XrdSfsFACtl; 00183 00184 /******************************************************************************/ 00185 /* O b j e c t W r a p p i n g G u i d e */ 00186 /******************************************************************************/ 00187 00188 /* The XrdSfsDirectory and XrdSfsFile objects can be wrapped. Wraping can be 00189 used to add functionality. The process is common and pretty muche rote. 00190 There is only one caveat: all wrappers must use the same XrdOucErrInfo 00191 object. This is because the ErrInfo object contains client parameters that 00192 are used to control how things are done to be backward compatible. Newer 00193 client can then use more efficient internal processing. The SFS provides 00194 two ways to make sure the same ErrInfo object is used by all objects in 00195 the wrapped chain. Forward propagation (the one typically used) and 00196 backward propagation (used in certain unusual cases). In forward mode, 00197 the ErrInfo object of the last object in the chain is propagated to the 00198 front of the chain. In backward mode the reverse happens. Let's assume 00199 the following scenarion. Object-A wraps object-B (the object here can be 00200 directory or file object). In forward mode weneed to create objects in 00201 reverse order (bottom to top) which is typically what you would do anyway 00202 as you need to capture the pinter to the object your wrapping. So, using 00203 newFile() as an example where sfsP points to the Interface being wrapped: 00204 00205 XrdSfsFile *newFile(const char *user, int MonID) 00206 { 00207 XrdSfsFile *wrapped_file = sfsP->newFile(user, MonID); 00208 if (!wrapped_file) return 0; 00209 return new mySfsFile(wrapped_file,...); 00210 } 00211 class mySfsFile : public XrdSfsFile 00212 {public: 00213 mySfsFile(XrdSfsFile *wrapped_file,...) : XrdSfsFile(*wrapped_file) 00214 {....} 00215 .... 00216 }; 00217 00218 Notice we are allocating the wrapped file ahead of the wrapper so that 00219 the wrapper can use the ErrInfo object of the wrapped file. 00220 00221 In backward mode we want to use the ErrInfo object of the front-most 00222 wrapper for all wrappers after it. This mechanism is far more complicated 00223 due to error handling requirements. However, it's useful when a wrapped 00224 object is not necessarily instantiated to accomplish the needs of the 00225 wrapper. An example of this is the newFile and newDir implementations for 00226 XrdSsi where wrapped object creation is subject to the resource name. 00227 */ 00228 00229 /******************************************************************************/ 00230 /* X r d S f s D i r e c t o r y */ 00231 /******************************************************************************/ 00232 00233 //------------------------------------------------------------------------------ 00236 //------------------------------------------------------------------------------ 00237 00238 class XrdSfsDirectory 00239 { 00240 public: 00241 00242 //----------------------------------------------------------------------------- 00245 //----------------------------------------------------------------------------- 00246 00247 XrdOucErrInfo &error; 00248 00249 //----------------------------------------------------------------------------- 00257 //----------------------------------------------------------------------------- 00258 00259 virtual int open(const char *path, 00260 const XrdSecEntity *client = 0, 00261 const char *opaque = 0) = 0; 00262 00263 //----------------------------------------------------------------------------- 00271 //----------------------------------------------------------------------------- 00272 00273 virtual const char *nextEntry() = 0; 00274 00275 //----------------------------------------------------------------------------- 00279 //----------------------------------------------------------------------------- 00280 00281 virtual int close() = 0; 00282 00283 //----------------------------------------------------------------------------- 00287 //----------------------------------------------------------------------------- 00288 00289 virtual const char *FName() = 0; 00290 00291 //----------------------------------------------------------------------------- 00297 //----------------------------------------------------------------------------- 00298 00299 virtual int autoStat(struct stat *buf); 00300 00301 //----------------------------------------------------------------------------- 00310 //----------------------------------------------------------------------------- 00311 00312 XrdSfsDirectory(const char *user=0, int MonID=0) 00313 : error(*(new XrdOucErrInfo(user, MonID))) 00314 {lclEI = &error;} 00315 00316 //----------------------------------------------------------------------------- 00322 //----------------------------------------------------------------------------- 00323 00324 XrdSfsDirectory(XrdSfsDirectory &wrapD) 00325 : error(wrapD.error), lclEI(0) {} 00326 00327 //----------------------------------------------------------------------------- 00332 //----------------------------------------------------------------------------- 00333 00334 XrdSfsDirectory(XrdOucErrInfo &eInfo) 00335 : error(eInfo), lclEI(0) {} 00336 00337 //----------------------------------------------------------------------------- 00339 //----------------------------------------------------------------------------- 00340 00341 virtual ~XrdSfsDirectory() {if (lclEI) delete lclEI;} 00342 00343 private: 00344 XrdOucErrInfo* lclEI; 00345 00346 }; // class XrdSfsDirectory 00347 00348 /******************************************************************************/ 00349 /* X r d S f s F i l e */ 00350 /******************************************************************************/ 00351 00352 //------------------------------------------------------------------------------ 00355 //------------------------------------------------------------------------------ 00356 00357 class XrdSfsAio; 00358 class XrdSfsDio; 00359 class XrdSfsXio; 00360 00361 class XrdSfsFile 00362 { 00363 public: 00364 00365 //----------------------------------------------------------------------------- 00368 //----------------------------------------------------------------------------- 00369 00370 XrdOucErrInfo &error; 00371 00372 //----------------------------------------------------------------------------- 00394 //----------------------------------------------------------------------------- 00395 00396 virtual int open(const char *fileName, 00397 XrdSfsFileOpenMode openMode, 00398 mode_t createMode, 00399 const XrdSecEntity *client = 0, 00400 const char *opaque = 0) = 0; 00401 00402 //----------------------------------------------------------------------------- 00410 //----------------------------------------------------------------------------- 00411 00412 enum cpAct {cpCreate=0, 00413 cpDelete, 00414 cpRestore 00415 }; 00416 00417 virtual int checkpoint(cpAct act, struct iov *range=0, int n=0); 00418 00419 //----------------------------------------------------------------------------- 00423 //----------------------------------------------------------------------------- 00424 00425 virtual int close() = 0; 00426 00427 //----------------------------------------------------------------------------- 00444 //----------------------------------------------------------------------------- 00445 00446 virtual int fctl(const int cmd, 00447 const char *args, 00448 XrdOucErrInfo &eInfo) = 0; 00449 00450 //----------------------------------------------------------------------------- 00463 //----------------------------------------------------------------------------- 00464 00465 virtual int fctl(const int cmd, 00466 int alen, 00467 const char *args, 00468 const XrdSecEntity *client = 0); 00469 00470 //----------------------------------------------------------------------------- 00474 //----------------------------------------------------------------------------- 00475 00476 virtual const char *FName() = 0; 00477 00478 //----------------------------------------------------------------------------- 00485 //----------------------------------------------------------------------------- 00486 00487 virtual int getMmap(void **Addr, off_t &Size) = 0; 00488 00489 //----------------------------------------------------------------------------- 00491 //----------------------------------------------------------------------------- 00492 00493 static const uint64_t 00494 Verify = 0x8000000000000000ULL; 00495 static const uint64_t 00496 NetOrder = 0x4000000000000000ULL; 00497 00498 //----------------------------------------------------------------------------- 00513 //----------------------------------------------------------------------------- 00514 00515 virtual XrdSfsXferSize pgRead(XrdSfsFileOffset offset, 00516 char *buffer, 00517 XrdSfsXferSize rdlen, 00518 uint32_t *csvec, 00519 uint64_t opts=0); 00520 00521 //----------------------------------------------------------------------------- 00529 //----------------------------------------------------------------------------- 00530 00531 virtual int pgRead(XrdSfsAio *aioparm, uint64_t opts=0); 00532 00533 //----------------------------------------------------------------------------- 00549 //----------------------------------------------------------------------------- 00550 00551 virtual XrdSfsXferSize pgWrite(XrdSfsFileOffset offset, 00552 char *buffer, 00553 XrdSfsXferSize wrlen, 00554 uint32_t *csvec, 00555 uint64_t opts=0); 00556 00557 //----------------------------------------------------------------------------- 00565 //----------------------------------------------------------------------------- 00566 00567 virtual int pgWrite(XrdSfsAio *aioparm, uint64_t opts=0); 00568 00569 //----------------------------------------------------------------------------- 00577 //----------------------------------------------------------------------------- 00578 00579 virtual XrdSfsXferSize read(XrdSfsFileOffset offset, 00580 XrdSfsXferSize size) = 0; 00581 00582 //----------------------------------------------------------------------------- 00591 //----------------------------------------------------------------------------- 00592 00593 virtual XrdSfsXferSize read(XrdSfsFileOffset offset, 00594 char *buffer, 00595 XrdSfsXferSize size) = 0; 00596 00597 //----------------------------------------------------------------------------- 00604 //----------------------------------------------------------------------------- 00605 00606 virtual int read(XrdSfsAio *aioparm) = 0; 00607 00608 //----------------------------------------------------------------------------- 00618 //----------------------------------------------------------------------------- 00619 00620 virtual XrdSfsXferSize readv(XrdOucIOVec *readV, 00621 int rdvCnt); 00622 00623 //----------------------------------------------------------------------------- 00633 //----------------------------------------------------------------------------- 00634 00635 virtual int SendData(XrdSfsDio *sfDio, 00636 XrdSfsFileOffset offset, 00637 XrdSfsXferSize size); 00638 00639 //----------------------------------------------------------------------------- 00648 //----------------------------------------------------------------------------- 00649 00650 virtual XrdSfsXferSize write(XrdSfsFileOffset offset, 00651 const char *buffer, 00652 XrdSfsXferSize size) = 0; 00653 00654 //----------------------------------------------------------------------------- 00661 //----------------------------------------------------------------------------- 00662 00663 virtual int write(XrdSfsAio *aioparm) = 0; 00664 00665 //----------------------------------------------------------------------------- 00675 //----------------------------------------------------------------------------- 00676 00677 virtual XrdSfsXferSize writev(XrdOucIOVec *writeV, 00678 int wdvCnt); 00679 00680 //----------------------------------------------------------------------------- 00687 //----------------------------------------------------------------------------- 00688 00689 virtual int stat(struct stat *buf) = 0; 00690 00691 //----------------------------------------------------------------------------- 00695 //----------------------------------------------------------------------------- 00696 00697 virtual int sync() = 0; 00698 00699 //----------------------------------------------------------------------------- 00704 //----------------------------------------------------------------------------- 00705 00706 virtual int sync(XrdSfsAio *aiop) = 0; 00707 00708 //----------------------------------------------------------------------------- 00714 //----------------------------------------------------------------------------- 00715 00716 virtual int truncate(XrdSfsFileOffset fsize) = 0; 00717 00718 //----------------------------------------------------------------------------- 00726 //----------------------------------------------------------------------------- 00727 00728 virtual int getCXinfo(char cxtype[4], int &cxrsz) = 0; 00729 00730 //----------------------------------------------------------------------------- 00734 //----------------------------------------------------------------------------- 00735 00736 virtual void setXio(XrdSfsXio *xioP) { (void)xioP; } 00737 00738 //----------------------------------------------------------------------------- 00747 //----------------------------------------------------------------------------- 00748 00749 XrdSfsFile(const char *user=0, int MonID=0) 00750 : error(*(new XrdOucErrInfo(user, MonID))) 00751 {lclEI = &error; pgwrEOF = 0;} 00752 00753 //----------------------------------------------------------------------------- 00759 //----------------------------------------------------------------------------- 00760 00761 XrdSfsFile(XrdSfsFile &wrapF) 00762 : error(wrapF.error), lclEI(0), pgwrEOF(0) {} 00763 00764 //----------------------------------------------------------------------------- 00769 //----------------------------------------------------------------------------- 00770 00771 XrdSfsFile(XrdOucErrInfo &eInfo) 00772 : error(eInfo), lclEI(0), pgwrEOF(0) {} 00773 00774 //----------------------------------------------------------------------------- 00776 //----------------------------------------------------------------------------- 00777 00778 virtual ~XrdSfsFile() {if (lclEI) delete lclEI;} 00779 00780 private: 00781 XrdOucErrInfo* lclEI; 00782 XrdSfsFileOffset pgwrEOF; 00783 }; // class XrdSfsFile 00784 00785 /******************************************************************************/ 00786 /* X r d S f s F i l e S y s t e m */ 00787 /******************************************************************************/ 00788 00789 //----------------------------------------------------------------------------- 00813 //----------------------------------------------------------------------------- 00814 00815 class XrdSfsFileSystem 00816 { 00817 public: 00818 00819 //----------------------------------------------------------------------------- 00829 //----------------------------------------------------------------------------- 00830 00831 virtual XrdSfsDirectory *newDir(char *user=0, int MonID=0) = 0; 00832 00833 //----------------------------------------------------------------------------- 00844 //----------------------------------------------------------------------------- 00845 00846 virtual XrdSfsDirectory *newDir(XrdOucErrInfo &eInfo) {(void)eInfo; return 0;} 00847 00848 //----------------------------------------------------------------------------- 00858 //----------------------------------------------------------------------------- 00859 00860 virtual XrdSfsFile *newFile(char *user=0, int MonID=0) = 0; 00861 00862 //----------------------------------------------------------------------------- 00873 //----------------------------------------------------------------------------- 00874 00875 virtual XrdSfsFile *newFile(XrdOucErrInfo &eInfo) {(void)eInfo; return 0;} 00876 00877 //----------------------------------------------------------------------------- 00896 //----------------------------------------------------------------------------- 00897 00898 enum csFunc {csCalc = 0, csGet, csSize}; 00899 00900 virtual int chksum( csFunc Func, 00901 const char *csName, 00902 const char *path, 00903 XrdOucErrInfo &eInfo, 00904 const XrdSecEntity *client = 0, 00905 const char *opaque = 0); 00906 00907 //----------------------------------------------------------------------------- 00917 //----------------------------------------------------------------------------- 00918 00919 virtual int chmod(const char *path, 00920 XrdSfsMode mode, 00921 XrdOucErrInfo &eInfo, 00922 const XrdSecEntity *client = 0, 00923 const char *opaque = 0) = 0; 00924 00925 //----------------------------------------------------------------------------- 00929 //----------------------------------------------------------------------------- 00930 00931 virtual void Connect(const XrdSecEntity *client = 0) 00932 { 00933 (void)client; 00934 } 00935 00936 //----------------------------------------------------------------------------- 00940 //----------------------------------------------------------------------------- 00941 00942 virtual void Disc(const XrdSecEntity *client = 0) {(void)client;} 00943 00944 //----------------------------------------------------------------------------- 00949 //----------------------------------------------------------------------------- 00950 00951 virtual void EnvInfo(XrdOucEnv *envP) {(void)envP;} 00952 00953 //----------------------------------------------------------------------------- 00969 //----------------------------------------------------------------------------- 00970 00971 virtual int exists(const char *path, 00972 XrdSfsFileExistence &eFlag, 00973 XrdOucErrInfo &eInfo, 00974 const XrdSecEntity *client = 0, 00975 const char *opaque = 0) = 0; 00976 00977 //----------------------------------------------------------------------------- 00991 //----------------------------------------------------------------------------- 00992 00993 virtual int FAttr( XrdSfsFACtl *faReq, 00994 XrdOucErrInfo &eInfo, 00995 const XrdSecEntity *client = 0); 00996 00997 //----------------------------------------------------------------------------- 01002 //----------------------------------------------------------------------------- 01003 01004 uint64_t Features() {return FeatureSet;} 01005 01006 //----------------------------------------------------------------------------- 01022 //----------------------------------------------------------------------------- 01023 01024 virtual int FSctl(const int cmd, 01025 XrdSfsFSctl &args, 01026 XrdOucErrInfo &eInfo, 01027 const XrdSecEntity *client = 0); 01028 01029 //----------------------------------------------------------------------------- 01057 //----------------------------------------------------------------------------- 01058 01059 virtual int fsctl(const int cmd, 01060 const char *args, 01061 XrdOucErrInfo &eInfo, 01062 const XrdSecEntity *client = 0) = 0; 01063 01064 //----------------------------------------------------------------------------- 01068 //----------------------------------------------------------------------------- 01069 01070 virtual int getChkPSize() {return 0;} 01071 01072 //----------------------------------------------------------------------------- 01082 //----------------------------------------------------------------------------- 01083 01084 virtual int getStats(char *buff, int blen) = 0; 01085 01086 //----------------------------------------------------------------------------- 01090 //----------------------------------------------------------------------------- 01091 01092 virtual const char *getVersion() = 0; 01093 01094 //----------------------------------------------------------------------------- 01105 //----------------------------------------------------------------------------- 01106 01107 enum gpfFunc {gpfCancel=0, 01108 gpfGet, 01109 gpfPut 01110 }; 01111 01112 virtual int gpFile( gpfFunc &gpAct, 01113 XrdSfsGPFile &gpReq, 01114 XrdOucErrInfo &eInfo, 01115 const XrdSecEntity *client = 0); 01116 01117 //----------------------------------------------------------------------------- 01127 //----------------------------------------------------------------------------- 01128 01129 virtual int mkdir(const char *path, 01130 XrdSfsMode mode, 01131 XrdOucErrInfo &eInfo, 01132 const XrdSecEntity *client = 0, 01133 const char *opaque = 0) = 0; 01134 01135 //----------------------------------------------------------------------------- 01143 //----------------------------------------------------------------------------- 01144 01145 virtual int prepare( XrdSfsPrep &pargs, 01146 XrdOucErrInfo &eInfo, 01147 const XrdSecEntity *client = 0) = 0; 01148 01149 //----------------------------------------------------------------------------- 01158 //----------------------------------------------------------------------------- 01159 01160 virtual int rem(const char *path, 01161 XrdOucErrInfo &eInfo, 01162 const XrdSecEntity *client = 0, 01163 const char *opaque = 0) = 0; 01164 01165 //----------------------------------------------------------------------------- 01174 //----------------------------------------------------------------------------- 01175 01176 virtual int remdir(const char *path, 01177 XrdOucErrInfo &eInfo, 01178 const XrdSecEntity *client = 0, 01179 const char *opaque = 0) = 0; 01180 01181 //----------------------------------------------------------------------------- 01192 //----------------------------------------------------------------------------- 01193 01194 virtual int rename(const char *oPath, 01195 const char *nPath, 01196 XrdOucErrInfo &eInfo, 01197 const XrdSecEntity *client = 0, 01198 const char *opaqueO = 0, 01199 const char *opaqueN = 0) = 0; 01200 01201 //----------------------------------------------------------------------------- 01212 //----------------------------------------------------------------------------- 01213 01214 virtual int stat(const char *Name, 01215 struct stat *buf, 01216 XrdOucErrInfo &eInfo, 01217 const XrdSecEntity *client = 0, 01218 const char *opaque = 0) = 0; 01219 01220 //----------------------------------------------------------------------------- 01232 //----------------------------------------------------------------------------- 01233 01234 virtual int stat(const char *path, 01235 mode_t &mode, 01236 XrdOucErrInfo &eInfo, 01237 const XrdSecEntity *client = 0, 01238 const char *opaque = 0) = 0; 01239 01240 //----------------------------------------------------------------------------- 01250 //----------------------------------------------------------------------------- 01251 01252 virtual int truncate(const char *path, 01253 XrdSfsFileOffset fsize, 01254 XrdOucErrInfo &eInfo, 01255 const XrdSecEntity *client = 0, 01256 const char *opaque = 0) = 0; 01257 01258 //----------------------------------------------------------------------------- 01260 //----------------------------------------------------------------------------- 01261 01262 XrdSfsFileSystem(); 01263 virtual ~XrdSfsFileSystem() {} 01264 01265 protected: 01266 01267 uint64_t FeatureSet; 01268 }; 01269 01270 /******************************************************************************/ 01271 /* F i l e S y s t e m I n s t a n t i a t o r */ 01272 /******************************************************************************/ 01273 01274 //----------------------------------------------------------------------------- 01297 typedef XrdSfsFileSystem *(*XrdSfsFileSystem2_t)(XrdSfsFileSystem *nativeFS, 01298 XrdSysLogger *Logger, 01299 const char *configFn, 01300 XrdOucEnv *envP); 01301 01302 //----------------------------------------------------------------------------- 01314 typedef XrdSfsFileSystem *(*XrdSfsFileSystem_t) (XrdSfsFileSystem *nativeFS, 01315 XrdSysLogger *Logger, 01316 const char *configFn); 01317 01318 //------------------------------------------------------------------------------ 01330 //------------------------------------------------------------------------------ 01331 #endif