00001 #ifndef __XRDOSS_VS_H__ 00002 #define __XRDOSS_VS_H__ 00003 /******************************************************************************/ 00004 /* */ 00005 /* X r d O s s V S . h h */ 00006 /* */ 00007 /* (c) 2020 by the Board of Trustees of the Leland Stanford, Jr., University */ 00008 /* All Rights Reserved */ 00009 /* Produced by Andrew Hanushevsky for Stanford University under contract */ 00010 /* DE-AC02-76-SFO0515 with the Department of Energy */ 00011 /* */ 00012 /* This file is part of the XRootD software suite. */ 00013 /* */ 00014 /* XRootD is free software: you can redistribute it and/or modify it under */ 00015 /* the terms of the GNU Lesser General Public License as published by the */ 00016 /* Free Software Foundation, either version 3 of the License, or (at your */ 00017 /* option) any later version. */ 00018 /* */ 00019 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */ 00020 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */ 00021 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */ 00022 /* License for more details. */ 00023 /* */ 00024 /* You should have received a copy of the GNU Lesser General Public License */ 00025 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */ 00026 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */ 00027 /* */ 00028 /* The copyright holder's institutional names and contributor's names may not */ 00029 /* be used to endorse or promote products derived from this software without */ 00030 /* specific prior written permission of the institution or contributor. */ 00031 /******************************************************************************/ 00032 00033 /******************************************************************************/ 00034 /* C l a s s X r d O s s V S P a r t */ 00035 /******************************************************************************/ 00036 00037 //----------------------------------------------------------------------------- 00061 //----------------------------------------------------------------------------- 00062 00063 class XrdOssVSPart 00064 { 00065 public: 00066 const char *pPath; // Valid path to partition (not the allocation path) 00067 const char **aPath; // Allocation root paths for this partition 00068 long long Total; // Total bytes 00069 long long Free; // Total bytes free 00070 unsigned short bdevID; // Device unique ID (bdevs may have many partitions) 00071 unsigned short partID; // Partition unique ID (parts may have the same bdevID) 00072 int rsvd1; 00073 void *rsvd2; // Reserved 00074 00075 XrdOssVSPart() : pPath(0), aPath(0), Total(0), Free(0), 00076 bdevID(0), partID(0), rsvd1(0), rsvd2(0) 00077 {} 00078 ~XrdOssVSPart() {} 00079 }; 00080 00081 /******************************************************************************/ 00082 /* C l a s s X r d O s s V S I n f o */ 00083 /******************************************************************************/ 00084 00085 // Class passed to StatVS() 00086 // 00087 class XrdOssVSInfo 00088 { 00089 public: 00090 long long Total; // Total bytes 00091 long long Free; // Total bytes free 00092 long long Large; // Total bytes in largest partition 00093 long long LFree; // Max bytes free in contiguous chunk 00094 long long Usage; // Used bytes (if usage enabled) 00095 long long Quota; // Quota bytes (if quota enabled) 00096 int Extents; // Number of partitions/extents 00097 int Reserved; 00098 XrdOssVSPart *vsPart; // Partition info as vsPart[extents] may be nil 00099 00100 //----------------------------------------------------------------------------- 00108 //----------------------------------------------------------------------------- 00109 00110 XrdOssVSPart *Export(int &nParts) 00111 {XrdOssVSPart *pVec = vsPart; 00112 vsPart = 0; 00113 nParts = Extents; 00114 return pVec; 00115 } 00116 00117 XrdOssVSInfo() : Total(0),Free(0),Large(0),LFree(0),Usage(-1), 00118 Quota(-1),Extents(0),Reserved(0), vsPart(0) {} 00119 ~XrdOssVSInfo() {if (vsPart) delete [] vsPart;} 00120 }; 00121 #endif