XRootD
XrdPosixExtra.hh
Go to the documentation of this file.
1 #ifndef __XRDPOSIXEXTRA_H__
2 #define __XRDPOSIXEXTRA_H__
3 /******************************************************************************/
4 /* */
5 /* X r d P o s i x E x t r a . h h */
6 /* */
7 /* */
8 /* (c) 2021 by the Board of Trustees of the Leland Stanford, Jr., University */
9 /* All Rights Reserved */
10 /* Produced by Andrew Hanushevsky for Stanford University under contract */
11 /* DE-AC02-76-SFO0515 with the Department of Energy */
12 /* */
13 /* This file is part of the XRootD software suite. */
14 /* */
15 /* XRootD is free software: you can redistribute it and/or modify it under */
16 /* the terms of the GNU Lesser General Public License as published by the */
17 /* Free Software Foundation, either version 3 of the License, or (at your */
18 /* option) any later version. */
19 /* */
20 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */
21 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
22 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
23 /* License for more details. */
24 /* */
25 /* You should have received a copy of the GNU Lesser General Public License */
26 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
27 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
28 /* */
29 /* The copyright holder's institutional names and contributor's names may not */
30 /* be used to endorse or promote products derived from this software without */
31 /* specific prior written permission of the institution or contributor. */
32 /* Modified by Frank Winklmeier to add the full Posix file system definition. */
33 /******************************************************************************/
34 
35 #include <cstdint>
36 #include <string>
37 #include <unistd.h>
38 #include <vector>
39 #include <sys/types.h>
40 
41 #include "XrdOuc/XrdOucCache.hh"
42 
43 class XrdPosixCallBackIO;
44 
45 //-----------------------------------------------------------------------------
47 //-----------------------------------------------------------------------------
48 
50 {
51 public:
52 
53 //-----------------------------------------------------------------------------
66 //-----------------------------------------------------------------------------
67 
68 static int Fctl(int fildes, XrdOucCacheOp::Code opc,
69  const std::string& args, std::string& resp);
70 
71 //-----------------------------------------------------------------------------
86 //-----------------------------------------------------------------------------
87 
88 static int FSctl(XrdOucCacheOp::Code opc,
89  const std::string& args, std::string& resp,
90  bool viaCache=false, bool viaRedir=false);
91 
92 //-----------------------------------------------------------------------------
107 //-----------------------------------------------------------------------------
108 
109 static const uint64_t forceCS = 0x0000000000000001ULL; // Gen chksum if missing
110 
111 static ssize_t pgRead (int fildes, void* buffer, off_t offset, size_t rdlen,
112  std::vector<uint32_t> &csvec, uint64_t opts=0,
113  XrdPosixCallBackIO *cbp=0);
114 
115 //-----------------------------------------------------------------------------
133 //-----------------------------------------------------------------------------
134 
135 static ssize_t pgWrite(int fildes, void* buffer, off_t offset, size_t wrlen,
136  std::vector<uint32_t> &csvec, uint64_t opts=0,
137  XrdPosixCallBackIO *cbp=0);
138 
139 
140 //------------------------------------------------------------------------
150 //------------------------------------------------------------------------
151 
152 static int PreRead(int fildes, off_t offs, int size);
153 
154 //------------------------------------------------------------------------
167 //------------------------------------------------------------------------
168 
169 static int PreRead(int fildes, XrdOucRangeList& rlist);
170 
173 };
174 #endif
std::vector< XrdOucRange > XrdOucRangeList
Definition: XrdOucRange.hh:57
struct myOpts opts
Extended POSIX interface to XRootD.
static int PreRead(int fildes, off_t offs, int size)
static int FSctl(XrdOucCacheOp::Code opc, const std::string &args, std::string &resp, bool viaCache=false, bool viaRedir=false)
static ssize_t pgWrite(int fildes, void *buffer, off_t offset, size_t wrlen, std::vector< uint32_t > &csvec, uint64_t opts=0, XrdPosixCallBackIO *cbp=0)
static const uint64_t forceCS
static ssize_t pgRead(int fildes, void *buffer, off_t offset, size_t rdlen, std::vector< uint32_t > &csvec, uint64_t opts=0, XrdPosixCallBackIO *cbp=0)
static int Fctl(int fildes, XrdOucCacheOp::Code opc, const std::string &args, std::string &resp)