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
13
// $Id$
14
15
#include "
XrdCms/XrdCmsReq.hh
"
16
#include "
XrdCms/XrdCmsXmi.hh
"
17
#include "
XrdSys/XrdSysPthread.hh
"
18
19
class
XrdCmsXmiReq
:
XrdCmsXmi
20
{
21
public
:
22
23
enum
ReqType
{
do_chmod
,
do_mkdir
,
do_mkpath
,
do_mv
,
24
do_prep
,
do_rm
,
do_rmdir
,
do_stage
,
do_stat
};
25
26
int
Chmod
(
XrdCmsReq
*Request,
27
mode_t mode,
28
const
char
*path,
29
const
char
*opaque)
30
{
return
Qit
(Request,
do_chmod
, (
int
)mode, path, opaque);}
31
32
int
Mkdir
(
XrdCmsReq
*Request,
33
mode_t mode,
34
const
char
*path,
35
const
char
*opaque)
36
{
return
Qit
(Request,
do_mkdir
, (
int
)mode, path, opaque);}
37
38
int
Mkpath
(
XrdCmsReq
*Request,
39
mode_t mode,
40
const
char
*path,
41
const
char
*opaque)
42
{
return
Qit
(Request,
do_mkpath
, (
int
)mode, path, opaque);}
43
44
int
Prep
(
const
char
*ReqID,
45
int
opts
,
46
const
char
*path,
47
const
char
*opaque)
48
{
return
Qit
(0,
do_prep
, 0, path, opaque, ReqID);}
49
50
int
Rename
(
XrdCmsReq
*Request,
51
const
char
*oldpath,
52
const
char
*oldopaque,
53
const
char
*newpath,
54
const
char
*newopaque)
55
{
return
Qit
(Request,
do_mv
, 0, oldpath, oldopaque,
56
newpath, newopaque);}
57
58
int
Remdir
(
XrdCmsReq
*Request,
59
const
char
*path,
60
const
char
*opaque)
61
{
return
Qit
(Request,
do_rmdir
, 0, path, opaque);}
62
63
int
Remove
(
XrdCmsReq
*Request,
64
const
char
*path,
65
const
char
*opaque)
66
{
return
Qit
(Request,
do_rm
, 0, path, opaque);}
67
68
int
Select
(
XrdCmsReq
*Request,
69
int
opts
,
70
const
char
*path,
71
const
char
*opaque)
72
{
return
Qit
(Request,
do_stage
, opts, path, opaque);}
73
74
int
Stat
(
XrdCmsReq
*Request,
75
const
char
*path,
76
const
char
*opaque)
77
{
return
Qit
(Request,
do_stat
, 0, path, opaque);}
78
79
static
void
processPrpQ
();
80
81
static
void
processReqQ
();
82
83
static
void
processStgQ
();
84
85
XrdCmsXmiReq
(
XrdCmsXmi
*xp);
86
87
XrdCmsXmiReq
(
XrdCmsReq
*reqp,
ReqType
rqtype,
int
parms,
88
const
char
*path,
const
char
*opaque,
89
const
char
*path2=0,
const
char
*opaque2=0);
90
91
virtual
~XrdCmsXmiReq
();
92
93
private
:
94
void
Start
();
95
int
Qit
(
XrdCmsReq
*rp,
ReqType
,
int
parms,
96
const
char
*path,
const
char
*opaque,
97
const
char
*path2=0,
const
char
*opaque2=0);
98
99
static
XrdCmsXmi
*
XmiP
;
100
static
XrdSysMutex
prpMutex
;
101
static
XrdSysSemaphore
prpReady
;
102
static
XrdCmsXmiReq
*
prpFirst
;
103
static
XrdCmsXmiReq
*
prpLast
;
104
static
XrdSysMutex
reqMutex
;
105
static
XrdSysSemaphore
reqReady
;
106
static
XrdCmsXmiReq
*
reqFirst
;
107
static
XrdCmsXmiReq
*
reqLast
;
108
static
XrdSysMutex
stgMutex
;
109
static
XrdSysSemaphore
stgReady
;
110
static
XrdCmsXmiReq
*
stgFirst
;
111
static
XrdCmsXmiReq
*
stgLast
;
112
XrdCmsXmiReq
*
Next
;
113
XrdCmsReq
*
ReqP
;
114
int
Parms
;
115
ReqType
Rtype
;
116
char
*
Path
;
117
char
*
Opaque
;
118
char
*
Path2
;
119
char
*
Opaque2
;
120
};
121
#endif
Generated by
1.8.1.2