blob: 136635de08857fb3f9696394bbfeeabc8f4ba29e [file] [log] [blame]
"Robert P. J. Day"63fc1a92006-07-02 19:47:05 +00001/* vi: set sw=4 ts=4: */
Mike Frysinger1fd98e02005-05-09 22:10:42 +00002/*
3 * jfs_dat.h --- stripped down header file which only contains the JFS
Tim Rikerc1ef7bd2006-01-25 00:08:53 +00004 * on-disk data structures
Mike Frysinger1fd98e02005-05-09 22:10:42 +00005 */
6
7#define JFS_MAGIC_NUMBER 0xc03b3998U /* The first 4 bytes of /dev/random! */
8
9/*
10 * On-disk structures
11 */
12
Tim Rikerc1ef7bd2006-01-25 00:08:53 +000013/*
Mike Frysinger1fd98e02005-05-09 22:10:42 +000014 * 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 */
24typedef struct journal_header_s
25{
26 __u32 h_magic;
27 __u32 h_blocktype;
28 __u32 h_sequence;
29} journal_header_t;
30
31
Tim Rikerc1ef7bd2006-01-25 00:08:53 +000032/*
33 * The block tag: used to describe a single buffer in the journal
Mike Frysinger1fd98e02005-05-09 22:10:42 +000034 */
35typedef 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 */
51typedef 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 */
Tim Rikerc1ef7bd2006-01-25 00:08:53 +000059
Mike Frysinger1fd98e02005-05-09 22:10:42 +000060 /* 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 */
Tim Rikerc1ef7bd2006-01-25 00:08:53 +000063
Mike Frysinger1fd98e02005-05-09 22:10:42 +000064} journal_superblock_t;
65