xrootd
XrdOssMio.hh
Go to the documentation of this file.
1 #ifndef __XRDOSSMIO_H__
2 #define __XRDOSSMIO_H__
3 /******************************************************************************/
4 /* */
5 /* X r d o s s M i o . h h */
6 /* */
7 /* (c) 2005 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 #include "XrdSys/XrdSysError.hh"
14 #include "XrdOuc/XrdOucHash.hh"
15 #include "XrdSys/XrdSysPthread.hh"
16 #include "XrdOss/XrdOssMioFile.hh"
17 
18 // The following are options passed to Map()
19 //
20 #define OSSMIO_MLOK 0x0001
21 #define OSSMIO_MMAP 0x0002
22 #define OSSMIO_MPRM 0x0004
23 
24 class XrdOssMio
25 {
26 public:
27 static void Display(XrdSysError &Eroute);
28 
29 static char isAuto() {return MM_chk;}
30 
31 static char isOn() {return MM_on;}
32 
33 static XrdOssMioFile *Map(char *path, int fd, int opts);
34 
35 static void *preLoad(void *arg);
36 
37 static void Recycle(XrdOssMioFile *mp);
38 
39 static void Set(int V_off, int V_preld, int V_check);
40 
41 static void Set(long long V_max);
42 
43 private:
44 static int Reclaim(off_t amount);
45 static int Reclaim(XrdOssMioFile *mp);
46 
48 
53 
54 static char MM_on;
55 static char MM_chk;
56 static char MM_okmlock;
57 static char MM_preld;
58 static long long MM_max;
59 static long long MM_pagsz;
60 static long long MM_pages;
61 static long long MM_inuse;
62 };
63 #endif