2 * Copyright (c) 2006 Apple Computer, Inc. All Rights Reserved.
4 * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
30 #ifndef __HFS_HOTFILES__
31 #define __HFS_HOTFILES__
33 #include <sys/appleapiopts.h>
36 #ifdef __APPLE_API_PRIVATE
39 #define HFC_FILENAME ".hotfiles.btree"
43 * Temperature measurement constraints.
45 #define HFC_DEFAULT_FILE_COUNT 1000
46 #define HFC_DEFAULT_DURATION (3600 * 60)
47 #define HFC_CUMULATIVE_CYCLES 4
48 #define HFC_MAXIMUM_FILE_COUNT 5000
49 #define HFC_MAXIMUM_FILESIZE (10 * 1024 * 1024)
50 #define HFC_MINIMUM_TEMPERATURE 24
56 #define HFC_BLKSPERSYNC 300
57 #define HFC_FILESPERSYNC 50
61 * Hot file clustering stages.
75 * B-tree file key format (on-disk).
78 u_int16_t keyLength
; /* length of key, excluding this field */
79 u_int8_t forkType
; /* 0 = data fork, FF = resource fork */
80 u_int8_t pad
; /* make the other fields align on 32-bit boundary */
81 u_int32_t temperature
; /* temperature recorded */
82 u_int32_t fileID
; /* file ID */
84 typedef struct HotFileKey HotFileKey
;
86 #define HFC_LOOKUPTAG 0xFFFFFFFF
87 #define HFC_KEYLENGTH (sizeof(HotFileKey) - sizeof(u_int16_t))
90 * B-tree header node user info (on-disk).
95 u_int32_t duration
; /* duration of sample period */
96 u_int32_t timebase
; /* recording period start time */
97 u_int32_t timeleft
; /* recording period stop time */
99 u_int32_t maxfileblks
;
100 u_int32_t maxfilecnt
;
103 typedef struct HotFilesInfo HotFilesInfo
;
105 #define HFC_MAGIC 0xFF28FF26
106 #define HFC_VERSION 1
114 * Hot File interface functions.
116 int hfs_hotfilesync (struct hfsmount
*, struct proc
*);
118 int hfs_recording_init(struct hfsmount
*);
119 int hfs_recording_suspend (struct hfsmount
*);
121 int hfs_addhotfile (struct vnode
*);
122 int hfs_removehotfile (struct vnode
*);
124 int hfs_relocate(struct vnode
*, u_int32_t
, kauth_cred_t
, struct proc
*);
127 #endif /* __APPLE_API_PRIVATE */
129 #endif /* __HFS_HOTFILES__ */