1 #ifndef __XRDOSS_CACHE_H__
2 #define __XRDOSS_CACHE_H__
45 #include <sys/statvfs.h>
46 #define STATFS_t struct statvfs
47 #define FS_Stat(a,b) statvfs(a,b)
48 #define FS_BLKSZ f_frsize
49 #define FS_FFREE f_favail
51 #if defined(__linux__) || defined(__GNU__) || (defined(__FreeBSD_kernel__) && defined(__GLIBC__))
53 #define FS_Stat(a,b) statfs(a,b)
54 #define STATFS_t struct statfs
55 #define FS_BLKSZ f_bsize
56 #define FS_FFREE f_ffree
59 #include <sys/statfs.h>
60 #define STATFS_t struct statfs
61 #define FS_Stat(a,b) statfs(a,b)
62 #define FS_BLKSZ f_bsize
63 #define FS_FFREE f_ffree
65 #if defined(__APPLE__) || defined(__FreeBSD__)
66 #include <sys/param.h>
67 #include <sys/mount.h>
68 #define STATFS_t struct statfs
69 #define FS_Stat(a,b) statfs(a,b)
70 #define FS_BLKSZ f_bsize
71 #define FS_FFREE f_ffree
102 #define XrdOssFSData_OFFLINE 0x0001
103 #define XrdOssFSData_ADJUSTED 0x0002
104 #define XrdOssFSData_REFRESH 0x0004
147 static int Add(
const char *
Path);
148 static long long freeSpace(
long long &Size,
const char *
path=0);
204 {
if (!strcmp(
"public", grp))
PubGroup =
this;}
216 static void Adjust(dev_t devid, off_t size);
218 static void Adjust(
const char *
Path, off_t size,
struct stat *buf=0);
240 static int Alloc(allocInfo &aInfo);
242 static void DevInfo(
struct stat &buf,
bool limits=
false);
246 static int Init(
const char *UDir,
const char *Qfile,
247 int isSOL,
int usync=0);
249 static int Init(
long long aMin,
int ovhd,
int aFuzz);
253 static void MapDevs(
bool dBug=
false);
255 static char *
Parse(
const char *token,
char *cbuff,
int cblen);
257 static void *
Scan(
int cscanint);
275 static bool MapDM(
const char *ldm,
char *buff,
int blen);
277 static long long minAlloc;
278 static double fuzAlloc;
int stat(const char *path, struct stat *buf)
XrdOssCache_FSData(const char *, STATFS_t &, dev_t)
XrdOssCache_FSData * next
static int getSpace(XrdOssCache_Space &Space, const char *sname, XrdOssVSPart **vsPart=0)
XrdOssCache_Group * fsgroup
static long long freeSpace(long long &Size, const char *path=0)
static int Add(const char *Path)
XrdOssCache_FSData * fsdata
XrdOssCache_FS(int &retc, const char *fsg, const char *fsp, FSOpts opt)
static long long PubQuota
static XrdOssCache_Group * fsgroups
XrdOssCache_Group(const char *grp, XrdOssCache_FS *fsp=0)
static XrdOssCache_Group * PubGroup
static int Init(const char *UDir, const char *Qfile, int isSOL, int usync=0)
static XrdOssCache_FSData * fsdata
static void * Scan(int cscanint)
static int Alloc(allocInfo &aInfo)
static void DevInfo(struct stat &buf, bool limits=false)
static char * Parse(const char *token, char *cbuff, int cblen)
static XrdOssCache_FS * fsfirst
static void List(const char *lname, XrdSysError &Eroute)
static XrdOssCache_FS * fslast
static void MapDevs(bool dBug=false)
static XrdOssCache_FS * Find(const char *Path, int lklen=0)
static void Adjust(dev_t devid, off_t size)
allocInfo(const char *pP, char *bP, int bL)