1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18#ifndef __XFS_TYPES_H__
19#define __XFS_TYPES_H__
20
21typedef uint32_t prid_t;
22
23typedef uint32_t xfs_agblock_t;
24typedef uint32_t xfs_agino_t;
25typedef uint32_t xfs_extlen_t;
26typedef uint32_t xfs_agnumber_t;
27typedef int32_t xfs_extnum_t;
28typedef int16_t xfs_aextnum_t;
29typedef int64_t xfs_fsize_t;
30typedef uint64_t xfs_ufsize_t;
31
32typedef int32_t xfs_suminfo_t;
33typedef int32_t xfs_rtword_t;
34
35typedef int64_t xfs_lsn_t;
36typedef int32_t xfs_tid_t;
37
38typedef uint32_t xfs_dablk_t;
39typedef uint32_t xfs_dahash_t;
40
41typedef uint64_t xfs_fsblock_t;
42typedef uint64_t xfs_rfsblock_t;
43typedef uint64_t xfs_rtblock_t;
44typedef uint64_t xfs_fileoff_t;
45typedef uint64_t xfs_filblks_t;
46
47typedef int64_t xfs_srtblock_t;
48typedef int64_t xfs_sfiloff_t;
49
50
51
52
53
54typedef void * xfs_failaddr_t;
55
56
57
58
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)
63
64#define NULLAGBLOCK ((xfs_agblock_t)-1)
65#define NULLAGNUMBER ((xfs_agnumber_t)-1)
66
67#define NULLCOMMITLSN ((xfs_lsn_t)-1)
68
69#define NULLFSINO ((xfs_ino_t)-1)
70#define NULLAGINO ((xfs_agino_t)-1)
71
72
73
74
75#define MAXEXTLEN ((xfs_extlen_t)0x001fffff)
76#define MAXEXTNUM ((xfs_extnum_t)0x7fffffff)
77#define MAXAEXTNUM ((xfs_aextnum_t)0x7fff)
78
79
80
81
82
83
84
85
86#define XFS_MIN_BLOCKSIZE_LOG 9
87#define XFS_MAX_BLOCKSIZE_LOG 16
88#define XFS_MIN_BLOCKSIZE (1 << XFS_MIN_BLOCKSIZE_LOG)
89#define XFS_MAX_BLOCKSIZE (1 << XFS_MAX_BLOCKSIZE_LOG)
90#define XFS_MIN_CRC_BLOCKSIZE (1 << (XFS_MIN_BLOCKSIZE_LOG + 1))
91#define XFS_MIN_SECTORSIZE_LOG 9
92#define XFS_MAX_SECTORSIZE_LOG 15
93#define XFS_MIN_SECTORSIZE (1 << XFS_MIN_SECTORSIZE_LOG)
94#define XFS_MAX_SECTORSIZE (1 << XFS_MAX_SECTORSIZE_LOG)
95
96
97
98
99#define XFS_DATA_FORK 0
100#define XFS_ATTR_FORK 1
101#define XFS_COW_FORK 2
102
103
104
105
106#define MINDBTPTRS 3
107#define MINABTPTRS 2
108
109
110
111
112
113#define MAXNAMELEN 256
114
115typedef enum {
116 XFS_LOOKUP_EQi, XFS_LOOKUP_LEi, XFS_LOOKUP_GEi
117} xfs_lookup_t;
118
119typedef enum {
120 XFS_BTNUM_BNOi, XFS_BTNUM_CNTi, XFS_BTNUM_RMAPi, XFS_BTNUM_BMAPi,
121 XFS_BTNUM_INOi, XFS_BTNUM_FINOi, XFS_BTNUM_REFCi, XFS_BTNUM_MAX
122} xfs_btnum_t;
123
124struct xfs_name {
125 const unsigned char *name;
126 int len;
127 int type;
128};
129
130
131
132
133
134typedef uint32_t xfs_dqid_t;
135
136
137
138
139#define XFS_NBBYLOG 3
140#define XFS_WORDLOG 2
141#define XFS_NBWORDLOG (XFS_NBBYLOG + XFS_WORDLOG)
142#define XFS_NBWORD (1 << XFS_NBWORDLOG)
143#define XFS_WORDMASK ((1 << XFS_WORDLOG) - 1)
144
145struct xfs_iext_cursor {
146 struct xfs_iext_leaf *leaf;
147 int pos;
148};
149
150typedef enum {
151 XFS_EXT_NORM, XFS_EXT_UNWRITTEN,
152} xfs_exntst_t;
153
154typedef struct xfs_bmbt_irec
155{
156 xfs_fileoff_t br_startoff;
157 xfs_fsblock_t br_startblock;
158 xfs_filblks_t br_blockcount;
159 xfs_exntst_t br_state;
160} xfs_bmbt_irec_t;
161
162#endif
163