2 * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
22 #ifndef __HFS_HOTFILES__
23 #define __HFS_HOTFILES__
25 #include <sys/appleapiopts.h>
28 #ifdef __APPLE_API_PRIVATE
31 #define HFC_FILENAME ".hotfiles.btree"
35 * Temperature measurement constraints.
37 #define HFC_DEFAULT_FILE_COUNT 1000
38 #define HFC_DEFAULT_DURATION (3600 * 60)
39 #define HFC_CUMULATIVE_CYCLES 4
40 #define HFC_MAXIMUM_FILE_COUNT 5000
41 #define HFC_MAXIMUM_FILESIZE (10 * 1024 * 1024)
42 #define HFC_MINIMUM_TEMPERATURE 24
48 #define HFC_BLKSPERSYNC 300
49 #define HFC_FILESPERSYNC 50
53 * Hot file clustering stages.
67 * B-tree file key format (on-disk).
70 u_int16_t keyLength
; /* length of key, excluding this field */
71 u_int8_t forkType
; /* 0 = data fork, FF = resource fork */
72 u_int8_t pad
; /* make the other fields align on 32-bit boundary */
73 u_int32_t temperature
; /* temperature recorded */
74 u_int32_t fileID
; /* file ID */
76 typedef struct HotFileKey HotFileKey
;
78 #define HFC_LOOKUPTAG 0xFFFFFFFF
79 #define HFC_KEYLENGTH (sizeof(HotFileKey) - sizeof(u_int16_t))
82 * B-tree header node user info (on-disk).
87 u_int32_t duration
; /* duration of sample period */
88 u_int32_t timebase
; /* recording period start time */
89 u_int32_t timeleft
; /* recording period stop time */
91 u_int32_t maxfileblks
;
95 typedef struct HotFilesInfo HotFilesInfo
;
97 #define HFC_MAGIC 0xFF28FF26
106 * Hot File interface functions.
108 int hfs_hotfilesync (struct hfsmount
*, struct proc
*);
110 int hfs_recording_init(struct hfsmount
*);
111 int hfs_recording_suspend (struct hfsmount
*);
113 int hfs_addhotfile (struct vnode
*);
114 int hfs_removehotfile (struct vnode
*);
116 int hfs_relocate(struct vnode
*, u_int32_t
, kauth_cred_t
, struct proc
*);
119 #endif /* __APPLE_API_PRIVATE */
121 #endif /* __HFS_HOTFILES__ */