#ifndef __HFS_HOTFILES__
#define __HFS_HOTFILES__
#include <sys/appleapiopts.h>
#ifdef KERNEL
#ifdef __APPLE_API_PRIVATE
#define HFC_FILENAME ".hotfiles.btree"
#define HFC_DEFAULT_FILE_COUNT 1000
#define HFC_DEFAULT_DURATION (3600 * 60)
#define HFC_CUMULATIVE_CYCLES 4
#define HFC_MAXIMUM_FILE_COUNT 5000
#define HFC_MAXIMUM_FILESIZE (10 * 1024 * 1024)
#define HFC_MINIMUM_TEMPERATURE 16
#define HFC_BLKSPERSYNC 300
#define HFC_FILESPERSYNC 50
enum hfc_stage {
HFC_DISABLED,
HFC_IDLE,
HFC_BUSY,
HFC_RECORDING,
HFC_EVALUATION,
HFC_EVICTION,
HFC_ADOPTION,
};
struct HotFileKey {
u_int16_t keyLength;
u_int8_t forkType;
u_int8_t pad;
u_int32_t temperature;
u_int32_t fileID;
};
typedef struct HotFileKey HotFileKey;
#define HFC_LOOKUPTAG 0xFFFFFFFF
#define HFC_KEYLENGTH (sizeof(HotFileKey) - sizeof(u_int16_t))
struct HotFilesInfo {
u_int32_t magic;
u_int32_t version;
u_int32_t duration;
u_int32_t timebase;
u_int32_t timeleft;
u_int32_t threshold;
u_int32_t maxfileblks;
u_int32_t maxfilecnt;
u_int8_t tag[32];
};
typedef struct HotFilesInfo HotFilesInfo;
#define HFC_MAGIC 0xFF28FF26
#define HFC_VERSION 1
struct hfsmount;
struct proc;
struct vnode;
int hfs_hotfilesync (struct hfsmount *, struct proc *);
int hfs_recording_init(struct hfsmount *, struct proc *);
int hfs_recording_start (struct hfsmount *, struct proc *);
int hfs_recording_stop (struct hfsmount *, struct proc *);
int hfs_recording_suspend (struct hfsmount *, struct proc *);
int hfs_recording_abort (struct hfsmount *, struct proc *);
int hfs_addhotfile (struct vnode *);
int hfs_removehotfile (struct vnode *);
#endif
#endif
#endif