]>
git.saurik.com Git - apple/xnu.git/blob - bsd/hfs/hfs_fsctl.h
aad94ddabebb03f1062b9ccaad0939b709d41918
2 * Copyright (c) 2004-2006 Apple Computer, Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_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 License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
32 #include <sys/appleapiopts.h>
34 #include <sys/param.h>
35 #include <sys/ioccom.h>
39 #ifdef __APPLE_API_UNSTABLE
41 struct hfs_backingstoreinfo
{
42 int signature
; /* == 3419115 */
43 int version
; /* version of this struct (1) */
44 int backingfd
; /* disk image file (on backing fs) */
45 int bandsize
; /* sparse disk image band size */
49 typedef char pathname_t
[MAXPATHLEN
];
51 struct hfs_journal_info
{
57 /* HFS FS CONTROL COMMANDS */
59 #define HFSIOC_RESIZE_PROGRESS _IOR('h', 1, u_int32_t)
60 #define HFS_RESIZE_PROGRESS IOCBASECMD(HFSIOC_RESIZE_PROGRESS)
62 #define HFSIOC_RESIZE_VOLUME _IOW('h', 2, u_int64_t)
63 #define HFS_RESIZE_VOLUME IOCBASECMD(HFSIOC_RESIZE_VOLUME)
65 #define HFSIOC_CHANGE_NEXT_ALLOCATION _IOWR('h', 3, u_int32_t)
66 #define HFS_CHANGE_NEXT_ALLOCATION IOCBASECMD(HFSIOC_CHANGE_NEXT_ALLOCATION)
67 /* Magic value for next allocation to use with fcntl to set next allocation
68 * to zero and never update it again on new block allocation.
70 #define HFS_NO_UPDATE_NEXT_ALLOCATION 0xffffFFFF
72 #define HFSIOC_GETCREATETIME _IOR('h', 4, time_t)
73 #define HFS_GETCREATETIME IOCBASECMD(HFSIOC_GETCREATETIME)
75 #define HFSIOC_SETBACKINGSTOREINFO _IOW('h', 7, struct hfs_backingstoreinfo)
76 #define HFS_SETBACKINGSTOREINFO IOCBASECMD(HFSIOC_SETBACKINGSTOREINFO)
78 #define HFSIOC_CLRBACKINGSTOREINFO _IO('h', 8)
79 #define HFS_CLRBACKINGSTOREINFO IOCBASECMD(HFSIOC_CLRBACKINGSTOREINFO)
81 #define HFSIOC_BULKACCESS _IOW('h', 9, struct user32_access_t)
82 #define HFS_BULKACCESS_FSCTL IOCBASECMD(HFSIOC_BULKACCESS)
84 /* Unsupported - Previously used to enable/disable ACLs */
85 #define HFSIOC_UNSUPPORTED _IOW('h', 10, int32_t)
87 #define HFSIOC_PREV_LINK _IOWR('h', 11, u_int32_t)
88 #define HFS_PREV_LINK IOCBASECMD(HFSIOC_PREV_LINK)
90 #define HFSIOC_NEXT_LINK _IOWR('h', 12, u_int32_t)
91 #define HFS_NEXT_LINK IOCBASECMD(HFSIOC_NEXT_LINK)
93 #define HFSIOC_GETPATH _IOWR('h', 13, pathname_t)
94 #define HFS_GETPATH IOCBASECMD(HFSIOC_GETPATH)
95 /* By default, the path returned by HFS_GETPATH is an absolute path,
96 * i.e. it also contains the mount point of the volume on which the
97 * fileID exists. If the following bit is set, the path returned is
98 * relative to the root of the volume.
100 #define HFS_GETPATH_VOLUME_RELATIVE 0x1
102 /* Enable/disable extent-based extended attributes */
103 #define HFSIOC_SET_XATTREXTENTS_STATE _IOW('h', 14, u_int32_t)
104 #define HFS_SET_XATTREXTENTS_STATE IOCBASECMD(HFSIOC_SET_XATTREXTENTS_STATE)
106 #define HFSIOC_EXT_BULKACCESS _IOW('h', 15, struct user32_ext_access_t)
107 #define HFS_EXT_BULKACCESS_FSCTL IOCBASECMD(HFSIOC_EXT_BULKACCESS)
109 #define HFSIOC_MARK_BOOT_CORRUPT _IO('h', 16)
110 #define HFS_MARK_BOOT_CORRUPT IOCBASECMD(HFSIOC_MARK_BOOT_CORRUPT)
112 #define HFSIOC_GET_JOURNAL_INFO _IOR('h', 17, struct hfs_journal_info)
113 #define HFS_FSCTL_GET_JOURNAL_INFO IOCBASECMD(HFSIOC_GET_JOURNAL_INFO)
115 #define HFSIOC_SET_VERY_LOW_DISK _IOW('h', 20, u_int32_t)
116 #define HFS_FSCTL_SET_VERY_LOW_DISK IOCBASECMD(HFSIOC_SET_VERY_LOW_DISK)
118 #define HFSIOC_SET_LOW_DISK _IOW('h', 21, u_int32_t)
119 #define HFS_FSCTL_SET_LOW_DISK IOCBASECMD(HFSIOC_SET_LOW_DISK)
121 #define HFSIOC_SET_DESIRED_DISK _IOW('h', 22, u_int32_t)
122 #define HFS_FSCTL_SET_DESIRED_DISK IOCBASECMD(HFSIOC_SET_DESIRED_DISK)
124 #define HFSIOC_SET_ALWAYS_ZEROFILL _IOW('h', 23, int32_t)
125 #define HFS_SET_ALWAYS_ZEROFILL IOCBASECMD(HFSIOC_SET_ALWAYS_ZEROFILL)
127 #define HFSIOC_VOLUME_STATUS _IOR('h', 24, u_int32_t)
128 #define HFS_VOLUME_STATUS IOCBASECMD(HFSIOC_VOLUME_STATUS)
130 /* Disable metadata zone for given volume */
131 #define HFSIOC_DISABLE_METAZONE _IO('h', 25)
132 #define HFS_DISABLE_METAZONE IOCBASECMD(HFSIOC_DISABLE_METAZONE)
134 /* Change the next CNID value */
135 #define HFSIOC_CHANGE_NEXTCNID _IOWR('h', 26, u_int32_t)
136 #define HFS_CHANGE_NEXTCNID IOCBASECMD(HFSIOC_CHANGE_NEXTCNID)
138 /* Get the low disk space values */
139 #define HFSIOC_GET_VERY_LOW_DISK _IOR('h', 27, u_int32_t)
140 #define HFS_FSCTL_GET_VERY_LOW_DISK IOCBASECMD(HFSIOC_GET_VERY_LOW_DISK)
142 #define HFSIOC_GET_LOW_DISK _IOR('h', 28, u_int32_t)
143 #define HFS_FSCTL_GET_LOW_DISK IOCBASECMD(HFSIOC_GET_LOW_DISK)
145 #define HFSIOC_GET_DESIRED_DISK _IOR('h', 29, u_int32_t)
146 #define HFS_FSCTL_GET_DESIRED_DISK IOCBASECMD(HFSIOC_GET_DESIRED_DISK)
148 #define HFSIOC_GET_WRITE_GEN_COUNTER _IOR('h', 30, u_int32_t)
149 #define HFS_GET_WRITE_GEN_COUNTER IOCBASECMD(HFSIOC_GET_WRITE_GEN_COUNTER)
151 #define HFS_DOCUMENT_ID_ALLOCATE 0x1
153 #define HFSIOC_GET_DOCUMENT_ID _IOR('h', 31, u_int32_t)
154 #define HFS_GET_DOCUMENT_ID IOCBASECMD(HFSIOC_GET_DOCUMENT_ID)
156 /* revisiond only uses this when something transforms in a way the kernel can't track such as "foo.rtf" -> "foo.rtfd" */
157 #define HFSIOC_TRANSFER_DOCUMENT_ID _IOW('h', 32, u_int32_t)
158 #define HFS_TRANSFER_DOCUMENT_ID IOCBASECMD(HFSIOC_TRANSFER_DOCUMENT_ID)
160 #endif /* __APPLE_API_UNSTABLE */
162 #endif /* ! _HFS_FSCTL_H_ */