ext2fs.h (251562) | ext2fs.h (251809) |
---|---|
1/*- 2 * modified for EXT2FS support in Lites 1.1 3 * 4 * Aug 1995, Godmar Back (gback@cs.utah.edu) 5 * University of Utah, Department of Computer Science 6 * | 1/*- 2 * modified for EXT2FS support in Lites 1.1 3 * 4 * Aug 1995, Godmar Back (gback@cs.utah.edu) 5 * University of Utah, Department of Computer Science 6 * |
7 * $FreeBSD: head/sys/fs/ext2fs/ext2fs.h 251562 2013-06-09 01:38:51Z pfg $ | 7 * $FreeBSD: head/sys/fs/ext2fs/ext2fs.h 251809 2013-06-16 16:10:45Z pfg $ |
8 */ 9/*- 10 * Copyright (c) 2009 Aditya Sarawgi 11 * All rights reserved. 12 * 13 * Redistribution and use in source and binary forms, with or without 14 * modification, are permitted provided that the following conditions 15 * are met: --- 24 unchanged lines hidden (view full) --- 40#include <sys/types.h> 41 42/* 43 * Maximal count of links to a file 44 */ 45#define EXT2_LINK_MAX 32000 46 47/* | 8 */ 9/*- 10 * Copyright (c) 2009 Aditya Sarawgi 11 * All rights reserved. 12 * 13 * Redistribution and use in source and binary forms, with or without 14 * modification, are permitted provided that the following conditions 15 * are met: --- 24 unchanged lines hidden (view full) --- 40#include <sys/types.h> 41 42/* 43 * Maximal count of links to a file 44 */ 45#define EXT2_LINK_MAX 32000 46 47/* |
48 * A summary of contiguous blocks of various sizes is maintained 49 * in each cylinder group. Normally this is set by the initial 50 * value of fs_maxcontig. 51 * 52 * XXX:FS_MAXCONTIG is set to 16 to conserve space. Here we set 53 * EXT2_MAXCONTIG to 32 for better performance. 54 */ 55#define EXT2_MAXCONTIG 32 56 57/* 58 * Constants relative to the data blocks 59 */ 60#define EXT2_NDIR_BLOCKS 12 61#define EXT2_IND_BLOCK EXT2_NDIR_BLOCKS 62#define EXT2_DIND_BLOCK (EXT2_IND_BLOCK + 1) 63#define EXT2_TIND_BLOCK (EXT2_DIND_BLOCK + 1) 64#define EXT2_N_BLOCKS (EXT2_TIND_BLOCK + 1) 65#define EXT2_MAXSYMLINKLEN (EXT2_N_BLOCKS * sizeof(uint32_t)) 66 67/* | |
68 * The path name on which the file system is mounted is maintained 69 * in fs_fsmnt. MAXMNTLEN defines the amount of space allocated in 70 * the super block for this name. 71 */ 72#define MAXMNTLEN 512 73 74/* 75 * Super block for an ext2fs file system. --- 94 unchanged lines hidden (view full) --- 170 char e2fs_wasvalid; /* valid at mount time */ 171 off_t e2fs_maxfilesize; 172 struct ext2_gd *e2fs_gd; /* Group Descriptors */ 173 int32_t e2fs_contigsumsize; /* size of cluster summary array */ 174 int32_t *e2fs_maxcluster; /* max cluster in each cyl group */ 175 struct csum *e2fs_clustersum; /* cluster summary in each cyl group */ 176}; 177 | 48 * The path name on which the file system is mounted is maintained 49 * in fs_fsmnt. MAXMNTLEN defines the amount of space allocated in 50 * the super block for this name. 51 */ 52#define MAXMNTLEN 512 53 54/* 55 * Super block for an ext2fs file system. --- 94 unchanged lines hidden (view full) --- 150 char e2fs_wasvalid; /* valid at mount time */ 151 off_t e2fs_maxfilesize; 152 struct ext2_gd *e2fs_gd; /* Group Descriptors */ 153 int32_t e2fs_contigsumsize; /* size of cluster summary array */ 154 int32_t *e2fs_maxcluster; /* max cluster in each cyl group */ 155 struct csum *e2fs_clustersum; /* cluster summary in each cyl group */ 156}; 157 |
178/* 179 * The second extended file system version 180 */ 181#define E2FS_DATE "95/08/09" 182#define E2FS_VERSION "0.5b" | 158/* cluster summary information */ |
183 | 159 |
160struct csum { 161 int8_t cs_init; /* cluster summary has been initialized */ 162 int32_t *cs_sum; /* cluster summary array */ 163}; 164 |
|
184/* 185 * The second extended file system magic number 186 */ 187#define E2FS_MAGIC 0xEF53 188 189/* 190 * Revision levels 191 */ 192#define E2FS_REV0 0 /* The good old (original) format */ 193#define E2FS_REV1 1 /* V2 format w/ dynamic inode sizes */ 194 | 165/* 166 * The second extended file system magic number 167 */ 168#define E2FS_MAGIC 0xEF53 169 170/* 171 * Revision levels 172 */ 173#define E2FS_REV0 0 /* The good old (original) format */ 174#define E2FS_REV1 1 /* V2 format w/ dynamic inode sizes */ 175 |
195#define E2FS_CURRENT_REV E2FS_REV0 196#define E2FS_MAX_SUPP_REV E2FS_REV1 197 | |
198#define E2FS_REV0_INODE_SIZE 128 199 200/* 201 * compatible/incompatible features 202 */ 203#define EXT2F_COMPAT_PREALLOC 0x0001 204#define EXT2F_COMPAT_HASJOURNAL 0x0004 205#define EXT2F_COMPAT_RESIZE 0x0010 --- 40 unchanged lines hidden (view full) --- 246#define EXT2_HAS_COMPAT_FEATURE(sb,mask) \ 247 ( EXT2_SB(sb)->e2fs->e2fs_features_compat & htole32(mask) ) 248#define EXT2_HAS_RO_COMPAT_FEATURE(sb,mask) \ 249 ( EXT2_SB(sb)->e2fs->e2fs_features_rocompat & htole32(mask) ) 250#define EXT2_HAS_INCOMPAT_FEATURE(sb,mask) \ 251 ( EXT2_SB(sb)->e2fs->e2fs_features_incompat & htole32(mask) ) 252 253/* | 176#define E2FS_REV0_INODE_SIZE 128 177 178/* 179 * compatible/incompatible features 180 */ 181#define EXT2F_COMPAT_PREALLOC 0x0001 182#define EXT2F_COMPAT_HASJOURNAL 0x0004 183#define EXT2F_COMPAT_RESIZE 0x0010 --- 40 unchanged lines hidden (view full) --- 224#define EXT2_HAS_COMPAT_FEATURE(sb,mask) \ 225 ( EXT2_SB(sb)->e2fs->e2fs_features_compat & htole32(mask) ) 226#define EXT2_HAS_RO_COMPAT_FEATURE(sb,mask) \ 227 ( EXT2_SB(sb)->e2fs->e2fs_features_rocompat & htole32(mask) ) 228#define EXT2_HAS_INCOMPAT_FEATURE(sb,mask) \ 229 ( EXT2_SB(sb)->e2fs->e2fs_features_incompat & htole32(mask) ) 230 231/* |
254 * Definitions of behavior on errors 255 */ 256#define E2FS_BEH_CONTINUE 1 /* continue operation */ 257#define E2FS_BEH_READONLY 2 /* remount fs read only */ 258#define E2FS_BEH_PANIC 3 /* cause panic */ 259#define E2FS_BEH_DEFAULT E2FS_BEH_CONTINUE 260 261/* 262 * OS identification 263 */ 264#define E2FS_OS_LINUX 0 265#define E2FS_OS_HURD 1 266#define E2FS_OS_MASIX 2 267#define E2FS_OS_FREEBSD 3 268#define E2FS_OS_LITES 4 269 270/* | |
271 * File clean flags 272 */ 273#define E2FS_ISCLEAN 0x0001 /* Unmounted cleanly */ 274#define E2FS_ERRORS 0x0002 /* Errors detected */ 275 276/* ext2 file system block group descriptor */ 277 278struct ext2_gd { --- 6 unchanged lines hidden (view full) --- 285 uint16_t ext2bgd_flags; /* block group flags */ 286 uint32_t ext2bgd_x_bitmap; /* snapshot exclusion bitmap loc. */ 287 uint16_t ext2bgd_b_bmap_csum; /* block bitmap checksum */ 288 uint16_t ext2bgd_i_bmap_csum; /* inode bitmap checksum */ 289 uint16_t ext2bgd_i_unused; /* unused inode count */ 290 uint16_t ext2bgd_csum; /* group descriptor checksum */ 291}; 292 | 232 * File clean flags 233 */ 234#define E2FS_ISCLEAN 0x0001 /* Unmounted cleanly */ 235#define E2FS_ERRORS 0x0002 /* Errors detected */ 236 237/* ext2 file system block group descriptor */ 238 239struct ext2_gd { --- 6 unchanged lines hidden (view full) --- 246 uint16_t ext2bgd_flags; /* block group flags */ 247 uint32_t ext2bgd_x_bitmap; /* snapshot exclusion bitmap loc. */ 248 uint16_t ext2bgd_b_bmap_csum; /* block bitmap checksum */ 249 uint16_t ext2bgd_i_bmap_csum; /* inode bitmap checksum */ 250 uint16_t ext2bgd_i_unused; /* unused inode count */ 251 uint16_t ext2bgd_csum; /* group descriptor checksum */ 252}; 253 |
293/* cluster summary information */ | |
294 | 254 |
295struct csum { 296 int8_t cs_init; /* cluster summary has been initialized */ 297 int32_t *cs_sum; /* cluster summary array */ 298}; 299 | |
300/* EXT2FS metadatas are stored in little-endian byte order. These macros 301 * helps reading these metadatas 302 */ 303 304#define e2fs_cgload(old, new, size) memcpy((new), (old), (size)); 305#define e2fs_cgsave(old, new, size) memcpy((new), (old), (size)); 306 307/* --- 23 unchanged lines hidden --- | 255/* EXT2FS metadatas are stored in little-endian byte order. These macros 256 * helps reading these metadatas 257 */ 258 259#define e2fs_cgload(old, new, size) memcpy((new), (old), (size)); 260#define e2fs_cgsave(old, new, size) memcpy((new), (old), (size)); 261 262/* --- 23 unchanged lines hidden --- |