xrootd
XrdOfsPoscq.hh
Go to the documentation of this file.
1#ifndef __OFSPOSCQ_H__
2#define __OFSPOSCQ_H__
3/******************************************************************************/
4/* */
5/* X r d O f s P o s c q . h h */
6/* */
7/* (c) 2009 by the Board of Trustees of the Leland Stanford, Jr., University */
8/* All Rights Reserved */
9/* Produced by Andrew Hanushevsky for Stanford University under contract */
10/* DE-AC02-76-SFO0515 with the Department of Energy */
11/* */
12/* This file is part of the XRootD software suite. */
13/* */
14/* XRootD is free software: you can redistribute it and/or modify it under */
15/* the terms of the GNU Lesser General Public License as published by the */
16/* Free Software Foundation, either version 3 of the License, or (at your */
17/* option) any later version. */
18/* */
19/* XRootD is distributed in the hope that it will be useful, but WITHOUT */
20/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
21/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
22/* License for more details. */
23/* */
24/* You should have received a copy of the GNU Lesser General Public License */
25/* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
26/* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
27/* */
28/* The copyright holder's institutional names and contributor's names may not */
29/* be used to endorse or promote products derived from this software without */
30/* specific prior written permission of the institution or contributor. */
31/******************************************************************************/
32
34
35class XrdOss;
36class XrdSysError;
37
39{
40public:
41
42struct Request
43{
44long long addT; // Time committed to the queue
45char LFN[1024]; // Logical File Name (null terminated)
46char User[288]; // User trace identifier
47char Reserved[24]; // Reserved for future
48};
49
50static const int ReqOffs = 64;
51static const int ReqSize = sizeof(Request);
52
53struct recEnt
54{
57int Mode;
59 recEnt(struct Request &reqref, int mval, recEnt *nval=0)
60 {Next = nval; Offset = 0; Mode = mval; reqData = reqref;}
61};
62
63 int Add(const char *Tident, const char *Lfn);
64
65 int Commit(const char *Lfn, int Offset);
66
67 int Del(const char *Lfn, int Offset, int Unlink=0);
68
69 recEnt *Init(int &Ok);
70
71static recEnt *List(XrdSysError *Say, const char *theFN);
72
73inline int Num() {return pocIQ;}
74
75 XrdOfsPoscq(XrdSysError *erp, XrdOss *oss, const char *fn,
76 int sv=1);
78
79private:
80void FailIni(const char *lfn);
81int reqRead(void *Buff, int Offs);
82int reqWrite(void *Buff, int Bsz, int Offs);
83int ReWrite(recEnt *rP);
84int VerOffset(const char *Lfn, int Offset);
85
88 int Offset;
89 };
90
96char *pocFN;
100unsigned
101short pocWS;
102unsigned
103short pocSV;
104};
105#endif
Definition: XrdOfsPoscq.hh:39
int Num()
Definition: XrdOfsPoscq.hh:73
int reqRead(void *Buff, int Offs)
static const int ReqOffs
Definition: XrdOfsPoscq.hh:50
static recEnt * List(XrdSysError *Say, const char *theFN)
unsigned short pocWS
Definition: XrdOfsPoscq.hh:101
FileSlot * SlotList
Definition: XrdOfsPoscq.hh:94
int Del(const char *Lfn, int Offset, int Unlink=0)
int VerOffset(const char *Lfn, int Offset)
int Add(const char *Tident, const char *Lfn)
int pocSZ
Definition: XrdOfsPoscq.hh:97
~XrdOfsPoscq()
Definition: XrdOfsPoscq.hh:77
char * pocFN
Definition: XrdOfsPoscq.hh:96
recEnt * Init(int &Ok)
void FailIni(const char *lfn)
int reqWrite(void *Buff, int Bsz, int Offs)
int ReWrite(recEnt *rP)
int pocIQ
Definition: XrdOfsPoscq.hh:99
XrdSysMutex myMutex
Definition: XrdOfsPoscq.hh:91
XrdOfsPoscq(XrdSysError *erp, XrdOss *oss, const char *fn, int sv=1)
static const int ReqSize
Definition: XrdOfsPoscq.hh:51
unsigned short pocSV
Definition: XrdOfsPoscq.hh:103
XrdSysError * eDest
Definition: XrdOfsPoscq.hh:92
FileSlot * SlotLust
Definition: XrdOfsPoscq.hh:95
int Commit(const char *Lfn, int Offset)
int pocFD
Definition: XrdOfsPoscq.hh:98
XrdOss * ossFS
Definition: XrdOfsPoscq.hh:93
Definition: XrdOss.hh:174
Definition: XrdSysError.hh:90
Definition: XrdSysPthread.hh:166
XrdSysError Say
Definition: XrdOfsPoscq.hh:87
FileSlot * Next
Definition: XrdOfsPoscq.hh:87
int Offset
Definition: XrdOfsPoscq.hh:88
Definition: XrdOfsPoscq.hh:43
char User[288]
Definition: XrdOfsPoscq.hh:46
long long addT
Definition: XrdOfsPoscq.hh:44
char Reserved[24]
Definition: XrdOfsPoscq.hh:47
char LFN[1024]
Definition: XrdOfsPoscq.hh:45
Definition: XrdOfsPoscq.hh:54
recEnt * Next
Definition: XrdOfsPoscq.hh:55
recEnt(struct Request &reqref, int mval, recEnt *nval=0)
Definition: XrdOfsPoscq.hh:59
int Mode
Definition: XrdOfsPoscq.hh:57
struct Request reqData
Definition: XrdOfsPoscq.hh:58
int Offset
Definition: XrdOfsPoscq.hh:56