]> git.saurik.com Git - apple/hfs.git/blob - livefiles_cs_plugin/lf_cs.h
hfs-556.41.1.tar.gz
[apple/hfs.git] / livefiles_cs_plugin / lf_cs.h
1 //
2 // Copyright (c) 2019-2019 Apple Inc. All rights reserved.
3 //
4 // lf_cs.h - Defines macros for livefiles Apple_CoreStorage plugin.
5 //
6
7 #ifndef _LF_CS_H
8 #define _LF_CS_H
9
10 #include <UserFS/UserVFS.h>
11
12 //
13 // Device/Block alignment and rounding.
14 //
15 #define CS_HOWMANY(_n, _b) howmany(_n, _b)
16 #define CS_ALIGN(_n, _b, _up)\
17 (((_up) ? CS_HOWMANY(_n, _b) : ((_n) / (_b))) * (_b))
18
19 #define CS_STATUS(_s) ((_s) & 0x000FFFFF)
20 #define CS_STATUS_OK 0x00000000 // No error.
21 #define CS_STATUS_NOTCS 0x00000001 // Not a current CS volume.
22 #define CS_STATUS_CKSUM 0x00000002 // Cksum mismatch.
23 #define CS_STATUS_BLKTYPE 0x00000004 // Incorrect block type.
24 #define CS_STATUS_INVALID 0x00000008 // Invalid field value.
25 #define CS_STATUS_ADDRESS 0x00000010 // Invalid laddr/vaddr.
26 #define CS_STATUS_TXG 0x00000020 // Invalid transaction.
27 #define CS_STATUS_UUID 0x00000040 // Inconsistent UUID.
28
29
30 #define CS_INFO(_s) ((_s) & 0xFFF00000)
31 #define CS_INFO_VERSIONITIS 0x00100000 // Incompatible CS volume format
32 #define CS_INFO_ZERO_VH 0x02000000 // In-progress CS volume forma
33
34 #endif /* _LF_CS_H */