XRootD
XrdOssVS.hh
Go to the documentation of this file.
1
#ifndef __XRDOSS_VS_H__
2
#define __XRDOSS_VS_H__
3
/******************************************************************************/
4
/* */
5
/* X r d O s s V S . h h */
6
/* */
7
/* (c) 2020 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
/******************************************************************************/
34
/* C l a s s X r d O s s V S P a r t */
35
/******************************************************************************/
36
37
//-----------------------------------------------------------------------------
61
//-----------------------------------------------------------------------------
62
63
class
XrdOssVSPart
64
{
65
public
:
66
const
char
*
pPath
;
// Valid path to partition (not the allocation path)
67
const
char
**
aPath
;
// Allocation root paths for this partition
68
long
long
Total
;
// Total bytes
69
long
long
Free
;
// Total bytes free
70
unsigned
short
bdevID
;
// Device unique ID (bdevs may have many partitions)
71
unsigned
short
partID
;
// Partition unique ID (parts may have the same bdevID)
72
int
rsvd1
;
73
void
*
rsvd2
;
// Reserved
74
75
XrdOssVSPart
() :
pPath
(0),
aPath
(0),
Total
(0),
Free
(0),
76
bdevID
(0),
partID
(0),
rsvd1
(0),
rsvd2
(0)
77
{}
78
~XrdOssVSPart
() {}
79
};
80
81
/******************************************************************************/
82
/* C l a s s X r d O s s V S I n f o */
83
/******************************************************************************/
84
85
// Class passed to StatVS()
86
//
87
class
XrdOssVSInfo
88
{
89
public
:
90
long
long
Total
;
// Total bytes
91
long
long
Free
;
// Total bytes free
92
long
long
Large
;
// Total bytes in largest partition
93
long
long
LFree
;
// Max bytes free in contiguous chunk
94
long
long
Usage
;
// Used bytes (if usage enabled)
95
long
long
Quota
;
// Quota bytes (if quota enabled)
96
int
Extents
;
// Number of partitions/extents
97
int
Reserved
;
98
XrdOssVSPart
*
vsPart
;
// Partition info as vsPart[extents] may be nil
99
100
//-----------------------------------------------------------------------------
108
//-----------------------------------------------------------------------------
109
110
XrdOssVSPart
*
Export
(
int
&nParts)
111
{
XrdOssVSPart
*pVec =
vsPart
;
112
vsPart
= 0;
113
nParts =
Extents
;
114
return
pVec;
115
}
116
117
XrdOssVSInfo
() :
Total
(0),
Free
(0),
Large
(0),
LFree
(0),
Usage
(-1),
118
Quota
(-1),
Extents
(0),
Reserved
(0),
vsPart
(0) {}
119
~XrdOssVSInfo
() {
if
(
vsPart
)
delete
[]
vsPart
;}
120
};
121
#endif
XrdOssVSInfo
Definition:
XrdOssVS.hh:88
XrdOssVSInfo::LFree
long long LFree
Definition:
XrdOssVS.hh:93
XrdOssVSInfo::Usage
long long Usage
Definition:
XrdOssVS.hh:94
XrdOssVSInfo::Extents
int Extents
Definition:
XrdOssVS.hh:96
XrdOssVSInfo::Reserved
int Reserved
Definition:
XrdOssVS.hh:97
XrdOssVSInfo::Export
XrdOssVSPart * Export(int &nParts)
Definition:
XrdOssVS.hh:110
XrdOssVSInfo::Large
long long Large
Definition:
XrdOssVS.hh:92
XrdOssVSInfo::Total
long long Total
Definition:
XrdOssVS.hh:90
XrdOssVSInfo::~XrdOssVSInfo
~XrdOssVSInfo()
Definition:
XrdOssVS.hh:119
XrdOssVSInfo::Free
long long Free
Definition:
XrdOssVS.hh:91
XrdOssVSInfo::XrdOssVSInfo
XrdOssVSInfo()
Definition:
XrdOssVS.hh:117
XrdOssVSInfo::vsPart
XrdOssVSPart * vsPart
Definition:
XrdOssVS.hh:98
XrdOssVSInfo::Quota
long long Quota
Definition:
XrdOssVS.hh:95
XrdOssVSPart
Definition:
XrdOssVS.hh:64
XrdOssVSPart::partID
unsigned short partID
Definition:
XrdOssVS.hh:71
XrdOssVSPart::Total
long long Total
Definition:
XrdOssVS.hh:68
XrdOssVSPart::pPath
const char * pPath
Definition:
XrdOssVS.hh:66
XrdOssVSPart::aPath
const char ** aPath
Definition:
XrdOssVS.hh:67
XrdOssVSPart::Free
long long Free
Definition:
XrdOssVS.hh:69
XrdOssVSPart::rsvd1
int rsvd1
Definition:
XrdOssVS.hh:72
XrdOssVSPart::bdevID
unsigned short bdevID
Definition:
XrdOssVS.hh:70
XrdOssVSPart::~XrdOssVSPart
~XrdOssVSPart()
Definition:
XrdOssVS.hh:78
XrdOssVSPart::XrdOssVSPart
XrdOssVSPart()
Definition:
XrdOssVS.hh:75
XrdOssVSPart::rsvd2
void * rsvd2
Definition:
XrdOssVS.hh:73
XrdOss
XrdOssVS.hh
Generated by
1.9.1