This source file includes following definitions.
- JFS_IP
- jfs_dirtable_inline
- JFS_SBI
- isReadOnly
1
2
3
4
5
6 #ifndef _H_JFS_INCORE
7 #define _H_JFS_INCORE
8
9 #include <linux/mutex.h>
10 #include <linux/rwsem.h>
11 #include <linux/slab.h>
12 #include <linux/bitops.h>
13 #include <linux/uuid.h>
14
15 #include "jfs_types.h"
16 #include "jfs_xtree.h"
17 #include "jfs_dtree.h"
18
19
20
21
22 #define JFS_SUPER_MAGIC 0x3153464a
23
24
25
26
27 struct jfs_inode_info {
28 int fileset;
29 uint mode2;
30 kuid_t saved_uid;
31 kgid_t saved_gid;
32 pxd_t ixpxd;
33 dxd_t acl;
34 dxd_t ea;
35 time64_t otime;
36 uint next_index;
37 int acltype;
38 short btorder;
39 short btindex;
40 struct inode *ipimap;
41 unsigned long cflag;
42 u64 agstart;
43 u16 bxflag;
44 unchar pad;
45 signed char active_ag;
46 lid_t blid;
47 lid_t atlhead;
48 lid_t atltail;
49 spinlock_t ag_lock;
50 struct list_head anon_inode_list;
51
52
53
54
55
56 struct rw_semaphore rdwrlock;
57
58
59
60
61
62
63 struct mutex commit_mutex;
64
65 struct rw_semaphore xattr_sem;
66 lid_t xtlid;
67 union {
68 struct {
69 xtpage_t _xtroot;
70 struct inomap *_imap;
71 } file;
72 struct {
73 struct dir_table_slot _table[12];
74 dtroot_t _dtroot;
75 } dir;
76 struct {
77 unchar _unused[16];
78 dxd_t _dxd;
79
80 unchar _inline[128];
81
82
83
84 unchar _inline_ea[128];
85 } link;
86 } u;
87 #ifdef CONFIG_QUOTA
88 struct dquot *i_dquot[MAXQUOTAS];
89 #endif
90 u32 dev;
91 struct inode vfs_inode;
92 };
93 #define i_xtroot u.file._xtroot
94 #define i_imap u.file._imap
95 #define i_dirtable u.dir._table
96 #define i_dtroot u.dir._dtroot
97 #define i_inline u.link._inline
98 #define i_inline_ea u.link._inline_ea
99
100 #define IREAD_LOCK(ip, subclass) \
101 down_read_nested(&JFS_IP(ip)->rdwrlock, subclass)
102 #define IREAD_UNLOCK(ip) up_read(&JFS_IP(ip)->rdwrlock)
103 #define IWRITE_LOCK(ip, subclass) \
104 down_write_nested(&JFS_IP(ip)->rdwrlock, subclass)
105 #define IWRITE_UNLOCK(ip) up_write(&JFS_IP(ip)->rdwrlock)
106
107
108
109
110 enum cflags {
111 COMMIT_Nolink,
112 COMMIT_Inlineea,
113 COMMIT_Freewmap,
114 COMMIT_Dirty,
115 COMMIT_Dirtable,
116 COMMIT_Stale,
117 COMMIT_Synclist,
118 };
119
120
121
122
123 enum commit_mutex_class
124 {
125 COMMIT_MUTEX_PARENT,
126 COMMIT_MUTEX_CHILD,
127 COMMIT_MUTEX_SECOND_PARENT,
128 COMMIT_MUTEX_VICTIM
129 };
130
131
132
133
134
135
136 enum rdwrlock_class
137 {
138 RDWRLOCK_NORMAL,
139 RDWRLOCK_IMAP,
140 RDWRLOCK_DMAP
141 };
142
143 #define set_cflag(flag, ip) set_bit(flag, &(JFS_IP(ip)->cflag))
144 #define clear_cflag(flag, ip) clear_bit(flag, &(JFS_IP(ip)->cflag))
145 #define test_cflag(flag, ip) test_bit(flag, &(JFS_IP(ip)->cflag))
146 #define test_and_clear_cflag(flag, ip) \
147 test_and_clear_bit(flag, &(JFS_IP(ip)->cflag))
148
149
150
151 struct jfs_sb_info {
152 struct super_block *sb;
153 unsigned long mntflag;
154 struct inode *ipbmap;
155 struct inode *ipaimap;
156 struct inode *ipaimap2;
157 struct inode *ipimap;
158 struct jfs_log *log;
159 struct list_head log_list;
160 short bsize;
161 short l2bsize;
162 short nbperpage;
163 short l2nbperpage;
164 short l2niperblk;
165 dev_t logdev;
166 uint aggregate;
167 pxd_t logpxd;
168 pxd_t fsckpxd;
169 pxd_t ait2;
170 uuid_t uuid;
171 uuid_t loguuid;
172
173
174
175
176 int commit_state;
177
178 uint gengen;
179 uint inostamp;
180
181
182 struct bmap *bmap;
183 struct nls_table *nls_tab;
184 struct inode *direct_inode;
185 uint state;
186 unsigned long flag;
187 uint p_state;
188 kuid_t uid;
189 kgid_t gid;
190 uint umask;
191 uint minblks_trim;
192 };
193
194
195 #define IN_LAZYCOMMIT 1
196
197 static inline struct jfs_inode_info *JFS_IP(struct inode *inode)
198 {
199 return container_of(inode, struct jfs_inode_info, vfs_inode);
200 }
201
202 static inline int jfs_dirtable_inline(struct inode *inode)
203 {
204 return (JFS_IP(inode)->next_index <= (MAX_INLINE_DIRTABLE_ENTRY + 1));
205 }
206
207 static inline struct jfs_sb_info *JFS_SBI(struct super_block *sb)
208 {
209 return sb->s_fs_info;
210 }
211
212 static inline int isReadOnly(struct inode *inode)
213 {
214 if (JFS_SBI(inode->i_sb)->log)
215 return 0;
216 return 1;
217 }
218 #endif