Mercurial > hg > toybox
annotate toys/e2fs.h @ 1613:96aa7ec74936 draft
Fix yet another sed bug.
The s/// command would copy the \ of substitutions before deciding what to
do with them (generally overwriting the \ with the new data). When the
substitution was A) at the very end of the new string, B) resolved to nothing,
it could leave a trailing \ that didn't belong there and didn't get overwritten
because the "copy trailing data" part that copies the original string's null
terminator already happened before the \ overwrote it.
The ghostwheel() function restarts regexes after embedded NUL bytes, but
if the string it's passed is _longer_ than the length it's told then it
gets confused (and it means we're off the end of our allocation so segfaults
are likely).
Fix: test for \ first and move the "copy byte" logic into an else case.
author | Rob Landley <rob@landley.net> |
---|---|
date | Mon, 15 Dec 2014 03:34:55 -0600 |
parents | 786841fdb1e0 |
children |
rev | line source |
---|---|
694
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
1 /* mke2fs.h - Headers for ext2 |
75
89ca591a9236
More random progress on mke2fs. Nothing to see yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
2 * |
89ca591a9236
More random progress on mke2fs. Nothing to see yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
3 * Copyright 2006 Rob Landley <rob@landley.net> |
89ca591a9236
More random progress on mke2fs. Nothing to see yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
4 */ |
89ca591a9236
More random progress on mke2fs. Nothing to see yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
5 |
89ca591a9236
More random progress on mke2fs. Nothing to see yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
6 // Stuff defined in linux/ext2_fs.h |
89ca591a9236
More random progress on mke2fs. Nothing to see yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
7 |
89ca591a9236
More random progress on mke2fs. Nothing to see yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
8 #define EXT2_SUPER_MAGIC 0xEF53 |
89ca591a9236
More random progress on mke2fs. Nothing to see yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
9 |
76 | 10 struct ext2_superblock { |
694
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
11 uint32_t inodes_count; // Inodes count |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
12 uint32_t blocks_count; // Blocks count |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
13 uint32_t r_blocks_count; // Reserved blocks count |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
14 uint32_t free_blocks_count; // Free blocks count |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
15 uint32_t free_inodes_count; // Free inodes count |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
16 uint32_t first_data_block; // First Data Block |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
17 uint32_t log_block_size; // Block size |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
18 uint32_t log_frag_size; // Fragment size |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
19 uint32_t blocks_per_group; // Blocks per group |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
20 uint32_t frags_per_group; // Fragments per group |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
21 uint32_t inodes_per_group; // Inodes per group |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
22 uint32_t mtime; // Mount time |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
23 uint32_t wtime; // Write time |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
24 uint16_t mnt_count; // Mount count |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
25 uint16_t max_mnt_count; // Maximal mount count |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
26 uint16_t magic; // Magic signature |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
27 uint16_t state; // File system state |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
28 uint16_t errors; // Behaviour when detecting errors |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
29 uint16_t minor_rev_level; // minor revision level |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
30 uint32_t lastcheck; // time of last check |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
31 uint32_t checkinterval; // max. time between checks |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
32 uint32_t creator_os; // OS |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
33 uint32_t rev_level; // Revision level |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
34 uint16_t def_resuid; // Default uid for reserved blocks |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
35 uint16_t def_resgid; // Default gid for reserved blocks |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
36 uint32_t first_ino; // First non-reserved inode |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
37 uint16_t inode_size; // size of inode structure |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
38 uint16_t block_group_nr; // block group # of this superblock |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
39 uint32_t feature_compat; // compatible feature set |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
40 uint32_t feature_incompat; // incompatible feature set |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
41 uint32_t feature_ro_compat; // readonly-compatible feature set |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
42 char uuid[16]; // 128-bit uuid for volume |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
43 char volume_name[16]; // volume name |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
44 char last_mounted[64]; // directory where last mounted |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
45 uint32_t alg_usage_bitmap; // For compression |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
46 // For EXT2_COMPAT_PREALLOC |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
47 uint8_t prealloc_blocks; // Nr of blocks to try to preallocate |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
48 uint8_t prealloc_dir_blocks; //Nr to preallocate for dirs |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
49 uint16_t padding1; |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
50 // For EXT3_FEATURE_COMPAT_HAS_JOURNAL |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
51 uint8_t journal_uuid[16]; // uuid of journal superblock |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
52 uint32_t journal_inum; // inode number of journal file |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
53 uint32_t journal_dev; // device number of journal file |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
54 uint32_t last_orphan; // start of list of inodes to delete |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
55 uint32_t hash_seed[4]; // HTREE hash seed |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
56 uint8_t def_hash_version; // Default hash version to use |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
57 uint8_t padding2[3]; |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
58 uint32_t default_mount_opts; |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
59 uint32_t first_meta_bg; // First metablock block group |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
60 uint32_t mkfs_time; // Creation timestamp |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
61 uint32_t jnl_blocks[17]; // Backup of journal inode |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
62 // uint32_t reserved[172]; // Padding to the end of the block |
75
89ca591a9236
More random progress on mke2fs. Nothing to see yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
63 }; |
89ca591a9236
More random progress on mke2fs. Nothing to see yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
64 |
80
7a058d60faf1
One more field, minor shrinking, and start on block groups.
Rob Landley <rob@landley.net>
parents:
76
diff
changeset
|
65 struct ext2_group |
7a058d60faf1
One more field, minor shrinking, and start on block groups.
Rob Landley <rob@landley.net>
parents:
76
diff
changeset
|
66 { |
694
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
67 uint32_t block_bitmap; // Block number of block bitmap |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
68 uint32_t inode_bitmap; // Block number of inode bitmap |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
69 uint32_t inode_table; // Block number of inode table |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
70 uint16_t free_blocks_count; // How many free blocks in this group? |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
71 uint16_t free_inodes_count; // How many free inodes in this group? |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
72 uint16_t used_dirs_count; // How many directories? |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
73 uint16_t reserved[7]; // pad to 32 bytes |
80
7a058d60faf1
One more field, minor shrinking, and start on block groups.
Rob Landley <rob@landley.net>
parents:
76
diff
changeset
|
74 }; |
7a058d60faf1
One more field, minor shrinking, and start on block groups.
Rob Landley <rob@landley.net>
parents:
76
diff
changeset
|
75 |
76 | 76 struct ext2_dentry { |
694
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
77 uint32_t inode; // Inode number |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
78 uint16_t rec_len; // Directory entry length |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
79 uint8_t name_len; // Name length |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
80 uint8_t file_type; |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
81 char name[0]; // File name |
76 | 82 }; |
83 | |
84 struct ext2_inode { | |
694
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
85 uint16_t mode; // File mode |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
86 uint16_t uid; // Low 16 bits of Owner Uid |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
87 uint32_t size; // Size in bytes |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
88 uint32_t atime; // Access time |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
89 uint32_t ctime; // Creation time |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
90 uint32_t mtime; // Modification time |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
91 uint32_t dtime; // Deletion Time |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
92 uint16_t gid; // Low 16 bits of Group Id |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
93 uint16_t links_count; // Links count |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
94 uint32_t blocks; // Blocks count |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
95 uint32_t flags; // File flags |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
96 uint32_t reserved1; |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
97 uint32_t block[15]; // Pointers to blocks |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
98 uint32_t generation; // File version (for NFS) |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
99 uint32_t file_acl; // File ACL |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
100 uint32_t dir_acl; // Directory ACL (or top bits of file length) |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
101 uint32_t faddr; // Last block in file |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
102 uint8_t frag; // Fragment number |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
103 uint8_t fsize; // Fragment size |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
104 uint16_t pad1; |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
105 uint16_t uid_high; // High bits of uid |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
106 uint16_t gid_high; // High bits of gid |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
107 uint32_t reserved2; |
76 | 108 }; |
109 | |
75
89ca591a9236
More random progress on mke2fs. Nothing to see yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
110 #define EXT2_FEATURE_COMPAT_DIR_PREALLOC 0x0001 |
89ca591a9236
More random progress on mke2fs. Nothing to see yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
111 #define EXT2_FEATURE_COMPAT_IMAGIC_INODES 0x0002 |
89ca591a9236
More random progress on mke2fs. Nothing to see yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
112 #define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0004 |
89ca591a9236
More random progress on mke2fs. Nothing to see yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
113 #define EXT2_FEATURE_COMPAT_EXT_ATTR 0x0008 |
89ca591a9236
More random progress on mke2fs. Nothing to see yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
114 #define EXT2_FEATURE_COMPAT_RESIZE_INO 0x0010 |
89ca591a9236
More random progress on mke2fs. Nothing to see yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
115 #define EXT2_FEATURE_COMPAT_DIR_INDEX 0x0020 |
89ca591a9236
More random progress on mke2fs. Nothing to see yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
116 |
89ca591a9236
More random progress on mke2fs. Nothing to see yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
117 #define EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001 |
89ca591a9236
More random progress on mke2fs. Nothing to see yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
118 #define EXT2_FEATURE_RO_COMPAT_LARGE_FILE 0x0002 |
89ca591a9236
More random progress on mke2fs. Nothing to see yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
119 #define EXT2_FEATURE_RO_COMPAT_BTREE_DIR 0x0004 |
89ca591a9236
More random progress on mke2fs. Nothing to see yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
120 |
89ca591a9236
More random progress on mke2fs. Nothing to see yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
121 #define EXT2_FEATURE_INCOMPAT_COMPRESSION 0x0001 |
89ca591a9236
More random progress on mke2fs. Nothing to see yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
122 #define EXT2_FEATURE_INCOMPAT_FILETYPE 0x0002 |
89ca591a9236
More random progress on mke2fs. Nothing to see yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
123 #define EXT3_FEATURE_INCOMPAT_RECOVER 0x0004 |
89ca591a9236
More random progress on mke2fs. Nothing to see yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
124 #define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV 0x0008 |
89ca591a9236
More random progress on mke2fs. Nothing to see yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
125 #define EXT2_FEATURE_INCOMPAT_META_BG 0x0010 |
89ca591a9236
More random progress on mke2fs. Nothing to see yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
126 |
89ca591a9236
More random progress on mke2fs. Nothing to see yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
127 #define EXT2_NAME_LEN 255 |
89ca591a9236
More random progress on mke2fs. Nothing to see yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
128 |
89ca591a9236
More random progress on mke2fs. Nothing to see yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
129 // Ext2 directory file types. Only the low 3 bits are used. The |
89ca591a9236
More random progress on mke2fs. Nothing to see yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
130 // other bits are reserved for now. |
89ca591a9236
More random progress on mke2fs. Nothing to see yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
131 |
89ca591a9236
More random progress on mke2fs. Nothing to see yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
132 enum { |
694
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
133 EXT2_FT_UNKNOWN, |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
134 EXT2_FT_REG_FILE, |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
135 EXT2_FT_DIR, |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
136 EXT2_FT_CHRDEV, |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
137 EXT2_FT_BLKDEV, |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
138 EXT2_FT_FIFO, |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
139 EXT2_FT_SOCK, |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
140 EXT2_FT_SYMLINK, |
786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents:
112
diff
changeset
|
141 EXT2_FT_MAX |
75
89ca591a9236
More random progress on mke2fs. Nothing to see yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
142 }; |