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