xrootd
XrdSsiSfs.hh
Go to the documentation of this file.
1 #ifndef __SSI_SFS_H__
2 #define __SSI_SFS_H__
3 /******************************************************************************/
4 /* */
5 /* X r d S s i S f s . h h */
6 /* */
7 /* (c) 2013 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 <sys/types.h>
33 
35 
36 #include "XrdSsi/XrdSsiDir.hh"
37 #include "XrdSsi/XrdSsiFile.hh"
38 
39 struct XrdVersionInfo;
40 
41 class XrdOucEnv;
42 class XrdSecEntity;
43 
44 class XrdSsiSfs : public XrdSfsFileSystem
45 {
46 friend class XrdSsiFile;
47 
48 public:
49 
50 // Object allocation
51 //
52  XrdSfsDirectory *newDir(char *user=0, int MonID=0)
53  {return new XrdSsiDir(user, MonID);}
54 
55  XrdSfsFile *newFile(char *user=0,int MonID=0)
56  {return new XrdSsiFile(user, MonID);}
57 
58 // Other functions
59 //
60  int chksum( csFunc Func,
61  const char *csName,
62  const char *path,
63  XrdOucErrInfo &eInfo,
64  const XrdSecEntity *client = 0,
65  const char *opaque = 0);
66 
67  int chmod(const char *Name,
68  XrdSfsMode Mode,
69  XrdOucErrInfo &eInfo,
70  const XrdSecEntity *client,
71  const char *opaque = 0);
72 
73  int exists(const char *fileName,
74  XrdSfsFileExistence &exists_flag,
75  XrdOucErrInfo &eInfo,
76  const XrdSecEntity *client,
77  const char *opaque = 0);
78 
79  int fsctl(const int cmd,
80  const char *args,
81  XrdOucErrInfo &eInfo,
82  const XrdSecEntity *client);
83 
84  int getStats(char *buff, int blen);
85 
86 const char *getVersion();
87 
88  int mkdir(const char *dirName,
89  XrdSfsMode Mode,
90  XrdOucErrInfo &eInfo,
91  const XrdSecEntity *client,
92  const char *opaque = 0);
93 
94  int prepare( XrdSfsPrep &pargs,
95  XrdOucErrInfo &eInfo,
96  const XrdSecEntity *client = 0);
97 
98  int rem(const char *path,
99  XrdOucErrInfo &eInfo,
100  const XrdSecEntity *client,
101  const char *info = 0);
102 
103  int remdir(const char *dirName,
104  XrdOucErrInfo &eInfo,
105  const XrdSecEntity *client,
106  const char *info = 0);
107 
108  int rename(const char *oldFileName,
109  const char *newFileName,
110  XrdOucErrInfo &eInfo,
111  const XrdSecEntity *client,
112  const char *infoO = 0,
113  const char *infoN = 0);
114 
115  int stat(const char *Name,
116  struct stat *buf,
117  XrdOucErrInfo &eInfo,
118  const XrdSecEntity *client,
119  const char *opaque = 0);
120 
121  int stat(const char *Name,
122  mode_t &mode,
123  XrdOucErrInfo &eInfo,
124  const XrdSecEntity *client,
125  const char *opaque = 0);
126 
127  int truncate(const char *Name,
128  XrdSfsFileOffset fileOffset,
129  XrdOucErrInfo &eInfo,
130  const XrdSecEntity *client = 0,
131  const char *opaque = 0);
132 
133 // Management functions
134 //
135  void setFeatures(XrdSfsFileSystem *prevFS);
136 
137 static void setMax(int mVal) {freeMax = mVal;}
138 
140 virtual ~XrdSsiSfs() {} // Too complicate to delete :-)
141 
142 private:
143 static int freeMax;
144 
145 int Emsg(const char *pfx, XrdOucErrInfo &einfo, int ecode,
146  const char *op, const char *target);
147 const char *Split(const char *Args, const char **Opq, char *Path, int Plen);
148 };
149 #endif
int remdir(const char *dirName, XrdOucErrInfo &eInfo, const XrdSecEntity *client, const char *info=0)
int chmod(const char *Name, XrdSfsMode Mode, XrdOucErrInfo &eInfo, const XrdSecEntity *client, const char *opaque=0)
XrdSfsFile * newFile(char *user=0, int MonID=0)
Definition: XrdSsiSfs.hh:55
XrdSsiSfs()
Definition: XrdSsiSfs.hh:139
int exists(const char *fileName, XrdSfsFileExistence &exists_flag, XrdOucErrInfo &eInfo, const XrdSecEntity *client, const char *opaque=0)
int truncate(const char *Name, XrdSfsFileOffset fileOffset, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaque=0)
void setFeatures(XrdSfsFileSystem *prevFS)
XrdSfsFileExistence
Definition: XrdSfsInterface.hh:131
int getStats(char *buff, int blen)
friend class XrdSsiFile
Definition: XrdSsiSfs.hh:46
int mkdir(const char *dirName, XrdSfsMode Mode, XrdOucErrInfo &eInfo, const XrdSecEntity *client, const char *opaque=0)
static void setMax(int mVal)
Definition: XrdSsiSfs.hh:137
Definition: XrdSfsInterface.hh:238
const char * getVersion()
long long XrdSfsFileOffset
Definition: XrdSfsInterface.hh:126
int chksum(csFunc Func, const char *csName, const char *path, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaque=0)
Definition: XrdSsiSfs.hh:44
Definition: XrdSsiDir.hh:36
Definition: XrdOucErrInfo.hh:100
XrdSfsDirectory * newDir(char *user=0, int MonID=0)
Definition: XrdSsiSfs.hh:52
Definition: XrdOucEnv.hh:41
static int freeMax
Definition: XrdSsiSfs.hh:143
int Emsg(const char *pfx, XrdOucErrInfo &einfo, int ecode, const char *op, const char *target)
const char * Split(const char *Args, const char **Opq, char *Path, int Plen)
int fsctl(const int cmd, const char *args, XrdOucErrInfo &eInfo, const XrdSecEntity *client)
int rem(const char *path, XrdOucErrInfo &eInfo, const XrdSecEntity *client, const char *info=0)
int XrdSfsMode
Definition: XrdSfsInterface.hh:128
virtual ~XrdSsiSfs()
Definition: XrdSsiSfs.hh:140
int rename(const char *oldFileName, const char *newFileName, XrdOucErrInfo &eInfo, const XrdSecEntity *client, const char *infoO=0, const char *infoN=0)
int prepare(XrdSfsPrep &pargs, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0)
Definition: XrdSsiFile.hh:39
Definition: XrdSecEntity.hh:63
Definition: XrdSfsInterface.hh:364
< Prepare parameters
Definition: XrdSfsInterface.hh:167
int stat(const char *Name, struct stat *buf, XrdOucErrInfo &eInfo, const XrdSecEntity *client, const char *opaque=0)