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 
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  void EnvInfo(XrdOucEnv *envP);
74 
75  int exists(const char *fileName,
76  XrdSfsFileExistence &exists_flag,
77  XrdOucErrInfo &eInfo,
78  const XrdSecEntity *client,
79  const char *opaque = 0);
80 
81  int fsctl(const int cmd,
82  const char *args,
83  XrdOucErrInfo &eInfo,
84  const XrdSecEntity *client);
85 
86  int getStats(char *buff, int blen);
87 
88 const char *getVersion();
89 
90  int mkdir(const char *dirName,
91  XrdSfsMode Mode,
92  XrdOucErrInfo &eInfo,
93  const XrdSecEntity *client,
94  const char *opaque = 0);
95 
96  int prepare( XrdSfsPrep &pargs,
97  XrdOucErrInfo &eInfo,
98  const XrdSecEntity *client = 0);
99 
100  int rem(const char *path,
101  XrdOucErrInfo &eInfo,
102  const XrdSecEntity *client,
103  const char *info = 0);
104 
105  int remdir(const char *dirName,
106  XrdOucErrInfo &eInfo,
107  const XrdSecEntity *client,
108  const char *info = 0);
109 
110  int rename(const char *oldFileName,
111  const char *newFileName,
112  XrdOucErrInfo &eInfo,
113  const XrdSecEntity *client,
114  const char *infoO = 0,
115  const char *infoN = 0);
116 
117  int stat(const char *Name,
118  struct stat *buf,
119  XrdOucErrInfo &eInfo,
120  const XrdSecEntity *client,
121  const char *opaque = 0);
122 
123  int stat(const char *Name,
124  mode_t &mode,
125  XrdOucErrInfo &eInfo,
126  const XrdSecEntity *client,
127  const char *opaque = 0);
128 
129  int truncate(const char *Name,
130  XrdSfsFileOffset fileOffset,
131  XrdOucErrInfo &eInfo,
132  const XrdSecEntity *client = 0,
133  const char *opaque = 0);
134 
135 // Management functions
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
XrdSsiSfs::mkdir
int mkdir(const char *dirName, XrdSfsMode Mode, XrdOucErrInfo &eInfo, const XrdSecEntity *client, const char *opaque=0)
XrdSfsInterface.hh
XrdSsiSfs::prepare
int prepare(XrdSfsPrep &pargs, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0)
XrdSsiSfs::setMax
static void setMax(int mVal)
Definition: XrdSsiSfs.hh:137
XrdSfsFileSystem
Definition: XrdSfsInterface.hh:209
XrdSfsFileSystem::csFunc
csFunc
Definition: XrdSfsInterface.hh:262
XrdSsiSfs::Split
const char * Split(const char *Args, const char **Opq, char *Path, int Plen)
XrdSfsFileExistence
XrdSfsFileExistence
Definition: XrdSfsInterface.hh:124
XrdSsiSfs::fsctl
int fsctl(const int cmd, const char *args, XrdOucErrInfo &eInfo, const XrdSecEntity *client)
XrdSfsFile
Definition: XrdSfsInterface.hh:651
XrdSsiDir
Definition: XrdSsiDir.hh:36
XrdSfsFileOffset
long long XrdSfsFileOffset
Definition: XrdSfsInterface.hh:119
XrdSsiSfs::rename
int rename(const char *oldFileName, const char *newFileName, XrdOucErrInfo &eInfo, const XrdSecEntity *client, const char *infoO=0, const char *infoN=0)
XrdSsiDir.hh
XrdSsiSfs::truncate
int truncate(const char *Name, XrdSfsFileOffset fileOffset, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaque=0)
XrdSsiSfs
Definition: XrdSsiSfs.hh:44
XrdSsiSfs::newFile
XrdSfsFile * newFile(char *user=0, int MonID=0)
Definition: XrdSsiSfs.hh:55
XrdSsiSfs::remdir
int remdir(const char *dirName, XrdOucErrInfo &eInfo, const XrdSecEntity *client, const char *info=0)
XrdSfsDirectory
Definition: XrdSfsInterface.hh:994
XrdSsiFile.hh
XrdSsiSfs::newDir
XrdSfsDirectory * newDir(char *user=0, int MonID=0)
Definition: XrdSsiSfs.hh:52
XrdSsiSfs::getStats
int getStats(char *buff, int blen)
XrdSsiSfs::rem
int rem(const char *path, XrdOucErrInfo &eInfo, const XrdSecEntity *client, const char *info=0)
XrdSsiSfs::XrdSsiFile
friend class XrdSsiFile
Definition: XrdSsiSfs.hh:46
XrdOucEnv
Definition: XrdOucEnv.hh:41
XrdSsiFile
Definition: XrdSsiFile.hh:39
XrdSsiSfs::XrdSsiSfs
XrdSsiSfs()
Definition: XrdSsiSfs.hh:139
XrdSsiSfs::getVersion
const char * getVersion()
XrdSfsMode
int XrdSfsMode
Definition: XrdSfsInterface.hh:121
XrdSsiSfs::exists
int exists(const char *fileName, XrdSfsFileExistence &exists_flag, XrdOucErrInfo &eInfo, const XrdSecEntity *client, const char *opaque=0)
XrdSsiSfs::chksum
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:160
XrdSsiSfs::freeMax
static int freeMax
Definition: XrdSsiSfs.hh:143
XrdSecEntity
Definition: XrdSecEntity.hh:51
XrdOucErrInfo
Definition: XrdOucErrInfo.hh:99
XrdSsiSfs::chmod
int chmod(const char *Name, XrdSfsMode Mode, XrdOucErrInfo &eInfo, const XrdSecEntity *client, const char *opaque=0)
XrdSsiSfs::Emsg
int Emsg(const char *pfx, XrdOucErrInfo &einfo, int ecode, const char *op, const char *target)
XrdSsiSfs::stat
int stat(const char *Name, struct stat *buf, XrdOucErrInfo &eInfo, const XrdSecEntity *client, const char *opaque=0)
XrdSsiSfs::EnvInfo
void EnvInfo(XrdOucEnv *envP)
XrdSsiSfs::~XrdSsiSfs
virtual ~XrdSsiSfs()
Definition: XrdSsiSfs.hh:140