blob: 7d03ba53be1e4c4053547ed159d2c291a3b4cbc2 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef __GFS2_ONDISK_DOT_H__
20#define __GFS2_ONDISK_DOT_H__
21#include <linux/types.h>
22#define GFS2_MAGIC 0x01161970
Ben Cheng655a7c02013-10-16 16:09:24 -070023#define GFS2_BASIC_BLOCK 512
24#define GFS2_BASIC_BLOCK_SHIFT 9
25#define GFS2_MOUNT_LOCK 0
26#define GFS2_LIVE_LOCK 1
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070027#define GFS2_FREEZE_LOCK 2
Ben Cheng655a7c02013-10-16 16:09:24 -070028#define GFS2_RENAME_LOCK 3
29#define GFS2_CONTROL_LOCK 4
30#define GFS2_MOUNTED_LOCK 5
Ben Cheng655a7c02013-10-16 16:09:24 -070031#define GFS2_FORMAT_NONE 0
32#define GFS2_FORMAT_SB 100
33#define GFS2_FORMAT_RG 200
34#define GFS2_FORMAT_RB 300
Ben Cheng655a7c02013-10-16 16:09:24 -070035#define GFS2_FORMAT_DI 400
36#define GFS2_FORMAT_IN 500
37#define GFS2_FORMAT_LF 600
38#define GFS2_FORMAT_JD 700
Ben Cheng655a7c02013-10-16 16:09:24 -070039#define GFS2_FORMAT_LH 800
40#define GFS2_FORMAT_LD 900
41#define GFS2_FORMAT_LB 1000
42#define GFS2_FORMAT_EA 1600
Ben Cheng655a7c02013-10-16 16:09:24 -070043#define GFS2_FORMAT_ED 1700
44#define GFS2_FORMAT_QC 1400
45#define GFS2_FORMAT_RI 1100
46#define GFS2_FORMAT_DE 1200
Ben Cheng655a7c02013-10-16 16:09:24 -070047#define GFS2_FORMAT_QU 1500
48#define GFS2_FORMAT_FS 1801
49#define GFS2_FORMAT_MULTI 1900
50struct gfs2_inum {
Tao Baod7db5942015-01-28 10:07:51 -080051 __be64 no_formal_ino;
52 __be64 no_addr;
Ben Cheng655a7c02013-10-16 16:09:24 -070053};
54#define GFS2_METATYPE_NONE 0
Ben Cheng655a7c02013-10-16 16:09:24 -070055#define GFS2_METATYPE_SB 1
56#define GFS2_METATYPE_RG 2
57#define GFS2_METATYPE_RB 3
58#define GFS2_METATYPE_DI 4
Ben Cheng655a7c02013-10-16 16:09:24 -070059#define GFS2_METATYPE_IN 5
60#define GFS2_METATYPE_LF 6
61#define GFS2_METATYPE_JD 7
62#define GFS2_METATYPE_LH 8
Ben Cheng655a7c02013-10-16 16:09:24 -070063#define GFS2_METATYPE_LD 9
64#define GFS2_METATYPE_LB 12
65#define GFS2_METATYPE_EA 10
66#define GFS2_METATYPE_ED 11
Ben Cheng655a7c02013-10-16 16:09:24 -070067#define GFS2_METATYPE_QC 14
68struct gfs2_meta_header {
Tao Baod7db5942015-01-28 10:07:51 -080069 __be32 mh_magic;
70 __be32 mh_type;
Tao Baod7db5942015-01-28 10:07:51 -080071 __be64 __pad0;
72 __be32 mh_format;
73 union {
74 __be32 mh_jid;
Tao Baod7db5942015-01-28 10:07:51 -080075 __be32 __pad1;
76 };
Ben Cheng655a7c02013-10-16 16:09:24 -070077};
78#define GFS2_SB_ADDR 128
Ben Cheng655a7c02013-10-16 16:09:24 -070079#define GFS2_SB_LOCK 0
80#define GFS2_LOCKNAME_LEN 64
81struct gfs2_sb {
Tao Baod7db5942015-01-28 10:07:51 -080082 struct gfs2_meta_header sb_header;
Tao Baod7db5942015-01-28 10:07:51 -080083 __be32 sb_fs_format;
84 __be32 sb_multihost_format;
85 __u32 __pad0;
86 __be32 sb_bsize;
Tao Baod7db5942015-01-28 10:07:51 -080087 __be32 sb_bsize_shift;
88 __u32 __pad1;
89 struct gfs2_inum sb_master_dir;
90 struct gfs2_inum __pad2;
Tao Baod7db5942015-01-28 10:07:51 -080091 struct gfs2_inum sb_root_dir;
92 char sb_lockproto[GFS2_LOCKNAME_LEN];
93 char sb_locktable[GFS2_LOCKNAME_LEN];
94 struct gfs2_inum __pad3;
Tao Baod7db5942015-01-28 10:07:51 -080095 struct gfs2_inum __pad4;
Ben Cheng655a7c02013-10-16 16:09:24 -070096#define GFS2_HAS_UUID 1
Tao Baod7db5942015-01-28 10:07:51 -080097 __u8 sb_uuid[16];
Ben Cheng655a7c02013-10-16 16:09:24 -070098};
Ben Cheng655a7c02013-10-16 16:09:24 -070099struct gfs2_rindex {
Tao Baod7db5942015-01-28 10:07:51 -0800100 __be64 ri_addr;
101 __be32 ri_length;
102 __u32 __pad;
Tao Baod7db5942015-01-28 10:07:51 -0800103 __be64 ri_data0;
104 __be32 ri_data;
105 __be32 ri_bitbytes;
106 __u8 ri_reserved[64];
Ben Cheng655a7c02013-10-16 16:09:24 -0700107};
108#define GFS2_NBBY 4
109#define GFS2_BIT_SIZE 2
110#define GFS2_BIT_MASK 0x00000003
Ben Cheng655a7c02013-10-16 16:09:24 -0700111#define GFS2_BLKST_FREE 0
112#define GFS2_BLKST_USED 1
113#define GFS2_BLKST_UNLINKED 2
114#define GFS2_BLKST_DINODE 3
Ben Cheng655a7c02013-10-16 16:09:24 -0700115#define GFS2_RGF_JOURNAL 0x00000001
116#define GFS2_RGF_METAONLY 0x00000002
117#define GFS2_RGF_DATAONLY 0x00000004
118#define GFS2_RGF_NOALLOC 0x00000008
Ben Cheng655a7c02013-10-16 16:09:24 -0700119#define GFS2_RGF_TRIMMED 0x00000010
120struct gfs2_rgrp_lvb {
Tao Baod7db5942015-01-28 10:07:51 -0800121 __be32 rl_magic;
122 __be32 rl_flags;
Tao Baod7db5942015-01-28 10:07:51 -0800123 __be32 rl_free;
124 __be32 rl_dinodes;
125 __be64 rl_igeneration;
126 __be32 rl_unlinked;
Tao Baod7db5942015-01-28 10:07:51 -0800127 __be32 __pad;
Ben Cheng655a7c02013-10-16 16:09:24 -0700128};
129struct gfs2_rgrp {
Tao Baod7db5942015-01-28 10:07:51 -0800130 struct gfs2_meta_header rg_header;
Tao Baod7db5942015-01-28 10:07:51 -0800131 __be32 rg_flags;
132 __be32 rg_free;
133 __be32 rg_dinodes;
Christopher Ferris76a1d452018-06-27 14:12:29 -0700134 union {
135 __be32 __pad;
136 __be32 rg_skip;
137 };
Tao Baod7db5942015-01-28 10:07:51 -0800138 __be64 rg_igeneration;
Christopher Ferris76a1d452018-06-27 14:12:29 -0700139 __be64 rg_data0;
140 __be32 rg_data;
141 __be32 rg_bitbytes;
142 __be32 rg_crc;
143 __u8 rg_reserved[60];
Ben Cheng655a7c02013-10-16 16:09:24 -0700144};
145struct gfs2_quota {
Tao Baod7db5942015-01-28 10:07:51 -0800146 __be64 qu_limit;
147 __be64 qu_warn;
148 __be64 qu_value;
149 __u8 qu_reserved[64];
Ben Cheng655a7c02013-10-16 16:09:24 -0700150};
151#define GFS2_MAX_META_HEIGHT 10
152#define GFS2_DIR_MAX_DEPTH 17
153#define DT2IF(dt) (((dt) << 12) & S_IFMT)
Ben Cheng655a7c02013-10-16 16:09:24 -0700154#define IF2DT(sif) (((sif) & S_IFMT) >> 12)
155enum {
Tao Baod7db5942015-01-28 10:07:51 -0800156 gfs2fl_Jdata = 0,
157 gfs2fl_ExHash = 1,
Tao Baod7db5942015-01-28 10:07:51 -0800158 gfs2fl_Unused = 2,
159 gfs2fl_EaIndirect = 3,
160 gfs2fl_Directio = 4,
161 gfs2fl_Immutable = 5,
Tao Baod7db5942015-01-28 10:07:51 -0800162 gfs2fl_AppendOnly = 6,
163 gfs2fl_NoAtime = 7,
164 gfs2fl_Sync = 8,
165 gfs2fl_System = 9,
Tao Baod7db5942015-01-28 10:07:51 -0800166 gfs2fl_TopLevel = 10,
167 gfs2fl_TruncInProg = 29,
168 gfs2fl_InheritDirectio = 30,
169 gfs2fl_InheritJdata = 31,
Ben Cheng655a7c02013-10-16 16:09:24 -0700170};
171#define GFS2_DIF_JDATA 0x00000001
172#define GFS2_DIF_EXHASH 0x00000002
173#define GFS2_DIF_UNUSED 0x00000004
Ben Cheng655a7c02013-10-16 16:09:24 -0700174#define GFS2_DIF_EA_INDIRECT 0x00000008
175#define GFS2_DIF_DIRECTIO 0x00000010
176#define GFS2_DIF_IMMUTABLE 0x00000020
177#define GFS2_DIF_APPENDONLY 0x00000040
Ben Cheng655a7c02013-10-16 16:09:24 -0700178#define GFS2_DIF_NOATIME 0x00000080
179#define GFS2_DIF_SYNC 0x00000100
180#define GFS2_DIF_SYSTEM 0x00000200
181#define GFS2_DIF_TOPDIR 0x00000400
Ben Cheng655a7c02013-10-16 16:09:24 -0700182#define GFS2_DIF_TRUNC_IN_PROG 0x20000000
183#define GFS2_DIF_INHERIT_DIRECTIO 0x40000000
184#define GFS2_DIF_INHERIT_JDATA 0x80000000
185struct gfs2_dinode {
Tao Baod7db5942015-01-28 10:07:51 -0800186 struct gfs2_meta_header di_header;
187 struct gfs2_inum di_num;
188 __be32 di_mode;
189 __be32 di_uid;
Tao Baod7db5942015-01-28 10:07:51 -0800190 __be32 di_gid;
191 __be32 di_nlink;
192 __be64 di_size;
193 __be64 di_blocks;
Tao Baod7db5942015-01-28 10:07:51 -0800194 __be64 di_atime;
195 __be64 di_mtime;
196 __be64 di_ctime;
197 __be32 di_major;
Tao Baod7db5942015-01-28 10:07:51 -0800198 __be32 di_minor;
199 __be64 di_goal_meta;
200 __be64 di_goal_data;
201 __be64 di_generation;
Tao Baod7db5942015-01-28 10:07:51 -0800202 __be32 di_flags;
203 __be32 di_payload_format;
204 __u16 __pad1;
205 __be16 di_height;
Tao Baod7db5942015-01-28 10:07:51 -0800206 __u32 __pad2;
207 __u16 __pad3;
208 __be16 di_depth;
209 __be32 di_entries;
Tao Baod7db5942015-01-28 10:07:51 -0800210 struct gfs2_inum __pad4;
211 __be64 di_eattr;
212 __be32 di_atime_nsec;
213 __be32 di_mtime_nsec;
Tao Baod7db5942015-01-28 10:07:51 -0800214 __be32 di_ctime_nsec;
215 __u8 di_reserved[44];
Ben Cheng655a7c02013-10-16 16:09:24 -0700216};
217#define GFS2_FNAMESIZE 255
Ben Cheng655a7c02013-10-16 16:09:24 -0700218#define GFS2_DIRENT_SIZE(name_len) ((sizeof(struct gfs2_dirent) + (name_len) + 7) & ~7)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700219#define GFS2_MIN_DIRENT_SIZE (GFS2_DIRENT_SIZE(1))
Ben Cheng655a7c02013-10-16 16:09:24 -0700220struct gfs2_dirent {
Tao Baod7db5942015-01-28 10:07:51 -0800221 struct gfs2_inum de_inum;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700222 __be32 de_hash;
Tao Baod7db5942015-01-28 10:07:51 -0800223 __be16 de_rec_len;
224 __be16 de_name_len;
225 __be16 de_type;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700226 __be16 de_rahead;
Tao Baod7db5942015-01-28 10:07:51 -0800227 union {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700228 __u8 __pad[12];
Tao Baod7db5942015-01-28 10:07:51 -0800229 struct {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700230 __u32 de_cookie;
231 __u8 pad3[8];
Tao Baod7db5942015-01-28 10:07:51 -0800232 };
233 };
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700234};
235struct gfs2_leaf {
Tao Baod7db5942015-01-28 10:07:51 -0800236 struct gfs2_meta_header lf_header;
237 __be16 lf_depth;
238 __be16 lf_entries;
239 __be32 lf_dirent_format;
Tao Baod7db5942015-01-28 10:07:51 -0800240 __be64 lf_next;
241 union {
242 __u8 lf_reserved[64];
243 struct {
Tao Baod7db5942015-01-28 10:07:51 -0800244 __be64 lf_inode;
245 __be32 lf_dist;
246 __be32 lf_nsec;
247 __be64 lf_sec;
Tao Baod7db5942015-01-28 10:07:51 -0800248 __u8 lf_reserved2[40];
249 };
250 };
Ben Cheng655a7c02013-10-16 16:09:24 -0700251};
252#define GFS2_EA_MAX_NAME_LEN 255
253#define GFS2_EA_MAX_DATA_LEN 65536
Christopher Ferris38062f92014-07-09 15:33:25 -0700254#define GFS2_EATYPE_UNUSED 0
Ben Cheng655a7c02013-10-16 16:09:24 -0700255#define GFS2_EATYPE_USR 1
256#define GFS2_EATYPE_SYS 2
257#define GFS2_EATYPE_SECURITY 3
Christopher Ferris38062f92014-07-09 15:33:25 -0700258#define GFS2_EATYPE_LAST 3
Ben Cheng655a7c02013-10-16 16:09:24 -0700259#define GFS2_EATYPE_VALID(x) ((x) <= GFS2_EATYPE_LAST)
260#define GFS2_EAFLAG_LAST 0x01
261struct gfs2_ea_header {
Tao Baod7db5942015-01-28 10:07:51 -0800262 __be32 ea_rec_len;
263 __be32 ea_data_len;
Tao Baod7db5942015-01-28 10:07:51 -0800264 __u8 ea_name_len;
265 __u8 ea_type;
266 __u8 ea_flags;
267 __u8 ea_num_ptrs;
Tao Baod7db5942015-01-28 10:07:51 -0800268 __u32 __pad;
Ben Cheng655a7c02013-10-16 16:09:24 -0700269};
Christopher Ferris38062f92014-07-09 15:33:25 -0700270#define GFS2_LOG_HEAD_UNMOUNT 0x00000001
Christopher Ferris76a1d452018-06-27 14:12:29 -0700271#define GFS2_LOG_HEAD_FLUSH_NORMAL 0x00000002
272#define GFS2_LOG_HEAD_FLUSH_SYNC 0x00000004
273#define GFS2_LOG_HEAD_FLUSH_SHUTDOWN 0x00000008
274#define GFS2_LOG_HEAD_FLUSH_FREEZE 0x00000010
275#define GFS2_LOG_HEAD_RECOVERY 0x00000020
276#define GFS2_LOG_HEAD_USERSPACE 0x80000000
277#define GFS2_LFC_SHUTDOWN 0x00000100
278#define GFS2_LFC_JDATA_WPAGES 0x00000200
279#define GFS2_LFC_SET_FLAGS 0x00000400
280#define GFS2_LFC_AIL_EMPTY_GL 0x00000800
281#define GFS2_LFC_AIL_FLUSH 0x00001000
282#define GFS2_LFC_RGRP_GO_SYNC 0x00002000
283#define GFS2_LFC_INODE_GO_SYNC 0x00004000
284#define GFS2_LFC_INODE_GO_INVAL 0x00008000
285#define GFS2_LFC_FREEZE_GO_SYNC 0x00010000
286#define GFS2_LFC_KILL_SB 0x00020000
287#define GFS2_LFC_DO_SYNC 0x00040000
288#define GFS2_LFC_INPLACE_RESERVE 0x00080000
289#define GFS2_LFC_WRITE_INODE 0x00100000
290#define GFS2_LFC_MAKE_FS_RO 0x00200000
291#define GFS2_LFC_SYNC_FS 0x00400000
292#define GFS2_LFC_EVICT_INODE 0x00800000
293#define GFS2_LFC_TRANS_END 0x01000000
294#define GFS2_LFC_LOGD_JFLUSH_REQD 0x02000000
295#define GFS2_LFC_LOGD_AIL_FLUSH_REQD 0x04000000
296#define LH_V1_SIZE (offsetofend(struct gfs2_log_header, lh_hash))
Ben Cheng655a7c02013-10-16 16:09:24 -0700297struct gfs2_log_header {
Tao Baod7db5942015-01-28 10:07:51 -0800298 struct gfs2_meta_header lh_header;
299 __be64 lh_sequence;
300 __be32 lh_flags;
301 __be32 lh_tail;
Tao Baod7db5942015-01-28 10:07:51 -0800302 __be32 lh_blkno;
303 __be32 lh_hash;
Christopher Ferris76a1d452018-06-27 14:12:29 -0700304 __be32 lh_crc;
305 __be32 lh_nsec;
306 __be64 lh_sec;
307 __be64 lh_addr;
308 __be64 lh_jinode;
309 __be64 lh_statfs_addr;
310 __be64 lh_quota_addr;
311 __be64 lh_local_total;
312 __be64 lh_local_free;
313 __be64 lh_local_dinodes;
Christopher Ferris38062f92014-07-09 15:33:25 -0700314};
Ben Cheng655a7c02013-10-16 16:09:24 -0700315#define GFS2_LOG_DESC_METADATA 300
316#define GFS2_LOG_DESC_REVOKE 301
317#define GFS2_LOG_DESC_JDATA 302
Christopher Ferris38062f92014-07-09 15:33:25 -0700318struct gfs2_log_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800319 struct gfs2_meta_header ld_header;
Tao Baod7db5942015-01-28 10:07:51 -0800320 __be32 ld_type;
321 __be32 ld_length;
322 __be32 ld_data1;
323 __be32 ld_data2;
Tao Baod7db5942015-01-28 10:07:51 -0800324 __u8 ld_reserved[32];
Ben Cheng655a7c02013-10-16 16:09:24 -0700325};
Christopher Ferris38062f92014-07-09 15:33:25 -0700326#define GFS2_INUM_QUANTUM 1048576
Ben Cheng655a7c02013-10-16 16:09:24 -0700327struct gfs2_inum_range {
Tao Baod7db5942015-01-28 10:07:51 -0800328 __be64 ir_start;
329 __be64 ir_length;
Christopher Ferris38062f92014-07-09 15:33:25 -0700330};
Ben Cheng655a7c02013-10-16 16:09:24 -0700331struct gfs2_statfs_change {
Tao Baod7db5942015-01-28 10:07:51 -0800332 __be64 sc_total;
333 __be64 sc_free;
334 __be64 sc_dinodes;
Ben Cheng655a7c02013-10-16 16:09:24 -0700335};
336#define GFS2_QCF_USER 0x00000001
337struct gfs2_quota_change {
Tao Baod7db5942015-01-28 10:07:51 -0800338 __be64 qc_change;
339 __be32 qc_flags;
Tao Baod7db5942015-01-28 10:07:51 -0800340 __be32 qc_id;
Ben Cheng655a7c02013-10-16 16:09:24 -0700341};
Christopher Ferris38062f92014-07-09 15:33:25 -0700342struct gfs2_quota_lvb {
Tao Baod7db5942015-01-28 10:07:51 -0800343 __be32 qb_magic;
Tao Baod7db5942015-01-28 10:07:51 -0800344 __u32 __pad;
345 __be64 qb_limit;
346 __be64 qb_warn;
347 __be64 qb_value;
Ben Cheng655a7c02013-10-16 16:09:24 -0700348};
349#endif