1*e3723e1fSApple OSS Distributions /*
2*e3723e1fSApple OSS Distributions * Copyright (c) 2008 Apple Inc. All rights reserved.
3*e3723e1fSApple OSS Distributions *
4*e3723e1fSApple OSS Distributions * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5*e3723e1fSApple OSS Distributions *
6*e3723e1fSApple OSS Distributions * This file contains Original Code and/or Modifications of Original Code
7*e3723e1fSApple OSS Distributions * as defined in and that are subject to the Apple Public Source License
8*e3723e1fSApple OSS Distributions * Version 2.0 (the 'License'). You may not use this file except in
9*e3723e1fSApple OSS Distributions * compliance with the License. The rights granted to you under the License
10*e3723e1fSApple OSS Distributions * may not be used to create, or enable the creation or redistribution of,
11*e3723e1fSApple OSS Distributions * unlawful or unlicensed copies of an Apple operating system, or to
12*e3723e1fSApple OSS Distributions * circumvent, violate, or enable the circumvention or violation of, any
13*e3723e1fSApple OSS Distributions * terms of an Apple operating system software license agreement.
14*e3723e1fSApple OSS Distributions *
15*e3723e1fSApple OSS Distributions * Please obtain a copy of the License at
16*e3723e1fSApple OSS Distributions * http://www.opensource.apple.com/apsl/ and read it before using this file.
17*e3723e1fSApple OSS Distributions *
18*e3723e1fSApple OSS Distributions * The Original Code and all software distributed under the License are
19*e3723e1fSApple OSS Distributions * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20*e3723e1fSApple OSS Distributions * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21*e3723e1fSApple OSS Distributions * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22*e3723e1fSApple OSS Distributions * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23*e3723e1fSApple OSS Distributions * Please see the License for the specific language governing rights and
24*e3723e1fSApple OSS Distributions * limitations under the License.
25*e3723e1fSApple OSS Distributions *
26*e3723e1fSApple OSS Distributions * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27*e3723e1fSApple OSS Distributions */
28*e3723e1fSApple OSS Distributions #ifndef _SYS_DECMPFS_H_
29*e3723e1fSApple OSS Distributions #define _SYS_DECMPFS_H_ 1
30*e3723e1fSApple OSS Distributions
31*e3723e1fSApple OSS Distributions #include <stdbool.h>
32*e3723e1fSApple OSS Distributions #include <sys/kdebug.h>
33*e3723e1fSApple OSS Distributions #include <sys/kernel_types.h>
34*e3723e1fSApple OSS Distributions #include <sys/vnode.h>
35*e3723e1fSApple OSS Distributions #include <sys/cdefs.h>
36*e3723e1fSApple OSS Distributions
37*e3723e1fSApple OSS Distributions __BEGIN_DECLS
38*e3723e1fSApple OSS Distributions /*
39*e3723e1fSApple OSS Distributions * Please switch on @DECMPFS_ENABLE_KDEBUG_TRACES to enable tracepoints.
40*e3723e1fSApple OSS Distributions * Tracepoints are compiled out by default to eliminate any overhead due to
41*e3723e1fSApple OSS Distributions * kernel tracing.
42*e3723e1fSApple OSS Distributions *
43*e3723e1fSApple OSS Distributions * #define DECMPFS_ENABLE_KDEBUG_TRACES 1
44*e3723e1fSApple OSS Distributions */
45*e3723e1fSApple OSS Distributions #if DECMPFS_ENABLE_KDEBUG_TRACES
46*e3723e1fSApple OSS Distributions #define DECMPFS_EMIT_TRACE_ENTRY(D, ...) \
47*e3723e1fSApple OSS Distributions KDBG_FILTERED((D) | DBG_FUNC_START, ## __VA_ARGS__)
48*e3723e1fSApple OSS Distributions #define DECMPFS_EMIT_TRACE_RETURN(D, ...) \
49*e3723e1fSApple OSS Distributions KDBG_FILTERED((D) | DBG_FUNC_END, ##__VA_ARGS__)
50*e3723e1fSApple OSS Distributions #else
51*e3723e1fSApple OSS Distributions #define DECMPFS_EMIT_TRACE_ENTRY(D, ...) do {} while (0)
52*e3723e1fSApple OSS Distributions #define DECMPFS_EMIT_TRACE_RETURN(D, ...) do {} while (0)
53*e3723e1fSApple OSS Distributions #endif /* DECMPFS_ENABLE_KDEBUG_TRACES */
54*e3723e1fSApple OSS Distributions
55*e3723e1fSApple OSS Distributions /*
56*e3723e1fSApple OSS Distributions * KERNEL_DEBUG related definitions for decmpfs.
57*e3723e1fSApple OSS Distributions *
58*e3723e1fSApple OSS Distributions * Please NOTE: The Class DBG_FSYSTEM = 3, and Subclass DBG_DECMP = 0x12, so
59*e3723e1fSApple OSS Distributions * these debug codes are of the form 0x0312nnnn.
60*e3723e1fSApple OSS Distributions */
61*e3723e1fSApple OSS Distributions #define DECMPDBG_CODE(code) FSDBG_CODE(DBG_DECMP, code)
62*e3723e1fSApple OSS Distributions
63*e3723e1fSApple OSS Distributions enum {
64*e3723e1fSApple OSS Distributions DECMPDBG_DECOMPRESS_FILE = DECMPDBG_CODE(0),/* 0x03120000 */
65*e3723e1fSApple OSS Distributions DECMPDBG_FETCH_COMPRESSED_HEADER = DECMPDBG_CODE(1),/* 0x03120004 */
66*e3723e1fSApple OSS Distributions DECMPDBG_FETCH_UNCOMPRESSED_DATA = DECMPDBG_CODE(2),/* 0x03120008 */
67*e3723e1fSApple OSS Distributions DECMPDBG_FREE_COMPRESSED_DATA = DECMPDBG_CODE(4),/* 0x03120010 */
68*e3723e1fSApple OSS Distributions DECMPDBG_FILE_IS_COMPRESSED = DECMPDBG_CODE(5),/* 0x03120014 */
69*e3723e1fSApple OSS Distributions };
70*e3723e1fSApple OSS Distributions
71*e3723e1fSApple OSS Distributions #define MAX_DECMPFS_XATTR_SIZE 3802
72*e3723e1fSApple OSS Distributions
73*e3723e1fSApple OSS Distributions /*
74*e3723e1fSApple OSS Distributions * NOTE: decmpfs can only be used by thread-safe filesystems
75*e3723e1fSApple OSS Distributions */
76*e3723e1fSApple OSS Distributions
77*e3723e1fSApple OSS Distributions #define DECMPFS_MAGIC 0x636d7066 /* cmpf */
78*e3723e1fSApple OSS Distributions
79*e3723e1fSApple OSS Distributions #define DECMPFS_XATTR_NAME "com.apple.decmpfs" /* extended attribute to use for decmpfs */
80*e3723e1fSApple OSS Distributions
81*e3723e1fSApple OSS Distributions /*
82*e3723e1fSApple OSS Distributions * This single field is to be interpreted differently depending on the
83*e3723e1fSApple OSS Distributions * corresponding item type.
84*e3723e1fSApple OSS Distributions * For regular files: it is a 64bits-encoded logical size
85*e3723e1fSApple OSS Distributions * For directories: it is a 64bits-encoded number of children (ie st_nlink - 2)
86*e3723e1fSApple OSS Distributions * For packages: it is 40bits encoded size and 24bits number of children at root
87*e3723e1fSApple OSS Distributions */
88*e3723e1fSApple OSS Distributions typedef struct __attribute__((packed)) {
89*e3723e1fSApple OSS Distributions uint64_t value;
90*e3723e1fSApple OSS Distributions } decmpfs_raw_item_size;
91*e3723e1fSApple OSS Distributions
92*e3723e1fSApple OSS Distributions #define DECMPFS_PKG_SIZE_MASK 0x000000ffffffffffULL
93*e3723e1fSApple OSS Distributions #define DECMPFS_PKG_COUNT_MASK 0xffffff
94*e3723e1fSApple OSS Distributions #define DECMPFS_PKG_CHLD_COUNT_SHIFT 40
95*e3723e1fSApple OSS Distributions
96*e3723e1fSApple OSS Distributions #define DECMPFS_PKG_SIZE(x) ((x).value & DECMPFS_PKG_SIZE_MASK)
97*e3723e1fSApple OSS Distributions #define DECMPFS_PKG_CHLD_COUNT(x) ((uint32_t)(((x).value >> DECMPFS_PKG_CHLD_COUNT_SHIFT) & DECMPFS_PKG_COUNT_MASK))
98*e3723e1fSApple OSS Distributions #define DECMPFS_PKG_VALUE_FROM_SIZE_COUNT(size, count) \
99*e3723e1fSApple OSS Distributions (((size) & DECMPFS_PKG_SIZE_MASK) | ((uint64_t)(count) << DECMPFS_PKG_CHLD_COUNT_SHIFT))
100*e3723e1fSApple OSS Distributions
101*e3723e1fSApple OSS Distributions /* Dataless file or directory */
102*e3723e1fSApple OSS Distributions #define DATALESS_CMPFS_TYPE 0x80000001
103*e3723e1fSApple OSS Distributions
104*e3723e1fSApple OSS Distributions /* Dataless package, with number of root children and total size encoded on disk */
105*e3723e1fSApple OSS Distributions #define DATALESS_PKG_CMPFS_TYPE 0x80000002
106*e3723e1fSApple OSS Distributions
107*e3723e1fSApple OSS Distributions
108*e3723e1fSApple OSS Distributions static inline bool
decmpfs_type_is_dataless(uint32_t cmp_type)109*e3723e1fSApple OSS Distributions decmpfs_type_is_dataless(uint32_t cmp_type)
110*e3723e1fSApple OSS Distributions {
111*e3723e1fSApple OSS Distributions return cmp_type == DATALESS_CMPFS_TYPE || cmp_type == DATALESS_PKG_CMPFS_TYPE;
112*e3723e1fSApple OSS Distributions }
113*e3723e1fSApple OSS Distributions
114*e3723e1fSApple OSS Distributions typedef struct __attribute__((packed)) {
115*e3723e1fSApple OSS Distributions /* this structure represents the xattr on disk; the fields below are little-endian */
116*e3723e1fSApple OSS Distributions uint32_t compression_magic;
117*e3723e1fSApple OSS Distributions uint32_t compression_type; /* see the enum below */
118*e3723e1fSApple OSS Distributions union {
119*e3723e1fSApple OSS Distributions uint64_t uncompressed_size; /* compatility accessor */
120*e3723e1fSApple OSS Distributions decmpfs_raw_item_size _size;
121*e3723e1fSApple OSS Distributions };
122*e3723e1fSApple OSS Distributions unsigned char attr_bytes[0]; /* the bytes of the attribute after the header */
123*e3723e1fSApple OSS Distributions } decmpfs_disk_header;
124*e3723e1fSApple OSS Distributions
125*e3723e1fSApple OSS Distributions typedef struct __attribute__((packed)) {
126*e3723e1fSApple OSS Distributions /* this structure represents the xattr in memory; the fields below are host-endian */
127*e3723e1fSApple OSS Distributions uint32_t attr_size;
128*e3723e1fSApple OSS Distributions uint32_t compression_magic;
129*e3723e1fSApple OSS Distributions uint32_t compression_type;
130*e3723e1fSApple OSS Distributions union {
131*e3723e1fSApple OSS Distributions /*
132*e3723e1fSApple OSS Distributions * although uncompressed_size remains available for backward-compatibility reasons
133*e3723e1fSApple OSS Distributions * the uncompressed size and nchildren should be accessed using the inline helpers
134*e3723e1fSApple OSS Distributions * below
135*e3723e1fSApple OSS Distributions */
136*e3723e1fSApple OSS Distributions uint64_t uncompressed_size;
137*e3723e1fSApple OSS Distributions decmpfs_raw_item_size _size;
138*e3723e1fSApple OSS Distributions };
139*e3723e1fSApple OSS Distributions unsigned char attr_bytes[0]; /* the bytes of the attribute after the header */
140*e3723e1fSApple OSS Distributions } decmpfs_header;
141*e3723e1fSApple OSS Distributions
142*e3723e1fSApple OSS Distributions static inline uint64_t
decmpfs_get_uncompressed_size(const decmpfs_header * hdr)143*e3723e1fSApple OSS Distributions decmpfs_get_uncompressed_size(const decmpfs_header *hdr)
144*e3723e1fSApple OSS Distributions {
145*e3723e1fSApple OSS Distributions if (hdr->compression_magic == DECMPFS_MAGIC && hdr->compression_type == DATALESS_PKG_CMPFS_TYPE) {
146*e3723e1fSApple OSS Distributions return DECMPFS_PKG_SIZE(hdr->_size);
147*e3723e1fSApple OSS Distributions }
148*e3723e1fSApple OSS Distributions
149*e3723e1fSApple OSS Distributions return hdr->uncompressed_size;
150*e3723e1fSApple OSS Distributions }
151*e3723e1fSApple OSS Distributions
152*e3723e1fSApple OSS Distributions static inline uint32_t
decmpfs_get_directory_entries(const decmpfs_header * hdr)153*e3723e1fSApple OSS Distributions decmpfs_get_directory_entries(const decmpfs_header *hdr)
154*e3723e1fSApple OSS Distributions {
155*e3723e1fSApple OSS Distributions if (hdr->compression_magic == DECMPFS_MAGIC && hdr->compression_type == DATALESS_PKG_CMPFS_TYPE) {
156*e3723e1fSApple OSS Distributions return DECMPFS_PKG_CHLD_COUNT(hdr->_size);
157*e3723e1fSApple OSS Distributions }
158*e3723e1fSApple OSS Distributions
159*e3723e1fSApple OSS Distributions return (uint32_t)hdr->uncompressed_size;
160*e3723e1fSApple OSS Distributions }
161*e3723e1fSApple OSS Distributions
162*e3723e1fSApple OSS Distributions /* compression_type values */
163*e3723e1fSApple OSS Distributions enum {
164*e3723e1fSApple OSS Distributions CMP_Type1 = 1,/* uncompressed data in xattr */
165*e3723e1fSApple OSS Distributions
166*e3723e1fSApple OSS Distributions /* additional types defined in AppleFSCompression project */
167*e3723e1fSApple OSS Distributions
168*e3723e1fSApple OSS Distributions CMP_MAX = 255/* Highest compression_type supported */
169*e3723e1fSApple OSS Distributions };
170*e3723e1fSApple OSS Distributions
171*e3723e1fSApple OSS Distributions typedef struct {
172*e3723e1fSApple OSS Distributions void *buf;
173*e3723e1fSApple OSS Distributions user_ssize_t size;
174*e3723e1fSApple OSS Distributions } decmpfs_vector;
175*e3723e1fSApple OSS Distributions
176*e3723e1fSApple OSS Distributions __END_DECLS
177*e3723e1fSApple OSS Distributions
178*e3723e1fSApple OSS Distributions #ifdef KERNEL
179*e3723e1fSApple OSS Distributions
180*e3723e1fSApple OSS Distributions #ifdef XNU_KERNEL_PRIVATE
181*e3723e1fSApple OSS Distributions
182*e3723e1fSApple OSS Distributions #include <kern/locks.h>
183*e3723e1fSApple OSS Distributions
184*e3723e1fSApple OSS Distributions __BEGIN_DECLS
185*e3723e1fSApple OSS Distributions
186*e3723e1fSApple OSS Distributions struct decmpfs_cnode {
187*e3723e1fSApple OSS Distributions uint8_t cmp_state;
188*e3723e1fSApple OSS Distributions uint8_t cmp_minimal_xattr; /* if non-zero, this file's com.apple.decmpfs xattr contained only the minimal decmpfs_disk_header */
189*e3723e1fSApple OSS Distributions uint32_t cmp_type;
190*e3723e1fSApple OSS Distributions uint32_t lockcount;
191*e3723e1fSApple OSS Distributions void *lockowner; /* cnode's lock owner (if a thread is currently holding an exclusive lock) */
192*e3723e1fSApple OSS Distributions uint64_t uncompressed_size __attribute__((aligned(8)));
193*e3723e1fSApple OSS Distributions uint64_t nchildren __attribute__((aligned(8))); /* for dataless directories (incl. packages) */
194*e3723e1fSApple OSS Distributions uint64_t total_size __attribute__((aligned(8)));/* for dataless directories (incl. packages) */
195*e3723e1fSApple OSS Distributions uint64_t decompression_flags;
196*e3723e1fSApple OSS Distributions lck_rw_t compressed_data_lock;
197*e3723e1fSApple OSS Distributions };
198*e3723e1fSApple OSS Distributions
199*e3723e1fSApple OSS Distributions __END_DECLS
200*e3723e1fSApple OSS Distributions
201*e3723e1fSApple OSS Distributions #endif // XNU_KERNEL_PRIVATE
202*e3723e1fSApple OSS Distributions
203*e3723e1fSApple OSS Distributions __BEGIN_DECLS
204*e3723e1fSApple OSS Distributions
205*e3723e1fSApple OSS Distributions typedef struct decmpfs_cnode decmpfs_cnode;
206*e3723e1fSApple OSS Distributions
207*e3723e1fSApple OSS Distributions /* return values from decmpfs_file_is_compressed */
208*e3723e1fSApple OSS Distributions enum {
209*e3723e1fSApple OSS Distributions FILE_TYPE_UNKNOWN = 0,
210*e3723e1fSApple OSS Distributions FILE_IS_NOT_COMPRESSED = 1,
211*e3723e1fSApple OSS Distributions FILE_IS_COMPRESSED = 2,
212*e3723e1fSApple OSS Distributions FILE_IS_CONVERTING = 3/* file is converting from compressed to decompressed */
213*e3723e1fSApple OSS Distributions };
214*e3723e1fSApple OSS Distributions
215*e3723e1fSApple OSS Distributions /* vfs entrypoints */
216*e3723e1fSApple OSS Distributions extern vfs_context_t decmpfs_ctx;
217*e3723e1fSApple OSS Distributions
218*e3723e1fSApple OSS Distributions /* client filesystem entrypoints */
219*e3723e1fSApple OSS Distributions void decmpfs_init(void);
220*e3723e1fSApple OSS Distributions decmpfs_cnode *decmpfs_cnode_alloc(void);
221*e3723e1fSApple OSS Distributions void decmpfs_cnode_free(decmpfs_cnode *dp);
222*e3723e1fSApple OSS Distributions void decmpfs_cnode_init(decmpfs_cnode *cp);
223*e3723e1fSApple OSS Distributions void decmpfs_cnode_destroy(decmpfs_cnode *cp);
224*e3723e1fSApple OSS Distributions
225*e3723e1fSApple OSS Distributions int decmpfs_hides_rsrc(vfs_context_t ctx, decmpfs_cnode *cp);
226*e3723e1fSApple OSS Distributions int decmpfs_hides_xattr(vfs_context_t ctx, decmpfs_cnode *cp, const char *xattr);
227*e3723e1fSApple OSS Distributions
228*e3723e1fSApple OSS Distributions bool decmpfs_trylock_compressed_data(decmpfs_cnode *cp, int exclusive);
229*e3723e1fSApple OSS Distributions void decmpfs_lock_compressed_data(decmpfs_cnode *cp, int exclusive);
230*e3723e1fSApple OSS Distributions void decmpfs_unlock_compressed_data(decmpfs_cnode *cp, int exclusive);
231*e3723e1fSApple OSS Distributions
232*e3723e1fSApple OSS Distributions uint32_t decmpfs_cnode_get_vnode_state(decmpfs_cnode *cp);
233*e3723e1fSApple OSS Distributions void decmpfs_cnode_set_vnode_state(decmpfs_cnode *cp, uint32_t state, int skiplock);
234*e3723e1fSApple OSS Distributions uint64_t decmpfs_cnode_get_vnode_cached_size(decmpfs_cnode *cp);
235*e3723e1fSApple OSS Distributions uint64_t decmpfs_cnode_get_vnode_cached_nchildren(decmpfs_cnode *cp);
236*e3723e1fSApple OSS Distributions uint64_t decmpfs_cnode_get_vnode_cached_total_size(decmpfs_cnode *cp);
237*e3723e1fSApple OSS Distributions void decmpfs_cnode_set_vnode_cached_size(decmpfs_cnode *cp, uint64_t size);
238*e3723e1fSApple OSS Distributions void decmpfs_cnode_set_vnode_cached_nchildren(decmpfs_cnode *cp, uint64_t nchildren);
239*e3723e1fSApple OSS Distributions void decmpfs_cnode_set_vnode_cached_total_size(decmpfs_cnode *cp, uint64_t total_sz);
240*e3723e1fSApple OSS Distributions uint32_t decmpfs_cnode_cmp_type(decmpfs_cnode *cp);
241*e3723e1fSApple OSS Distributions
242*e3723e1fSApple OSS Distributions int decmpfs_file_is_compressed(vnode_t vp, decmpfs_cnode *cp);
243*e3723e1fSApple OSS Distributions errno_t decmpfs_validate_compressed_file(vnode_t vp, decmpfs_cnode *cp);
244*e3723e1fSApple OSS Distributions int decmpfs_decompress_file(vnode_t vp, decmpfs_cnode *cp, off_t toSize, int truncate_okay, int skiplock); /* if toSize == -1, decompress the entire file */
245*e3723e1fSApple OSS Distributions int decmpfs_free_compressed_data(vnode_t vp, decmpfs_cnode *cp);
246*e3723e1fSApple OSS Distributions int decmpfs_update_attributes(vnode_t vp, struct vnode_attr *vap);
247*e3723e1fSApple OSS Distributions /* the following two routines will set *is_compressed to 0 if the file was converted from compressed to decompressed before data could be fetched from the decompressor */
248*e3723e1fSApple OSS Distributions errno_t decmpfs_pagein_compressed(struct vnop_pagein_args *ap, int *is_compressed, decmpfs_cnode *cp);
249*e3723e1fSApple OSS Distributions errno_t decmpfs_read_compressed(struct vnop_read_args *ap, int *is_compressed, decmpfs_cnode *cp);
250*e3723e1fSApple OSS Distributions
251*e3723e1fSApple OSS Distributions /* types shared between the kernel and kexts */
252*e3723e1fSApple OSS Distributions typedef int (*decmpfs_validate_compressed_file_func)(vnode_t vp, vfs_context_t ctx, decmpfs_header *hdr);
253*e3723e1fSApple OSS Distributions typedef void (*decmpfs_adjust_fetch_region_func)(vnode_t vp, vfs_context_t ctx, decmpfs_header *hdr, off_t *offset, user_ssize_t *size);
254*e3723e1fSApple OSS Distributions typedef int (*decmpfs_fetch_uncompressed_data_func)(vnode_t vp, vfs_context_t ctx, decmpfs_header *hdr, off_t offset, user_ssize_t size, int nvec, decmpfs_vector *vec, uint64_t *bytes_read);
255*e3723e1fSApple OSS Distributions typedef int (*decmpfs_free_compressed_data_func)(vnode_t vp, vfs_context_t ctx, decmpfs_header *hdr);
256*e3723e1fSApple OSS Distributions typedef uint64_t (*decmpfs_get_decompression_flags_func)(vnode_t vp, vfs_context_t ctx, decmpfs_header *hdr); // returns flags from the DECMPFS_FLAGS enumeration below
257*e3723e1fSApple OSS Distributions
258*e3723e1fSApple OSS Distributions enum {
259*e3723e1fSApple OSS Distributions DECMPFS_FLAGS_FORCE_FLUSH_ON_DECOMPRESS = 1 << 0,
260*e3723e1fSApple OSS Distributions };
261*e3723e1fSApple OSS Distributions
262*e3723e1fSApple OSS Distributions /* Versions that are supported for binary compatibility */
263*e3723e1fSApple OSS Distributions #define DECMPFS_REGISTRATION_VERSION_V1 1
264*e3723e1fSApple OSS Distributions #define DECMPFS_REGISTRATION_VERSION_V3 3
265*e3723e1fSApple OSS Distributions
266*e3723e1fSApple OSS Distributions #define DECMPFS_REGISTRATION_VERSION (DECMPFS_REGISTRATION_VERSION_V3)
267*e3723e1fSApple OSS Distributions
268*e3723e1fSApple OSS Distributions typedef struct {
269*e3723e1fSApple OSS Distributions int decmpfs_registration;
270*e3723e1fSApple OSS Distributions decmpfs_validate_compressed_file_func validate;
271*e3723e1fSApple OSS Distributions decmpfs_adjust_fetch_region_func adjust_fetch;
272*e3723e1fSApple OSS Distributions decmpfs_fetch_uncompressed_data_func fetch;
273*e3723e1fSApple OSS Distributions decmpfs_free_compressed_data_func free_data;
274*e3723e1fSApple OSS Distributions decmpfs_get_decompression_flags_func get_flags;
275*e3723e1fSApple OSS Distributions } decmpfs_registration;
276*e3723e1fSApple OSS Distributions
277*e3723e1fSApple OSS Distributions /* hooks for kexts to call */
278*e3723e1fSApple OSS Distributions errno_t register_decmpfs_decompressor(uint32_t compression_type, const decmpfs_registration *registration);
279*e3723e1fSApple OSS Distributions errno_t unregister_decmpfs_decompressor(uint32_t compression_type, decmpfs_registration *registration);
280*e3723e1fSApple OSS Distributions
281*e3723e1fSApple OSS Distributions __END_DECLS
282*e3723e1fSApple OSS Distributions #endif /* KERNEL */
283*e3723e1fSApple OSS Distributions
284*e3723e1fSApple OSS Distributions #endif /* _SYS_DECMPFS_H_ */
285