jbd.h revision 1dc9e472e19acfe6dc7f41e429236e7eef7ceda1
1/****************************************************************************
2 ****************************************************************************
3 ***
4 ***   This header was automatically generated from a Linux kernel header
5 ***   of the same name, to make information necessary for userspace to
6 ***   call into the kernel available to libc.  It contains only constants,
7 ***   structures, and macros generated from the original header, and thus,
8 ***   contains no copyrightable information.
9 ***
10 ****************************************************************************
11 ****************************************************************************/
12#ifndef _LINUX_JBD_H
13#define _LINUX_JBD_H
14
15#include "jfs_compat.h"
16#define JFS_DEBUG
17#define jfs_debug jbd_debug
18
19#define journal_oom_retry 1
20
21#undef JBD_PARANOID_IOFAIL
22
23#define JBD_DEFAULT_MAX_COMMIT_AGE 5
24
25#define jbd_debug(f, a...)
26
27#define jbd_kmalloc(size, flags)   __jbd_kmalloc(__FUNCTION__, (size), (flags), journal_oom_retry)
28#define jbd_rep_kmalloc(size, flags)   __jbd_kmalloc(__FUNCTION__, (size), (flags), 1)
29
30#define JFS_MIN_JOURNAL_BLOCKS 1024
31
32#define JFS_MAGIC_NUMBER 0xc03b3998U
33
34#define JFS_DESCRIPTOR_BLOCK 1
35#define JFS_COMMIT_BLOCK 2
36#define JFS_SUPERBLOCK_V1 3
37#define JFS_SUPERBLOCK_V2 4
38#define JFS_REVOKE_BLOCK 5
39
40typedef struct journal_header_s
41{
42 __be32 h_magic;
43 __be32 h_blocktype;
44 __be32 h_sequence;
45} journal_header_t;
46
47typedef struct journal_block_tag_s
48{
49 __be32 t_blocknr;
50 __be32 t_flags;
51} journal_block_tag_t;
52
53typedef struct journal_revoke_header_s
54{
55 journal_header_t r_header;
56 __be32 r_count;
57} journal_revoke_header_t;
58
59#define JFS_FLAG_ESCAPE 1
60#define JFS_FLAG_SAME_UUID 2
61#define JFS_FLAG_DELETED 4
62#define JFS_FLAG_LAST_TAG 8
63
64typedef struct journal_superblock_s
65{
66
67 journal_header_t s_header;
68
69 __be32 s_blocksize;
70 __be32 s_maxlen;
71 __be32 s_first;
72
73 __be32 s_sequence;
74 __be32 s_start;
75
76 __be32 s_errno;
77
78 __be32 s_feature_compat;
79 __be32 s_feature_incompat;
80 __be32 s_feature_ro_compat;
81
82 __u8 s_uuid[16];
83
84 __be32 s_nr_users;
85
86 __be32 s_dynsuper;
87
88 __be32 s_max_transaction;
89 __be32 s_max_trans_data;
90
91 __u32 s_padding[44];
92
93 __u8 s_users[16*48];
94
95} journal_superblock_t;
96
97#define JFS_HAS_COMPAT_FEATURE(j,mask)   ((j)->j_format_version >= 2 &&   ((j)->j_superblock->s_feature_compat & cpu_to_be32((mask))))
98#define JFS_HAS_RO_COMPAT_FEATURE(j,mask)   ((j)->j_format_version >= 2 &&   ((j)->j_superblock->s_feature_ro_compat & cpu_to_be32((mask))))
99#define JFS_HAS_INCOMPAT_FEATURE(j,mask)   ((j)->j_format_version >= 2 &&   ((j)->j_superblock->s_feature_incompat & cpu_to_be32((mask))))
100
101#define JFS_FEATURE_INCOMPAT_REVOKE 0x00000001
102
103#define JFS_KNOWN_COMPAT_FEATURES 0
104#define JFS_KNOWN_ROCOMPAT_FEATURES 0
105#define JFS_KNOWN_INCOMPAT_FEATURES JFS_FEATURE_INCOMPAT_REVOKE
106
107#define BJ_None 0
108#define BJ_SyncData 1
109#define BJ_Metadata 2
110#define BJ_Forget 3
111#define BJ_IO 4
112#define BJ_Shadow 5
113#define BJ_LogCtl 6
114#define BJ_Reserved 7
115#define BJ_Locked 8
116#define BJ_Types 9
117
118#endif
119