aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2014-11-27 22:24:06 -0500
committerDave Chinner <david@fromorbit.com>2014-11-27 22:24:06 -0500
commit6d3ebaae7c20128bfa6965a8d5cee0d1deea8486 (patch)
treee5f11025b5654334af070e646077b56979d75aca /fs
parentcac7f2429872d3733dc3f9915857b1691da2eb2f (diff)
xfs: merge xfs_dinode.h into xfs_format.h
More consolidatation for the on-disk format defintions. Note that the XFS_IS_REALTIME_INODE moves to xfs_linux.h instead as it is not related to the on disk format, but depends on a CONFIG_ option. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/libxfs/xfs_attr.c1
-rw-r--r--fs/xfs/libxfs/xfs_attr_leaf.c1
-rw-r--r--fs/xfs/libxfs/xfs_bmap.c1
-rw-r--r--fs/xfs/libxfs/xfs_bmap_btree.c1
-rw-r--r--fs/xfs/libxfs/xfs_dinode.h243
-rw-r--r--fs/xfs/libxfs/xfs_dir2.c1
-rw-r--r--fs/xfs/libxfs/xfs_dir2_block.c1
-rw-r--r--fs/xfs/libxfs/xfs_dir2_sf.c1
-rw-r--r--fs/xfs/libxfs/xfs_format.h214
-rw-r--r--fs/xfs/libxfs/xfs_ialloc.c1
-rw-r--r--fs/xfs/libxfs/xfs_inode_buf.c1
-rw-r--r--fs/xfs/libxfs/xfs_inode_fork.c1
-rw-r--r--fs/xfs/libxfs/xfs_log_format.h2
-rw-r--r--fs/xfs/libxfs/xfs_rtbitmap.c1
-rw-r--r--fs/xfs/libxfs/xfs_sb.c1
-rw-r--r--fs/xfs/xfs_aops.c1
-rw-r--r--fs/xfs/xfs_attr_inactive.c1
-rw-r--r--fs/xfs/xfs_attr_list.c1
-rw-r--r--fs/xfs/xfs_bmap_util.c1
-rw-r--r--fs/xfs/xfs_dir2_readdir.c1
-rw-r--r--fs/xfs/xfs_file.c1
-rw-r--r--fs/xfs/xfs_filestream.c1
-rw-r--r--fs/xfs/xfs_fsops.c1
-rw-r--r--fs/xfs/xfs_inode.h2
-rw-r--r--fs/xfs/xfs_inode_item.c1
-rw-r--r--fs/xfs/xfs_ioctl.c1
-rw-r--r--fs/xfs/xfs_iomap.c1
-rw-r--r--fs/xfs/xfs_iops.c1
-rw-r--r--fs/xfs/xfs_itable.c1
-rw-r--r--fs/xfs/xfs_linux.h6
-rw-r--r--fs/xfs/xfs_log_recover.c1
-rw-r--r--fs/xfs/xfs_mount.c1
-rw-r--r--fs/xfs/xfs_qm.c1
-rw-r--r--fs/xfs/xfs_rtalloc.c1
-rw-r--r--fs/xfs/xfs_super.c1
-rw-r--r--fs/xfs/xfs_symlink.c1
36 files changed, 221 insertions, 277 deletions
diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c
index 353fb425faef..4c0e33b0138f 100644
--- a/fs/xfs/libxfs/xfs_attr.c
+++ b/fs/xfs/libxfs/xfs_attr.c
@@ -42,7 +42,6 @@
42#include "xfs_quota.h" 42#include "xfs_quota.h"
43#include "xfs_trans_space.h" 43#include "xfs_trans_space.h"
44#include "xfs_trace.h" 44#include "xfs_trace.h"
45#include "xfs_dinode.h"
46 45
47/* 46/*
48 * xfs_attr.c 47 * xfs_attr.c
diff --git a/fs/xfs/libxfs/xfs_attr_leaf.c b/fs/xfs/libxfs/xfs_attr_leaf.c
index b1f73dbbf3d8..d9a172b121db 100644
--- a/fs/xfs/libxfs/xfs_attr_leaf.c
+++ b/fs/xfs/libxfs/xfs_attr_leaf.c
@@ -41,7 +41,6 @@
41#include "xfs_trace.h" 41#include "xfs_trace.h"
42#include "xfs_buf_item.h" 42#include "xfs_buf_item.h"
43#include "xfs_cksum.h" 43#include "xfs_cksum.h"
44#include "xfs_dinode.h"
45#include "xfs_dir2.h" 44#include "xfs_dir2.h"
46 45
47 46
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index 79c981984dca..427c13f20011 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -46,7 +46,6 @@
46#include "xfs_trace.h" 46#include "xfs_trace.h"
47#include "xfs_symlink.h" 47#include "xfs_symlink.h"
48#include "xfs_attr_leaf.h" 48#include "xfs_attr_leaf.h"
49#include "xfs_dinode.h"
50#include "xfs_filestream.h" 49#include "xfs_filestream.h"
51 50
52 51
diff --git a/fs/xfs/libxfs/xfs_bmap_btree.c b/fs/xfs/libxfs/xfs_bmap_btree.c
index fba753308f31..b016fc442ae9 100644
--- a/fs/xfs/libxfs/xfs_bmap_btree.c
+++ b/fs/xfs/libxfs/xfs_bmap_btree.c
@@ -36,7 +36,6 @@
36#include "xfs_quota.h" 36#include "xfs_quota.h"
37#include "xfs_trace.h" 37#include "xfs_trace.h"
38#include "xfs_cksum.h" 38#include "xfs_cksum.h"
39#include "xfs_dinode.h"
40 39
41/* 40/*
42 * Determine the extent state. 41 * Determine the extent state.
diff --git a/fs/xfs/libxfs/xfs_dinode.h b/fs/xfs/libxfs/xfs_dinode.h
deleted file mode 100644
index 623bbe8fd921..000000000000
--- a/fs/xfs/libxfs/xfs_dinode.h
+++ /dev/null
@@ -1,243 +0,0 @@
1/*
2 * Copyright (c) 2000,2002,2005 Silicon Graphics, Inc.
3 * All Rights Reserved.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18#ifndef __XFS_DINODE_H__
19#define __XFS_DINODE_H__
20
21#define XFS_DINODE_MAGIC 0x494e /* 'IN' */
22#define XFS_DINODE_GOOD_VERSION(v) ((v) >= 1 && (v) <= 3)
23
24typedef struct xfs_timestamp {
25 __be32 t_sec; /* timestamp seconds */
26 __be32 t_nsec; /* timestamp nanoseconds */
27} xfs_timestamp_t;
28
29/*
30 * On-disk inode structure.
31 *
32 * This is just the header or "dinode core", the inode is expanded to fill a
33 * variable size the leftover area split into a data and an attribute fork.
34 * The format of the data and attribute fork depends on the format of the
35 * inode as indicated by di_format and di_aformat. To access the data and
36 * attribute use the XFS_DFORK_DPTR, XFS_DFORK_APTR, and XFS_DFORK_PTR macros
37 * below.
38 *
39 * There is a very similar struct icdinode in xfs_inode which matches the
40 * layout of the first 96 bytes of this structure, but is kept in native
41 * format instead of big endian.
42 *
43 * Note: di_flushiter is only used by v1/2 inodes - it's effectively a zeroed
44 * padding field for v3 inodes.
45 */
46typedef struct xfs_dinode {
47 __be16 di_magic; /* inode magic # = XFS_DINODE_MAGIC */
48 __be16 di_mode; /* mode and type of file */
49 __u8 di_version; /* inode version */
50 __u8 di_format; /* format of di_c data */
51 __be16 di_onlink; /* old number of links to file */
52 __be32 di_uid; /* owner's user id */
53 __be32 di_gid; /* owner's group id */
54 __be32 di_nlink; /* number of links to file */
55 __be16 di_projid_lo; /* lower part of owner's project id */
56 __be16 di_projid_hi; /* higher part owner's project id */
57 __u8 di_pad[6]; /* unused, zeroed space */
58 __be16 di_flushiter; /* incremented on flush */
59 xfs_timestamp_t di_atime; /* time last accessed */
60 xfs_timestamp_t di_mtime; /* time last modified */
61 xfs_timestamp_t di_ctime; /* time created/inode modified */
62 __be64 di_size; /* number of bytes in file */
63 __be64 di_nblocks; /* # of direct & btree blocks used */
64 __be32 di_extsize; /* basic/minimum extent size for file */
65 __be32 di_nextents; /* number of extents in data fork */
66 __be16 di_anextents; /* number of extents in attribute fork*/
67 __u8 di_forkoff; /* attr fork offs, <<3 for 64b align */
68 __s8 di_aformat; /* format of attr fork's data */
69 __be32 di_dmevmask; /* DMIG event mask */
70 __be16 di_dmstate; /* DMIG state info */
71 __be16 di_flags; /* random flags, XFS_DIFLAG_... */
72 __be32 di_gen; /* generation number */
73
74 /* di_next_unlinked is the only non-core field in the old dinode */
75 __be32 di_next_unlinked;/* agi unlinked list ptr */
76
77 /* start of the extended dinode, writable fields */
78 __le32 di_crc; /* CRC of the inode */
79 __be64 di_changecount; /* number of attribute changes */
80 __be64 di_lsn; /* flush sequence */
81 __be64 di_flags2; /* more random flags */
82 __u8 di_pad2[16]; /* more padding for future expansion */
83
84 /* fields only written to during inode creation */
85 xfs_timestamp_t di_crtime; /* time created */
86 __be64 di_ino; /* inode number */
87 uuid_t di_uuid; /* UUID of the filesystem */
88
89 /* structure must be padded to 64 bit alignment */
90} xfs_dinode_t;
91
92#define XFS_DINODE_CRC_OFF offsetof(struct xfs_dinode, di_crc)
93
94#define DI_MAX_FLUSH 0xffff
95
96/*
97 * Size of the core inode on disk. Version 1 and 2 inodes have
98 * the same size, but version 3 has grown a few additional fields.
99 */
100static inline uint xfs_dinode_size(int version)
101{
102 if (version == 3)
103 return sizeof(struct xfs_dinode);
104 return offsetof(struct xfs_dinode, di_crc);
105}
106
107/*
108 * The 32 bit link count in the inode theoretically maxes out at UINT_MAX.
109 * Since the pathconf interface is signed, we use 2^31 - 1 instead.
110 * The old inode format had a 16 bit link count, so its maximum is USHRT_MAX.
111 */
112#define XFS_MAXLINK ((1U << 31) - 1U)
113#define XFS_MAXLINK_1 65535U
114
115/*
116 * Values for di_format
117 */
118typedef enum xfs_dinode_fmt {
119 XFS_DINODE_FMT_DEV, /* xfs_dev_t */
120 XFS_DINODE_FMT_LOCAL, /* bulk data */
121 XFS_DINODE_FMT_EXTENTS, /* struct xfs_bmbt_rec */
122 XFS_DINODE_FMT_BTREE, /* struct xfs_bmdr_block */
123 XFS_DINODE_FMT_UUID /* uuid_t */
124} xfs_dinode_fmt_t;
125
126/*
127 * Inode minimum and maximum sizes.
128 */
129#define XFS_DINODE_MIN_LOG 8
130#define XFS_DINODE_MAX_LOG 11
131#define XFS_DINODE_MIN_SIZE (1 << XFS_DINODE_MIN_LOG)
132#define XFS_DINODE_MAX_SIZE (1 << XFS_DINODE_MAX_LOG)
133
134/*
135 * Inode size for given fs.
136 */
137#define XFS_LITINO(mp, version) \
138 ((int)(((mp)->m_sb.sb_inodesize) - xfs_dinode_size(version)))
139
140/*
141 * Inode data & attribute fork sizes, per inode.
142 */
143#define XFS_DFORK_Q(dip) ((dip)->di_forkoff != 0)
144#define XFS_DFORK_BOFF(dip) ((int)((dip)->di_forkoff << 3))
145
146#define XFS_DFORK_DSIZE(dip,mp) \
147 (XFS_DFORK_Q(dip) ? \
148 XFS_DFORK_BOFF(dip) : \
149 XFS_LITINO(mp, (dip)->di_version))
150#define XFS_DFORK_ASIZE(dip,mp) \
151 (XFS_DFORK_Q(dip) ? \
152 XFS_LITINO(mp, (dip)->di_version) - XFS_DFORK_BOFF(dip) : \
153 0)
154#define XFS_DFORK_SIZE(dip,mp,w) \
155 ((w) == XFS_DATA_FORK ? \
156 XFS_DFORK_DSIZE(dip, mp) : \
157 XFS_DFORK_ASIZE(dip, mp))
158
159/*
160 * Return pointers to the data or attribute forks.
161 */
162#define XFS_DFORK_DPTR(dip) \
163 ((char *)dip + xfs_dinode_size(dip->di_version))
164#define XFS_DFORK_APTR(dip) \
165 (XFS_DFORK_DPTR(dip) + XFS_DFORK_BOFF(dip))
166#define XFS_DFORK_PTR(dip,w) \
167 ((w) == XFS_DATA_FORK ? XFS_DFORK_DPTR(dip) : XFS_DFORK_APTR(dip))
168
169#define XFS_DFORK_FORMAT(dip,w) \
170 ((w) == XFS_DATA_FORK ? \
171 (dip)->di_format : \
172 (dip)->di_aformat)
173#define XFS_DFORK_NEXTENTS(dip,w) \
174 ((w) == XFS_DATA_FORK ? \
175 be32_to_cpu((dip)->di_nextents) : \
176 be16_to_cpu((dip)->di_anextents))
177
178#define XFS_BUF_TO_DINODE(bp) ((xfs_dinode_t *)((bp)->b_addr))
179
180/*
181 * For block and character special files the 32bit dev_t is stored at the
182 * beginning of the data fork.
183 */
184static inline xfs_dev_t xfs_dinode_get_rdev(struct xfs_dinode *dip)
185{
186 return be32_to_cpu(*(__be32 *)XFS_DFORK_DPTR(dip));
187}
188
189static inline void xfs_dinode_put_rdev(struct xfs_dinode *dip, xfs_dev_t rdev)
190{
191 *(__be32 *)XFS_DFORK_DPTR(dip) = cpu_to_be32(rdev);
192}
193
194/*
195 * Values for di_flags
196 * There should be a one-to-one correspondence between these flags and the
197 * XFS_XFLAG_s.
198 */
199#define XFS_DIFLAG_REALTIME_BIT 0 /* file's blocks come from rt area */
200#define XFS_DIFLAG_PREALLOC_BIT 1 /* file space has been preallocated */
201#define XFS_DIFLAG_NEWRTBM_BIT 2 /* for rtbitmap inode, new format */
202#define XFS_DIFLAG_IMMUTABLE_BIT 3 /* inode is immutable */
203#define XFS_DIFLAG_APPEND_BIT 4 /* inode is append-only */
204#define XFS_DIFLAG_SYNC_BIT 5 /* inode is written synchronously */
205#define XFS_DIFLAG_NOATIME_BIT 6 /* do not update atime */
206#define XFS_DIFLAG_NODUMP_BIT 7 /* do not dump */
207#define XFS_DIFLAG_RTINHERIT_BIT 8 /* create with realtime bit set */
208#define XFS_DIFLAG_PROJINHERIT_BIT 9 /* create with parents projid */
209#define XFS_DIFLAG_NOSYMLINKS_BIT 10 /* disallow symlink creation */
210#define XFS_DIFLAG_EXTSIZE_BIT 11 /* inode extent size allocator hint */
211#define XFS_DIFLAG_EXTSZINHERIT_BIT 12 /* inherit inode extent size */
212#define XFS_DIFLAG_NODEFRAG_BIT 13 /* do not reorganize/defragment */
213#define XFS_DIFLAG_FILESTREAM_BIT 14 /* use filestream allocator */
214#define XFS_DIFLAG_REALTIME (1 << XFS_DIFLAG_REALTIME_BIT)
215#define XFS_DIFLAG_PREALLOC (1 << XFS_DIFLAG_PREALLOC_BIT)
216#define XFS_DIFLAG_NEWRTBM (1 << XFS_DIFLAG_NEWRTBM_BIT)
217#define XFS_DIFLAG_IMMUTABLE (1 << XFS_DIFLAG_IMMUTABLE_BIT)
218#define XFS_DIFLAG_APPEND (1 << XFS_DIFLAG_APPEND_BIT)
219#define XFS_DIFLAG_SYNC (1 << XFS_DIFLAG_SYNC_BIT)
220#define XFS_DIFLAG_NOATIME (1 << XFS_DIFLAG_NOATIME_BIT)
221#define XFS_DIFLAG_NODUMP (1 << XFS_DIFLAG_NODUMP_BIT)
222#define XFS_DIFLAG_RTINHERIT (1 << XFS_DIFLAG_RTINHERIT_BIT)
223#define XFS_DIFLAG_PROJINHERIT (1 << XFS_DIFLAG_PROJINHERIT_BIT)
224#define XFS_DIFLAG_NOSYMLINKS (1 << XFS_DIFLAG_NOSYMLINKS_BIT)
225#define XFS_DIFLAG_EXTSIZE (1 << XFS_DIFLAG_EXTSIZE_BIT)
226#define XFS_DIFLAG_EXTSZINHERIT (1 << XFS_DIFLAG_EXTSZINHERIT_BIT)
227#define XFS_DIFLAG_NODEFRAG (1 << XFS_DIFLAG_NODEFRAG_BIT)
228#define XFS_DIFLAG_FILESTREAM (1 << XFS_DIFLAG_FILESTREAM_BIT)
229
230#ifdef CONFIG_XFS_RT
231#define XFS_IS_REALTIME_INODE(ip) ((ip)->i_d.di_flags & XFS_DIFLAG_REALTIME)
232#else
233#define XFS_IS_REALTIME_INODE(ip) (0)
234#endif
235
236#define XFS_DIFLAG_ANY \
237 (XFS_DIFLAG_REALTIME | XFS_DIFLAG_PREALLOC | XFS_DIFLAG_NEWRTBM | \
238 XFS_DIFLAG_IMMUTABLE | XFS_DIFLAG_APPEND | XFS_DIFLAG_SYNC | \
239 XFS_DIFLAG_NOATIME | XFS_DIFLAG_NODUMP | XFS_DIFLAG_RTINHERIT | \
240 XFS_DIFLAG_PROJINHERIT | XFS_DIFLAG_NOSYMLINKS | XFS_DIFLAG_EXTSIZE | \
241 XFS_DIFLAG_EXTSZINHERIT | XFS_DIFLAG_NODEFRAG | XFS_DIFLAG_FILESTREAM)
242
243#endif /* __XFS_DINODE_H__ */
diff --git a/fs/xfs/libxfs/xfs_dir2.c b/fs/xfs/libxfs/xfs_dir2.c
index 7075aaf131f4..d6ddb3ff7ab9 100644
--- a/fs/xfs/libxfs/xfs_dir2.c
+++ b/fs/xfs/libxfs/xfs_dir2.c
@@ -34,7 +34,6 @@
34#include "xfs_dir2_priv.h" 34#include "xfs_dir2_priv.h"
35#include "xfs_error.h" 35#include "xfs_error.h"
36#include "xfs_trace.h" 36#include "xfs_trace.h"
37#include "xfs_dinode.h"
38 37
39struct xfs_name xfs_name_dotdot = { (unsigned char *)"..", 2, XFS_DIR3_FT_DIR }; 38struct xfs_name xfs_name_dotdot = { (unsigned char *)"..", 2, XFS_DIR3_FT_DIR };
40 39
diff --git a/fs/xfs/libxfs/xfs_dir2_block.c b/fs/xfs/libxfs/xfs_dir2_block.c
index 9628ceccfa02..a9afd7e97e0e 100644
--- a/fs/xfs/libxfs/xfs_dir2_block.c
+++ b/fs/xfs/libxfs/xfs_dir2_block.c
@@ -36,7 +36,6 @@
36#include "xfs_error.h" 36#include "xfs_error.h"
37#include "xfs_trace.h" 37#include "xfs_trace.h"
38#include "xfs_cksum.h" 38#include "xfs_cksum.h"
39#include "xfs_dinode.h"
40 39
41/* 40/*
42 * Local function prototypes. 41 * Local function prototypes.
diff --git a/fs/xfs/libxfs/xfs_dir2_sf.c b/fs/xfs/libxfs/xfs_dir2_sf.c
index 5079e051ef08..58133d2a3e45 100644
--- a/fs/xfs/libxfs/xfs_dir2_sf.c
+++ b/fs/xfs/libxfs/xfs_dir2_sf.c
@@ -32,7 +32,6 @@
32#include "xfs_dir2.h" 32#include "xfs_dir2.h"
33#include "xfs_dir2_priv.h" 33#include "xfs_dir2_priv.h"
34#include "xfs_trace.h" 34#include "xfs_trace.h"
35#include "xfs_dinode.h"
36 35
37/* 36/*
38 * Prototypes for internal functions. 37 * Prototypes for internal functions.
diff --git a/fs/xfs/libxfs/xfs_format.h b/fs/xfs/libxfs/xfs_format.h
index 7e42bba9a420..3be17eee8f30 100644
--- a/fs/xfs/libxfs/xfs_format.h
+++ b/fs/xfs/libxfs/xfs_format.h
@@ -33,6 +33,220 @@ struct xfs_inode;
33struct xfs_buf; 33struct xfs_buf;
34struct xfs_ifork; 34struct xfs_ifork;
35 35
36typedef struct xfs_timestamp {
37 __be32 t_sec; /* timestamp seconds */
38 __be32 t_nsec; /* timestamp nanoseconds */
39} xfs_timestamp_t;
40
41/*
42 * On-disk inode structure.
43 *
44 * This is just the header or "dinode core", the inode is expanded to fill a
45 * variable size the leftover area split into a data and an attribute fork.
46 * The format of the data and attribute fork depends on the format of the
47 * inode as indicated by di_format and di_aformat. To access the data and
48 * attribute use the XFS_DFORK_DPTR, XFS_DFORK_APTR, and XFS_DFORK_PTR macros
49 * below.
50 *
51 * There is a very similar struct icdinode in xfs_inode which matches the
52 * layout of the first 96 bytes of this structure, but is kept in native
53 * format instead of big endian.
54 *
55 * Note: di_flushiter is only used by v1/2 inodes - it's effectively a zeroed
56 * padding field for v3 inodes.
57 */
58#define XFS_DINODE_MAGIC 0x494e /* 'IN' */
59#define XFS_DINODE_GOOD_VERSION(v) ((v) >= 1 && (v) <= 3)
60typedef struct xfs_dinode {
61 __be16 di_magic; /* inode magic # = XFS_DINODE_MAGIC */
62 __be16 di_mode; /* mode and type of file */
63 __u8 di_version; /* inode version */
64 __u8 di_format; /* format of di_c data */
65 __be16 di_onlink; /* old number of links to file */
66 __be32 di_uid; /* owner's user id */
67 __be32 di_gid; /* owner's group id */
68 __be32 di_nlink; /* number of links to file */
69 __be16 di_projid_lo; /* lower part of owner's project id */
70 __be16 di_projid_hi; /* higher part owner's project id */
71 __u8 di_pad[6]; /* unused, zeroed space */
72 __be16 di_flushiter; /* incremented on flush */
73 xfs_timestamp_t di_atime; /* time last accessed */
74 xfs_timestamp_t di_mtime; /* time last modified */
75 xfs_timestamp_t di_ctime; /* time created/inode modified */
76 __be64 di_size; /* number of bytes in file */
77 __be64 di_nblocks; /* # of direct & btree blocks used */
78 __be32 di_extsize; /* basic/minimum extent size for file */
79 __be32 di_nextents; /* number of extents in data fork */
80 __be16 di_anextents; /* number of extents in attribute fork*/
81 __u8 di_forkoff; /* attr fork offs, <<3 for 64b align */
82 __s8 di_aformat; /* format of attr fork's data */
83 __be32 di_dmevmask; /* DMIG event mask */
84 __be16 di_dmstate; /* DMIG state info */
85 __be16 di_flags; /* random flags, XFS_DIFLAG_... */
86 __be32 di_gen; /* generation number */
87
88 /* di_next_unlinked is the only non-core field in the old dinode */
89 __be32 di_next_unlinked;/* agi unlinked list ptr */
90
91 /* start of the extended dinode, writable fields */
92 __le32 di_crc; /* CRC of the inode */
93 __be64 di_changecount; /* number of attribute changes */
94 __be64 di_lsn; /* flush sequence */
95 __be64 di_flags2; /* more random flags */
96 __u8 di_pad2[16]; /* more padding for future expansion */
97
98 /* fields only written to during inode creation */
99 xfs_timestamp_t di_crtime; /* time created */
100 __be64 di_ino; /* inode number */
101 uuid_t di_uuid; /* UUID of the filesystem */
102
103 /* structure must be padded to 64 bit alignment */
104} xfs_dinode_t;
105
106#define XFS_DINODE_CRC_OFF offsetof(struct xfs_dinode, di_crc)
107
108#define DI_MAX_FLUSH 0xffff
109
110/*
111 * Size of the core inode on disk. Version 1 and 2 inodes have
112 * the same size, but version 3 has grown a few additional fields.
113 */
114static inline uint xfs_dinode_size(int version)
115{
116 if (version == 3)
117 return sizeof(struct xfs_dinode);
118 return offsetof(struct xfs_dinode, di_crc);
119}
120
121/*
122 * The 32 bit link count in the inode theoretically maxes out at UINT_MAX.
123 * Since the pathconf interface is signed, we use 2^31 - 1 instead.
124 * The old inode format had a 16 bit link count, so its maximum is USHRT_MAX.
125 */
126#define XFS_MAXLINK ((1U << 31) - 1U)
127#define XFS_MAXLINK_1 65535U
128
129/*
130 * Values for di_format
131 */
132typedef enum xfs_dinode_fmt {
133 XFS_DINODE_FMT_DEV, /* xfs_dev_t */
134 XFS_DINODE_FMT_LOCAL, /* bulk data */
135 XFS_DINODE_FMT_EXTENTS, /* struct xfs_bmbt_rec */
136 XFS_DINODE_FMT_BTREE, /* struct xfs_bmdr_block */
137 XFS_DINODE_FMT_UUID /* uuid_t */
138} xfs_dinode_fmt_t;
139
140/*
141 * Inode minimum and maximum sizes.
142 */
143#define XFS_DINODE_MIN_LOG 8
144#define XFS_DINODE_MAX_LOG 11
145#define XFS_DINODE_MIN_SIZE (1 << XFS_DINODE_MIN_LOG)
146#define XFS_DINODE_MAX_SIZE (1 << XFS_DINODE_MAX_LOG)
147
148/*
149 * Inode size for given fs.
150 */
151#define XFS_LITINO(mp, version) \
152 ((int)(((mp)->m_sb.sb_inodesize) - xfs_dinode_size(version)))
153
154/*
155 * Inode data & attribute fork sizes, per inode.
156 */
157#define XFS_DFORK_Q(dip) ((dip)->di_forkoff != 0)
158#define XFS_DFORK_BOFF(dip) ((int)((dip)->di_forkoff << 3))
159
160#define XFS_DFORK_DSIZE(dip,mp) \
161 (XFS_DFORK_Q(dip) ? \
162 XFS_DFORK_BOFF(dip) : \
163 XFS_LITINO(mp, (dip)->di_version))
164#define XFS_DFORK_ASIZE(dip,mp) \
165 (XFS_DFORK_Q(dip) ? \
166 XFS_LITINO(mp, (dip)->di_version) - XFS_DFORK_BOFF(dip) : \
167 0)
168#define XFS_DFORK_SIZE(dip,mp,w) \
169 ((w) == XFS_DATA_FORK ? \
170 XFS_DFORK_DSIZE(dip, mp) : \
171 XFS_DFORK_ASIZE(dip, mp))
172
173/*
174 * Return pointers to the data or attribute forks.
175 */
176#define XFS_DFORK_DPTR(dip) \
177 ((char *)dip + xfs_dinode_size(dip->di_version))
178#define XFS_DFORK_APTR(dip) \
179 (XFS_DFORK_DPTR(dip) + XFS_DFORK_BOFF(dip))
180#define XFS_DFORK_PTR(dip,w) \
181 ((w) == XFS_DATA_FORK ? XFS_DFORK_DPTR(dip) : XFS_DFORK_APTR(dip))
182
183#define XFS_DFORK_FORMAT(dip,w) \
184 ((w) == XFS_DATA_FORK ? \
185 (dip)->di_format : \
186 (dip)->di_aformat)
187#define XFS_DFORK_NEXTENTS(dip,w) \
188 ((w) == XFS_DATA_FORK ? \
189 be32_to_cpu((dip)->di_nextents) : \
190 be16_to_cpu((dip)->di_anextents))
191
192/*
193 * For block and character special files the 32bit dev_t is stored at the
194 * beginning of the data fork.
195 */
196static inline xfs_dev_t xfs_dinode_get_rdev(struct xfs_dinode *dip)
197{
198 return be32_to_cpu(*(__be32 *)XFS_DFORK_DPTR(dip));
199}
200
201static inline void xfs_dinode_put_rdev(struct xfs_dinode *dip, xfs_dev_t rdev)
202{
203 *(__be32 *)XFS_DFORK_DPTR(dip) = cpu_to_be32(rdev);
204}
205
206/*
207 * Values for di_flags
208 * There should be a one-to-one correspondence between these flags and the
209 * XFS_XFLAG_s.
210 */
211#define XFS_DIFLAG_REALTIME_BIT 0 /* file's blocks come from rt area */
212#define XFS_DIFLAG_PREALLOC_BIT 1 /* file space has been preallocated */
213#define XFS_DIFLAG_NEWRTBM_BIT 2 /* for rtbitmap inode, new format */
214#define XFS_DIFLAG_IMMUTABLE_BIT 3 /* inode is immutable */
215#define XFS_DIFLAG_APPEND_BIT 4 /* inode is append-only */
216#define XFS_DIFLAG_SYNC_BIT 5 /* inode is written synchronously */
217#define XFS_DIFLAG_NOATIME_BIT 6 /* do not update atime */
218#define XFS_DIFLAG_NODUMP_BIT 7 /* do not dump */
219#define XFS_DIFLAG_RTINHERIT_BIT 8 /* create with realtime bit set */
220#define XFS_DIFLAG_PROJINHERIT_BIT 9 /* create with parents projid */
221#define XFS_DIFLAG_NOSYMLINKS_BIT 10 /* disallow symlink creation */
222#define XFS_DIFLAG_EXTSIZE_BIT 11 /* inode extent size allocator hint */
223#define XFS_DIFLAG_EXTSZINHERIT_BIT 12 /* inherit inode extent size */
224#define XFS_DIFLAG_NODEFRAG_BIT 13 /* do not reorganize/defragment */
225#define XFS_DIFLAG_FILESTREAM_BIT 14 /* use filestream allocator */
226#define XFS_DIFLAG_REALTIME (1 << XFS_DIFLAG_REALTIME_BIT)
227#define XFS_DIFLAG_PREALLOC (1 << XFS_DIFLAG_PREALLOC_BIT)
228#define XFS_DIFLAG_NEWRTBM (1 << XFS_DIFLAG_NEWRTBM_BIT)
229#define XFS_DIFLAG_IMMUTABLE (1 << XFS_DIFLAG_IMMUTABLE_BIT)
230#define XFS_DIFLAG_APPEND (1 << XFS_DIFLAG_APPEND_BIT)
231#define XFS_DIFLAG_SYNC (1 << XFS_DIFLAG_SYNC_BIT)
232#define XFS_DIFLAG_NOATIME (1 << XFS_DIFLAG_NOATIME_BIT)
233#define XFS_DIFLAG_NODUMP (1 << XFS_DIFLAG_NODUMP_BIT)
234#define XFS_DIFLAG_RTINHERIT (1 << XFS_DIFLAG_RTINHERIT_BIT)
235#define XFS_DIFLAG_PROJINHERIT (1 << XFS_DIFLAG_PROJINHERIT_BIT)
236#define XFS_DIFLAG_NOSYMLINKS (1 << XFS_DIFLAG_NOSYMLINKS_BIT)
237#define XFS_DIFLAG_EXTSIZE (1 << XFS_DIFLAG_EXTSIZE_BIT)
238#define XFS_DIFLAG_EXTSZINHERIT (1 << XFS_DIFLAG_EXTSZINHERIT_BIT)
239#define XFS_DIFLAG_NODEFRAG (1 << XFS_DIFLAG_NODEFRAG_BIT)
240#define XFS_DIFLAG_FILESTREAM (1 << XFS_DIFLAG_FILESTREAM_BIT)
241
242#define XFS_DIFLAG_ANY \
243 (XFS_DIFLAG_REALTIME | XFS_DIFLAG_PREALLOC | XFS_DIFLAG_NEWRTBM | \
244 XFS_DIFLAG_IMMUTABLE | XFS_DIFLAG_APPEND | XFS_DIFLAG_SYNC | \
245 XFS_DIFLAG_NOATIME | XFS_DIFLAG_NODUMP | XFS_DIFLAG_RTINHERIT | \
246 XFS_DIFLAG_PROJINHERIT | XFS_DIFLAG_NOSYMLINKS | XFS_DIFLAG_EXTSIZE | \
247 XFS_DIFLAG_EXTSZINHERIT | XFS_DIFLAG_NODEFRAG | XFS_DIFLAG_FILESTREAM)
248
249
36/* 250/*
37 * RealTime Device format definitions 251 * RealTime Device format definitions
38 */ 252 */
diff --git a/fs/xfs/libxfs/xfs_ialloc.c b/fs/xfs/libxfs/xfs_ialloc.c
index 23dcb72fc5e6..7eb2fca678d0 100644
--- a/fs/xfs/libxfs/xfs_ialloc.c
+++ b/fs/xfs/libxfs/xfs_ialloc.c
@@ -39,7 +39,6 @@
39#include "xfs_buf_item.h" 39#include "xfs_buf_item.h"
40#include "xfs_icreate_item.h" 40#include "xfs_icreate_item.h"
41#include "xfs_icache.h" 41#include "xfs_icache.h"
42#include "xfs_dinode.h"
43#include "xfs_trace.h" 42#include "xfs_trace.h"
44 43
45 44
diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c
index f18fd2da49f7..184c68e34b81 100644
--- a/fs/xfs/libxfs/xfs_inode_buf.c
+++ b/fs/xfs/libxfs/xfs_inode_buf.c
@@ -30,7 +30,6 @@
30#include "xfs_icache.h" 30#include "xfs_icache.h"
31#include "xfs_trans.h" 31#include "xfs_trans.h"
32#include "xfs_ialloc.h" 32#include "xfs_ialloc.h"
33#include "xfs_dinode.h"
34 33
35/* 34/*
36 * Check that none of the inode's in the buffer have a next 35 * Check that none of the inode's in the buffer have a next
diff --git a/fs/xfs/libxfs/xfs_inode_fork.c b/fs/xfs/libxfs/xfs_inode_fork.c
index 6a00f7fed69d..e45d833ffcb6 100644
--- a/fs/xfs/libxfs/xfs_inode_fork.c
+++ b/fs/xfs/libxfs/xfs_inode_fork.c
@@ -34,7 +34,6 @@
34#include "xfs_error.h" 34#include "xfs_error.h"
35#include "xfs_trace.h" 35#include "xfs_trace.h"
36#include "xfs_attr_sf.h" 36#include "xfs_attr_sf.h"
37#include "xfs_dinode.h"
38 37
39kmem_zone_t *xfs_ifork_zone; 38kmem_zone_t *xfs_ifork_zone;
40 39
diff --git a/fs/xfs/libxfs/xfs_log_format.h b/fs/xfs/libxfs/xfs_log_format.h
index aff12f2d4428..265314690415 100644
--- a/fs/xfs/libxfs/xfs_log_format.h
+++ b/fs/xfs/libxfs/xfs_log_format.h
@@ -361,7 +361,7 @@ typedef struct xfs_ictimestamp {
361 361
362/* 362/*
363 * NOTE: This structure must be kept identical to struct xfs_dinode 363 * NOTE: This structure must be kept identical to struct xfs_dinode
364 * in xfs_dinode.h except for the endianness annotations. 364 * except for the endianness annotations.
365 */ 365 */
366typedef struct xfs_icdinode { 366typedef struct xfs_icdinode {
367 __uint16_t di_magic; /* inode magic # = XFS_DINODE_MAGIC */ 367 __uint16_t di_magic; /* inode magic # = XFS_DINODE_MAGIC */
diff --git a/fs/xfs/libxfs/xfs_rtbitmap.c b/fs/xfs/libxfs/xfs_rtbitmap.c
index 7c818f1e4484..de0fe1efefe9 100644
--- a/fs/xfs/libxfs/xfs_rtbitmap.c
+++ b/fs/xfs/libxfs/xfs_rtbitmap.c
@@ -36,7 +36,6 @@
36#include "xfs_trace.h" 36#include "xfs_trace.h"
37#include "xfs_buf.h" 37#include "xfs_buf.h"
38#include "xfs_icache.h" 38#include "xfs_icache.h"
39#include "xfs_dinode.h"
40#include "xfs_rtalloc.h" 39#include "xfs_rtalloc.h"
41 40
42 41
diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c
index 5f902fa7913f..1eed4361aa1e 100644
--- a/fs/xfs/libxfs/xfs_sb.c
+++ b/fs/xfs/libxfs/xfs_sb.c
@@ -33,7 +33,6 @@
33#include "xfs_cksum.h" 33#include "xfs_cksum.h"
34#include "xfs_trans.h" 34#include "xfs_trans.h"
35#include "xfs_buf_item.h" 35#include "xfs_buf_item.h"
36#include "xfs_dinode.h"
37#include "xfs_bmap_btree.h" 36#include "xfs_bmap_btree.h"
38#include "xfs_alloc_btree.h" 37#include "xfs_alloc_btree.h"
39#include "xfs_ialloc_btree.h" 38#include "xfs_ialloc_btree.h"
diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
index f5b2453a43b2..e4f27e75c1fa 100644
--- a/fs/xfs/xfs_aops.c
+++ b/fs/xfs/xfs_aops.c
@@ -33,7 +33,6 @@
33#include "xfs_bmap.h" 33#include "xfs_bmap.h"
34#include "xfs_bmap_util.h" 34#include "xfs_bmap_util.h"
35#include "xfs_bmap_btree.h" 35#include "xfs_bmap_btree.h"
36#include "xfs_dinode.h"
37#include <linux/aio.h> 36#include <linux/aio.h>
38#include <linux/gfp.h> 37#include <linux/gfp.h>
39#include <linux/mpage.h> 38#include <linux/mpage.h>
diff --git a/fs/xfs/xfs_attr_inactive.c b/fs/xfs/xfs_attr_inactive.c
index aa2a8b1838a2..5665f4633565 100644
--- a/fs/xfs/xfs_attr_inactive.c
+++ b/fs/xfs/xfs_attr_inactive.c
@@ -39,7 +39,6 @@
39#include "xfs_error.h" 39#include "xfs_error.h"
40#include "xfs_quota.h" 40#include "xfs_quota.h"
41#include "xfs_trace.h" 41#include "xfs_trace.h"
42#include "xfs_dinode.h"
43#include "xfs_dir2.h" 42#include "xfs_dir2.h"
44 43
45/* 44/*
diff --git a/fs/xfs/xfs_attr_list.c b/fs/xfs/xfs_attr_list.c
index 62db83ab6cbc..143435c9dc93 100644
--- a/fs/xfs/xfs_attr_list.c
+++ b/fs/xfs/xfs_attr_list.c
@@ -39,7 +39,6 @@
39#include "xfs_trace.h" 39#include "xfs_trace.h"
40#include "xfs_buf_item.h" 40#include "xfs_buf_item.h"
41#include "xfs_cksum.h" 41#include "xfs_cksum.h"
42#include "xfs_dinode.h"
43#include "xfs_dir2.h" 42#include "xfs_dir2.h"
44 43
45STATIC int 44STATIC int
diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
index 92e8f99a5857..7477552e3b6d 100644
--- a/fs/xfs/xfs_bmap_util.c
+++ b/fs/xfs/xfs_bmap_util.c
@@ -42,7 +42,6 @@
42#include "xfs_trace.h" 42#include "xfs_trace.h"
43#include "xfs_icache.h" 43#include "xfs_icache.h"
44#include "xfs_log.h" 44#include "xfs_log.h"
45#include "xfs_dinode.h"
46 45
47/* Kernel only BMAP related definitions and functions */ 46/* Kernel only BMAP related definitions and functions */
48 47
diff --git a/fs/xfs/xfs_dir2_readdir.c b/fs/xfs/xfs_dir2_readdir.c
index f1b69edcdf31..1e937fc9e833 100644
--- a/fs/xfs/xfs_dir2_readdir.c
+++ b/fs/xfs/xfs_dir2_readdir.c
@@ -34,7 +34,6 @@
34#include "xfs_trace.h" 34#include "xfs_trace.h"
35#include "xfs_bmap.h" 35#include "xfs_bmap.h"
36#include "xfs_trans.h" 36#include "xfs_trans.h"
37#include "xfs_dinode.h"
38 37
39/* 38/*
40 * Directory file type support functions 39 * Directory file type support functions
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index eb596b419942..8fe87bb55f4a 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -37,7 +37,6 @@
37#include "xfs_ioctl.h" 37#include "xfs_ioctl.h"
38#include "xfs_trace.h" 38#include "xfs_trace.h"
39#include "xfs_log.h" 39#include "xfs_log.h"
40#include "xfs_dinode.h"
41#include "xfs_icache.h" 40#include "xfs_icache.h"
42 41
43#include <linux/aio.h> 42#include <linux/aio.h>
diff --git a/fs/xfs/xfs_filestream.c b/fs/xfs/xfs_filestream.c
index e92730c1d3ca..fe47f3da4ed6 100644
--- a/fs/xfs/xfs_filestream.c
+++ b/fs/xfs/xfs_filestream.c
@@ -29,7 +29,6 @@
29#include "xfs_bmap_util.h" 29#include "xfs_bmap_util.h"
30#include "xfs_alloc.h" 30#include "xfs_alloc.h"
31#include "xfs_mru_cache.h" 31#include "xfs_mru_cache.h"
32#include "xfs_dinode.h"
33#include "xfs_filestream.h" 32#include "xfs_filestream.h"
34#include "xfs_trace.h" 33#include "xfs_trace.h"
35 34
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c
index c05ac8b70fa9..594af198af87 100644
--- a/fs/xfs/xfs_fsops.c
+++ b/fs/xfs/xfs_fsops.c
@@ -40,7 +40,6 @@
40#include "xfs_rtalloc.h" 40#include "xfs_rtalloc.h"
41#include "xfs_trace.h" 41#include "xfs_trace.h"
42#include "xfs_log.h" 42#include "xfs_log.h"
43#include "xfs_dinode.h"
44#include "xfs_filestream.h" 43#include "xfs_filestream.h"
45 44
46/* 45/*
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index 9af2882e1f4c..4ed2ba9342dc 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -20,7 +20,6 @@
20 20
21#include "xfs_inode_buf.h" 21#include "xfs_inode_buf.h"
22#include "xfs_inode_fork.h" 22#include "xfs_inode_fork.h"
23#include "xfs_dinode.h"
24 23
25/* 24/*
26 * Kernel only inode definitions 25 * Kernel only inode definitions
@@ -324,7 +323,6 @@ static inline int xfs_isiflocked(struct xfs_inode *ip)
324 (((pip)->i_mount->m_flags & XFS_MOUNT_GRPID) || \ 323 (((pip)->i_mount->m_flags & XFS_MOUNT_GRPID) || \
325 ((pip)->i_d.di_mode & S_ISGID)) 324 ((pip)->i_d.di_mode & S_ISGID))
326 325
327
328int xfs_release(struct xfs_inode *ip); 326int xfs_release(struct xfs_inode *ip);
329void xfs_inactive(struct xfs_inode *ip); 327void xfs_inactive(struct xfs_inode *ip);
330int xfs_lookup(struct xfs_inode *dp, struct xfs_name *name, 328int xfs_lookup(struct xfs_inode *dp, struct xfs_name *name,
diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c
index 63de0b0acc32..efa6e5938fba 100644
--- a/fs/xfs/xfs_inode_item.c
+++ b/fs/xfs/xfs_inode_item.c
@@ -29,7 +29,6 @@
29#include "xfs_error.h" 29#include "xfs_error.h"
30#include "xfs_trace.h" 30#include "xfs_trace.h"
31#include "xfs_trans_priv.h" 31#include "xfs_trans_priv.h"
32#include "xfs_dinode.h"
33#include "xfs_log.h" 32#include "xfs_log.h"
34 33
35 34
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
index 24c926b6fe85..6a8737b124c0 100644
--- a/fs/xfs/xfs_ioctl.c
+++ b/fs/xfs/xfs_ioctl.c
@@ -40,7 +40,6 @@
40#include "xfs_trace.h" 40#include "xfs_trace.h"
41#include "xfs_icache.h" 41#include "xfs_icache.h"
42#include "xfs_symlink.h" 42#include "xfs_symlink.h"
43#include "xfs_dinode.h"
44#include "xfs_trans.h" 43#include "xfs_trans.h"
45 44
46#include <linux/capability.h> 45#include <linux/capability.h>
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index afcf3c926565..cf1102248d6a 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -38,7 +38,6 @@
38#include "xfs_quota.h" 38#include "xfs_quota.h"
39#include "xfs_dquot_item.h" 39#include "xfs_dquot_item.h"
40#include "xfs_dquot.h" 40#include "xfs_dquot.h"
41#include "xfs_dinode.h"
42 41
43 42
44#define XFS_WRITEIO_ALIGN(mp,off) (((off) >> mp->m_writeio_log) \ 43#define XFS_WRITEIO_ALIGN(mp,off) (((off) >> mp->m_writeio_log) \
diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c
index ec6dcdc181ee..1e72c7714b09 100644
--- a/fs/xfs/xfs_iops.c
+++ b/fs/xfs/xfs_iops.c
@@ -38,7 +38,6 @@
38#include "xfs_symlink.h" 38#include "xfs_symlink.h"
39#include "xfs_da_btree.h" 39#include "xfs_da_btree.h"
40#include "xfs_dir2_priv.h" 40#include "xfs_dir2_priv.h"
41#include "xfs_dinode.h"
42#include "xfs_trans_space.h" 41#include "xfs_trans_space.h"
43 42
44#include <linux/capability.h> 43#include <linux/capability.h>
diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c
index f1deb961a296..855dacfc36ac 100644
--- a/fs/xfs/xfs_itable.c
+++ b/fs/xfs/xfs_itable.c
@@ -33,7 +33,6 @@
33#include "xfs_error.h" 33#include "xfs_error.h"
34#include "xfs_trace.h" 34#include "xfs_trace.h"
35#include "xfs_icache.h" 35#include "xfs_icache.h"
36#include "xfs_dinode.h"
37 36
38STATIC int 37STATIC int
39xfs_internal_inum( 38xfs_internal_inum(
diff --git a/fs/xfs/xfs_linux.h b/fs/xfs/xfs_linux.h
index 6a51619d8690..c31d2c2eadc4 100644
--- a/fs/xfs/xfs_linux.h
+++ b/fs/xfs/xfs_linux.h
@@ -384,4 +384,10 @@ static inline __uint64_t howmany_64(__uint64_t x, __uint32_t y)
384#endif /* XFS_WARN */ 384#endif /* XFS_WARN */
385#endif /* DEBUG */ 385#endif /* DEBUG */
386 386
387#ifdef CONFIG_XFS_RT
388#define XFS_IS_REALTIME_INODE(ip) ((ip)->i_d.di_flags & XFS_DIFLAG_REALTIME)
389#else
390#define XFS_IS_REALTIME_INODE(ip) (0)
391#endif
392
387#endif /* __XFS_LINUX__ */ 393#endif /* __XFS_LINUX__ */
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 00cd7f3a8f59..9b3fca6a4554 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -42,7 +42,6 @@
42#include "xfs_trace.h" 42#include "xfs_trace.h"
43#include "xfs_icache.h" 43#include "xfs_icache.h"
44#include "xfs_bmap_btree.h" 44#include "xfs_bmap_btree.h"
45#include "xfs_dinode.h"
46#include "xfs_error.h" 45#include "xfs_error.h"
47#include "xfs_dir2.h" 46#include "xfs_dir2.h"
48 47
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index 51435dbce9c4..faf3e36b5c13 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -41,7 +41,6 @@
41#include "xfs_fsops.h" 41#include "xfs_fsops.h"
42#include "xfs_trace.h" 42#include "xfs_trace.h"
43#include "xfs_icache.h" 43#include "xfs_icache.h"
44#include "xfs_dinode.h"
45#include "xfs_sysfs.h" 44#include "xfs_sysfs.h"
46 45
47 46
diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
index d68f23021af3..cca74453e5a2 100644
--- a/fs/xfs/xfs_qm.c
+++ b/fs/xfs/xfs_qm.c
@@ -38,7 +38,6 @@
38#include "xfs_trace.h" 38#include "xfs_trace.h"
39#include "xfs_icache.h" 39#include "xfs_icache.h"
40#include "xfs_cksum.h" 40#include "xfs_cksum.h"
41#include "xfs_dinode.h"
42 41
43/* 42/*
44 * The global quota manager. There is only one of these for the entire 43 * The global quota manager. There is only one of these for the entire
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
index e1175ea9b551..562dcdffc502 100644
--- a/fs/xfs/xfs_rtalloc.c
+++ b/fs/xfs/xfs_rtalloc.c
@@ -36,7 +36,6 @@
36#include "xfs_trace.h" 36#include "xfs_trace.h"
37#include "xfs_buf.h" 37#include "xfs_buf.h"
38#include "xfs_icache.h" 38#include "xfs_icache.h"
39#include "xfs_dinode.h"
40#include "xfs_rtalloc.h" 39#include "xfs_rtalloc.h"
41 40
42 41
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 9f622feda6a4..8f0264749cbb 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -44,7 +44,6 @@
44#include "xfs_icache.h" 44#include "xfs_icache.h"
45#include "xfs_trace.h" 45#include "xfs_trace.h"
46#include "xfs_icreate_item.h" 46#include "xfs_icreate_item.h"
47#include "xfs_dinode.h"
48#include "xfs_filestream.h" 47#include "xfs_filestream.h"
49#include "xfs_quota.h" 48#include "xfs_quota.h"
50#include "xfs_sysfs.h" 49#include "xfs_sysfs.h"
diff --git a/fs/xfs/xfs_symlink.c b/fs/xfs/xfs_symlink.c
index 02ae62a998e0..f38a3f1ff2f8 100644
--- a/fs/xfs/xfs_symlink.c
+++ b/fs/xfs/xfs_symlink.c
@@ -42,7 +42,6 @@
42#include "xfs_symlink.h" 42#include "xfs_symlink.h"
43#include "xfs_trans.h" 43#include "xfs_trans.h"
44#include "xfs_log.h" 44#include "xfs_log.h"
45#include "xfs_dinode.h"
46 45
47/* ----- Kernel only functions below ----- */ 46/* ----- Kernel only functions below ----- */
48STATIC int 47STATIC int