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 1801 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_rgrp_lvb { 121 __be32 rl_magic; 122 __be32 rl_flags; 123 __be32 rl_free; 124 __be32 rl_dinodes; 125 __be64 rl_igeneration; 126 __be32 rl_unlinked; 127 __be32 __pad; 128 }; 129 struct gfs2_rgrp { 130 struct gfs2_meta_header rg_header; 131 __be32 rg_flags; 132 __be32 rg_free; 133 __be32 rg_dinodes; 134 union { 135 __be32 __pad; 136 __be32 rg_skip; 137 }; 138 __be64 rg_igeneration; 139 __be64 rg_data0; 140 __be32 rg_data; 141 __be32 rg_bitbytes; 142 __be32 rg_crc; 143 __u8 rg_reserved[60]; 144 }; 145 struct gfs2_quota { 146 __be64 qu_limit; 147 __be64 qu_warn; 148 __be64 qu_value; 149 __u8 qu_reserved[64]; 150 }; 151 #define GFS2_MAX_META_HEIGHT 10 152 #define GFS2_DIR_MAX_DEPTH 17 153 #define DT2IF(dt) (((dt) << 12) & S_IFMT) 154 #define IF2DT(sif) (((sif) & S_IFMT) >> 12) 155 enum { 156 gfs2fl_Jdata = 0, 157 gfs2fl_ExHash = 1, 158 gfs2fl_Unused = 2, 159 gfs2fl_EaIndirect = 3, 160 gfs2fl_Directio = 4, 161 gfs2fl_Immutable = 5, 162 gfs2fl_AppendOnly = 6, 163 gfs2fl_NoAtime = 7, 164 gfs2fl_Sync = 8, 165 gfs2fl_System = 9, 166 gfs2fl_TopLevel = 10, 167 gfs2fl_TruncInProg = 29, 168 gfs2fl_InheritDirectio = 30, 169 gfs2fl_InheritJdata = 31, 170 }; 171 #define GFS2_DIF_JDATA 0x00000001 172 #define GFS2_DIF_EXHASH 0x00000002 173 #define GFS2_DIF_UNUSED 0x00000004 174 #define GFS2_DIF_EA_INDIRECT 0x00000008 175 #define GFS2_DIF_DIRECTIO 0x00000010 176 #define GFS2_DIF_IMMUTABLE 0x00000020 177 #define GFS2_DIF_APPENDONLY 0x00000040 178 #define GFS2_DIF_NOATIME 0x00000080 179 #define GFS2_DIF_SYNC 0x00000100 180 #define GFS2_DIF_SYSTEM 0x00000200 181 #define GFS2_DIF_TOPDIR 0x00000400 182 #define GFS2_DIF_TRUNC_IN_PROG 0x20000000 183 #define GFS2_DIF_INHERIT_DIRECTIO 0x40000000 184 #define GFS2_DIF_INHERIT_JDATA 0x80000000 185 struct gfs2_dinode { 186 struct gfs2_meta_header di_header; 187 struct gfs2_inum di_num; 188 __be32 di_mode; 189 __be32 di_uid; 190 __be32 di_gid; 191 __be32 di_nlink; 192 __be64 di_size; 193 __be64 di_blocks; 194 __be64 di_atime; 195 __be64 di_mtime; 196 __be64 di_ctime; 197 __be32 di_major; 198 __be32 di_minor; 199 __be64 di_goal_meta; 200 __be64 di_goal_data; 201 __be64 di_generation; 202 __be32 di_flags; 203 __be32 di_payload_format; 204 __u16 __pad1; 205 __be16 di_height; 206 __u32 __pad2; 207 __u16 __pad3; 208 __be16 di_depth; 209 __be32 di_entries; 210 struct gfs2_inum __pad4; 211 __be64 di_eattr; 212 __be32 di_atime_nsec; 213 __be32 di_mtime_nsec; 214 __be32 di_ctime_nsec; 215 __u8 di_reserved[44]; 216 }; 217 #define GFS2_FNAMESIZE 255 218 #define GFS2_DIRENT_SIZE(name_len) ((sizeof(struct gfs2_dirent) + (name_len) + 7) & ~7) 219 #define GFS2_MIN_DIRENT_SIZE (GFS2_DIRENT_SIZE(1)) 220 struct gfs2_dirent { 221 struct gfs2_inum de_inum; 222 __be32 de_hash; 223 __be16 de_rec_len; 224 __be16 de_name_len; 225 __be16 de_type; 226 __be16 de_rahead; 227 union { 228 __u8 __pad[12]; 229 struct { 230 __u32 de_cookie; 231 __u8 pad3[8]; 232 }; 233 }; 234 }; 235 struct gfs2_leaf { 236 struct gfs2_meta_header lf_header; 237 __be16 lf_depth; 238 __be16 lf_entries; 239 __be32 lf_dirent_format; 240 __be64 lf_next; 241 union { 242 __u8 lf_reserved[64]; 243 struct { 244 __be64 lf_inode; 245 __be32 lf_dist; 246 __be32 lf_nsec; 247 __be64 lf_sec; 248 __u8 lf_reserved2[40]; 249 }; 250 }; 251 }; 252 #define GFS2_EA_MAX_NAME_LEN 255 253 #define GFS2_EA_MAX_DATA_LEN 65536 254 #define GFS2_EATYPE_UNUSED 0 255 #define GFS2_EATYPE_USR 1 256 #define GFS2_EATYPE_SYS 2 257 #define GFS2_EATYPE_SECURITY 3 258 #define GFS2_EATYPE_LAST 3 259 #define GFS2_EATYPE_VALID(x) ((x) <= GFS2_EATYPE_LAST) 260 #define GFS2_EAFLAG_LAST 0x01 261 struct gfs2_ea_header { 262 __be32 ea_rec_len; 263 __be32 ea_data_len; 264 __u8 ea_name_len; 265 __u8 ea_type; 266 __u8 ea_flags; 267 __u8 ea_num_ptrs; 268 __u32 __pad; 269 }; 270 #define GFS2_LOG_HEAD_UNMOUNT 0x00000001 271 #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)) 297 struct gfs2_log_header { 298 struct gfs2_meta_header lh_header; 299 __be64 lh_sequence; 300 __be32 lh_flags; 301 __be32 lh_tail; 302 __be32 lh_blkno; 303 __be32 lh_hash; 304 __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; 314 }; 315 #define GFS2_LOG_DESC_METADATA 300 316 #define GFS2_LOG_DESC_REVOKE 301 317 #define GFS2_LOG_DESC_JDATA 302 318 struct gfs2_log_descriptor { 319 struct gfs2_meta_header ld_header; 320 __be32 ld_type; 321 __be32 ld_length; 322 __be32 ld_data1; 323 __be32 ld_data2; 324 __u8 ld_reserved[32]; 325 }; 326 #define GFS2_INUM_QUANTUM 1048576 327 struct gfs2_inum_range { 328 __be64 ir_start; 329 __be64 ir_length; 330 }; 331 struct gfs2_statfs_change { 332 __be64 sc_total; 333 __be64 sc_free; 334 __be64 sc_dinodes; 335 }; 336 #define GFS2_QCF_USER 0x00000001 337 struct gfs2_quota_change { 338 __be64 qc_change; 339 __be32 qc_flags; 340 __be32 qc_id; 341 }; 342 struct gfs2_quota_lvb { 343 __be32 qb_magic; 344 __u32 __pad; 345 __be64 qb_limit; 346 __be64 qb_warn; 347 __be64 qb_value; 348 }; 349 #endif 350