XRootD
XrdSsiFile.hh
Go to the documentation of this file.
1 #ifndef __SSI_FILE_H__
2 #define __SSI_FILE_H__
3 /******************************************************************************/
4 /* */
5 /* X r d S s i F i l e . 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 <cstring>
33 #include <sys/types.h>
34 
36 
37 class XrdSsiFileSess;
38 
39 class XrdSsiFile : public XrdSfsFile
40 {
41 public:
42 
43 // SfsFile methods
44 //
45  int open(const char *fileName,
46  XrdSfsFileOpenMode openMode,
47  mode_t createMode,
48  const XrdSecEntity *client = 0,
49  const char *opaque = 0);
50 
51  int close();
52 
53  int fctl(const int cmd,
54  const char *args,
55  XrdOucErrInfo &out_error);
56 
57  int fctl(const int cmd,
58  int alen,
59  const char *args,
60  const XrdSecEntity *client);
61 
62  const char *FName();
63 
64  int getCXinfo(char cxtype[4], int &cxrsz);
65 
66  int getMmap(void **Addr, off_t &Size);
67 
68  int read(XrdSfsFileOffset fileOffset,
69  XrdSfsXferSize preread_sz);
70 
72  char *buffer,
73  XrdSfsXferSize buffer_size);
74 
75  int read(XrdSfsAio *aioparm);
76 
78  int readCount);
79 
80  int SendData(XrdSfsDio *sfDio,
81  XrdSfsFileOffset offset,
82  XrdSfsXferSize size);
83 
84  void setXio(XrdSfsXio *xP);
85 
86  int stat(struct stat *buf);
87 
88  int sync();
89 
90  int sync(XrdSfsAio *aiop);
91 
92  int truncate(XrdSfsFileOffset fileOffset);
93 
95  const char *buffer,
96  XrdSfsXferSize buffer_size);
97 
98  int write(XrdSfsAio *aioparm);
99 
100 // Constructor and destructor
101 //
102  XrdSsiFile(const char *user, int MonID)
103  : XrdSfsFile(myEInfo), fsFile(0), fSessP(0),
104  myEInfo(user, MonID) {}
105 
106 virtual ~XrdSsiFile();
107 
108 private:
109 
110 XrdSfsFile *fsFile;
111 XrdSsiFileSess *fSessP;
112 XrdOucErrInfo myEInfo;
113 };
114 #endif
int XrdSfsFileOpenMode
long long XrdSfsFileOffset
int XrdSfsXferSize
XrdSsiFile(const char *user, int MonID)
Definition: XrdSsiFile.hh:102
XrdSfsXferSize readv(XrdOucIOVec *readV, int readCount)
Definition: XrdSsiFile.cc:332
int fctl(const int cmd, const char *args, XrdOucErrInfo &out_error)
Definition: XrdSsiFile.cc:101
XrdSfsXferSize write(XrdSfsFileOffset fileOffset, const char *buffer, XrdSfsXferSize buffer_size)
Definition: XrdSsiFile.cc:471
int getCXinfo(char cxtype[4], int &cxrsz)
Definition: XrdSsiFile.cc:159
const char * FName()
Definition: XrdSsiFile.cc:143
void setXio(XrdSfsXio *xP)
Definition: XrdSsiFile.cc:375
int close()
Definition: XrdSsiFile.cc:78
int getMmap(void **Addr, off_t &Size)
Definition: XrdSsiFile.cc:185
int stat(struct stat *buf)
Definition: XrdSsiFile.cc:385
int open(const char *fileName, XrdSfsFileOpenMode openMode, mode_t createMode, const XrdSecEntity *client=0, const char *opaque=0)
Definition: XrdSsiFile.cc:209
int truncate(XrdSfsFileOffset fileOffset)
Definition: XrdSsiFile.cc:448
int read(XrdSfsFileOffset fileOffset, XrdSfsXferSize preread_sz)
Definition: XrdSsiFile.cc:258
int SendData(XrdSfsDio *sfDio, XrdSfsFileOffset offset, XrdSfsXferSize size)
Definition: XrdSsiFile.cc:357
virtual ~XrdSsiFile()
Definition: XrdSsiFile.cc:65
int sync()
Definition: XrdSsiFile.cc:409