]>
Commit | Line | Data |
---|---|---|
2bd0ea18 | 1 | /* |
f302e9e4 NS |
2 | * Copyright (c) 2000-2005 Silicon Graphics, Inc. |
3 | * All Rights Reserved. | |
5000d01d | 4 | * |
f302e9e4 NS |
5 | * This program is free software; you can redistribute it and/or |
6 | * modify it under the terms of the GNU General Public License as | |
2bd0ea18 | 7 | * published by the Free Software Foundation. |
5000d01d | 8 | * |
f302e9e4 NS |
9 | * This program is distributed in the hope that it would be useful, |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | * GNU General Public License for more details. | |
5000d01d | 13 | * |
f302e9e4 NS |
14 | * You should have received a copy of the GNU General Public License |
15 | * along with this program; if not, write the Free Software Foundation, | |
16 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
2bd0ea18 NS |
17 | */ |
18 | #ifndef __XFS_TYPES_H__ | |
dfc130f3 | 19 | #define __XFS_TYPES_H__ |
2bd0ea18 | 20 | |
4a492e72 | 21 | typedef uint32_t prid_t; /* project ID */ |
a2ceac1f | 22 | |
4a492e72 DW |
23 | typedef uint32_t xfs_agblock_t; /* blockno in alloc. group */ |
24 | typedef uint32_t xfs_agino_t; /* inode # within allocation grp */ | |
25 | typedef uint32_t xfs_extlen_t; /* extent length in blocks */ | |
26 | typedef uint32_t xfs_agnumber_t; /* allocation group number */ | |
27 | typedef int32_t xfs_extnum_t; /* # of extents in a file */ | |
28 | typedef int16_t xfs_aextnum_t; /* # extents in an attribute fork */ | |
29 | typedef int64_t xfs_fsize_t; /* bytes in a file */ | |
30 | typedef uint64_t xfs_ufsize_t; /* unsigned bytes in a file */ | |
2bd0ea18 | 31 | |
4a492e72 DW |
32 | typedef int32_t xfs_suminfo_t; /* type of bitmap summary info */ |
33 | typedef int32_t xfs_rtword_t; /* word type for bitmap manipulations */ | |
2bd0ea18 | 34 | |
4a492e72 DW |
35 | typedef int64_t xfs_lsn_t; /* log sequence number */ |
36 | typedef int32_t xfs_tid_t; /* transaction identifier */ | |
2bd0ea18 | 37 | |
4a492e72 DW |
38 | typedef uint32_t xfs_dablk_t; /* dir/attr block number (in file) */ |
39 | typedef uint32_t xfs_dahash_t; /* dir/attr hash value */ | |
2bd0ea18 | 40 | |
4a492e72 DW |
41 | typedef uint64_t xfs_fsblock_t; /* blockno in filesystem (agno|agbno) */ |
42 | typedef uint64_t xfs_rfsblock_t; /* blockno in filesystem (raw) */ | |
43 | typedef uint64_t xfs_rtblock_t; /* extent (block) in realtime area */ | |
44 | typedef uint64_t xfs_fileoff_t; /* block number in a file */ | |
45 | typedef uint64_t xfs_filblks_t; /* number of blocks in a file */ | |
2bd0ea18 | 46 | |
4a492e72 DW |
47 | typedef int64_t xfs_srtblock_t; /* signed version of xfs_rtblock_t */ |
48 | typedef int64_t xfs_sfiloff_t; /* signed block number in a file */ | |
a2ceac1f | 49 | |
b47beff8 DW |
50 | /* |
51 | * New verifiers will return the instruction address of the failing check. | |
52 | * NULL means everything is ok. | |
53 | */ | |
54 | typedef void * xfs_failaddr_t; | |
55 | ||
2bd0ea18 NS |
56 | /* |
57 | * Null values for the types. | |
58 | */ | |
dfc130f3 RC |
59 | #define NULLFSBLOCK ((xfs_fsblock_t)-1) |
60 | #define NULLRFSBLOCK ((xfs_rfsblock_t)-1) | |
61 | #define NULLRTBLOCK ((xfs_rtblock_t)-1) | |
62 | #define NULLFILEOFF ((xfs_fileoff_t)-1) | |
2bd0ea18 | 63 | |
dfc130f3 RC |
64 | #define NULLAGBLOCK ((xfs_agblock_t)-1) |
65 | #define NULLAGNUMBER ((xfs_agnumber_t)-1) | |
2bd0ea18 NS |
66 | |
67 | #define NULLCOMMITLSN ((xfs_lsn_t)-1) | |
68 | ||
a2ceac1f DC |
69 | #define NULLFSINO ((xfs_ino_t)-1) |
70 | #define NULLAGINO ((xfs_agino_t)-1) | |
71 | ||
2bd0ea18 NS |
72 | /* |
73 | * Max values for extlen, extnum, aextnum. | |
74 | */ | |
dfc130f3 RC |
75 | #define MAXEXTLEN ((xfs_extlen_t)0x001fffff) /* 21 bits */ |
76 | #define MAXEXTNUM ((xfs_extnum_t)0x7fffffff) /* signed int */ | |
77 | #define MAXAEXTNUM ((xfs_aextnum_t)0x7fff) /* signed short */ | |
2bd0ea18 | 78 | |
a2ceac1f DC |
79 | /* |
80 | * Minimum and maximum blocksize and sectorsize. | |
81 | * The blocksize upper limit is pretty much arbitrary. | |
82 | * The sectorsize upper limit is due to sizeof(sb_sectsize). | |
e24ee60b DC |
83 | * CRC enable filesystems use 512 byte inodes, meaning 512 byte block sizes |
84 | * cannot be used. | |
a2ceac1f DC |
85 | */ |
86 | #define XFS_MIN_BLOCKSIZE_LOG 9 /* i.e. 512 bytes */ | |
87 | #define XFS_MAX_BLOCKSIZE_LOG 16 /* i.e. 65536 bytes */ | |
88 | #define XFS_MIN_BLOCKSIZE (1 << XFS_MIN_BLOCKSIZE_LOG) | |
89 | #define XFS_MAX_BLOCKSIZE (1 << XFS_MAX_BLOCKSIZE_LOG) | |
e24ee60b | 90 | #define XFS_MIN_CRC_BLOCKSIZE (1 << (XFS_MIN_BLOCKSIZE_LOG + 1)) |
a2ceac1f DC |
91 | #define XFS_MIN_SECTORSIZE_LOG 9 /* i.e. 512 bytes */ |
92 | #define XFS_MAX_SECTORSIZE_LOG 15 /* i.e. 32768 bytes */ | |
93 | #define XFS_MIN_SECTORSIZE (1 << XFS_MIN_SECTORSIZE_LOG) | |
94 | #define XFS_MAX_SECTORSIZE (1 << XFS_MAX_SECTORSIZE_LOG) | |
95 | ||
2d4bfb91 DC |
96 | /* |
97 | * Inode fork identifiers. | |
98 | */ | |
99 | #define XFS_DATA_FORK 0 | |
100 | #define XFS_ATTR_FORK 1 | |
cb8a004a | 101 | #define XFS_COW_FORK 2 |
2d4bfb91 | 102 | |
ca86e759 NS |
103 | /* |
104 | * Min numbers of data/attr fork btree root pointers. | |
105 | */ | |
106 | #define MINDBTPTRS 3 | |
107 | #define MINABTPTRS 2 | |
108 | ||
2bd0ea18 NS |
109 | /* |
110 | * MAXNAMELEN is the length (including the terminating null) of | |
111 | * the longest permissible file (component) name. | |
112 | */ | |
113 | #define MAXNAMELEN 256 | |
114 | ||
115 | typedef enum { | |
116 | XFS_LOOKUP_EQi, XFS_LOOKUP_LEi, XFS_LOOKUP_GEi | |
117 | } xfs_lookup_t; | |
118 | ||
119 | typedef enum { | |
e37838e5 | 120 | XFS_BTNUM_BNOi, XFS_BTNUM_CNTi, XFS_BTNUM_RMAPi, XFS_BTNUM_BMAPi, |
88ce0792 | 121 | XFS_BTNUM_INOi, XFS_BTNUM_FINOi, XFS_BTNUM_REFCi, XFS_BTNUM_MAX |
2bd0ea18 NS |
122 | } xfs_btnum_t; |
123 | ||
5e656dbb | 124 | struct xfs_name { |
56b2de80 DC |
125 | const unsigned char *name; |
126 | int len; | |
494434d7 | 127 | int type; |
5e656dbb BN |
128 | }; |
129 | ||
dcbc51df DC |
130 | /* |
131 | * uid_t and gid_t are hard-coded to 32 bits in the inode. | |
132 | * Hence, an 'id' in a dquot is 32 bits.. | |
133 | */ | |
4a492e72 | 134 | typedef uint32_t xfs_dqid_t; |
dcbc51df | 135 | |
4c51838c DC |
136 | /* |
137 | * Constants for bit manipulations. | |
138 | */ | |
139 | #define XFS_NBBYLOG 3 /* log2(NBBY) */ | |
140 | #define XFS_WORDLOG 2 /* log2(sizeof(xfs_rtword_t)) */ | |
141 | #define XFS_NBWORDLOG (XFS_NBBYLOG + XFS_WORDLOG) | |
142 | #define XFS_NBWORD (1 << XFS_NBWORDLOG) | |
143 | #define XFS_WORDMASK ((1 << XFS_WORDLOG) - 1) | |
144 | ||
145 | ||
2b288ccf | 146 | #endif /* __XFS_TYPES_H__ */ |