00001 #ifndef __XRDOSSMIO_H__
00002 #define __XRDOSSMIO_H__
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include "XrdSys/XrdSysError.hh"
00014 #include "XrdOuc/XrdOucHash.hh"
00015 #include "XrdSys/XrdSysPthread.hh"
00016 #include "XrdOss/XrdOssMioFile.hh"
00017
00018
00019
00020 #define OSSMIO_MLOK 0x0001
00021 #define OSSMIO_MMAP 0x0002
00022 #define OSSMIO_MPRM 0x0004
00023
00024 class XrdOssMio
00025 {
00026 public:
00027 static void Display(XrdSysError &Eroute);
00028
00029 static char isAuto() {return MM_chk;}
00030
00031 static char isOn() {return MM_on;}
00032
00033 static XrdOssMioFile *Map(char *path, int fd, int opts);
00034
00035 static void *preLoad(void *arg);
00036
00037 static void Recycle(XrdOssMioFile *mp);
00038
00039 static void Set(int V_off, int V_preld, int V_check);
00040
00041 static void Set(long long V_max);
00042
00043 private:
00044 static int Reclaim(off_t amount);
00045 static int Reclaim(XrdOssMioFile *mp);
00046
00047 static XrdOucHash<XrdOssMioFile> MM_Hash;
00048
00049 static XrdSysMutex MM_Mutex;
00050 static XrdOssMioFile *MM_Perm;
00051 static XrdOssMioFile *MM_Idle;
00052 static XrdOssMioFile *MM_IdleLast;
00053
00054 static char MM_on;
00055 static char MM_chk;
00056 static char MM_okmlock;
00057 static char MM_preld;
00058 static long long MM_max;
00059 static long long MM_pagsz;
00060 static long long MM_pages;
00061 static long long MM_inuse;
00062 };
00063 #endif