aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2013-08-12 06:49:23 -0400
committerBen Myers <bpm@sgi.com>2013-08-12 17:05:19 -0400
commit69432832fd7466c20c7c92cbd92c561ac78988c2 (patch)
treee88e0d4698eab40c93248c7be3b7d8d2ffd52c19 /fs
parentfc06c6d064dd50f7aa157065ef79216190d75c91 (diff)
xfs: split out inode log item format definition
The log item format definitions are shared with userspace. Split them out of header files that contain kernel only defintions to make it simple to shared them. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/xfs_acl.c1
-rw-r--r--fs/xfs/xfs_filestream.c2
-rw-r--r--fs/xfs/xfs_inode.h69
-rw-r--r--fs/xfs/xfs_inode_item.h115
-rw-r--r--fs/xfs/xfs_log_format.h189
-rw-r--r--fs/xfs/xfs_types.h6
-rw-r--r--fs/xfs/xfs_xattr.c1
7 files changed, 200 insertions, 183 deletions
diff --git a/fs/xfs/xfs_acl.c b/fs/xfs/xfs_acl.c
index 306d883d89bc..695606a3147d 100644
--- a/fs/xfs/xfs_acl.c
+++ b/fs/xfs/xfs_acl.c
@@ -16,6 +16,7 @@
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */ 17 */
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_log_format.h"
19#include "xfs_acl.h" 20#include "xfs_acl.h"
20#include "xfs_attr.h" 21#include "xfs_attr.h"
21#include "xfs_bmap_btree.h" 22#include "xfs_bmap_btree.h"
diff --git a/fs/xfs/xfs_filestream.c b/fs/xfs/xfs_filestream.c
index 5170306a1009..9eae097ca223 100644
--- a/fs/xfs/xfs_filestream.c
+++ b/fs/xfs/xfs_filestream.c
@@ -16,12 +16,12 @@
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */ 17 */
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_log.h"
19#include "xfs_bmap_btree.h" 20#include "xfs_bmap_btree.h"
20#include "xfs_inum.h" 21#include "xfs_inum.h"
21#include "xfs_dinode.h" 22#include "xfs_dinode.h"
22#include "xfs_inode.h" 23#include "xfs_inode.h"
23#include "xfs_ag.h" 24#include "xfs_ag.h"
24#include "xfs_log.h"
25#include "xfs_trans.h" 25#include "xfs_trans.h"
26#include "xfs_sb.h" 26#include "xfs_sb.h"
27#include "xfs_mount.h" 27#include "xfs_mount.h"
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index b55fd347ab5b..de4f963b268c 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -23,12 +23,6 @@ struct xfs_dinode;
23struct xfs_inode; 23struct xfs_inode;
24 24
25/* 25/*
26 * Fork identifiers.
27 */
28#define XFS_DATA_FORK 0
29#define XFS_ATTR_FORK 1
30
31/*
32 * The following xfs_ext_irec_t struct introduces a second (top) level 26 * The following xfs_ext_irec_t struct introduces a second (top) level
33 * to the in-core extent allocation scheme. These structs are allocated 27 * to the in-core extent allocation scheme. These structs are allocated
34 * in a contiguous block, creating an indirection array where each entry 28 * in a contiguous block, creating an indirection array where each entry
@@ -114,68 +108,6 @@ struct xfs_imap {
114 * chain off the mount structure by xfs_sync calls. 108 * chain off the mount structure by xfs_sync calls.
115 */ 109 */
116 110
117typedef struct xfs_ictimestamp {
118 __int32_t t_sec; /* timestamp seconds */
119 __int32_t t_nsec; /* timestamp nanoseconds */
120} xfs_ictimestamp_t;
121
122/*
123 * NOTE: This structure must be kept identical to struct xfs_dinode
124 * in xfs_dinode.h except for the endianness annotations.
125 */
126typedef struct xfs_icdinode {
127 __uint16_t di_magic; /* inode magic # = XFS_DINODE_MAGIC */
128 __uint16_t di_mode; /* mode and type of file */
129 __int8_t di_version; /* inode version */
130 __int8_t di_format; /* format of di_c data */
131 __uint16_t di_onlink; /* old number of links to file */
132 __uint32_t di_uid; /* owner's user id */
133 __uint32_t di_gid; /* owner's group id */
134 __uint32_t di_nlink; /* number of links to file */
135 __uint16_t di_projid_lo; /* lower part of owner's project id */
136 __uint16_t di_projid_hi; /* higher part of owner's project id */
137 __uint8_t di_pad[6]; /* unused, zeroed space */
138 __uint16_t di_flushiter; /* incremented on flush */
139 xfs_ictimestamp_t di_atime; /* time last accessed */
140 xfs_ictimestamp_t di_mtime; /* time last modified */
141 xfs_ictimestamp_t di_ctime; /* time created/inode modified */
142 xfs_fsize_t di_size; /* number of bytes in file */
143 xfs_drfsbno_t di_nblocks; /* # of direct & btree blocks used */
144 xfs_extlen_t di_extsize; /* basic/minimum extent size for file */
145 xfs_extnum_t di_nextents; /* number of extents in data fork */
146 xfs_aextnum_t di_anextents; /* number of extents in attribute fork*/
147 __uint8_t di_forkoff; /* attr fork offs, <<3 for 64b align */
148 __int8_t di_aformat; /* format of attr fork's data */
149 __uint32_t di_dmevmask; /* DMIG event mask */
150 __uint16_t di_dmstate; /* DMIG state info */
151 __uint16_t di_flags; /* random flags, XFS_DIFLAG_... */
152 __uint32_t di_gen; /* generation number */
153
154 /* di_next_unlinked is the only non-core field in the old dinode */
155 xfs_agino_t di_next_unlinked;/* agi unlinked list ptr */
156
157 /* start of the extended dinode, writable fields */
158 __uint32_t di_crc; /* CRC of the inode */
159 __uint64_t di_changecount; /* number of attribute changes */
160 xfs_lsn_t di_lsn; /* flush sequence */
161 __uint64_t di_flags2; /* more random flags */
162 __uint8_t di_pad2[16]; /* more padding for future expansion */
163
164 /* fields only written to during inode creation */
165 xfs_ictimestamp_t di_crtime; /* time created */
166 xfs_ino_t di_ino; /* inode number */
167 uuid_t di_uuid; /* UUID of the filesystem */
168
169 /* structure must be padded to 64 bit alignment */
170} xfs_icdinode_t;
171
172static inline uint xfs_icdinode_size(int version)
173{
174 if (version == 3)
175 return sizeof(struct xfs_icdinode);
176 return offsetof(struct xfs_icdinode, di_next_unlinked);
177}
178
179/* 111/*
180 * Flags for xfs_ichgtime(). 112 * Flags for xfs_ichgtime().
181 */ 113 */
@@ -626,7 +558,6 @@ void xfs_inobp_check(struct xfs_mount *, struct xfs_buf *);
626 558
627extern struct kmem_zone *xfs_ifork_zone; 559extern struct kmem_zone *xfs_ifork_zone;
628extern struct kmem_zone *xfs_inode_zone; 560extern struct kmem_zone *xfs_inode_zone;
629extern struct kmem_zone *xfs_ili_zone;
630extern const struct xfs_buf_ops xfs_inode_buf_ops; 561extern const struct xfs_buf_ops xfs_inode_buf_ops;
631 562
632#endif /* __XFS_INODE_H__ */ 563#endif /* __XFS_INODE_H__ */
diff --git a/fs/xfs/xfs_inode_item.h b/fs/xfs/xfs_inode_item.h
index 779812fb3d80..dce4d656768c 100644
--- a/fs/xfs/xfs_inode_item.h
+++ b/fs/xfs/xfs_inode_item.h
@@ -18,123 +18,13 @@
18#ifndef __XFS_INODE_ITEM_H__ 18#ifndef __XFS_INODE_ITEM_H__
19#define __XFS_INODE_ITEM_H__ 19#define __XFS_INODE_ITEM_H__
20 20
21/* 21/* kernel only definitions */
22 * This is the structure used to lay out an inode log item in the
23 * log. The size of the inline data/extents/b-tree root to be logged
24 * (if any) is indicated in the ilf_dsize field. Changes to this structure
25 * must be added on to the end.
26 */
27typedef struct xfs_inode_log_format {
28 __uint16_t ilf_type; /* inode log item type */
29 __uint16_t ilf_size; /* size of this item */
30 __uint32_t ilf_fields; /* flags for fields logged */
31 __uint16_t ilf_asize; /* size of attr d/ext/root */
32 __uint16_t ilf_dsize; /* size of data/ext/root */
33 __uint64_t ilf_ino; /* inode number */
34 union {
35 __uint32_t ilfu_rdev; /* rdev value for dev inode*/
36 uuid_t ilfu_uuid; /* mount point value */
37 } ilf_u;
38 __int64_t ilf_blkno; /* blkno of inode buffer */
39 __int32_t ilf_len; /* len of inode buffer */
40 __int32_t ilf_boffset; /* off of inode in buffer */
41} xfs_inode_log_format_t;
42
43typedef struct xfs_inode_log_format_32 {
44 __uint16_t ilf_type; /* inode log item type */
45 __uint16_t ilf_size; /* size of this item */
46 __uint32_t ilf_fields; /* flags for fields logged */
47 __uint16_t ilf_asize; /* size of attr d/ext/root */
48 __uint16_t ilf_dsize; /* size of data/ext/root */
49 __uint64_t ilf_ino; /* inode number */
50 union {
51 __uint32_t ilfu_rdev; /* rdev value for dev inode*/
52 uuid_t ilfu_uuid; /* mount point value */
53 } ilf_u;
54 __int64_t ilf_blkno; /* blkno of inode buffer */
55 __int32_t ilf_len; /* len of inode buffer */
56 __int32_t ilf_boffset; /* off of inode in buffer */
57} __attribute__((packed)) xfs_inode_log_format_32_t;
58
59typedef struct xfs_inode_log_format_64 {
60 __uint16_t ilf_type; /* inode log item type */
61 __uint16_t ilf_size; /* size of this item */
62 __uint32_t ilf_fields; /* flags for fields logged */
63 __uint16_t ilf_asize; /* size of attr d/ext/root */
64 __uint16_t ilf_dsize; /* size of data/ext/root */
65 __uint32_t ilf_pad; /* pad for 64 bit boundary */
66 __uint64_t ilf_ino; /* inode number */
67 union {
68 __uint32_t ilfu_rdev; /* rdev value for dev inode*/
69 uuid_t ilfu_uuid; /* mount point value */
70 } ilf_u;
71 __int64_t ilf_blkno; /* blkno of inode buffer */
72 __int32_t ilf_len; /* len of inode buffer */
73 __int32_t ilf_boffset; /* off of inode in buffer */
74} xfs_inode_log_format_64_t;
75
76/*
77 * Flags for xfs_trans_log_inode flags field.
78 */
79#define XFS_ILOG_CORE 0x001 /* log standard inode fields */
80#define XFS_ILOG_DDATA 0x002 /* log i_df.if_data */
81#define XFS_ILOG_DEXT 0x004 /* log i_df.if_extents */
82#define XFS_ILOG_DBROOT 0x008 /* log i_df.i_broot */
83#define XFS_ILOG_DEV 0x010 /* log the dev field */
84#define XFS_ILOG_UUID 0x020 /* log the uuid field */
85#define XFS_ILOG_ADATA 0x040 /* log i_af.if_data */
86#define XFS_ILOG_AEXT 0x080 /* log i_af.if_extents */
87#define XFS_ILOG_ABROOT 0x100 /* log i_af.i_broot */
88
89
90/*
91 * The timestamps are dirty, but not necessarily anything else in the inode
92 * core. Unlike the other fields above this one must never make it to disk
93 * in the ilf_fields of the inode_log_format, but is purely store in-memory in
94 * ili_fields in the inode_log_item.
95 */
96#define XFS_ILOG_TIMESTAMP 0x4000
97
98#define XFS_ILOG_NONCORE (XFS_ILOG_DDATA | XFS_ILOG_DEXT | \
99 XFS_ILOG_DBROOT | XFS_ILOG_DEV | \
100 XFS_ILOG_UUID | XFS_ILOG_ADATA | \
101 XFS_ILOG_AEXT | XFS_ILOG_ABROOT)
102
103#define XFS_ILOG_DFORK (XFS_ILOG_DDATA | XFS_ILOG_DEXT | \
104 XFS_ILOG_DBROOT)
105
106#define XFS_ILOG_AFORK (XFS_ILOG_ADATA | XFS_ILOG_AEXT | \
107 XFS_ILOG_ABROOT)
108
109#define XFS_ILOG_ALL (XFS_ILOG_CORE | XFS_ILOG_DDATA | \
110 XFS_ILOG_DEXT | XFS_ILOG_DBROOT | \
111 XFS_ILOG_DEV | XFS_ILOG_UUID | \
112 XFS_ILOG_ADATA | XFS_ILOG_AEXT | \
113 XFS_ILOG_ABROOT | XFS_ILOG_TIMESTAMP)
114
115static inline int xfs_ilog_fbroot(int w)
116{
117 return (w == XFS_DATA_FORK ? XFS_ILOG_DBROOT : XFS_ILOG_ABROOT);
118}
119
120static inline int xfs_ilog_fext(int w)
121{
122 return (w == XFS_DATA_FORK ? XFS_ILOG_DEXT : XFS_ILOG_AEXT);
123}
124
125static inline int xfs_ilog_fdata(int w)
126{
127 return (w == XFS_DATA_FORK ? XFS_ILOG_DDATA : XFS_ILOG_ADATA);
128}
129
130#ifdef __KERNEL__
131 22
132struct xfs_buf; 23struct xfs_buf;
133struct xfs_bmbt_rec; 24struct xfs_bmbt_rec;
134struct xfs_inode; 25struct xfs_inode;
135struct xfs_mount; 26struct xfs_mount;
136 27
137
138typedef struct xfs_inode_log_item { 28typedef struct xfs_inode_log_item {
139 xfs_log_item_t ili_item; /* common portion */ 29 xfs_log_item_t ili_item; /* common portion */
140 struct xfs_inode *ili_inode; /* inode ptr */ 30 struct xfs_inode *ili_inode; /* inode ptr */
@@ -151,7 +41,6 @@ typedef struct xfs_inode_log_item {
151 xfs_inode_log_format_t ili_format; /* logged structure */ 41 xfs_inode_log_format_t ili_format; /* logged structure */
152} xfs_inode_log_item_t; 42} xfs_inode_log_item_t;
153 43
154
155static inline int xfs_inode_clean(xfs_inode_t *ip) 44static inline int xfs_inode_clean(xfs_inode_t *ip)
156{ 45{
157 return !ip->i_itemp || !(ip->i_itemp->ili_fields & XFS_ILOG_ALL); 46 return !ip->i_itemp || !(ip->i_itemp->ili_fields & XFS_ILOG_ALL);
@@ -165,6 +54,6 @@ extern void xfs_iflush_abort(struct xfs_inode *, bool);
165extern int xfs_inode_item_format_convert(xfs_log_iovec_t *, 54extern int xfs_inode_item_format_convert(xfs_log_iovec_t *,
166 xfs_inode_log_format_t *); 55 xfs_inode_log_format_t *);
167 56
168#endif /* __KERNEL__ */ 57extern struct kmem_zone *xfs_ili_zone;
169 58
170#endif /* __XFS_INODE_ITEM_H__ */ 59#endif /* __XFS_INODE_ITEM_H__ */
diff --git a/fs/xfs/xfs_log_format.h b/fs/xfs/xfs_log_format.h
index 9f9aeb63545a..fd46a7f2293a 100644
--- a/fs/xfs/xfs_log_format.h
+++ b/fs/xfs/xfs_log_format.h
@@ -18,6 +18,16 @@
18#ifndef __XFS_LOG_FORMAT_H__ 18#ifndef __XFS_LOG_FORMAT_H__
19#define __XFS_LOG_FORMAT_H__ 19#define __XFS_LOG_FORMAT_H__
20 20
21/*
22 * On-disk Log Format definitions.
23 *
24 * This file contains all the on-disk format definitions used within the log. It
25 * includes the physical log structure itself, as well as all the log item
26 * format structures that are written into the log and intepreted by log
27 * recovery. We start with the physical log format definitions, and then work
28 * through all the log items definitions and everything they encode into the
29 * log.
30 */
21typedef __uint32_t xlog_tid_t; 31typedef __uint32_t xlog_tid_t;
22 32
23#define XLOG_MIN_ICLOGS 2 33#define XLOG_MIN_ICLOGS 2
@@ -175,4 +185,183 @@ typedef struct xfs_log_iovec {
175 uint i_type; /* type of region */ 185 uint i_type; /* type of region */
176} xfs_log_iovec_t; 186} xfs_log_iovec_t;
177 187
188
189/*
190 * Inode Log Item Format definitions.
191 *
192 * This is the structure used to lay out an inode log item in the
193 * log. The size of the inline data/extents/b-tree root to be logged
194 * (if any) is indicated in the ilf_dsize field. Changes to this structure
195 * must be added on to the end.
196 */
197typedef struct xfs_inode_log_format {
198 __uint16_t ilf_type; /* inode log item type */
199 __uint16_t ilf_size; /* size of this item */
200 __uint32_t ilf_fields; /* flags for fields logged */
201 __uint16_t ilf_asize; /* size of attr d/ext/root */
202 __uint16_t ilf_dsize; /* size of data/ext/root */
203 __uint64_t ilf_ino; /* inode number */
204 union {
205 __uint32_t ilfu_rdev; /* rdev value for dev inode*/
206 uuid_t ilfu_uuid; /* mount point value */
207 } ilf_u;
208 __int64_t ilf_blkno; /* blkno of inode buffer */
209 __int32_t ilf_len; /* len of inode buffer */
210 __int32_t ilf_boffset; /* off of inode in buffer */
211} xfs_inode_log_format_t;
212
213typedef struct xfs_inode_log_format_32 {
214 __uint16_t ilf_type; /* inode log item type */
215 __uint16_t ilf_size; /* size of this item */
216 __uint32_t ilf_fields; /* flags for fields logged */
217 __uint16_t ilf_asize; /* size of attr d/ext/root */
218 __uint16_t ilf_dsize; /* size of data/ext/root */
219 __uint64_t ilf_ino; /* inode number */
220 union {
221 __uint32_t ilfu_rdev; /* rdev value for dev inode*/
222 uuid_t ilfu_uuid; /* mount point value */
223 } ilf_u;
224 __int64_t ilf_blkno; /* blkno of inode buffer */
225 __int32_t ilf_len; /* len of inode buffer */
226 __int32_t ilf_boffset; /* off of inode in buffer */
227} __attribute__((packed)) xfs_inode_log_format_32_t;
228
229typedef struct xfs_inode_log_format_64 {
230 __uint16_t ilf_type; /* inode log item type */
231 __uint16_t ilf_size; /* size of this item */
232 __uint32_t ilf_fields; /* flags for fields logged */
233 __uint16_t ilf_asize; /* size of attr d/ext/root */
234 __uint16_t ilf_dsize; /* size of data/ext/root */
235 __uint32_t ilf_pad; /* pad for 64 bit boundary */
236 __uint64_t ilf_ino; /* inode number */
237 union {
238 __uint32_t ilfu_rdev; /* rdev value for dev inode*/
239 uuid_t ilfu_uuid; /* mount point value */
240 } ilf_u;
241 __int64_t ilf_blkno; /* blkno of inode buffer */
242 __int32_t ilf_len; /* len of inode buffer */
243 __int32_t ilf_boffset; /* off of inode in buffer */
244} xfs_inode_log_format_64_t;
245
246/*
247 * Flags for xfs_trans_log_inode flags field.
248 */
249#define XFS_ILOG_CORE 0x001 /* log standard inode fields */
250#define XFS_ILOG_DDATA 0x002 /* log i_df.if_data */
251#define XFS_ILOG_DEXT 0x004 /* log i_df.if_extents */
252#define XFS_ILOG_DBROOT 0x008 /* log i_df.i_broot */
253#define XFS_ILOG_DEV 0x010 /* log the dev field */
254#define XFS_ILOG_UUID 0x020 /* log the uuid field */
255#define XFS_ILOG_ADATA 0x040 /* log i_af.if_data */
256#define XFS_ILOG_AEXT 0x080 /* log i_af.if_extents */
257#define XFS_ILOG_ABROOT 0x100 /* log i_af.i_broot */
258
259
260/*
261 * The timestamps are dirty, but not necessarily anything else in the inode
262 * core. Unlike the other fields above this one must never make it to disk
263 * in the ilf_fields of the inode_log_format, but is purely store in-memory in
264 * ili_fields in the inode_log_item.
265 */
266#define XFS_ILOG_TIMESTAMP 0x4000
267
268#define XFS_ILOG_NONCORE (XFS_ILOG_DDATA | XFS_ILOG_DEXT | \
269 XFS_ILOG_DBROOT | XFS_ILOG_DEV | \
270 XFS_ILOG_UUID | XFS_ILOG_ADATA | \
271 XFS_ILOG_AEXT | XFS_ILOG_ABROOT)
272
273#define XFS_ILOG_DFORK (XFS_ILOG_DDATA | XFS_ILOG_DEXT | \
274 XFS_ILOG_DBROOT)
275
276#define XFS_ILOG_AFORK (XFS_ILOG_ADATA | XFS_ILOG_AEXT | \
277 XFS_ILOG_ABROOT)
278
279#define XFS_ILOG_ALL (XFS_ILOG_CORE | XFS_ILOG_DDATA | \
280 XFS_ILOG_DEXT | XFS_ILOG_DBROOT | \
281 XFS_ILOG_DEV | XFS_ILOG_UUID | \
282 XFS_ILOG_ADATA | XFS_ILOG_AEXT | \
283 XFS_ILOG_ABROOT | XFS_ILOG_TIMESTAMP)
284
285static inline int xfs_ilog_fbroot(int w)
286{
287 return (w == XFS_DATA_FORK ? XFS_ILOG_DBROOT : XFS_ILOG_ABROOT);
288}
289
290static inline int xfs_ilog_fext(int w)
291{
292 return (w == XFS_DATA_FORK ? XFS_ILOG_DEXT : XFS_ILOG_AEXT);
293}
294
295static inline int xfs_ilog_fdata(int w)
296{
297 return (w == XFS_DATA_FORK ? XFS_ILOG_DDATA : XFS_ILOG_ADATA);
298}
299
300/*
301 * Incore version of the on-disk inode core structures. We log this directly
302 * into the journal in host CPU format (for better or worse) and as such
303 * directly mirrors the xfs_dinode structure as it must contain all the same
304 * information.
305 */
306typedef struct xfs_ictimestamp {
307 __int32_t t_sec; /* timestamp seconds */
308 __int32_t t_nsec; /* timestamp nanoseconds */
309} xfs_ictimestamp_t;
310
311/*
312 * NOTE: This structure must be kept identical to struct xfs_dinode
313 * in xfs_dinode.h except for the endianness annotations.
314 */
315typedef struct xfs_icdinode {
316 __uint16_t di_magic; /* inode magic # = XFS_DINODE_MAGIC */
317 __uint16_t di_mode; /* mode and type of file */
318 __int8_t di_version; /* inode version */
319 __int8_t di_format; /* format of di_c data */
320 __uint16_t di_onlink; /* old number of links to file */
321 __uint32_t di_uid; /* owner's user id */
322 __uint32_t di_gid; /* owner's group id */
323 __uint32_t di_nlink; /* number of links to file */
324 __uint16_t di_projid_lo; /* lower part of owner's project id */
325 __uint16_t di_projid_hi; /* higher part of owner's project id */
326 __uint8_t di_pad[6]; /* unused, zeroed space */
327 __uint16_t di_flushiter; /* incremented on flush */
328 xfs_ictimestamp_t di_atime; /* time last accessed */
329 xfs_ictimestamp_t di_mtime; /* time last modified */
330 xfs_ictimestamp_t di_ctime; /* time created/inode modified */
331 xfs_fsize_t di_size; /* number of bytes in file */
332 xfs_drfsbno_t di_nblocks; /* # of direct & btree blocks used */
333 xfs_extlen_t di_extsize; /* basic/minimum extent size for file */
334 xfs_extnum_t di_nextents; /* number of extents in data fork */
335 xfs_aextnum_t di_anextents; /* number of extents in attribute fork*/
336 __uint8_t di_forkoff; /* attr fork offs, <<3 for 64b align */
337 __int8_t di_aformat; /* format of attr fork's data */
338 __uint32_t di_dmevmask; /* DMIG event mask */
339 __uint16_t di_dmstate; /* DMIG state info */
340 __uint16_t di_flags; /* random flags, XFS_DIFLAG_... */
341 __uint32_t di_gen; /* generation number */
342
343 /* di_next_unlinked is the only non-core field in the old dinode */
344 xfs_agino_t di_next_unlinked;/* agi unlinked list ptr */
345
346 /* start of the extended dinode, writable fields */
347 __uint32_t di_crc; /* CRC of the inode */
348 __uint64_t di_changecount; /* number of attribute changes */
349 xfs_lsn_t di_lsn; /* flush sequence */
350 __uint64_t di_flags2; /* more random flags */
351 __uint8_t di_pad2[16]; /* more padding for future expansion */
352
353 /* fields only written to during inode creation */
354 xfs_ictimestamp_t di_crtime; /* time created */
355 xfs_ino_t di_ino; /* inode number */
356 uuid_t di_uuid; /* UUID of the filesystem */
357
358 /* structure must be padded to 64 bit alignment */
359} xfs_icdinode_t;
360
361static inline uint xfs_icdinode_size(int version)
362{
363 if (version == 3)
364 return sizeof(struct xfs_icdinode);
365 return offsetof(struct xfs_icdinode, di_next_unlinked);
366}
178#endif /* __XFS_LOG_FORMAT_H__ */ 367#endif /* __XFS_LOG_FORMAT_H__ */
diff --git a/fs/xfs/xfs_types.h b/fs/xfs/xfs_types.h
index 61ba1cfa974c..39c48ca64a60 100644
--- a/fs/xfs/xfs_types.h
+++ b/fs/xfs/xfs_types.h
@@ -146,6 +146,12 @@ typedef __uint64_t xfs_filblks_t; /* number of blocks in a file */
146#define XFS_MAX_SECTORSIZE (1 << XFS_MAX_SECTORSIZE_LOG) 146#define XFS_MAX_SECTORSIZE (1 << XFS_MAX_SECTORSIZE_LOG)
147 147
148/* 148/*
149 * Inode fork identifiers.
150 */
151#define XFS_DATA_FORK 0
152#define XFS_ATTR_FORK 1
153
154/*
149 * Min numbers of data/attr fork btree root pointers. 155 * Min numbers of data/attr fork btree root pointers.
150 */ 156 */
151#define MINDBTPTRS 3 157#define MINDBTPTRS 3
diff --git a/fs/xfs/xfs_xattr.c b/fs/xfs/xfs_xattr.c
index 87d3e03878c8..b7311aaa5f0e 100644
--- a/fs/xfs/xfs_xattr.c
+++ b/fs/xfs/xfs_xattr.c
@@ -17,6 +17,7 @@
17 */ 17 */
18 18
19#include "xfs.h" 19#include "xfs.h"
20#include "xfs_log_format.h"
20#include "xfs_da_btree.h" 21#include "xfs_da_btree.h"
21#include "xfs_bmap_btree.h" 22#include "xfs_bmap_btree.h"
22#include "xfs_inode.h" 23#include "xfs_inode.h"