X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/316670eb35587141e969394ae8537d66b9211e80..743345f9a4b36f7e2f9ba37691e70c50baecb56e:/bsd/sys/decmpfs.h diff --git a/bsd/sys/decmpfs.h b/bsd/sys/decmpfs.h index 8cef87b69..58ad8fed5 100644 --- a/bsd/sys/decmpfs.h +++ b/bsd/sys/decmpfs.h @@ -29,6 +29,8 @@ #define _SYS_DECMPFS_H_ 1 #include +#include +#include #define MAX_DECMPFS_XATTR_SIZE 3802 @@ -77,7 +79,7 @@ typedef struct { #include -typedef struct decmpfs_cnode { +struct decmpfs_cnode { uint8_t cmp_state; uint8_t cmp_minimal_xattr; /* if non-zero, this file's com.apple.decmpfs xattr contained only the minimal decmpfs_disk_header */ uint32_t cmp_type; @@ -86,7 +88,11 @@ typedef struct decmpfs_cnode { uint64_t uncompressed_size __attribute__((aligned(8))); uint64_t decompression_flags; lck_rw_t compressed_data_lock; -} decmpfs_cnode; +}; + +#endif // XNU_KERNEL_PRIVATE + +typedef struct decmpfs_cnode decmpfs_cnode; /* return values from decmpfs_file_is_compressed */ enum { @@ -101,19 +107,22 @@ extern vfs_context_t decmpfs_ctx; /* client filesystem entrypoints */ void decmpfs_init(void); +decmpfs_cnode *decmpfs_cnode_alloc(void); +void decmpfs_cnode_free(decmpfs_cnode *dp); void decmpfs_cnode_init(decmpfs_cnode *cp); void decmpfs_cnode_destroy(decmpfs_cnode *cp); int decmpfs_hides_rsrc(vfs_context_t ctx, decmpfs_cnode *cp); int decmpfs_hides_xattr(vfs_context_t ctx, decmpfs_cnode *cp, const char *xattr); -boolean_t decmpfs_trylock_compressed_data(decmpfs_cnode *cp, int exclusive); +bool decmpfs_trylock_compressed_data(decmpfs_cnode *cp, int exclusive); void decmpfs_lock_compressed_data(decmpfs_cnode *cp, int exclusive); void decmpfs_unlock_compressed_data(decmpfs_cnode *cp, int exclusive); uint32_t decmpfs_cnode_get_vnode_state(decmpfs_cnode *cp); void decmpfs_cnode_set_vnode_state(decmpfs_cnode *cp, uint32_t state, int skiplock); uint64_t decmpfs_cnode_get_vnode_cached_size(decmpfs_cnode *cp); +uint32_t decmpfs_cnode_cmp_type(decmpfs_cnode *cp); int decmpfs_file_is_compressed(vnode_t vp, decmpfs_cnode *cp); errno_t decmpfs_validate_compressed_file(vnode_t vp, decmpfs_cnode *cp); @@ -124,8 +133,6 @@ int decmpfs_update_attributes(vnode_t vp, struct vnode_attr *vap); errno_t decmpfs_pagein_compressed(struct vnop_pagein_args *ap, int *is_compressed, decmpfs_cnode *cp); errno_t decmpfs_read_compressed(struct vnop_read_args *ap, int *is_compressed, decmpfs_cnode *cp); -#endif /* XNU_KERNEL_PRIVATE */ - /* types shared between the kernel and kexts */ typedef int (*decmpfs_validate_compressed_file_func)(vnode_t vp, vfs_context_t ctx, decmpfs_header *hdr); typedef void (*decmpfs_adjust_fetch_region_func)(vnode_t vp, vfs_context_t ctx, decmpfs_header *hdr, off_t *offset, user_ssize_t *size);