xrootd
Main Page
Namespaces
Classes
Files
File List
File Members
src
XrdCms
XrdCmsXmiReq.hh
Go to the documentation of this file.
1
#ifndef _XRDCMSXMIREQ_H_
2
#define _XRDCMSXMIREQ_H_
3
/******************************************************************************/
4
/* */
5
/* X r d C m s X m i R e q . h h */
6
/* */
7
/* (c) 2007 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
33
#include "
XrdCms/XrdCmsReq.hh
"
34
#include "
XrdCms/XrdCmsXmi.hh
"
35
#include "
XrdSys/XrdSysPthread.hh
"
36
37
class
XrdCmsXmiReq
:
XrdCmsXmi
38
{
39
public
:
40
41
enum
ReqType
{
do_chmod
,
do_mkdir
,
do_mkpath
,
do_mv
,
42
do_prep
,
do_rm
,
do_rmdir
,
do_stage
,
do_stat
};
43
44
int
Chmod
(
XrdCmsReq
*Request,
45
mode_t mode,
46
const
char
*path,
47
const
char
*opaque)
48
{
return
Qit
(Request,
do_chmod
, (
int
)mode, path, opaque);}
49
50
int
Mkdir
(
XrdCmsReq
*Request,
51
mode_t mode,
52
const
char
*path,
53
const
char
*opaque)
54
{
return
Qit
(Request,
do_mkdir
, (
int
)mode, path, opaque);}
55
56
int
Mkpath
(
XrdCmsReq
*Request,
57
mode_t mode,
58
const
char
*path,
59
const
char
*opaque)
60
{
return
Qit
(Request,
do_mkpath
, (
int
)mode, path, opaque);}
61
62
int
Prep
(
const
char
*ReqID,
63
int
opts
,
64
const
char
*path,
65
const
char
*opaque)
66
{
return
Qit
(0,
do_prep
, 0, path, opaque, ReqID);}
67
68
int
Rename
(
XrdCmsReq
*Request,
69
const
char
*oldpath,
70
const
char
*oldopaque,
71
const
char
*newpath,
72
const
char
*newopaque)
73
{
return
Qit
(Request,
do_mv
, 0, oldpath, oldopaque,
74
newpath, newopaque);}
75
76
int
Remdir
(
XrdCmsReq
*Request,
77
const
char
*path,
78
const
char
*opaque)
79
{
return
Qit
(Request,
do_rmdir
, 0, path, opaque);}
80
81
int
Remove
(
XrdCmsReq
*Request,
82
const
char
*path,
83
const
char
*opaque)
84
{
return
Qit
(Request,
do_rm
, 0, path, opaque);}
85
86
int
Select
(
XrdCmsReq
*Request,
87
int
opts
,
88
const
char
*path,
89
const
char
*opaque)
90
{
return
Qit
(Request,
do_stage
, opts, path, opaque);}
91
92
int
Stat
(
XrdCmsReq
*Request,
93
const
char
*path,
94
const
char
*opaque)
95
{
return
Qit
(Request,
do_stat
, 0, path, opaque);}
96
97
static
void
processPrpQ
();
98
99
static
void
processReqQ
();
100
101
static
void
processStgQ
();
102
103
XrdCmsXmiReq
(
XrdCmsXmi
*xp);
104
105
XrdCmsXmiReq
(
XrdCmsReq
*reqp,
ReqType
rqtype,
int
parms,
106
const
char
*path,
const
char
*opaque,
107
const
char
*path2=0,
const
char
*opaque2=0);
108
109
virtual
~XrdCmsXmiReq
();
110
111
private
:
112
void
Start
();
113
int
Qit
(
XrdCmsReq
*rp,
ReqType
,
int
parms,
114
const
char
*path,
const
char
*opaque,
115
const
char
*path2=0,
const
char
*opaque2=0);
116
117
static
XrdCmsXmi
*
XmiP
;
118
static
XrdSysMutex
prpMutex
;
119
static
XrdSysSemaphore
prpReady
;
120
static
XrdCmsXmiReq
*
prpFirst
;
121
static
XrdCmsXmiReq
*
prpLast
;
122
static
XrdSysMutex
reqMutex
;
123
static
XrdSysSemaphore
reqReady
;
124
static
XrdCmsXmiReq
*
reqFirst
;
125
static
XrdCmsXmiReq
*
reqLast
;
126
static
XrdSysMutex
stgMutex
;
127
static
XrdSysSemaphore
stgReady
;
128
static
XrdCmsXmiReq
*
stgFirst
;
129
static
XrdCmsXmiReq
*
stgLast
;
130
XrdCmsXmiReq
*
Next
;
131
XrdCmsReq
*
ReqP
;
132
int
Parms
;
133
ReqType
Rtype
;
134
char
*
Path
;
135
char
*
Opaque
;
136
char
*
Path2
;
137
char
*
Opaque2
;
138
};
139
#endif
Generated by
1.8.3.1