1 /**************************************************************************** 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 23 #define GFS2_BASIC_BLOCK 512 24 #define GFS2_BASIC_BLOCK_SHIFT 9 25 #define GFS2_MOUNT_LOCK 0 26 #define GFS2_LIVE_LOCK 1 27 #define GFS2_FREEZE_LOCK 2 28 #define GFS2_RENAME_LOCK 3 29 #define GFS2_CONTROL_LOCK 4 30 #define GFS2_MOUNTED_LOCK 5 31 #define GFS2_FORMAT_NONE 0 32 #define GFS2_FORMAT_SB 100 33 #define GFS2_FORMAT_RG 200 34 #define GFS2_FORMAT_RB 300 35 #define GFS2_FORMAT_DI 400 36 #define GFS2_FORMAT_IN 500 37 #define GFS2_FORMAT_LF 600 38 #define GFS2_FORMAT_JD 700 39 #define GFS2_FORMAT_LH 800 40 #define GFS2_FORMAT_LD 900 41 #define GFS2_FORMAT_LB 1000 42 #define GFS2_FORMAT_EA 1600 43 #define GFS2_FORMAT_ED 1700 44 #define GFS2_FORMAT_QC 1400 45 #define GFS2_FORMAT_RI 1100 46 #define GFS2_FORMAT_DE 1200 47 #define GFS2_FORMAT_QU 1500 48 #define GFS2_FORMAT_FS 1802 49 #define GFS2_FORMAT_MULTI 1900 50 struct gfs2_inum { 51 __be64 no_formal_ino; 52 __be64 no_addr; 53 }; 54 #define GFS2_METATYPE_NONE 0 55 #define GFS2_METATYPE_SB 1 56 #define GFS2_METATYPE_RG 2 57 #define GFS2_METATYPE_RB 3 58 #define GFS2_METATYPE_DI 4 59 #define GFS2_METATYPE_IN 5 60 #define GFS2_METATYPE_LF 6 61 #define GFS2_METATYPE_JD 7 62 #define GFS2_METATYPE_LH 8 63 #define GFS2_METATYPE_LD 9 64 #define GFS2_METATYPE_LB 12 65 #define GFS2_METATYPE_EA 10 66 #define GFS2_METATYPE_ED 11 67 #define GFS2_METATYPE_QC 14 68 struct gfs2_meta_header { 69 __be32 mh_magic; 70 __be32 mh_type; 71 __be64 __pad0; 72 __be32 mh_format; 73 union { 74 __be32 mh_jid; 75 __be32 __pad1; 76 }; 77 }; 78 #define GFS2_SB_ADDR 128 79 #define GFS2_SB_LOCK 0 80 #define GFS2_LOCKNAME_LEN 64 81 struct gfs2_sb { 82 struct gfs2_meta_header sb_header; 83 __be32 sb_fs_format; 84 __be32 sb_multihost_format; 85 __u32 __pad0; 86 __be32 sb_bsize; 87 __be32 sb_bsize_shift; 88 __u32 __pad1; 89 struct gfs2_inum sb_master_dir; 90 struct gfs2_inum __pad2; 91 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; 95 struct gfs2_inum __pad4; 96 #define GFS2_HAS_UUID 1 97 __u8 sb_uuid[16]; 98 }; 99 struct gfs2_rindex { 100 __be64 ri_addr; 101 __be32 ri_length; 102 __u32 __pad; 103 __be64 ri_data0; 104 __be32 ri_data; 105 __be32 ri_bitbytes; 106 __u8 ri_reserved[64]; 107 }; 108 #define GFS2_NBBY 4 109 #define GFS2_BIT_SIZE 2 110 #define GFS2_BIT_MASK 0x00000003 111 #define GFS2_BLKST_FREE 0 112 #define GFS2_BLKST_USED 1 113 #define GFS2_BLKST_UNLINKED 2 114 #define GFS2_BLKST_DINODE 3 115 #define GFS2_RGF_JOURNAL 0x00000001 116 #define GFS2_RGF_METAONLY 0x00000002 117 #define GFS2_RGF_DATAONLY 0x00000004 118 #define GFS2_RGF_NOALLOC 0x00000008 119 #define GFS2_RGF_TRIMMED 0x00000010 120 struct gfs2_inode_lvb { 121 __be32 ri_magic; 122 __be32 __pad; 123 __be64 ri_generation_deleted; 124 }; 125 struct gfs2_rgrp_lvb { 126 __be32 rl_magic; 127 __be32 rl_flags; 128 __be32 rl_free; 129 __be32 rl_dinodes; 130 __be64 rl_igeneration; 131 __be32 rl_unlinked; 132 __be32 __pad; 133 }; 134 struct gfs2_rgrp { 135 struct gfs2_meta_header rg_header; 136 __be32 rg_flags; 137 __be32 rg_free; 138 __be32 rg_dinodes; 139 union { 140 __be32 __pad; 141 __be32 rg_skip; 142 }; 143 __be64 rg_igeneration; 144 __be64 rg_data0; 145 __be32 rg_data; 146 __be32 rg_bitbytes; 147 __be32 rg_crc; 148 __u8 rg_reserved[60]; 149 }; 150 struct gfs2_quota { 151 __be64 qu_limit; 152 __be64 qu_warn; 153 __be64 qu_value; 154 __u8 qu_reserved[64]; 155 }; 156 #define GFS2_MAX_META_HEIGHT 10 157 #define GFS2_DIR_MAX_DEPTH 17 158 #define DT2IF(dt) (((dt) << 12) & S_IFMT) 159 #define IF2DT(sif) (((sif) & S_IFMT) >> 12) 160 enum { 161 gfs2fl_Jdata = 0, 162 gfs2fl_ExHash = 1, 163 gfs2fl_Unused = 2, 164 gfs2fl_EaIndirect = 3, 165 gfs2fl_Directio = 4, 166 gfs2fl_Immutable = 5, 167 gfs2fl_AppendOnly = 6, 168 gfs2fl_NoAtime = 7, 169 gfs2fl_Sync = 8, 170 gfs2fl_System = 9, 171 gfs2fl_TopLevel = 10, 172 gfs2fl_TruncInProg = 29, 173 gfs2fl_InheritDirectio = 30, 174 gfs2fl_InheritJdata = 31, 175 }; 176 #define GFS2_DIF_JDATA 0x00000001 177 #define GFS2_DIF_EXHASH 0x00000002 178 #define GFS2_DIF_UNUSED 0x00000004 179 #define GFS2_DIF_EA_INDIRECT 0x00000008 180 #define GFS2_DIF_DIRECTIO 0x00000010 181 #define GFS2_DIF_IMMUTABLE 0x00000020 182 #define GFS2_DIF_APPENDONLY 0x00000040 183 #define GFS2_DIF_NOATIME 0x00000080 184 #define GFS2_DIF_SYNC 0x00000100 185 #define GFS2_DIF_SYSTEM 0x00000200 186 #define GFS2_DIF_TOPDIR 0x00000400 187 #define GFS2_DIF_TRUNC_IN_PROG 0x20000000 188 #define GFS2_DIF_INHERIT_DIRECTIO 0x40000000 189 #define GFS2_DIF_INHERIT_JDATA 0x80000000 190 struct gfs2_dinode { 191 struct gfs2_meta_header di_header; 192 struct gfs2_inum di_num; 193 __be32 di_mode; 194 __be32 di_uid; 195 __be32 di_gid; 196 __be32 di_nlink; 197 __be64 di_size; 198 __be64 di_blocks; 199 __be64 di_atime; 200 __be64 di_mtime; 201 __be64 di_ctime; 202 __be32 di_major; 203 __be32 di_minor; 204 __be64 di_goal_meta; 205 __be64 di_goal_data; 206 __be64 di_generation; 207 __be32 di_flags; 208 __be32 di_payload_format; 209 __u16 __pad1; 210 __be16 di_height; 211 __u32 __pad2; 212 __u16 __pad3; 213 __be16 di_depth; 214 __be32 di_entries; 215 struct gfs2_inum __pad4; 216 __be64 di_eattr; 217 __be32 di_atime_nsec; 218 __be32 di_mtime_nsec; 219 __be32 di_ctime_nsec; 220 __u8 di_reserved[44]; 221 }; 222 #define GFS2_FNAMESIZE 255 223 #define GFS2_DIRENT_SIZE(name_len) ((sizeof(struct gfs2_dirent) + (name_len) + 7) & ~7) 224 #define GFS2_MIN_DIRENT_SIZE (GFS2_DIRENT_SIZE(1)) 225 struct gfs2_dirent { 226 struct gfs2_inum de_inum; 227 __be32 de_hash; 228 __be16 de_rec_len; 229 __be16 de_name_len; 230 __be16 de_type; 231 __be16 de_rahead; 232 union { 233 __u8 __pad[12]; 234 struct { 235 __u32 de_cookie; 236 __u8 pad3[8]; 237 }; 238 }; 239 }; 240 struct gfs2_leaf { 241 struct gfs2_meta_header lf_header; 242 __be16 lf_depth; 243 __be16 lf_entries; 244 __be32 lf_dirent_format; 245 __be64 lf_next; 246 union { 247 __u8 lf_reserved[64]; 248 struct { 249 __be64 lf_inode; 250 __be32 lf_dist; 251 __be32 lf_nsec; 252 __be64 lf_sec; 253 __u8 lf_reserved2[40]; 254 }; 255 }; 256 }; 257 #define GFS2_EA_MAX_NAME_LEN 255 258 #define GFS2_EA_MAX_DATA_LEN 65536 259 #define GFS2_EATYPE_UNUSED 0 260 #define GFS2_EATYPE_USR 1 261 #define GFS2_EATYPE_SYS 2 262 #define GFS2_EATYPE_SECURITY 3 263 #define GFS2_EATYPE_TRUSTED 4 264 #define GFS2_EATYPE_LAST 4 265 #define GFS2_EATYPE_VALID(x) ((x) <= GFS2_EATYPE_LAST) 266 #define GFS2_EAFLAG_LAST 0x01 267 struct gfs2_ea_header { 268 __be32 ea_rec_len; 269 __be32 ea_data_len; 270 __u8 ea_name_len; 271 __u8 ea_type; 272 __u8 ea_flags; 273 __u8 ea_num_ptrs; 274 __u32 __pad; 275 }; 276 #define GFS2_LOG_HEAD_UNMOUNT 0x00000001 277 #define GFS2_LOG_HEAD_FLUSH_NORMAL 0x00000002 278 #define GFS2_LOG_HEAD_FLUSH_SYNC 0x00000004 279 #define GFS2_LOG_HEAD_FLUSH_SHUTDOWN 0x00000008 280 #define GFS2_LOG_HEAD_FLUSH_FREEZE 0x00000010 281 #define GFS2_LOG_HEAD_RECOVERY 0x00000020 282 #define GFS2_LOG_HEAD_USERSPACE 0x80000000 283 #define GFS2_LFC_SHUTDOWN 0x00000100 284 #define GFS2_LFC_JDATA_WPAGES 0x00000200 285 #define GFS2_LFC_SET_FLAGS 0x00000400 286 #define GFS2_LFC_AIL_EMPTY_GL 0x00000800 287 #define GFS2_LFC_AIL_FLUSH 0x00001000 288 #define GFS2_LFC_RGRP_GO_SYNC 0x00002000 289 #define GFS2_LFC_INODE_GO_SYNC 0x00004000 290 #define GFS2_LFC_INODE_GO_INVAL 0x00008000 291 #define GFS2_LFC_FREEZE_GO_SYNC 0x00010000 292 #define GFS2_LFC_KILL_SB 0x00020000 293 #define GFS2_LFC_DO_SYNC 0x00040000 294 #define GFS2_LFC_INPLACE_RESERVE 0x00080000 295 #define GFS2_LFC_WRITE_INODE 0x00100000 296 #define GFS2_LFC_MAKE_FS_RO 0x00200000 297 #define GFS2_LFC_SYNC_FS 0x00400000 298 #define GFS2_LFC_EVICT_INODE 0x00800000 299 #define GFS2_LFC_TRANS_END 0x01000000 300 #define GFS2_LFC_LOGD_JFLUSH_REQD 0x02000000 301 #define GFS2_LFC_LOGD_AIL_FLUSH_REQD 0x04000000 302 #define LH_V1_SIZE (offsetofend(struct gfs2_log_header, lh_hash)) 303 struct gfs2_log_header { 304 struct gfs2_meta_header lh_header; 305 __be64 lh_sequence; 306 __be32 lh_flags; 307 __be32 lh_tail; 308 __be32 lh_blkno; 309 __be32 lh_hash; 310 __be32 lh_crc; 311 __be32 lh_nsec; 312 __be64 lh_sec; 313 __be64 lh_addr; 314 __be64 lh_jinode; 315 __be64 lh_statfs_addr; 316 __be64 lh_quota_addr; 317 __be64 lh_local_total; 318 __be64 lh_local_free; 319 __be64 lh_local_dinodes; 320 }; 321 #define GFS2_LOG_DESC_METADATA 300 322 #define GFS2_LOG_DESC_REVOKE 301 323 #define GFS2_LOG_DESC_JDATA 302 324 struct gfs2_log_descriptor { 325 struct gfs2_meta_header ld_header; 326 __be32 ld_type; 327 __be32 ld_length; 328 __be32 ld_data1; 329 __be32 ld_data2; 330 __u8 ld_reserved[32]; 331 }; 332 #define GFS2_INUM_QUANTUM 1048576 333 struct gfs2_inum_range { 334 __be64 ir_start; 335 __be64 ir_length; 336 }; 337 struct gfs2_statfs_change { 338 __be64 sc_total; 339 __be64 sc_free; 340 __be64 sc_dinodes; 341 }; 342 #define GFS2_QCF_USER 0x00000001 343 struct gfs2_quota_change { 344 __be64 qc_change; 345 __be32 qc_flags; 346 __be32 qc_id; 347 }; 348 struct gfs2_quota_lvb { 349 __be32 qb_magic; 350 __u32 __pad; 351 __be64 qb_limit; 352 __be64 qb_warn; 353 __be64 qb_value; 354 }; 355 #endif 356