[1765] | 1 | /* vi: set sw=4 ts=4: */
|
---|
| 2 | /*
|
---|
| 3 | * jfs_dat.h --- stripped down header file which only contains the JFS
|
---|
| 4 | * on-disk data structures
|
---|
| 5 | */
|
---|
| 6 |
|
---|
| 7 | #define JFS_MAGIC_NUMBER 0xc03b3998U /* The first 4 bytes of /dev/random! */
|
---|
| 8 |
|
---|
| 9 | /*
|
---|
| 10 | * On-disk structures
|
---|
| 11 | */
|
---|
| 12 |
|
---|
| 13 | /*
|
---|
| 14 | * Descriptor block types:
|
---|
| 15 | */
|
---|
| 16 |
|
---|
| 17 | #define JFS_DESCRIPTOR_BLOCK 1
|
---|
| 18 | #define JFS_COMMIT_BLOCK 2
|
---|
| 19 | #define JFS_SUPERBLOCK 3
|
---|
| 20 |
|
---|
| 21 | /*
|
---|
| 22 | * Standard header for all descriptor blocks:
|
---|
| 23 | */
|
---|
| 24 | typedef struct journal_header_s
|
---|
| 25 | {
|
---|
| 26 | __u32 h_magic;
|
---|
| 27 | __u32 h_blocktype;
|
---|
| 28 | __u32 h_sequence;
|
---|
| 29 | } journal_header_t;
|
---|
| 30 |
|
---|
| 31 |
|
---|
| 32 | /*
|
---|
| 33 | * The block tag: used to describe a single buffer in the journal
|
---|
| 34 | */
|
---|
| 35 | typedef struct journal_block_tag_s
|
---|
| 36 | {
|
---|
| 37 | __u32 t_blocknr; /* The on-disk block number */
|
---|
| 38 | __u32 t_flags; /* See below */
|
---|
| 39 | } journal_block_tag_t;
|
---|
| 40 |
|
---|
| 41 | /* Definitions for the journal tag flags word: */
|
---|
| 42 | #define JFS_FLAG_ESCAPE 1 /* on-disk block is escaped */
|
---|
| 43 | #define JFS_FLAG_SAME_UUID 2 /* block has same uuid as previous */
|
---|
| 44 | #define JFS_FLAG_DELETED 4 /* block deleted by this transaction */
|
---|
| 45 | #define JFS_FLAG_LAST_TAG 8 /* last tag in this descriptor block */
|
---|
| 46 |
|
---|
| 47 |
|
---|
| 48 | /*
|
---|
| 49 | * The journal superblock
|
---|
| 50 | */
|
---|
| 51 | typedef struct journal_superblock_s
|
---|
| 52 | {
|
---|
| 53 | journal_header_t s_header;
|
---|
| 54 |
|
---|
| 55 | /* Static information describing the journal */
|
---|
| 56 | __u32 s_blocksize; /* journal device blocksize */
|
---|
| 57 | __u32 s_maxlen; /* total blocks in journal file */
|
---|
| 58 | __u32 s_first; /* first block of log information */
|
---|
| 59 |
|
---|
| 60 | /* Dynamic information describing the current state of the log */
|
---|
| 61 | __u32 s_sequence; /* first commit ID expected in log */
|
---|
| 62 | __u32 s_start; /* blocknr of start of log */
|
---|
| 63 |
|
---|
| 64 | } journal_superblock_t;
|
---|
| 65 |
|
---|