aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2013-10-22 19:51:50 -0400
committerBen Myers <bpm@sgi.com>2013-10-23 17:28:49 -0400
commita4fbe6ab1e7abecf42b75e9c73701ed33b4ab03b (patch)
tree24753fd80e3ee2e8038869858d108db4c078a4b0 /fs/xfs
parent239880ef6454ccff2ba8d762c3f86e8278f0ce1c (diff)
xfs: decouple inode and bmap btree header files
Currently the xfs_inode.h header has a dependency on the definition of the BMAP btree records as the inode fork includes an array of xfs_bmbt_rec_host_t objects in it's definition. Move all the btree format definitions from xfs_btree.h, xfs_bmap_btree.h, xfs_alloc_btree.h and xfs_ialloc_btree.h to xfs_format.h to continue the process of centralising the on-disk format definitions. With this done, the xfs inode definitions are no longer dependent on btree header files. The enables a massive culling of unnecessary includes, with close to 200 #include directives removed from the XFS kernel code base. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Ben Myers <bpm@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_acl.c8
-rw-r--r--fs/xfs/xfs_alloc.c5
-rw-r--r--fs/xfs/xfs_alloc_btree.c7
-rw-r--r--fs/xfs/xfs_alloc_btree.h33
-rw-r--r--fs/xfs/xfs_aops.c4
-rw-r--r--fs/xfs/xfs_attr.c4
-rw-r--r--fs/xfs/xfs_attr_inactive.c8
-rw-r--r--fs/xfs/xfs_attr_leaf.c13
-rw-r--r--fs/xfs/xfs_attr_list.c12
-rw-r--r--fs/xfs/xfs_attr_remote.c5
-rw-r--r--fs/xfs/xfs_bmap.c12
-rw-r--r--fs/xfs/xfs_bmap_btree.c7
-rw-r--r--fs/xfs/xfs_bmap_btree.h103
-rw-r--r--fs/xfs/xfs_bmap_util.c6
-rw-r--r--fs/xfs/xfs_btree.c5
-rw-r--r--fs/xfs/xfs_btree.h79
-rw-r--r--fs/xfs/xfs_buf_item.h4
-rw-r--r--fs/xfs/xfs_da_btree.c2
-rw-r--r--fs/xfs/xfs_dir2.c5
-rw-r--r--fs/xfs/xfs_dir2_block.c4
-rw-r--r--fs/xfs/xfs_dir2_data.c3
-rw-r--r--fs/xfs/xfs_dir2_leaf.c4
-rw-r--r--fs/xfs/xfs_dir2_node.c3
-rw-r--r--fs/xfs/xfs_dir2_readdir.c4
-rw-r--r--fs/xfs/xfs_dir2_sf.c4
-rw-r--r--fs/xfs/xfs_discard.c6
-rw-r--r--fs/xfs/xfs_dquot.c5
-rw-r--r--fs/xfs/xfs_dquot_buf.c2
-rw-r--r--fs/xfs/xfs_dquot_item.c8
-rw-r--r--fs/xfs/xfs_error.c4
-rw-r--r--fs/xfs/xfs_export.c2
-rw-r--r--fs/xfs/xfs_extent_busy.c2
-rw-r--r--fs/xfs/xfs_extent_busy.h4
-rw-r--r--fs/xfs/xfs_file.c5
-rw-r--r--fs/xfs/xfs_filestream.c4
-rw-r--r--fs/xfs/xfs_format.h255
-rw-r--r--fs/xfs/xfs_fsops.c12
-rw-r--r--fs/xfs/xfs_ialloc.c6
-rw-r--r--fs/xfs/xfs_ialloc.h3
-rw-r--r--fs/xfs/xfs_ialloc_btree.c6
-rw-r--r--fs/xfs/xfs_ialloc_btree.h49
-rw-r--r--fs/xfs/xfs_icache.c4
-rw-r--r--fs/xfs/xfs_inode.c10
-rw-r--r--fs/xfs/xfs_inode.h1
-rw-r--r--fs/xfs/xfs_inode_buf.c6
-rw-r--r--fs/xfs/xfs_inode_fork.c16
-rw-r--r--fs/xfs/xfs_inode_fork.h1
-rw-r--r--fs/xfs/xfs_inode_item.c4
-rw-r--r--fs/xfs/xfs_ioctl.c9
-rw-r--r--fs/xfs/xfs_ioctl32.c3
-rw-r--r--fs/xfs/xfs_iomap.c16
-rw-r--r--fs/xfs/xfs_iops.c8
-rw-r--r--fs/xfs/xfs_itable.c9
-rw-r--r--fs/xfs/xfs_log.c6
-rw-r--r--fs/xfs/xfs_log_recover.c18
-rw-r--r--fs/xfs/xfs_log_rlimit.c3
-rw-r--r--fs/xfs/xfs_mount.c15
-rw-r--r--fs/xfs/xfs_qm.c11
-rw-r--r--fs/xfs/xfs_qm_bhv.c7
-rw-r--r--fs/xfs/xfs_qm_syscalls.c10
-rw-r--r--fs/xfs/xfs_quotaops.c3
-rw-r--r--fs/xfs/xfs_rtalloc.c9
-rw-r--r--fs/xfs/xfs_sb.c18
-rw-r--r--fs/xfs/xfs_super.c16
-rw-r--r--fs/xfs/xfs_symlink.c6
-rw-r--r--fs/xfs/xfs_trace.c5
-rw-r--r--fs/xfs/xfs_trans.c16
-rw-r--r--fs/xfs/xfs_trans.h5
-rw-r--r--fs/xfs/xfs_trans_buf.c5
-rw-r--r--fs/xfs/xfs_trans_dquot.c9
-rw-r--r--fs/xfs/xfs_trans_inode.c6
-rw-r--r--fs/xfs/xfs_trans_resv.c12
-rw-r--r--fs/xfs/xfs_xattr.c2
73 files changed, 403 insertions, 583 deletions
diff --git a/fs/xfs/xfs_acl.c b/fs/xfs/xfs_acl.c
index 0e2f37efedd0..370eb3e121d1 100644
--- a/fs/xfs/xfs_acl.c
+++ b/fs/xfs/xfs_acl.c
@@ -16,15 +16,15 @@
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_format.h"
19#include "xfs_log_format.h" 20#include "xfs_log_format.h"
20#include "xfs_trans_resv.h" 21#include "xfs_trans_resv.h"
21#include "xfs_acl.h"
22#include "xfs_attr.h"
23#include "xfs_bmap_btree.h"
24#include "xfs_inode.h"
25#include "xfs_ag.h" 22#include "xfs_ag.h"
26#include "xfs_sb.h" 23#include "xfs_sb.h"
27#include "xfs_mount.h" 24#include "xfs_mount.h"
25#include "xfs_inode.h"
26#include "xfs_acl.h"
27#include "xfs_attr.h"
28#include "xfs_trace.h" 28#include "xfs_trace.h"
29#include <linux/slab.h> 29#include <linux/slab.h>
30#include <linux/xattr.h> 30#include <linux/xattr.h>
diff --git a/fs/xfs/xfs_alloc.c b/fs/xfs/xfs_alloc.c
index 999db7a95663..bcf16528bac5 100644
--- a/fs/xfs/xfs_alloc.c
+++ b/fs/xfs/xfs_alloc.c
@@ -25,12 +25,9 @@
25#include "xfs_sb.h" 25#include "xfs_sb.h"
26#include "xfs_ag.h" 26#include "xfs_ag.h"
27#include "xfs_mount.h" 27#include "xfs_mount.h"
28#include "xfs_bmap_btree.h"
29#include "xfs_alloc_btree.h"
30#include "xfs_ialloc_btree.h"
31#include "xfs_dinode.h"
32#include "xfs_inode.h" 28#include "xfs_inode.h"
33#include "xfs_btree.h" 29#include "xfs_btree.h"
30#include "xfs_alloc_btree.h"
34#include "xfs_alloc.h" 31#include "xfs_alloc.h"
35#include "xfs_extent_busy.h" 32#include "xfs_extent_busy.h"
36#include "xfs_error.h" 33#include "xfs_error.h"
diff --git a/fs/xfs/xfs_alloc_btree.c b/fs/xfs/xfs_alloc_btree.c
index 0bd33bfbb789..698587f6c60a 100644
--- a/fs/xfs/xfs_alloc_btree.c
+++ b/fs/xfs/xfs_alloc_btree.c
@@ -17,17 +17,14 @@
17 */ 17 */
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_fs.h" 19#include "xfs_fs.h"
20#include "xfs_format.h"
20#include "xfs_log_format.h" 21#include "xfs_log_format.h"
21#include "xfs_trans_resv.h" 22#include "xfs_trans_resv.h"
22#include "xfs_sb.h" 23#include "xfs_sb.h"
23#include "xfs_ag.h" 24#include "xfs_ag.h"
24#include "xfs_mount.h" 25#include "xfs_mount.h"
25#include "xfs_bmap_btree.h"
26#include "xfs_alloc_btree.h"
27#include "xfs_ialloc_btree.h"
28#include "xfs_dinode.h"
29#include "xfs_inode.h"
30#include "xfs_btree.h" 26#include "xfs_btree.h"
27#include "xfs_alloc_btree.h"
31#include "xfs_alloc.h" 28#include "xfs_alloc.h"
32#include "xfs_extent_busy.h" 29#include "xfs_extent_busy.h"
33#include "xfs_error.h" 30#include "xfs_error.h"
diff --git a/fs/xfs/xfs_alloc_btree.h b/fs/xfs/xfs_alloc_btree.h
index 72676c36b1bb..45e189e7e81c 100644
--- a/fs/xfs/xfs_alloc_btree.h
+++ b/fs/xfs/xfs_alloc_btree.h
@@ -27,39 +27,6 @@ struct xfs_btree_cur;
27struct xfs_mount; 27struct xfs_mount;
28 28
29/* 29/*
30 * There are two on-disk btrees, one sorted by blockno and one sorted
31 * by blockcount and blockno. All blocks look the same to make the code
32 * simpler; if we have time later, we'll make the optimizations.
33 */
34#define XFS_ABTB_MAGIC 0x41425442 /* 'ABTB' for bno tree */
35#define XFS_ABTB_CRC_MAGIC 0x41423342 /* 'AB3B' */
36#define XFS_ABTC_MAGIC 0x41425443 /* 'ABTC' for cnt tree */
37#define XFS_ABTC_CRC_MAGIC 0x41423343 /* 'AB3C' */
38
39/*
40 * Data record/key structure
41 */
42typedef struct xfs_alloc_rec {
43 __be32 ar_startblock; /* starting block number */
44 __be32 ar_blockcount; /* count of free blocks */
45} xfs_alloc_rec_t, xfs_alloc_key_t;
46
47typedef struct xfs_alloc_rec_incore {
48 xfs_agblock_t ar_startblock; /* starting block number */
49 xfs_extlen_t ar_blockcount; /* count of free blocks */
50} xfs_alloc_rec_incore_t;
51
52/* btree pointer type */
53typedef __be32 xfs_alloc_ptr_t;
54
55/*
56 * Block numbers in the AG:
57 * SB is sector 0, AGF is sector 1, AGI is sector 2, AGFL is sector 3.
58 */
59#define XFS_BNO_BLOCK(mp) ((xfs_agblock_t)(XFS_AGFL_BLOCK(mp) + 1))
60#define XFS_CNT_BLOCK(mp) ((xfs_agblock_t)(XFS_BNO_BLOCK(mp) + 1))
61
62/*
63 * Btree block header size depends on a superblock flag. 30 * Btree block header size depends on a superblock flag.
64 */ 31 */
65#define XFS_ALLOC_BLOCK_LEN(mp) \ 32#define XFS_ALLOC_BLOCK_LEN(mp) \
diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
index caa63cb3e2fd..eb310caf13b1 100644
--- a/fs/xfs/xfs_aops.c
+++ b/fs/xfs/xfs_aops.c
@@ -23,8 +23,6 @@
23#include "xfs_sb.h" 23#include "xfs_sb.h"
24#include "xfs_ag.h" 24#include "xfs_ag.h"
25#include "xfs_mount.h" 25#include "xfs_mount.h"
26#include "xfs_bmap_btree.h"
27#include "xfs_dinode.h"
28#include "xfs_inode.h" 26#include "xfs_inode.h"
29#include "xfs_trans.h" 27#include "xfs_trans.h"
30#include "xfs_inode_item.h" 28#include "xfs_inode_item.h"
@@ -34,6 +32,8 @@
34#include "xfs_trace.h" 32#include "xfs_trace.h"
35#include "xfs_bmap.h" 33#include "xfs_bmap.h"
36#include "xfs_bmap_util.h" 34#include "xfs_bmap_util.h"
35#include "xfs_bmap_btree.h"
36#include "xfs_dinode.h"
37#include <linux/aio.h> 37#include <linux/aio.h>
38#include <linux/gfp.h> 38#include <linux/gfp.h>
39#include <linux/mpage.h> 39#include <linux/mpage.h>
diff --git a/fs/xfs/xfs_attr.c b/fs/xfs/xfs_attr.c
index ce6f9e0b6c5f..b86127072ac3 100644
--- a/fs/xfs/xfs_attr.c
+++ b/fs/xfs/xfs_attr.c
@@ -27,15 +27,14 @@
27#include "xfs_mount.h" 27#include "xfs_mount.h"
28#include "xfs_da_format.h" 28#include "xfs_da_format.h"
29#include "xfs_da_btree.h" 29#include "xfs_da_btree.h"
30#include "xfs_bmap_btree.h"
31#include "xfs_attr_sf.h" 30#include "xfs_attr_sf.h"
32#include "xfs_dinode.h"
33#include "xfs_inode.h" 31#include "xfs_inode.h"
34#include "xfs_alloc.h" 32#include "xfs_alloc.h"
35#include "xfs_trans.h" 33#include "xfs_trans.h"
36#include "xfs_inode_item.h" 34#include "xfs_inode_item.h"
37#include "xfs_bmap.h" 35#include "xfs_bmap.h"
38#include "xfs_bmap_util.h" 36#include "xfs_bmap_util.h"
37#include "xfs_bmap_btree.h"
39#include "xfs_attr.h" 38#include "xfs_attr.h"
40#include "xfs_attr_leaf.h" 39#include "xfs_attr_leaf.h"
41#include "xfs_attr_remote.h" 40#include "xfs_attr_remote.h"
@@ -43,6 +42,7 @@
43#include "xfs_quota.h" 42#include "xfs_quota.h"
44#include "xfs_trans_space.h" 43#include "xfs_trans_space.h"
45#include "xfs_trace.h" 44#include "xfs_trace.h"
45#include "xfs_dinode.h"
46 46
47/* 47/*
48 * xfs_attr.c 48 * xfs_attr.c
diff --git a/fs/xfs/xfs_attr_inactive.c b/fs/xfs/xfs_attr_inactive.c
index 45480f5b6aea..f33fb62b7f17 100644
--- a/fs/xfs/xfs_attr_inactive.c
+++ b/fs/xfs/xfs_attr_inactive.c
@@ -28,14 +28,9 @@
28#include "xfs_mount.h" 28#include "xfs_mount.h"
29#include "xfs_da_format.h" 29#include "xfs_da_format.h"
30#include "xfs_da_btree.h" 30#include "xfs_da_btree.h"
31#include "xfs_bmap_btree.h" 31#include "xfs_inode.h"
32#include "xfs_alloc_btree.h"
33#include "xfs_ialloc_btree.h"
34#include "xfs_alloc.h" 32#include "xfs_alloc.h"
35#include "xfs_btree.h"
36#include "xfs_attr_remote.h" 33#include "xfs_attr_remote.h"
37#include "xfs_dinode.h"
38#include "xfs_inode.h"
39#include "xfs_trans.h" 34#include "xfs_trans.h"
40#include "xfs_inode_item.h" 35#include "xfs_inode_item.h"
41#include "xfs_bmap.h" 36#include "xfs_bmap.h"
@@ -44,6 +39,7 @@
44#include "xfs_error.h" 39#include "xfs_error.h"
45#include "xfs_quota.h" 40#include "xfs_quota.h"
46#include "xfs_trace.h" 41#include "xfs_trace.h"
42#include "xfs_dinode.h"
47 43
48/* 44/*
49 * Look at all the extents for this logical region, 45 * Look at all the extents for this logical region,
diff --git a/fs/xfs/xfs_attr_leaf.c b/fs/xfs/xfs_attr_leaf.c
index c10c70c88ec9..a0f90193a247 100644
--- a/fs/xfs/xfs_attr_leaf.c
+++ b/fs/xfs/xfs_attr_leaf.c
@@ -18,6 +18,7 @@
18 */ 18 */
19#include "xfs.h" 19#include "xfs.h"
20#include "xfs_fs.h" 20#include "xfs_fs.h"
21#include "xfs_format.h"
21#include "xfs_log_format.h" 22#include "xfs_log_format.h"
22#include "xfs_trans_resv.h" 23#include "xfs_trans_resv.h"
23#include "xfs_bit.h" 24#include "xfs_bit.h"
@@ -26,24 +27,20 @@
26#include "xfs_mount.h" 27#include "xfs_mount.h"
27#include "xfs_da_format.h" 28#include "xfs_da_format.h"
28#include "xfs_da_btree.h" 29#include "xfs_da_btree.h"
29#include "xfs_bmap_btree.h"
30#include "xfs_alloc_btree.h"
31#include "xfs_ialloc_btree.h"
32#include "xfs_alloc.h"
33#include "xfs_btree.h"
34#include "xfs_attr_sf.h"
35#include "xfs_attr_remote.h"
36#include "xfs_dinode.h"
37#include "xfs_inode.h" 30#include "xfs_inode.h"
38#include "xfs_trans.h" 31#include "xfs_trans.h"
39#include "xfs_inode_item.h" 32#include "xfs_inode_item.h"
33#include "xfs_bmap_btree.h"
40#include "xfs_bmap.h" 34#include "xfs_bmap.h"
35#include "xfs_attr_sf.h"
36#include "xfs_attr_remote.h"
41#include "xfs_attr.h" 37#include "xfs_attr.h"
42#include "xfs_attr_leaf.h" 38#include "xfs_attr_leaf.h"
43#include "xfs_error.h" 39#include "xfs_error.h"
44#include "xfs_trace.h" 40#include "xfs_trace.h"
45#include "xfs_buf_item.h" 41#include "xfs_buf_item.h"
46#include "xfs_cksum.h" 42#include "xfs_cksum.h"
43#include "xfs_dinode.h"
47 44
48 45
49/* 46/*
diff --git a/fs/xfs/xfs_attr_list.c b/fs/xfs/xfs_attr_list.c
index a319eb4d123f..46c4ce148a43 100644
--- a/fs/xfs/xfs_attr_list.c
+++ b/fs/xfs/xfs_attr_list.c
@@ -18,6 +18,7 @@
18 */ 18 */
19#include "xfs.h" 19#include "xfs.h"
20#include "xfs_fs.h" 20#include "xfs_fs.h"
21#include "xfs_format.h"
21#include "xfs_log_format.h" 22#include "xfs_log_format.h"
22#include "xfs_trans_resv.h" 23#include "xfs_trans_resv.h"
23#include "xfs_bit.h" 24#include "xfs_bit.h"
@@ -26,24 +27,19 @@
26#include "xfs_mount.h" 27#include "xfs_mount.h"
27#include "xfs_da_format.h" 28#include "xfs_da_format.h"
28#include "xfs_da_btree.h" 29#include "xfs_da_btree.h"
29#include "xfs_bmap_btree.h"
30#include "xfs_alloc_btree.h"
31#include "xfs_ialloc_btree.h"
32#include "xfs_alloc.h"
33#include "xfs_btree.h"
34#include "xfs_attr_sf.h"
35#include "xfs_attr_remote.h"
36#include "xfs_dinode.h"
37#include "xfs_inode.h" 30#include "xfs_inode.h"
38#include "xfs_trans.h" 31#include "xfs_trans.h"
39#include "xfs_inode_item.h" 32#include "xfs_inode_item.h"
40#include "xfs_bmap.h" 33#include "xfs_bmap.h"
41#include "xfs_attr.h" 34#include "xfs_attr.h"
35#include "xfs_attr_sf.h"
36#include "xfs_attr_remote.h"
42#include "xfs_attr_leaf.h" 37#include "xfs_attr_leaf.h"
43#include "xfs_error.h" 38#include "xfs_error.h"
44#include "xfs_trace.h" 39#include "xfs_trace.h"
45#include "xfs_buf_item.h" 40#include "xfs_buf_item.h"
46#include "xfs_cksum.h" 41#include "xfs_cksum.h"
42#include "xfs_dinode.h"
47 43
48STATIC int 44STATIC int
49xfs_attr_shortform_compare(const void *a, const void *b) 45xfs_attr_shortform_compare(const void *a, const void *b)
diff --git a/fs/xfs/xfs_attr_remote.c b/fs/xfs/xfs_attr_remote.c
index 1407191f90c3..2e5530467f2d 100644
--- a/fs/xfs/xfs_attr_remote.c
+++ b/fs/xfs/xfs_attr_remote.c
@@ -18,6 +18,7 @@
18 */ 18 */
19#include "xfs.h" 19#include "xfs.h"
20#include "xfs_fs.h" 20#include "xfs_fs.h"
21#include "xfs_format.h"
21#include "xfs_log_format.h" 22#include "xfs_log_format.h"
22#include "xfs_trans_resv.h" 23#include "xfs_trans_resv.h"
23#include "xfs_bit.h" 24#include "xfs_bit.h"
@@ -25,10 +26,7 @@
25#include "xfs_ag.h" 26#include "xfs_ag.h"
26#include "xfs_mount.h" 27#include "xfs_mount.h"
27#include "xfs_da_format.h" 28#include "xfs_da_format.h"
28#include "xfs_error.h"
29#include "xfs_da_btree.h" 29#include "xfs_da_btree.h"
30#include "xfs_bmap_btree.h"
31#include "xfs_dinode.h"
32#include "xfs_inode.h" 30#include "xfs_inode.h"
33#include "xfs_alloc.h" 31#include "xfs_alloc.h"
34#include "xfs_trans.h" 32#include "xfs_trans.h"
@@ -42,6 +40,7 @@
42#include "xfs_trace.h" 40#include "xfs_trace.h"
43#include "xfs_cksum.h" 41#include "xfs_cksum.h"
44#include "xfs_buf_item.h" 42#include "xfs_buf_item.h"
43#include "xfs_error.h"
45 44
46#define ATTR_RMTVALUE_MAPSIZE 1 /* # of map entries at once */ 45#define ATTR_RMTVALUE_MAPSIZE 1 /* # of map entries at once */
47 46
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index c3756ac09658..1c02da8bb7df 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -29,29 +29,25 @@
29#include "xfs_da_format.h" 29#include "xfs_da_format.h"
30#include "xfs_da_btree.h" 30#include "xfs_da_btree.h"
31#include "xfs_dir2.h" 31#include "xfs_dir2.h"
32#include "xfs_bmap_btree.h"
33#include "xfs_alloc_btree.h"
34#include "xfs_ialloc_btree.h"
35#include "xfs_dinode.h"
36#include "xfs_inode.h" 32#include "xfs_inode.h"
37#include "xfs_btree.h" 33#include "xfs_btree.h"
38#include "xfs_mount.h"
39#include "xfs_itable.h"
40#include "xfs_trans.h" 34#include "xfs_trans.h"
41#include "xfs_inode_item.h" 35#include "xfs_inode_item.h"
42#include "xfs_extfree_item.h" 36#include "xfs_extfree_item.h"
43#include "xfs_alloc.h" 37#include "xfs_alloc.h"
44#include "xfs_bmap.h" 38#include "xfs_bmap.h"
45#include "xfs_bmap_util.h" 39#include "xfs_bmap_util.h"
40#include "xfs_bmap_btree.h"
46#include "xfs_rtalloc.h" 41#include "xfs_rtalloc.h"
47#include "xfs_error.h" 42#include "xfs_error.h"
48#include "xfs_attr_leaf.h"
49#include "xfs_quota.h" 43#include "xfs_quota.h"
50#include "xfs_trans_space.h" 44#include "xfs_trans_space.h"
51#include "xfs_buf_item.h" 45#include "xfs_buf_item.h"
52#include "xfs_filestream.h"
53#include "xfs_trace.h" 46#include "xfs_trace.h"
54#include "xfs_symlink.h" 47#include "xfs_symlink.h"
48#include "xfs_attr_leaf.h"
49#include "xfs_dinode.h"
50#include "xfs_filestream.h"
55 51
56 52
57kmem_zone_t *xfs_bmap_free_item_zone; 53kmem_zone_t *xfs_bmap_free_item_zone;
diff --git a/fs/xfs/xfs_bmap_btree.c b/fs/xfs/xfs_bmap_btree.c
index 89ef4e67ff54..2fb4a2202e17 100644
--- a/fs/xfs/xfs_bmap_btree.c
+++ b/fs/xfs/xfs_bmap_btree.c
@@ -24,21 +24,18 @@
24#include "xfs_sb.h" 24#include "xfs_sb.h"
25#include "xfs_ag.h" 25#include "xfs_ag.h"
26#include "xfs_mount.h" 26#include "xfs_mount.h"
27#include "xfs_bmap_btree.h"
28#include "xfs_alloc_btree.h"
29#include "xfs_ialloc_btree.h"
30#include "xfs_dinode.h"
31#include "xfs_inode.h" 27#include "xfs_inode.h"
32#include "xfs_trans.h" 28#include "xfs_trans.h"
33#include "xfs_inode_item.h" 29#include "xfs_inode_item.h"
34#include "xfs_alloc.h" 30#include "xfs_alloc.h"
35#include "xfs_btree.h" 31#include "xfs_btree.h"
36#include "xfs_itable.h" 32#include "xfs_bmap_btree.h"
37#include "xfs_bmap.h" 33#include "xfs_bmap.h"
38#include "xfs_error.h" 34#include "xfs_error.h"
39#include "xfs_quota.h" 35#include "xfs_quota.h"
40#include "xfs_trace.h" 36#include "xfs_trace.h"
41#include "xfs_cksum.h" 37#include "xfs_cksum.h"
38#include "xfs_dinode.h"
42 39
43/* 40/*
44 * Determine the extent state. 41 * Determine the extent state.
diff --git a/fs/xfs/xfs_bmap_btree.h b/fs/xfs/xfs_bmap_btree.h
index e2b0768a89ba..6e42e1e50b89 100644
--- a/fs/xfs/xfs_bmap_btree.h
+++ b/fs/xfs/xfs_bmap_btree.h
@@ -18,9 +18,6 @@
18#ifndef __XFS_BMAP_BTREE_H__ 18#ifndef __XFS_BMAP_BTREE_H__
19#define __XFS_BMAP_BTREE_H__ 19#define __XFS_BMAP_BTREE_H__
20 20
21#define XFS_BMAP_MAGIC 0x424d4150 /* 'BMAP' */
22#define XFS_BMAP_CRC_MAGIC 0x424d4133 /* 'BMA3' */
23
24struct xfs_btree_cur; 21struct xfs_btree_cur;
25struct xfs_btree_block; 22struct xfs_btree_block;
26struct xfs_mount; 23struct xfs_mount;
@@ -28,85 +25,6 @@ struct xfs_inode;
28struct xfs_trans; 25struct xfs_trans;
29 26
30/* 27/*
31 * Bmap root header, on-disk form only.
32 */
33typedef struct xfs_bmdr_block {
34 __be16 bb_level; /* 0 is a leaf */
35 __be16 bb_numrecs; /* current # of data records */
36} xfs_bmdr_block_t;
37
38/*
39 * Bmap btree record and extent descriptor.
40 * l0:63 is an extent flag (value 1 indicates non-normal).
41 * l0:9-62 are startoff.
42 * l0:0-8 and l1:21-63 are startblock.
43 * l1:0-20 are blockcount.
44 */
45#define BMBT_EXNTFLAG_BITLEN 1
46#define BMBT_STARTOFF_BITLEN 54
47#define BMBT_STARTBLOCK_BITLEN 52
48#define BMBT_BLOCKCOUNT_BITLEN 21
49
50typedef struct xfs_bmbt_rec {
51 __be64 l0, l1;
52} xfs_bmbt_rec_t;
53
54typedef __uint64_t xfs_bmbt_rec_base_t; /* use this for casts */
55typedef xfs_bmbt_rec_t xfs_bmdr_rec_t;
56
57typedef struct xfs_bmbt_rec_host {
58 __uint64_t l0, l1;
59} xfs_bmbt_rec_host_t;
60
61/*
62 * Values and macros for delayed-allocation startblock fields.
63 */
64#define STARTBLOCKVALBITS 17
65#define STARTBLOCKMASKBITS (15 + XFS_BIG_BLKNOS * 20)
66#define DSTARTBLOCKMASKBITS (15 + 20)
67#define STARTBLOCKMASK \
68 (((((xfs_fsblock_t)1) << STARTBLOCKMASKBITS) - 1) << STARTBLOCKVALBITS)
69#define DSTARTBLOCKMASK \
70 (((((xfs_dfsbno_t)1) << DSTARTBLOCKMASKBITS) - 1) << STARTBLOCKVALBITS)
71
72static inline int isnullstartblock(xfs_fsblock_t x)
73{
74 return ((x) & STARTBLOCKMASK) == STARTBLOCKMASK;
75}
76
77static inline int isnulldstartblock(xfs_dfsbno_t x)
78{
79 return ((x) & DSTARTBLOCKMASK) == DSTARTBLOCKMASK;
80}
81
82static inline xfs_fsblock_t nullstartblock(int k)
83{
84 ASSERT(k < (1 << STARTBLOCKVALBITS));
85 return STARTBLOCKMASK | (k);
86}
87
88static inline xfs_filblks_t startblockval(xfs_fsblock_t x)
89{
90 return (xfs_filblks_t)((x) & ~STARTBLOCKMASK);
91}
92
93/*
94 * Possible extent formats.
95 */
96typedef enum {
97 XFS_EXTFMT_NOSTATE = 0,
98 XFS_EXTFMT_HASSTATE
99} xfs_exntfmt_t;
100
101/*
102 * Possible extent states.
103 */
104typedef enum {
105 XFS_EXT_NORM, XFS_EXT_UNWRITTEN,
106 XFS_EXT_DMAPI_OFFLINE, XFS_EXT_INVALID
107} xfs_exntst_t;
108
109/*
110 * Extent state and extent format macros. 28 * Extent state and extent format macros.
111 */ 29 */
112#define XFS_EXTFMT_INODE(x) \ 30#define XFS_EXTFMT_INODE(x) \
@@ -115,27 +33,6 @@ typedef enum {
115#define ISUNWRITTEN(x) ((x)->br_state == XFS_EXT_UNWRITTEN) 33#define ISUNWRITTEN(x) ((x)->br_state == XFS_EXT_UNWRITTEN)
116 34
117/* 35/*
118 * Incore version of above.
119 */
120typedef struct xfs_bmbt_irec
121{
122 xfs_fileoff_t br_startoff; /* starting file offset */
123 xfs_fsblock_t br_startblock; /* starting block number */
124 xfs_filblks_t br_blockcount; /* number of blocks */
125 xfs_exntst_t br_state; /* extent state */
126} xfs_bmbt_irec_t;
127
128/*
129 * Key structure for non-leaf levels of the tree.
130 */
131typedef struct xfs_bmbt_key {
132 __be64 br_startoff; /* starting file offset */
133} xfs_bmbt_key_t, xfs_bmdr_key_t;
134
135/* btree pointer type */
136typedef __be64 xfs_bmbt_ptr_t, xfs_bmdr_ptr_t;
137
138/*
139 * Btree block header size depends on a superblock flag. 36 * Btree block header size depends on a superblock flag.
140 */ 37 */
141#define XFS_BMBT_BLOCK_LEN(mp) \ 38#define XFS_BMBT_BLOCK_LEN(mp) \
diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
index 271c0d6ceafd..5887e41c0323 100644
--- a/fs/xfs/xfs_bmap_util.c
+++ b/fs/xfs/xfs_bmap_util.c
@@ -27,10 +27,6 @@
27#include "xfs_ag.h" 27#include "xfs_ag.h"
28#include "xfs_mount.h" 28#include "xfs_mount.h"
29#include "xfs_da_format.h" 29#include "xfs_da_format.h"
30#include "xfs_bmap_btree.h"
31#include "xfs_alloc_btree.h"
32#include "xfs_ialloc_btree.h"
33#include "xfs_dinode.h"
34#include "xfs_inode.h" 30#include "xfs_inode.h"
35#include "xfs_btree.h" 31#include "xfs_btree.h"
36#include "xfs_trans.h" 32#include "xfs_trans.h"
@@ -38,6 +34,7 @@
38#include "xfs_alloc.h" 34#include "xfs_alloc.h"
39#include "xfs_bmap.h" 35#include "xfs_bmap.h"
40#include "xfs_bmap_util.h" 36#include "xfs_bmap_util.h"
37#include "xfs_bmap_btree.h"
41#include "xfs_rtalloc.h" 38#include "xfs_rtalloc.h"
42#include "xfs_error.h" 39#include "xfs_error.h"
43#include "xfs_quota.h" 40#include "xfs_quota.h"
@@ -45,6 +42,7 @@
45#include "xfs_trace.h" 42#include "xfs_trace.h"
46#include "xfs_icache.h" 43#include "xfs_icache.h"
47#include "xfs_log.h" 44#include "xfs_log.h"
45#include "xfs_dinode.h"
48 46
49/* Kernel only BMAP related definitions and functions */ 47/* Kernel only BMAP related definitions and functions */
50 48
diff --git a/fs/xfs/xfs_btree.c b/fs/xfs/xfs_btree.c
index 08365117a933..9adaae4f3e2f 100644
--- a/fs/xfs/xfs_btree.c
+++ b/fs/xfs/xfs_btree.c
@@ -18,16 +18,13 @@
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_fs.h" 19#include "xfs_fs.h"
20#include "xfs_shared.h" 20#include "xfs_shared.h"
21#include "xfs_format.h"
21#include "xfs_log_format.h" 22#include "xfs_log_format.h"
22#include "xfs_trans_resv.h" 23#include "xfs_trans_resv.h"
23#include "xfs_bit.h" 24#include "xfs_bit.h"
24#include "xfs_sb.h" 25#include "xfs_sb.h"
25#include "xfs_ag.h" 26#include "xfs_ag.h"
26#include "xfs_mount.h" 27#include "xfs_mount.h"
27#include "xfs_bmap_btree.h"
28#include "xfs_alloc_btree.h"
29#include "xfs_ialloc_btree.h"
30#include "xfs_dinode.h"
31#include "xfs_inode.h" 28#include "xfs_inode.h"
32#include "xfs_trans.h" 29#include "xfs_trans.h"
33#include "xfs_inode_item.h" 30#include "xfs_inode_item.h"
diff --git a/fs/xfs/xfs_btree.h b/fs/xfs/xfs_btree.h
index 06729b67ad58..91e34f21bace 100644
--- a/fs/xfs/xfs_btree.h
+++ b/fs/xfs/xfs_btree.h
@@ -27,73 +27,6 @@ struct xfs_trans;
27extern kmem_zone_t *xfs_btree_cur_zone; 27extern kmem_zone_t *xfs_btree_cur_zone;
28 28
29/* 29/*
30 * This nonsense is to make -wlint happy.
31 */
32#define XFS_LOOKUP_EQ ((xfs_lookup_t)XFS_LOOKUP_EQi)
33#define XFS_LOOKUP_LE ((xfs_lookup_t)XFS_LOOKUP_LEi)
34#define XFS_LOOKUP_GE ((xfs_lookup_t)XFS_LOOKUP_GEi)
35
36#define XFS_BTNUM_BNO ((xfs_btnum_t)XFS_BTNUM_BNOi)
37#define XFS_BTNUM_CNT ((xfs_btnum_t)XFS_BTNUM_CNTi)
38#define XFS_BTNUM_BMAP ((xfs_btnum_t)XFS_BTNUM_BMAPi)
39#define XFS_BTNUM_INO ((xfs_btnum_t)XFS_BTNUM_INOi)
40
41/*
42 * Generic btree header.
43 *
44 * This is a combination of the actual format used on disk for short and long
45 * format btrees. The first three fields are shared by both format, but the
46 * pointers are different and should be used with care.
47 *
48 * To get the size of the actual short or long form headers please use the size
49 * macros below. Never use sizeof(xfs_btree_block).
50 *
51 * The blkno, crc, lsn, owner and uuid fields are only available in filesystems
52 * with the crc feature bit, and all accesses to them must be conditional on
53 * that flag.
54 */
55struct xfs_btree_block {
56 __be32 bb_magic; /* magic number for block type */
57 __be16 bb_level; /* 0 is a leaf */
58 __be16 bb_numrecs; /* current # of data records */
59 union {
60 struct {
61 __be32 bb_leftsib;
62 __be32 bb_rightsib;
63
64 __be64 bb_blkno;
65 __be64 bb_lsn;
66 uuid_t bb_uuid;
67 __be32 bb_owner;
68 __le32 bb_crc;
69 } s; /* short form pointers */
70 struct {
71 __be64 bb_leftsib;
72 __be64 bb_rightsib;
73
74 __be64 bb_blkno;
75 __be64 bb_lsn;
76 uuid_t bb_uuid;
77 __be64 bb_owner;
78 __le32 bb_crc;
79 __be32 bb_pad; /* padding for alignment */
80 } l; /* long form pointers */
81 } bb_u; /* rest */
82};
83
84#define XFS_BTREE_SBLOCK_LEN 16 /* size of a short form block */
85#define XFS_BTREE_LBLOCK_LEN 24 /* size of a long form block */
86
87/* sizes of CRC enabled btree blocks */
88#define XFS_BTREE_SBLOCK_CRC_LEN (XFS_BTREE_SBLOCK_LEN + 40)
89#define XFS_BTREE_LBLOCK_CRC_LEN (XFS_BTREE_LBLOCK_LEN + 48)
90
91#define XFS_BTREE_SBLOCK_CRC_OFF \
92 offsetof(struct xfs_btree_block, bb_u.s.bb_crc)
93#define XFS_BTREE_LBLOCK_CRC_OFF \
94 offsetof(struct xfs_btree_block, bb_u.l.bb_crc)
95
96/*
97 * Generic key, ptr and record wrapper structures. 30 * Generic key, ptr and record wrapper structures.
98 * 31 *
99 * These are disk format structures, and are converted where necessary 32 * These are disk format structures, and are converted where necessary
@@ -119,6 +52,18 @@ union xfs_btree_rec {
119}; 52};
120 53
121/* 54/*
55 * This nonsense is to make -wlint happy.
56 */
57#define XFS_LOOKUP_EQ ((xfs_lookup_t)XFS_LOOKUP_EQi)
58#define XFS_LOOKUP_LE ((xfs_lookup_t)XFS_LOOKUP_LEi)
59#define XFS_LOOKUP_GE ((xfs_lookup_t)XFS_LOOKUP_GEi)
60
61#define XFS_BTNUM_BNO ((xfs_btnum_t)XFS_BTNUM_BNOi)
62#define XFS_BTNUM_CNT ((xfs_btnum_t)XFS_BTNUM_CNTi)
63#define XFS_BTNUM_BMAP ((xfs_btnum_t)XFS_BTNUM_BMAPi)
64#define XFS_BTNUM_INO ((xfs_btnum_t)XFS_BTNUM_INOi)
65
66/*
122 * For logging record fields. 67 * For logging record fields.
123 */ 68 */
124#define XFS_BB_MAGIC (1 << 0) 69#define XFS_BB_MAGIC (1 << 0)
diff --git a/fs/xfs/xfs_buf_item.h b/fs/xfs/xfs_buf_item.h
index db6371087fe8..3f3455a41510 100644
--- a/fs/xfs/xfs_buf_item.h
+++ b/fs/xfs/xfs_buf_item.h
@@ -71,10 +71,6 @@ void xfs_buf_attach_iodone(struct xfs_buf *,
71void xfs_buf_iodone_callbacks(struct xfs_buf *); 71void xfs_buf_iodone_callbacks(struct xfs_buf *);
72void xfs_buf_iodone(struct xfs_buf *, struct xfs_log_item *); 72void xfs_buf_iodone(struct xfs_buf *, struct xfs_log_item *);
73 73
74void xfs_trans_buf_set_type(struct xfs_trans *, struct xfs_buf *,
75 enum xfs_blft);
76void xfs_trans_buf_copy_type(struct xfs_buf *dst_bp, struct xfs_buf *src_bp);
77
78extern kmem_zone_t *xfs_buf_item_zone; 74extern kmem_zone_t *xfs_buf_item_zone;
79 75
80#endif /* __XFS_BUF_ITEM_H__ */ 76#endif /* __XFS_BUF_ITEM_H__ */
diff --git a/fs/xfs/xfs_da_btree.c b/fs/xfs/xfs_da_btree.c
index 377011195975..eb65c546ffd8 100644
--- a/fs/xfs/xfs_da_btree.c
+++ b/fs/xfs/xfs_da_btree.c
@@ -28,10 +28,8 @@
28#include "xfs_mount.h" 28#include "xfs_mount.h"
29#include "xfs_da_format.h" 29#include "xfs_da_format.h"
30#include "xfs_da_btree.h" 30#include "xfs_da_btree.h"
31#include "xfs_bmap_btree.h"
32#include "xfs_dir2.h" 31#include "xfs_dir2.h"
33#include "xfs_dir2_priv.h" 32#include "xfs_dir2_priv.h"
34#include "xfs_dinode.h"
35#include "xfs_inode.h" 33#include "xfs_inode.h"
36#include "xfs_trans.h" 34#include "xfs_trans.h"
37#include "xfs_inode_item.h" 35#include "xfs_inode_item.h"
diff --git a/fs/xfs/xfs_dir2.c b/fs/xfs/xfs_dir2.c
index cef16615f761..38bf9324302c 100644
--- a/fs/xfs/xfs_dir2.c
+++ b/fs/xfs/xfs_dir2.c
@@ -17,6 +17,7 @@
17 */ 17 */
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_fs.h" 19#include "xfs_fs.h"
20#include "xfs_format.h"
20#include "xfs_log_format.h" 21#include "xfs_log_format.h"
21#include "xfs_trans_resv.h" 22#include "xfs_trans_resv.h"
22#include "xfs_inum.h" 23#include "xfs_inum.h"
@@ -25,9 +26,6 @@
25#include "xfs_mount.h" 26#include "xfs_mount.h"
26#include "xfs_da_format.h" 27#include "xfs_da_format.h"
27#include "xfs_da_btree.h" 28#include "xfs_da_btree.h"
28#include "xfs_bmap_btree.h"
29#include "xfs_alloc_btree.h"
30#include "xfs_dinode.h"
31#include "xfs_inode.h" 29#include "xfs_inode.h"
32#include "xfs_trans.h" 30#include "xfs_trans.h"
33#include "xfs_inode_item.h" 31#include "xfs_inode_item.h"
@@ -36,6 +34,7 @@
36#include "xfs_dir2_priv.h" 34#include "xfs_dir2_priv.h"
37#include "xfs_error.h" 35#include "xfs_error.h"
38#include "xfs_trace.h" 36#include "xfs_trace.h"
37#include "xfs_dinode.h"
39 38
40struct xfs_name xfs_name_dotdot = { (unsigned char *)"..", 2, XFS_DIR3_FT_DIR }; 39struct xfs_name xfs_name_dotdot = { (unsigned char *)"..", 2, XFS_DIR3_FT_DIR };
41 40
diff --git a/fs/xfs/xfs_dir2_block.c b/fs/xfs/xfs_dir2_block.c
index 6c7cd3ce9e72..9f3f83a5e2da 100644
--- a/fs/xfs/xfs_dir2_block.c
+++ b/fs/xfs/xfs_dir2_block.c
@@ -18,6 +18,7 @@
18 */ 18 */
19#include "xfs.h" 19#include "xfs.h"
20#include "xfs_fs.h" 20#include "xfs_fs.h"
21#include "xfs_format.h"
21#include "xfs_log_format.h" 22#include "xfs_log_format.h"
22#include "xfs_trans_resv.h" 23#include "xfs_trans_resv.h"
23#include "xfs_sb.h" 24#include "xfs_sb.h"
@@ -25,8 +26,6 @@
25#include "xfs_mount.h" 26#include "xfs_mount.h"
26#include "xfs_da_format.h" 27#include "xfs_da_format.h"
27#include "xfs_da_btree.h" 28#include "xfs_da_btree.h"
28#include "xfs_bmap_btree.h"
29#include "xfs_dinode.h"
30#include "xfs_inode.h" 29#include "xfs_inode.h"
31#include "xfs_trans.h" 30#include "xfs_trans.h"
32#include "xfs_inode_item.h" 31#include "xfs_inode_item.h"
@@ -37,6 +36,7 @@
37#include "xfs_error.h" 36#include "xfs_error.h"
38#include "xfs_trace.h" 37#include "xfs_trace.h"
39#include "xfs_cksum.h" 38#include "xfs_cksum.h"
39#include "xfs_dinode.h"
40 40
41/* 41/*
42 * Local function prototypes. 42 * Local function prototypes.
diff --git a/fs/xfs/xfs_dir2_data.c b/fs/xfs/xfs_dir2_data.c
index 3f7edddb8eff..ccfeb4d8376a 100644
--- a/fs/xfs/xfs_dir2_data.c
+++ b/fs/xfs/xfs_dir2_data.c
@@ -18,6 +18,7 @@
18 */ 18 */
19#include "xfs.h" 19#include "xfs.h"
20#include "xfs_fs.h" 20#include "xfs_fs.h"
21#include "xfs_format.h"
21#include "xfs_log_format.h" 22#include "xfs_log_format.h"
22#include "xfs_trans_resv.h" 23#include "xfs_trans_resv.h"
23#include "xfs_sb.h" 24#include "xfs_sb.h"
@@ -25,8 +26,6 @@
25#include "xfs_mount.h" 26#include "xfs_mount.h"
26#include "xfs_da_format.h" 27#include "xfs_da_format.h"
27#include "xfs_da_btree.h" 28#include "xfs_da_btree.h"
28#include "xfs_bmap_btree.h"
29#include "xfs_dinode.h"
30#include "xfs_inode.h" 29#include "xfs_inode.h"
31#include "xfs_dir2.h" 30#include "xfs_dir2.h"
32#include "xfs_dir2_priv.h" 31#include "xfs_dir2_priv.h"
diff --git a/fs/xfs/xfs_dir2_leaf.c b/fs/xfs/xfs_dir2_leaf.c
index 44fe4b83ac9b..51fdc11a1e2c 100644
--- a/fs/xfs/xfs_dir2_leaf.c
+++ b/fs/xfs/xfs_dir2_leaf.c
@@ -18,16 +18,14 @@
18 */ 18 */
19#include "xfs.h" 19#include "xfs.h"
20#include "xfs_fs.h" 20#include "xfs_fs.h"
21#include "xfs_format.h"
21#include "xfs_log_format.h" 22#include "xfs_log_format.h"
22#include "xfs_trans_resv.h" 23#include "xfs_trans_resv.h"
23#include "xfs_bit.h"
24#include "xfs_sb.h" 24#include "xfs_sb.h"
25#include "xfs_ag.h" 25#include "xfs_ag.h"
26#include "xfs_mount.h" 26#include "xfs_mount.h"
27#include "xfs_da_format.h" 27#include "xfs_da_format.h"
28#include "xfs_da_btree.h" 28#include "xfs_da_btree.h"
29#include "xfs_bmap_btree.h"
30#include "xfs_dinode.h"
31#include "xfs_inode.h" 29#include "xfs_inode.h"
32#include "xfs_bmap.h" 30#include "xfs_bmap.h"
33#include "xfs_dir2.h" 31#include "xfs_dir2.h"
diff --git a/fs/xfs/xfs_dir2_node.c b/fs/xfs/xfs_dir2_node.c
index 7836f048102e..b8381646b8af 100644
--- a/fs/xfs/xfs_dir2_node.c
+++ b/fs/xfs/xfs_dir2_node.c
@@ -18,6 +18,7 @@
18 */ 18 */
19#include "xfs.h" 19#include "xfs.h"
20#include "xfs_fs.h" 20#include "xfs_fs.h"
21#include "xfs_format.h"
21#include "xfs_log_format.h" 22#include "xfs_log_format.h"
22#include "xfs_trans_resv.h" 23#include "xfs_trans_resv.h"
23#include "xfs_sb.h" 24#include "xfs_sb.h"
@@ -25,8 +26,6 @@
25#include "xfs_mount.h" 26#include "xfs_mount.h"
26#include "xfs_da_format.h" 27#include "xfs_da_format.h"
27#include "xfs_da_btree.h" 28#include "xfs_da_btree.h"
28#include "xfs_bmap_btree.h"
29#include "xfs_dinode.h"
30#include "xfs_inode.h" 29#include "xfs_inode.h"
31#include "xfs_bmap.h" 30#include "xfs_bmap.h"
32#include "xfs_dir2.h" 31#include "xfs_dir2.h"
diff --git a/fs/xfs/xfs_dir2_readdir.c b/fs/xfs/xfs_dir2_readdir.c
index 048d582525cf..45c9ce8cdb28 100644
--- a/fs/xfs/xfs_dir2_readdir.c
+++ b/fs/xfs/xfs_dir2_readdir.c
@@ -18,6 +18,7 @@
18 */ 18 */
19#include "xfs.h" 19#include "xfs.h"
20#include "xfs_fs.h" 20#include "xfs_fs.h"
21#include "xfs_format.h"
21#include "xfs_log_format.h" 22#include "xfs_log_format.h"
22#include "xfs_trans_resv.h" 23#include "xfs_trans_resv.h"
23#include "xfs_bit.h" 24#include "xfs_bit.h"
@@ -26,8 +27,6 @@
26#include "xfs_mount.h" 27#include "xfs_mount.h"
27#include "xfs_da_format.h" 28#include "xfs_da_format.h"
28#include "xfs_da_btree.h" 29#include "xfs_da_btree.h"
29#include "xfs_bmap_btree.h"
30#include "xfs_dinode.h"
31#include "xfs_inode.h" 30#include "xfs_inode.h"
32#include "xfs_dir2.h" 31#include "xfs_dir2.h"
33#include "xfs_dir2_priv.h" 32#include "xfs_dir2_priv.h"
@@ -35,6 +34,7 @@
35#include "xfs_trace.h" 34#include "xfs_trace.h"
36#include "xfs_bmap.h" 35#include "xfs_bmap.h"
37#include "xfs_trans.h" 36#include "xfs_trans.h"
37#include "xfs_dinode.h"
38 38
39/* 39/*
40 * Directory file type support functions 40 * Directory file type support functions
diff --git a/fs/xfs/xfs_dir2_sf.c b/fs/xfs/xfs_dir2_sf.c
index ac3bb58b58b9..8811ee5eaec6 100644
--- a/fs/xfs/xfs_dir2_sf.c
+++ b/fs/xfs/xfs_dir2_sf.c
@@ -17,6 +17,7 @@
17 */ 17 */
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_fs.h" 19#include "xfs_fs.h"
20#include "xfs_format.h"
20#include "xfs_log_format.h" 21#include "xfs_log_format.h"
21#include "xfs_trans_resv.h" 22#include "xfs_trans_resv.h"
22#include "xfs_sb.h" 23#include "xfs_sb.h"
@@ -24,8 +25,6 @@
24#include "xfs_mount.h" 25#include "xfs_mount.h"
25#include "xfs_da_format.h" 26#include "xfs_da_format.h"
26#include "xfs_da_btree.h" 27#include "xfs_da_btree.h"
27#include "xfs_bmap_btree.h"
28#include "xfs_dinode.h"
29#include "xfs_inode.h" 28#include "xfs_inode.h"
30#include "xfs_trans.h" 29#include "xfs_trans.h"
31#include "xfs_inode_item.h" 30#include "xfs_inode_item.h"
@@ -33,6 +32,7 @@
33#include "xfs_dir2.h" 32#include "xfs_dir2.h"
34#include "xfs_dir2_priv.h" 33#include "xfs_dir2_priv.h"
35#include "xfs_trace.h" 34#include "xfs_trace.h"
35#include "xfs_dinode.h"
36 36
37/* 37/*
38 * Prototypes for internal functions. 38 * Prototypes for internal functions.
diff --git a/fs/xfs/xfs_discard.c b/fs/xfs/xfs_discard.c
index d38f34cecb40..8367d6dc18c9 100644
--- a/fs/xfs/xfs_discard.c
+++ b/fs/xfs/xfs_discard.c
@@ -23,11 +23,9 @@
23#include "xfs_ag.h" 23#include "xfs_ag.h"
24#include "xfs_mount.h" 24#include "xfs_mount.h"
25#include "xfs_quota.h" 25#include "xfs_quota.h"
26#include "xfs_alloc_btree.h"
27#include "xfs_bmap_btree.h"
28#include "xfs_ialloc_btree.h"
29#include "xfs_btree.h"
30#include "xfs_inode.h" 26#include "xfs_inode.h"
27#include "xfs_btree.h"
28#include "xfs_alloc_btree.h"
31#include "xfs_alloc.h" 29#include "xfs_alloc.h"
32#include "xfs_error.h" 30#include "xfs_error.h"
33#include "xfs_extent_busy.h" 31#include "xfs_extent_busy.h"
diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c
index 47a815d4a345..6b1e695caf0e 100644
--- a/fs/xfs/xfs_dquot.c
+++ b/fs/xfs/xfs_dquot.c
@@ -25,16 +25,12 @@
25#include "xfs_sb.h" 25#include "xfs_sb.h"
26#include "xfs_ag.h" 26#include "xfs_ag.h"
27#include "xfs_mount.h" 27#include "xfs_mount.h"
28#include "xfs_bmap_btree.h"
29#include "xfs_inode.h" 28#include "xfs_inode.h"
30#include "xfs_bmap.h" 29#include "xfs_bmap.h"
31#include "xfs_bmap_util.h" 30#include "xfs_bmap_util.h"
32#include "xfs_alloc.h" 31#include "xfs_alloc.h"
33#include "xfs_quota.h" 32#include "xfs_quota.h"
34#include "xfs_rtalloc.h"
35#include "xfs_error.h" 33#include "xfs_error.h"
36#include "xfs_itable.h"
37#include "xfs_attr.h"
38#include "xfs_trans.h" 34#include "xfs_trans.h"
39#include "xfs_buf_item.h" 35#include "xfs_buf_item.h"
40#include "xfs_trans_space.h" 36#include "xfs_trans_space.h"
@@ -43,6 +39,7 @@
43#include "xfs_cksum.h" 39#include "xfs_cksum.h"
44#include "xfs_trace.h" 40#include "xfs_trace.h"
45#include "xfs_log.h" 41#include "xfs_log.h"
42#include "xfs_bmap_btree.h"
46 43
47/* 44/*
48 * Lock order: 45 * Lock order:
diff --git a/fs/xfs/xfs_dquot_buf.c b/fs/xfs/xfs_dquot_buf.c
index 3e84b3a57f57..aaaf41b29869 100644
--- a/fs/xfs/xfs_dquot_buf.c
+++ b/fs/xfs/xfs_dquot_buf.c
@@ -21,11 +21,9 @@
21#include "xfs_format.h" 21#include "xfs_format.h"
22#include "xfs_log_format.h" 22#include "xfs_log_format.h"
23#include "xfs_trans_resv.h" 23#include "xfs_trans_resv.h"
24#include "xfs_bit.h"
25#include "xfs_sb.h" 24#include "xfs_sb.h"
26#include "xfs_ag.h" 25#include "xfs_ag.h"
27#include "xfs_mount.h" 26#include "xfs_mount.h"
28#include "xfs_bmap_btree.h"
29#include "xfs_inode.h" 27#include "xfs_inode.h"
30#include "xfs_quota.h" 28#include "xfs_quota.h"
31#include "xfs_trans.h" 29#include "xfs_trans.h"
diff --git a/fs/xfs/xfs_dquot_item.c b/fs/xfs/xfs_dquot_item.c
index f8a47f77c3fa..92e5f62eefc6 100644
--- a/fs/xfs/xfs_dquot_item.c
+++ b/fs/xfs/xfs_dquot_item.c
@@ -22,16 +22,10 @@
22#include "xfs_trans_resv.h" 22#include "xfs_trans_resv.h"
23#include "xfs_sb.h" 23#include "xfs_sb.h"
24#include "xfs_ag.h" 24#include "xfs_ag.h"
25#include "xfs_alloc.h"
26#include "xfs_quota.h"
27#include "xfs_mount.h" 25#include "xfs_mount.h"
28#include "xfs_bmap_btree.h"
29#include "xfs_inode.h" 26#include "xfs_inode.h"
30#include "xfs_bmap.h" 27#include "xfs_quota.h"
31#include "xfs_rtalloc.h"
32#include "xfs_error.h" 28#include "xfs_error.h"
33#include "xfs_itable.h"
34#include "xfs_attr.h"
35#include "xfs_trans.h" 29#include "xfs_trans.h"
36#include "xfs_buf_item.h" 30#include "xfs_buf_item.h"
37#include "xfs_trans_priv.h" 31#include "xfs_trans_priv.h"
diff --git a/fs/xfs/xfs_error.c b/fs/xfs/xfs_error.c
index d6c188cc7d43..9995b807d627 100644
--- a/fs/xfs/xfs_error.c
+++ b/fs/xfs/xfs_error.c
@@ -16,15 +16,13 @@
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_format.h"
19#include "xfs_fs.h" 20#include "xfs_fs.h"
20#include "xfs_log_format.h" 21#include "xfs_log_format.h"
21#include "xfs_trans_resv.h" 22#include "xfs_trans_resv.h"
22#include "xfs_sb.h" 23#include "xfs_sb.h"
23#include "xfs_ag.h" 24#include "xfs_ag.h"
24#include "xfs_mount.h" 25#include "xfs_mount.h"
25#include "xfs_bmap_btree.h"
26#include "xfs_dinode.h"
27#include "xfs_inode.h"
28#include "xfs_error.h" 26#include "xfs_error.h"
29 27
30#ifdef DEBUG 28#ifdef DEBUG
diff --git a/fs/xfs/xfs_export.c b/fs/xfs/xfs_export.c
index 8502aee8e65d..1399e187d425 100644
--- a/fs/xfs/xfs_export.c
+++ b/fs/xfs/xfs_export.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_format.h"
19#include "xfs_log_format.h" 20#include "xfs_log_format.h"
20#include "xfs_trans_resv.h" 21#include "xfs_trans_resv.h"
21#include "xfs_sb.h" 22#include "xfs_sb.h"
@@ -24,7 +25,6 @@
24#include "xfs_da_format.h" 25#include "xfs_da_format.h"
25#include "xfs_dir2.h" 26#include "xfs_dir2.h"
26#include "xfs_export.h" 27#include "xfs_export.h"
27#include "xfs_bmap_btree.h"
28#include "xfs_inode.h" 28#include "xfs_inode.h"
29#include "xfs_trans.h" 29#include "xfs_trans.h"
30#include "xfs_inode_item.h" 30#include "xfs_inode_item.h"
diff --git a/fs/xfs/xfs_extent_busy.c b/fs/xfs/xfs_extent_busy.c
index de462640606f..fd22f69049d4 100644
--- a/fs/xfs/xfs_extent_busy.c
+++ b/fs/xfs/xfs_extent_busy.c
@@ -26,9 +26,7 @@
26#include "xfs_sb.h" 26#include "xfs_sb.h"
27#include "xfs_ag.h" 27#include "xfs_ag.h"
28#include "xfs_mount.h" 28#include "xfs_mount.h"
29#include "xfs_bmap_btree.h"
30#include "xfs_alloc.h" 29#include "xfs_alloc.h"
31#include "xfs_inode.h"
32#include "xfs_extent_busy.h" 30#include "xfs_extent_busy.h"
33#include "xfs_trace.h" 31#include "xfs_trace.h"
34#include "xfs_trans.h" 32#include "xfs_trans.h"
diff --git a/fs/xfs/xfs_extent_busy.h b/fs/xfs/xfs_extent_busy.h
index 985412d65ba5..bfff284d2dcc 100644
--- a/fs/xfs/xfs_extent_busy.h
+++ b/fs/xfs/xfs_extent_busy.h
@@ -20,6 +20,10 @@
20#ifndef __XFS_EXTENT_BUSY_H__ 20#ifndef __XFS_EXTENT_BUSY_H__
21#define __XFS_EXTENT_BUSY_H__ 21#define __XFS_EXTENT_BUSY_H__
22 22
23struct xfs_mount;
24struct xfs_trans;
25struct xfs_alloc_arg;
26
23/* 27/*
24 * Busy block/extent entry. Indexed by a rbtree in perag to mark blocks that 28 * Busy block/extent entry. Indexed by a rbtree in perag to mark blocks that
25 * have been freed but whose transactions aren't committed to disk yet. 29 * have been freed but whose transactions aren't committed to disk yet.
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index 8b43bfa023af..52c91e143725 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -18,6 +18,7 @@
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_fs.h" 19#include "xfs_fs.h"
20#include "xfs_shared.h" 20#include "xfs_shared.h"
21#include "xfs_format.h"
21#include "xfs_log_format.h" 22#include "xfs_log_format.h"
22#include "xfs_trans_resv.h" 23#include "xfs_trans_resv.h"
23#include "xfs_sb.h" 24#include "xfs_sb.h"
@@ -25,9 +26,6 @@
25#include "xfs_mount.h" 26#include "xfs_mount.h"
26#include "xfs_da_format.h" 27#include "xfs_da_format.h"
27#include "xfs_da_btree.h" 28#include "xfs_da_btree.h"
28#include "xfs_bmap_btree.h"
29#include "xfs_alloc.h"
30#include "xfs_dinode.h"
31#include "xfs_inode.h" 29#include "xfs_inode.h"
32#include "xfs_trans.h" 30#include "xfs_trans.h"
33#include "xfs_inode_item.h" 31#include "xfs_inode_item.h"
@@ -39,6 +37,7 @@
39#include "xfs_ioctl.h" 37#include "xfs_ioctl.h"
40#include "xfs_trace.h" 38#include "xfs_trace.h"
41#include "xfs_log.h" 39#include "xfs_log.h"
40#include "xfs_dinode.h"
42 41
43#include <linux/aio.h> 42#include <linux/aio.h>
44#include <linux/dcache.h> 43#include <linux/dcache.h>
diff --git a/fs/xfs/xfs_filestream.c b/fs/xfs/xfs_filestream.c
index 7f2c3c1c8ba4..12b6e7701985 100644
--- a/fs/xfs/xfs_filestream.c
+++ b/fs/xfs/xfs_filestream.c
@@ -16,19 +16,19 @@
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_format.h"
19#include "xfs_log_format.h" 20#include "xfs_log_format.h"
20#include "xfs_trans_resv.h" 21#include "xfs_trans_resv.h"
21#include "xfs_ag.h" 22#include "xfs_ag.h"
22#include "xfs_sb.h" 23#include "xfs_sb.h"
23#include "xfs_mount.h" 24#include "xfs_mount.h"
24#include "xfs_bmap_btree.h"
25#include "xfs_inum.h" 25#include "xfs_inum.h"
26#include "xfs_dinode.h"
27#include "xfs_inode.h" 26#include "xfs_inode.h"
28#include "xfs_bmap.h" 27#include "xfs_bmap.h"
29#include "xfs_bmap_util.h" 28#include "xfs_bmap_util.h"
30#include "xfs_alloc.h" 29#include "xfs_alloc.h"
31#include "xfs_mru_cache.h" 30#include "xfs_mru_cache.h"
31#include "xfs_dinode.h"
32#include "xfs_filestream.h" 32#include "xfs_filestream.h"
33#include "xfs_trace.h" 33#include "xfs_trace.h"
34 34
diff --git a/fs/xfs/xfs_format.h b/fs/xfs/xfs_format.h
index a790428f3bf4..b6ab5a3cfa12 100644
--- a/fs/xfs/xfs_format.h
+++ b/fs/xfs/xfs_format.h
@@ -156,4 +156,259 @@ struct xfs_dsymlink_hdr {
156 ((bufsize) - (xfs_sb_version_hascrc(&(mp)->m_sb) ? \ 156 ((bufsize) - (xfs_sb_version_hascrc(&(mp)->m_sb) ? \
157 sizeof(struct xfs_dsymlink_hdr) : 0)) 157 sizeof(struct xfs_dsymlink_hdr) : 0))
158 158
159
160/*
161 * Allocation Btree format definitions
162 *
163 * There are two on-disk btrees, one sorted by blockno and one sorted
164 * by blockcount and blockno. All blocks look the same to make the code
165 * simpler; if we have time later, we'll make the optimizations.
166 */
167#define XFS_ABTB_MAGIC 0x41425442 /* 'ABTB' for bno tree */
168#define XFS_ABTB_CRC_MAGIC 0x41423342 /* 'AB3B' */
169#define XFS_ABTC_MAGIC 0x41425443 /* 'ABTC' for cnt tree */
170#define XFS_ABTC_CRC_MAGIC 0x41423343 /* 'AB3C' */
171
172/*
173 * Data record/key structure
174 */
175typedef struct xfs_alloc_rec {
176 __be32 ar_startblock; /* starting block number */
177 __be32 ar_blockcount; /* count of free blocks */
178} xfs_alloc_rec_t, xfs_alloc_key_t;
179
180typedef struct xfs_alloc_rec_incore {
181 xfs_agblock_t ar_startblock; /* starting block number */
182 xfs_extlen_t ar_blockcount; /* count of free blocks */
183} xfs_alloc_rec_incore_t;
184
185/* btree pointer type */
186typedef __be32 xfs_alloc_ptr_t;
187
188/*
189 * Block numbers in the AG:
190 * SB is sector 0, AGF is sector 1, AGI is sector 2, AGFL is sector 3.
191 */
192#define XFS_BNO_BLOCK(mp) ((xfs_agblock_t)(XFS_AGFL_BLOCK(mp) + 1))
193#define XFS_CNT_BLOCK(mp) ((xfs_agblock_t)(XFS_BNO_BLOCK(mp) + 1))
194
195
196/*
197 * Inode Allocation Btree format definitions
198 *
199 * There is a btree for the inode map per allocation group.
200 */
201#define XFS_IBT_MAGIC 0x49414254 /* 'IABT' */
202#define XFS_IBT_CRC_MAGIC 0x49414233 /* 'IAB3' */
203
204typedef __uint64_t xfs_inofree_t;
205#define XFS_INODES_PER_CHUNK (NBBY * sizeof(xfs_inofree_t))
206#define XFS_INODES_PER_CHUNK_LOG (XFS_NBBYLOG + 3)
207#define XFS_INOBT_ALL_FREE ((xfs_inofree_t)-1)
208#define XFS_INOBT_MASK(i) ((xfs_inofree_t)1 << (i))
209
210static inline xfs_inofree_t xfs_inobt_maskn(int i, int n)
211{
212 return ((n >= XFS_INODES_PER_CHUNK ? 0 : XFS_INOBT_MASK(n)) - 1) << i;
213}
214
215/*
216 * Data record structure
217 */
218typedef struct xfs_inobt_rec {
219 __be32 ir_startino; /* starting inode number */
220 __be32 ir_freecount; /* count of free inodes (set bits) */
221 __be64 ir_free; /* free inode mask */
222} xfs_inobt_rec_t;
223
224typedef struct xfs_inobt_rec_incore {
225 xfs_agino_t ir_startino; /* starting inode number */
226 __int32_t ir_freecount; /* count of free inodes (set bits) */
227 xfs_inofree_t ir_free; /* free inode mask */
228} xfs_inobt_rec_incore_t;
229
230
231/*
232 * Key structure
233 */
234typedef struct xfs_inobt_key {
235 __be32 ir_startino; /* starting inode number */
236} xfs_inobt_key_t;
237
238/* btree pointer type */
239typedef __be32 xfs_inobt_ptr_t;
240
241/*
242 * block numbers in the AG.
243 */
244#define XFS_IBT_BLOCK(mp) ((xfs_agblock_t)(XFS_CNT_BLOCK(mp) + 1))
245#define XFS_PREALLOC_BLOCKS(mp) ((xfs_agblock_t)(XFS_IBT_BLOCK(mp) + 1))
246
247
248
249/*
250 * BMAP Btree format definitions
251 *
252 * This includes both the root block definition that sits inside an inode fork
253 * and the record/pointer formats for the leaf/node in the blocks.
254 */
255#define XFS_BMAP_MAGIC 0x424d4150 /* 'BMAP' */
256#define XFS_BMAP_CRC_MAGIC 0x424d4133 /* 'BMA3' */
257
258/*
259 * Bmap root header, on-disk form only.
260 */
261typedef struct xfs_bmdr_block {
262 __be16 bb_level; /* 0 is a leaf */
263 __be16 bb_numrecs; /* current # of data records */
264} xfs_bmdr_block_t;
265
266/*
267 * Bmap btree record and extent descriptor.
268 * l0:63 is an extent flag (value 1 indicates non-normal).
269 * l0:9-62 are startoff.
270 * l0:0-8 and l1:21-63 are startblock.
271 * l1:0-20 are blockcount.
272 */
273#define BMBT_EXNTFLAG_BITLEN 1
274#define BMBT_STARTOFF_BITLEN 54
275#define BMBT_STARTBLOCK_BITLEN 52
276#define BMBT_BLOCKCOUNT_BITLEN 21
277
278typedef struct xfs_bmbt_rec {
279 __be64 l0, l1;
280} xfs_bmbt_rec_t;
281
282typedef __uint64_t xfs_bmbt_rec_base_t; /* use this for casts */
283typedef xfs_bmbt_rec_t xfs_bmdr_rec_t;
284
285typedef struct xfs_bmbt_rec_host {
286 __uint64_t l0, l1;
287} xfs_bmbt_rec_host_t;
288
289/*
290 * Values and macros for delayed-allocation startblock fields.
291 */
292#define STARTBLOCKVALBITS 17
293#define STARTBLOCKMASKBITS (15 + XFS_BIG_BLKNOS * 20)
294#define DSTARTBLOCKMASKBITS (15 + 20)
295#define STARTBLOCKMASK \
296 (((((xfs_fsblock_t)1) << STARTBLOCKMASKBITS) - 1) << STARTBLOCKVALBITS)
297#define DSTARTBLOCKMASK \
298 (((((xfs_dfsbno_t)1) << DSTARTBLOCKMASKBITS) - 1) << STARTBLOCKVALBITS)
299
300static inline int isnullstartblock(xfs_fsblock_t x)
301{
302 return ((x) & STARTBLOCKMASK) == STARTBLOCKMASK;
303}
304
305static inline int isnulldstartblock(xfs_dfsbno_t x)
306{
307 return ((x) & DSTARTBLOCKMASK) == DSTARTBLOCKMASK;
308}
309
310static inline xfs_fsblock_t nullstartblock(int k)
311{
312 ASSERT(k < (1 << STARTBLOCKVALBITS));
313 return STARTBLOCKMASK | (k);
314}
315
316static inline xfs_filblks_t startblockval(xfs_fsblock_t x)
317{
318 return (xfs_filblks_t)((x) & ~STARTBLOCKMASK);
319}
320
321/*
322 * Possible extent formats.
323 */
324typedef enum {
325 XFS_EXTFMT_NOSTATE = 0,
326 XFS_EXTFMT_HASSTATE
327} xfs_exntfmt_t;
328
329/*
330 * Possible extent states.
331 */
332typedef enum {
333 XFS_EXT_NORM, XFS_EXT_UNWRITTEN,
334 XFS_EXT_DMAPI_OFFLINE, XFS_EXT_INVALID
335} xfs_exntst_t;
336
337/*
338 * Incore version of above.
339 */
340typedef struct xfs_bmbt_irec
341{
342 xfs_fileoff_t br_startoff; /* starting file offset */
343 xfs_fsblock_t br_startblock; /* starting block number */
344 xfs_filblks_t br_blockcount; /* number of blocks */
345 xfs_exntst_t br_state; /* extent state */
346} xfs_bmbt_irec_t;
347
348/*
349 * Key structure for non-leaf levels of the tree.
350 */
351typedef struct xfs_bmbt_key {
352 __be64 br_startoff; /* starting file offset */
353} xfs_bmbt_key_t, xfs_bmdr_key_t;
354
355/* btree pointer type */
356typedef __be64 xfs_bmbt_ptr_t, xfs_bmdr_ptr_t;
357
358
359/*
360 * Generic Btree block format definitions
361 *
362 * This is a combination of the actual format used on disk for short and long
363 * format btrees. The first three fields are shared by both format, but the
364 * pointers are different and should be used with care.
365 *
366 * To get the size of the actual short or long form headers please use the size
367 * macros below. Never use sizeof(xfs_btree_block).
368 *
369 * The blkno, crc, lsn, owner and uuid fields are only available in filesystems
370 * with the crc feature bit, and all accesses to them must be conditional on
371 * that flag.
372 */
373struct xfs_btree_block {
374 __be32 bb_magic; /* magic number for block type */
375 __be16 bb_level; /* 0 is a leaf */
376 __be16 bb_numrecs; /* current # of data records */
377 union {
378 struct {
379 __be32 bb_leftsib;
380 __be32 bb_rightsib;
381
382 __be64 bb_blkno;
383 __be64 bb_lsn;
384 uuid_t bb_uuid;
385 __be32 bb_owner;
386 __le32 bb_crc;
387 } s; /* short form pointers */
388 struct {
389 __be64 bb_leftsib;
390 __be64 bb_rightsib;
391
392 __be64 bb_blkno;
393 __be64 bb_lsn;
394 uuid_t bb_uuid;
395 __be64 bb_owner;
396 __le32 bb_crc;
397 __be32 bb_pad; /* padding for alignment */
398 } l; /* long form pointers */
399 } bb_u; /* rest */
400};
401
402#define XFS_BTREE_SBLOCK_LEN 16 /* size of a short form block */
403#define XFS_BTREE_LBLOCK_LEN 24 /* size of a long form block */
404
405/* sizes of CRC enabled btree blocks */
406#define XFS_BTREE_SBLOCK_CRC_LEN (XFS_BTREE_SBLOCK_LEN + 40)
407#define XFS_BTREE_LBLOCK_CRC_LEN (XFS_BTREE_LBLOCK_LEN + 48)
408
409#define XFS_BTREE_SBLOCK_CRC_OFF \
410 offsetof(struct xfs_btree_block, bb_u.s.bb_crc)
411#define XFS_BTREE_LBLOCK_CRC_OFF \
412 offsetof(struct xfs_btree_block, bb_u.l.bb_crc)
413
159#endif /* __XFS_FORMAT_H__ */ 414#endif /* __XFS_FORMAT_H__ */
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c
index ceaec3165921..a6e54b3319bd 100644
--- a/fs/xfs/xfs_fsops.c
+++ b/fs/xfs/xfs_fsops.c
@@ -18,30 +18,28 @@
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_fs.h" 19#include "xfs_fs.h"
20#include "xfs_shared.h" 20#include "xfs_shared.h"
21#include "xfs_log_format.h"
22#include "xfs_format.h" 21#include "xfs_format.h"
22#include "xfs_log_format.h"
23#include "xfs_trans_resv.h" 23#include "xfs_trans_resv.h"
24#include "xfs_sb.h" 24#include "xfs_sb.h"
25#include "xfs_ag.h" 25#include "xfs_ag.h"
26#include "xfs_mount.h" 26#include "xfs_mount.h"
27#include "xfs_bmap_btree.h"
28#include "xfs_alloc_btree.h"
29#include "xfs_ialloc_btree.h"
30#include "xfs_dinode.h"
31#include "xfs_inode.h" 27#include "xfs_inode.h"
32#include "xfs_trans.h" 28#include "xfs_trans.h"
33#include "xfs_inode_item.h" 29#include "xfs_inode_item.h"
34#include "xfs_btree.h"
35#include "xfs_error.h" 30#include "xfs_error.h"
31#include "xfs_btree.h"
32#include "xfs_alloc_btree.h"
36#include "xfs_alloc.h" 33#include "xfs_alloc.h"
37#include "xfs_ialloc.h" 34#include "xfs_ialloc.h"
38#include "xfs_fsops.h" 35#include "xfs_fsops.h"
39#include "xfs_itable.h" 36#include "xfs_itable.h"
40#include "xfs_trans_space.h" 37#include "xfs_trans_space.h"
41#include "xfs_rtalloc.h" 38#include "xfs_rtalloc.h"
42#include "xfs_filestream.h"
43#include "xfs_trace.h" 39#include "xfs_trace.h"
44#include "xfs_log.h" 40#include "xfs_log.h"
41#include "xfs_dinode.h"
42#include "xfs_filestream.h"
45 43
46/* 44/*
47 * File system operations 45 * File system operations
diff --git a/fs/xfs/xfs_ialloc.c b/fs/xfs/xfs_ialloc.c
index c973ff8c4a7c..14d732f61a41 100644
--- a/fs/xfs/xfs_ialloc.c
+++ b/fs/xfs/xfs_ialloc.c
@@ -26,13 +26,10 @@
26#include "xfs_sb.h" 26#include "xfs_sb.h"
27#include "xfs_ag.h" 27#include "xfs_ag.h"
28#include "xfs_mount.h" 28#include "xfs_mount.h"
29#include "xfs_bmap_btree.h"
30#include "xfs_alloc_btree.h"
31#include "xfs_ialloc_btree.h"
32#include "xfs_dinode.h"
33#include "xfs_inode.h" 29#include "xfs_inode.h"
34#include "xfs_btree.h" 30#include "xfs_btree.h"
35#include "xfs_ialloc.h" 31#include "xfs_ialloc.h"
32#include "xfs_ialloc_btree.h"
36#include "xfs_alloc.h" 33#include "xfs_alloc.h"
37#include "xfs_rtalloc.h" 34#include "xfs_rtalloc.h"
38#include "xfs_error.h" 35#include "xfs_error.h"
@@ -42,6 +39,7 @@
42#include "xfs_buf_item.h" 39#include "xfs_buf_item.h"
43#include "xfs_icreate_item.h" 40#include "xfs_icreate_item.h"
44#include "xfs_icache.h" 41#include "xfs_icache.h"
42#include "xfs_dinode.h"
45 43
46 44
47/* 45/*
diff --git a/fs/xfs/xfs_ialloc.h b/fs/xfs/xfs_ialloc.h
index 155779803d67..a8f76a5ff418 100644
--- a/fs/xfs/xfs_ialloc.h
+++ b/fs/xfs/xfs_ialloc.h
@@ -23,6 +23,7 @@ struct xfs_dinode;
23struct xfs_imap; 23struct xfs_imap;
24struct xfs_mount; 24struct xfs_mount;
25struct xfs_trans; 25struct xfs_trans;
26struct xfs_btree_cur;
26 27
27/* 28/*
28 * Allocation parameters for inode allocation. 29 * Allocation parameters for inode allocation.
@@ -42,7 +43,7 @@ struct xfs_trans;
42static inline struct xfs_dinode * 43static inline struct xfs_dinode *
43xfs_make_iptr(struct xfs_mount *mp, struct xfs_buf *b, int o) 44xfs_make_iptr(struct xfs_mount *mp, struct xfs_buf *b, int o)
44{ 45{
45 return (xfs_dinode_t *) 46 return (struct xfs_dinode *)
46 (xfs_buf_offset(b, o << (mp)->m_sb.sb_inodelog)); 47 (xfs_buf_offset(b, o << (mp)->m_sb.sb_inodelog));
47} 48}
48 49
diff --git a/fs/xfs/xfs_ialloc_btree.c b/fs/xfs/xfs_ialloc_btree.c
index 2a0b6158e4c4..1fa142dc86cb 100644
--- a/fs/xfs/xfs_ialloc_btree.c
+++ b/fs/xfs/xfs_ialloc_btree.c
@@ -17,19 +17,17 @@
17 */ 17 */
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_fs.h" 19#include "xfs_fs.h"
20#include "xfs_format.h"
20#include "xfs_log_format.h" 21#include "xfs_log_format.h"
21#include "xfs_trans_resv.h" 22#include "xfs_trans_resv.h"
22#include "xfs_bit.h" 23#include "xfs_bit.h"
23#include "xfs_sb.h" 24#include "xfs_sb.h"
24#include "xfs_ag.h" 25#include "xfs_ag.h"
25#include "xfs_mount.h" 26#include "xfs_mount.h"
26#include "xfs_bmap_btree.h"
27#include "xfs_alloc_btree.h"
28#include "xfs_ialloc_btree.h"
29#include "xfs_dinode.h"
30#include "xfs_inode.h" 27#include "xfs_inode.h"
31#include "xfs_btree.h" 28#include "xfs_btree.h"
32#include "xfs_ialloc.h" 29#include "xfs_ialloc.h"
30#include "xfs_ialloc_btree.h"
33#include "xfs_alloc.h" 31#include "xfs_alloc.h"
34#include "xfs_error.h" 32#include "xfs_error.h"
35#include "xfs_trace.h" 33#include "xfs_trace.h"
diff --git a/fs/xfs/xfs_ialloc_btree.h b/fs/xfs/xfs_ialloc_btree.h
index cfbfe461abbc..f38b22011c4e 100644
--- a/fs/xfs/xfs_ialloc_btree.h
+++ b/fs/xfs/xfs_ialloc_btree.h
@@ -27,55 +27,6 @@ struct xfs_btree_cur;
27struct xfs_mount; 27struct xfs_mount;
28 28
29/* 29/*
30 * There is a btree for the inode map per allocation group.
31 */
32#define XFS_IBT_MAGIC 0x49414254 /* 'IABT' */
33#define XFS_IBT_CRC_MAGIC 0x49414233 /* 'IAB3' */
34
35typedef __uint64_t xfs_inofree_t;
36#define XFS_INODES_PER_CHUNK (NBBY * sizeof(xfs_inofree_t))
37#define XFS_INODES_PER_CHUNK_LOG (XFS_NBBYLOG + 3)
38#define XFS_INOBT_ALL_FREE ((xfs_inofree_t)-1)
39#define XFS_INOBT_MASK(i) ((xfs_inofree_t)1 << (i))
40
41static inline xfs_inofree_t xfs_inobt_maskn(int i, int n)
42{
43 return ((n >= XFS_INODES_PER_CHUNK ? 0 : XFS_INOBT_MASK(n)) - 1) << i;
44}
45
46/*
47 * Data record structure
48 */
49typedef struct xfs_inobt_rec {
50 __be32 ir_startino; /* starting inode number */
51 __be32 ir_freecount; /* count of free inodes (set bits) */
52 __be64 ir_free; /* free inode mask */
53} xfs_inobt_rec_t;
54
55typedef struct xfs_inobt_rec_incore {
56 xfs_agino_t ir_startino; /* starting inode number */
57 __int32_t ir_freecount; /* count of free inodes (set bits) */
58 xfs_inofree_t ir_free; /* free inode mask */
59} xfs_inobt_rec_incore_t;
60
61
62/*
63 * Key structure
64 */
65typedef struct xfs_inobt_key {
66 __be32 ir_startino; /* starting inode number */
67} xfs_inobt_key_t;
68
69/* btree pointer type */
70typedef __be32 xfs_inobt_ptr_t;
71
72/*
73 * block numbers in the AG.
74 */
75#define XFS_IBT_BLOCK(mp) ((xfs_agblock_t)(XFS_CNT_BLOCK(mp) + 1))
76#define XFS_PREALLOC_BLOCKS(mp) ((xfs_agblock_t)(XFS_IBT_BLOCK(mp) + 1))
77
78/*
79 * Btree block header size depends on a superblock flag. 30 * Btree block header size depends on a superblock flag.
80 */ 31 */
81#define XFS_INOBT_BLOCK_LEN(mp) \ 32#define XFS_INOBT_BLOCK_LEN(mp) \
diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index 6db11556731d..98d35244eecc 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -24,17 +24,13 @@
24#include "xfs_sb.h" 24#include "xfs_sb.h"
25#include "xfs_ag.h" 25#include "xfs_ag.h"
26#include "xfs_mount.h" 26#include "xfs_mount.h"
27#include "xfs_bmap_btree.h"
28#include "xfs_inode.h" 27#include "xfs_inode.h"
29#include "xfs_dinode.h"
30#include "xfs_error.h" 28#include "xfs_error.h"
31#include "xfs_filestream.h"
32#include "xfs_trans.h" 29#include "xfs_trans.h"
33#include "xfs_trans_priv.h" 30#include "xfs_trans_priv.h"
34#include "xfs_inode_item.h" 31#include "xfs_inode_item.h"
35#include "xfs_quota.h" 32#include "xfs_quota.h"
36#include "xfs_trace.h" 33#include "xfs_trace.h"
37#include "xfs_fsops.h"
38#include "xfs_icache.h" 34#include "xfs_icache.h"
39#include "xfs_bmap_util.h" 35#include "xfs_bmap_util.h"
40 36
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index f0440dcb5d8c..326b94dbe159 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -27,27 +27,22 @@
27#include "xfs_sb.h" 27#include "xfs_sb.h"
28#include "xfs_ag.h" 28#include "xfs_ag.h"
29#include "xfs_mount.h" 29#include "xfs_mount.h"
30#include "xfs_inode.h"
30#include "xfs_da_format.h" 31#include "xfs_da_format.h"
31#include "xfs_da_btree.h" 32#include "xfs_da_btree.h"
32#include "xfs_dir2.h" 33#include "xfs_dir2.h"
33#include "xfs_bmap_btree.h"
34#include "xfs_alloc_btree.h"
35#include "xfs_ialloc_btree.h"
36#include "xfs_attr_sf.h" 34#include "xfs_attr_sf.h"
37#include "xfs_attr.h" 35#include "xfs_attr.h"
38#include "xfs_dinode.h"
39#include "xfs_inode.h"
40#include "xfs_trans_space.h" 36#include "xfs_trans_space.h"
41#include "xfs_trans.h" 37#include "xfs_trans.h"
42#include "xfs_buf_item.h" 38#include "xfs_buf_item.h"
43#include "xfs_inode_item.h" 39#include "xfs_inode_item.h"
44#include "xfs_btree.h"
45#include "xfs_alloc.h"
46#include "xfs_ialloc.h" 40#include "xfs_ialloc.h"
47#include "xfs_bmap.h" 41#include "xfs_bmap.h"
48#include "xfs_bmap_util.h" 42#include "xfs_bmap_util.h"
49#include "xfs_error.h" 43#include "xfs_error.h"
50#include "xfs_quota.h" 44#include "xfs_quota.h"
45#include "xfs_dinode.h"
51#include "xfs_filestream.h" 46#include "xfs_filestream.h"
52#include "xfs_cksum.h" 47#include "xfs_cksum.h"
53#include "xfs_trace.h" 48#include "xfs_trace.h"
@@ -55,6 +50,7 @@
55#include "xfs_symlink.h" 50#include "xfs_symlink.h"
56#include "xfs_trans_priv.h" 51#include "xfs_trans_priv.h"
57#include "xfs_log.h" 52#include "xfs_log.h"
53#include "xfs_bmap_btree.h"
58 54
59kmem_zone_t *xfs_inode_zone; 55kmem_zone_t *xfs_inode_zone;
60 56
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index cce62ce1a73a..66675877f38c 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -24,7 +24,6 @@
24/* 24/*
25 * Kernel only inode definitions 25 * Kernel only inode definitions
26 */ 26 */
27
28struct xfs_dinode; 27struct xfs_dinode;
29struct xfs_inode; 28struct xfs_inode;
30struct xfs_buf; 29struct xfs_buf;
diff --git a/fs/xfs/xfs_inode_buf.c b/fs/xfs/xfs_inode_buf.c
index c0f974b6cd46..4fc9f39dd89e 100644
--- a/fs/xfs/xfs_inode_buf.c
+++ b/fs/xfs/xfs_inode_buf.c
@@ -24,15 +24,13 @@
24#include "xfs_sb.h" 24#include "xfs_sb.h"
25#include "xfs_ag.h" 25#include "xfs_ag.h"
26#include "xfs_mount.h" 26#include "xfs_mount.h"
27#include "xfs_bmap_btree.h"
28#include "xfs_ialloc_btree.h"
29#include "xfs_dinode.h"
30#include "xfs_inode.h" 27#include "xfs_inode.h"
31#include "xfs_error.h" 28#include "xfs_error.h"
32#include "xfs_cksum.h" 29#include "xfs_cksum.h"
33#include "xfs_icache.h" 30#include "xfs_icache.h"
34#include "xfs_ialloc.h"
35#include "xfs_trans.h" 31#include "xfs_trans.h"
32#include "xfs_ialloc.h"
33#include "xfs_dinode.h"
36 34
37/* 35/*
38 * Check that none of the inode's in the buffer have a next 36 * Check that none of the inode's in the buffer have a next
diff --git a/fs/xfs/xfs_inode_fork.c b/fs/xfs/xfs_inode_fork.c
index b89b58a3a350..22c9837c5d4b 100644
--- a/fs/xfs/xfs_inode_fork.c
+++ b/fs/xfs/xfs_inode_fork.c
@@ -26,25 +26,15 @@
26#include "xfs_sb.h" 26#include "xfs_sb.h"
27#include "xfs_ag.h" 27#include "xfs_ag.h"
28#include "xfs_mount.h" 28#include "xfs_mount.h"
29#include "xfs_bmap_btree.h"
30#include "xfs_alloc_btree.h"
31#include "xfs_ialloc_btree.h"
32#include "xfs_attr_sf.h"
33#include "xfs_dinode.h"
34#include "xfs_inode.h" 29#include "xfs_inode.h"
35#include "xfs_trans.h" 30#include "xfs_trans.h"
36#include "xfs_buf_item.h"
37#include "xfs_inode_item.h" 31#include "xfs_inode_item.h"
38#include "xfs_btree.h" 32#include "xfs_bmap_btree.h"
39#include "xfs_alloc.h"
40#include "xfs_ialloc.h"
41#include "xfs_bmap.h" 33#include "xfs_bmap.h"
42#include "xfs_error.h" 34#include "xfs_error.h"
43#include "xfs_quota.h"
44#include "xfs_filestream.h"
45#include "xfs_cksum.h"
46#include "xfs_trace.h" 35#include "xfs_trace.h"
47#include "xfs_icache.h" 36#include "xfs_attr_sf.h"
37#include "xfs_dinode.h"
48 38
49kmem_zone_t *xfs_ifork_zone; 39kmem_zone_t *xfs_ifork_zone;
50 40
diff --git a/fs/xfs/xfs_inode_fork.h b/fs/xfs/xfs_inode_fork.h
index 28661a0d9058..eb329a1ea888 100644
--- a/fs/xfs/xfs_inode_fork.h
+++ b/fs/xfs/xfs_inode_fork.h
@@ -19,6 +19,7 @@
19#define __XFS_INODE_FORK_H__ 19#define __XFS_INODE_FORK_H__
20 20
21struct xfs_inode_log_item; 21struct xfs_inode_log_item;
22struct xfs_dinode;
22 23
23/* 24/*
24 * The following xfs_ext_irec_t struct introduces a second (top) level 25 * The following xfs_ext_irec_t struct introduces a second (top) level
diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c
index 9f8e85ef2681..7c0d391f9a6e 100644
--- a/fs/xfs/xfs_inode_item.c
+++ b/fs/xfs/xfs_inode_item.c
@@ -17,19 +17,19 @@
17 */ 17 */
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_fs.h" 19#include "xfs_fs.h"
20#include "xfs_format.h"
20#include "xfs_log_format.h" 21#include "xfs_log_format.h"
21#include "xfs_trans_resv.h" 22#include "xfs_trans_resv.h"
22#include "xfs_sb.h" 23#include "xfs_sb.h"
23#include "xfs_ag.h" 24#include "xfs_ag.h"
24#include "xfs_mount.h" 25#include "xfs_mount.h"
25#include "xfs_bmap_btree.h"
26#include "xfs_dinode.h"
27#include "xfs_inode.h" 26#include "xfs_inode.h"
28#include "xfs_trans.h" 27#include "xfs_trans.h"
29#include "xfs_inode_item.h" 28#include "xfs_inode_item.h"
30#include "xfs_error.h" 29#include "xfs_error.h"
31#include "xfs_trace.h" 30#include "xfs_trace.h"
32#include "xfs_trans_priv.h" 31#include "xfs_trans_priv.h"
32#include "xfs_dinode.h"
33 33
34 34
35kmem_zone_t *xfs_ili_zone; /* inode log item zone */ 35kmem_zone_t *xfs_ili_zone; /* inode log item zone */
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
index ea65a73d49ba..4d613401a5e0 100644
--- a/fs/xfs/xfs_ioctl.c
+++ b/fs/xfs/xfs_ioctl.c
@@ -23,28 +23,25 @@
23#include "xfs_trans_resv.h" 23#include "xfs_trans_resv.h"
24#include "xfs_sb.h" 24#include "xfs_sb.h"
25#include "xfs_ag.h" 25#include "xfs_ag.h"
26#include "xfs_alloc.h"
27#include "xfs_mount.h" 26#include "xfs_mount.h"
28#include "xfs_bmap_btree.h"
29#include "xfs_dinode.h"
30#include "xfs_inode.h" 27#include "xfs_inode.h"
31#include "xfs_ioctl.h" 28#include "xfs_ioctl.h"
29#include "xfs_alloc.h"
32#include "xfs_rtalloc.h" 30#include "xfs_rtalloc.h"
33#include "xfs_itable.h" 31#include "xfs_itable.h"
34#include "xfs_error.h" 32#include "xfs_error.h"
35#include "xfs_attr.h" 33#include "xfs_attr.h"
36#include "xfs_bmap.h" 34#include "xfs_bmap.h"
37#include "xfs_bmap_util.h" 35#include "xfs_bmap_util.h"
38#include "xfs_trans.h"
39#include "xfs_buf_item.h"
40#include "xfs_fsops.h" 36#include "xfs_fsops.h"
41#include "xfs_discard.h" 37#include "xfs_discard.h"
42#include "xfs_quota.h" 38#include "xfs_quota.h"
43#include "xfs_inode_item.h"
44#include "xfs_export.h" 39#include "xfs_export.h"
45#include "xfs_trace.h" 40#include "xfs_trace.h"
46#include "xfs_icache.h" 41#include "xfs_icache.h"
47#include "xfs_symlink.h" 42#include "xfs_symlink.h"
43#include "xfs_dinode.h"
44#include "xfs_trans.h"
48 45
49#include <linux/capability.h> 46#include <linux/capability.h>
50#include <linux/dcache.h> 47#include <linux/dcache.h>
diff --git a/fs/xfs/xfs_ioctl32.c b/fs/xfs/xfs_ioctl32.c
index 1be3333b260c..e8fb1231db81 100644
--- a/fs/xfs/xfs_ioctl32.c
+++ b/fs/xfs/xfs_ioctl32.c
@@ -22,14 +22,13 @@
22#include <asm/uaccess.h> 22#include <asm/uaccess.h>
23#include "xfs.h" 23#include "xfs.h"
24#include "xfs_fs.h" 24#include "xfs_fs.h"
25#include "xfs_format.h"
25#include "xfs_log_format.h" 26#include "xfs_log_format.h"
26#include "xfs_trans_resv.h" 27#include "xfs_trans_resv.h"
27#include "xfs_sb.h" 28#include "xfs_sb.h"
28#include "xfs_ag.h" 29#include "xfs_ag.h"
29#include "xfs_mount.h" 30#include "xfs_mount.h"
30#include "xfs_bmap_btree.h"
31#include "xfs_vnode.h" 31#include "xfs_vnode.h"
32#include "xfs_dinode.h"
33#include "xfs_inode.h" 32#include "xfs_inode.h"
34#include "xfs_itable.h" 33#include "xfs_itable.h"
35#include "xfs_error.h" 34#include "xfs_error.h"
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index adadf80709b8..22d1cbea283d 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -24,29 +24,21 @@
24#include "xfs_sb.h" 24#include "xfs_sb.h"
25#include "xfs_ag.h" 25#include "xfs_ag.h"
26#include "xfs_mount.h" 26#include "xfs_mount.h"
27#include "xfs_bmap_btree.h"
28#include "xfs_alloc_btree.h"
29#include "xfs_ialloc_btree.h"
30#include "xfs_dinode.h"
31#include "xfs_inode.h" 27#include "xfs_inode.h"
32#include "xfs_trans.h"
33#include "xfs_inode_item.h"
34#include "xfs_alloc.h"
35#include "xfs_quota.h"
36#include "xfs_btree.h" 28#include "xfs_btree.h"
29#include "xfs_bmap_btree.h"
37#include "xfs_bmap.h" 30#include "xfs_bmap.h"
38#include "xfs_bmap_util.h" 31#include "xfs_bmap_util.h"
39#include "xfs_rtalloc.h"
40#include "xfs_error.h" 32#include "xfs_error.h"
41#include "xfs_itable.h" 33#include "xfs_trans.h"
42#include "xfs_attr.h"
43#include "xfs_buf_item.h"
44#include "xfs_trans_space.h" 34#include "xfs_trans_space.h"
45#include "xfs_iomap.h" 35#include "xfs_iomap.h"
46#include "xfs_trace.h" 36#include "xfs_trace.h"
47#include "xfs_icache.h" 37#include "xfs_icache.h"
38#include "xfs_quota.h"
48#include "xfs_dquot_item.h" 39#include "xfs_dquot_item.h"
49#include "xfs_dquot.h" 40#include "xfs_dquot.h"
41#include "xfs_dinode.h"
50 42
51 43
52#define XFS_WRITEIO_ALIGN(mp,off) (((off) >> mp->m_writeio_log) \ 44#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 3f2ae19c8ca0..718b62b0fe05 100644
--- a/fs/xfs/xfs_iops.c
+++ b/fs/xfs/xfs_iops.c
@@ -25,26 +25,20 @@
25#include "xfs_ag.h" 25#include "xfs_ag.h"
26#include "xfs_mount.h" 26#include "xfs_mount.h"
27#include "xfs_da_format.h" 27#include "xfs_da_format.h"
28#include "xfs_bmap_btree.h"
29#include "xfs_dinode.h"
30#include "xfs_inode.h" 28#include "xfs_inode.h"
31#include "xfs_bmap.h" 29#include "xfs_bmap.h"
32#include "xfs_bmap_util.h" 30#include "xfs_bmap_util.h"
33#include "xfs_acl.h" 31#include "xfs_acl.h"
34#include "xfs_alloc.h"
35#include "xfs_quota.h" 32#include "xfs_quota.h"
36#include "xfs_rtalloc.h"
37#include "xfs_error.h" 33#include "xfs_error.h"
38#include "xfs_itable.h"
39#include "xfs_attr.h" 34#include "xfs_attr.h"
40#include "xfs_trans.h" 35#include "xfs_trans.h"
41#include "xfs_buf_item.h"
42#include "xfs_inode_item.h"
43#include "xfs_trace.h" 36#include "xfs_trace.h"
44#include "xfs_icache.h" 37#include "xfs_icache.h"
45#include "xfs_symlink.h" 38#include "xfs_symlink.h"
46#include "xfs_da_btree.h" 39#include "xfs_da_btree.h"
47#include "xfs_dir2_priv.h" 40#include "xfs_dir2_priv.h"
41#include "xfs_dinode.h"
48 42
49#include <linux/capability.h> 43#include <linux/capability.h>
50#include <linux/xattr.h> 44#include <linux/xattr.h>
diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c
index 964b1caae085..c237ad15d500 100644
--- a/fs/xfs/xfs_itable.c
+++ b/fs/xfs/xfs_itable.c
@@ -18,23 +18,22 @@
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_fs.h" 19#include "xfs_fs.h"
20#include "xfs_shared.h" 20#include "xfs_shared.h"
21#include "xfs_format.h"
21#include "xfs_log_format.h" 22#include "xfs_log_format.h"
22#include "xfs_trans_resv.h" 23#include "xfs_trans_resv.h"
23#include "xfs_inum.h" 24#include "xfs_inum.h"
24#include "xfs_sb.h" 25#include "xfs_sb.h"
25#include "xfs_ag.h" 26#include "xfs_ag.h"
26#include "xfs_mount.h" 27#include "xfs_mount.h"
27#include "xfs_bmap_btree.h"
28#include "xfs_alloc_btree.h"
29#include "xfs_ialloc_btree.h"
30#include "xfs_dinode.h"
31#include "xfs_inode.h" 28#include "xfs_inode.h"
29#include "xfs_btree.h"
32#include "xfs_ialloc.h" 30#include "xfs_ialloc.h"
31#include "xfs_ialloc_btree.h"
33#include "xfs_itable.h" 32#include "xfs_itable.h"
34#include "xfs_error.h" 33#include "xfs_error.h"
35#include "xfs_btree.h"
36#include "xfs_trace.h" 34#include "xfs_trace.h"
37#include "xfs_icache.h" 35#include "xfs_icache.h"
36#include "xfs_dinode.h"
38 37
39STATIC int 38STATIC int
40xfs_internal_inum( 39xfs_internal_inum(
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 5275ad886971..e523396753c5 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -18,6 +18,7 @@
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_fs.h" 19#include "xfs_fs.h"
20#include "xfs_shared.h" 20#include "xfs_shared.h"
21#include "xfs_format.h"
21#include "xfs_log_format.h" 22#include "xfs_log_format.h"
22#include "xfs_trans_resv.h" 23#include "xfs_trans_resv.h"
23#include "xfs_sb.h" 24#include "xfs_sb.h"
@@ -28,12 +29,7 @@
28#include "xfs_trans_priv.h" 29#include "xfs_trans_priv.h"
29#include "xfs_log.h" 30#include "xfs_log.h"
30#include "xfs_log_priv.h" 31#include "xfs_log_priv.h"
31#include "xfs_buf_item.h"
32#include "xfs_bmap_btree.h"
33#include "xfs_alloc_btree.h"
34#include "xfs_ialloc_btree.h"
35#include "xfs_log_recover.h" 32#include "xfs_log_recover.h"
36#include "xfs_dinode.h"
37#include "xfs_inode.h" 33#include "xfs_inode.h"
38#include "xfs_trace.h" 34#include "xfs_trace.h"
39#include "xfs_fsops.h" 35#include "xfs_fsops.h"
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 832ba5d5eb3a..b6b669df40f3 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -27,29 +27,23 @@
27#include "xfs_ag.h" 27#include "xfs_ag.h"
28#include "xfs_mount.h" 28#include "xfs_mount.h"
29#include "xfs_da_format.h" 29#include "xfs_da_format.h"
30#include "xfs_error.h"
31#include "xfs_bmap_btree.h"
32#include "xfs_alloc_btree.h"
33#include "xfs_ialloc_btree.h"
34#include "xfs_btree.h"
35#include "xfs_dinode.h"
36#include "xfs_inode.h" 30#include "xfs_inode.h"
37#include "xfs_trans.h" 31#include "xfs_trans.h"
38#include "xfs_inode_item.h"
39#include "xfs_alloc.h"
40#include "xfs_ialloc.h"
41#include "xfs_log.h" 32#include "xfs_log.h"
42#include "xfs_log_priv.h" 33#include "xfs_log_priv.h"
43#include "xfs_log_recover.h" 34#include "xfs_log_recover.h"
35#include "xfs_inode_item.h"
44#include "xfs_extfree_item.h" 36#include "xfs_extfree_item.h"
45#include "xfs_trans_priv.h" 37#include "xfs_trans_priv.h"
38#include "xfs_alloc.h"
39#include "xfs_ialloc.h"
46#include "xfs_quota.h" 40#include "xfs_quota.h"
47#include "xfs_cksum.h" 41#include "xfs_cksum.h"
48#include "xfs_trace.h" 42#include "xfs_trace.h"
49#include "xfs_icache.h" 43#include "xfs_icache.h"
50 44#include "xfs_bmap_btree.h"
51/* Need all the magic numbers and buffer ops structures from these headers */ 45#include "xfs_dinode.h"
52#include "xfs_da_btree.h" 46#include "xfs_error.h"
53#include "xfs_dir2.h" 47#include "xfs_dir2.h"
54 48
55#define BLK_AVG(blk1, blk2) ((blk1+blk2) >> 1) 49#define BLK_AVG(blk1, blk2) ((blk1+blk2) >> 1)
diff --git a/fs/xfs/xfs_log_rlimit.c b/fs/xfs/xfs_log_rlimit.c
index 3749bc1c00a4..2af1a0a4d0f1 100644
--- a/fs/xfs/xfs_log_rlimit.c
+++ b/fs/xfs/xfs_log_rlimit.c
@@ -18,6 +18,7 @@
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_fs.h" 19#include "xfs_fs.h"
20#include "xfs_shared.h" 20#include "xfs_shared.h"
21#include "xfs_format.h"
21#include "xfs_log_format.h" 22#include "xfs_log_format.h"
22#include "xfs_trans_resv.h" 23#include "xfs_trans_resv.h"
23#include "xfs_ag.h" 24#include "xfs_ag.h"
@@ -25,10 +26,10 @@
25#include "xfs_mount.h" 26#include "xfs_mount.h"
26#include "xfs_da_format.h" 27#include "xfs_da_format.h"
27#include "xfs_trans_space.h" 28#include "xfs_trans_space.h"
28#include "xfs_bmap_btree.h"
29#include "xfs_inode.h" 29#include "xfs_inode.h"
30#include "xfs_da_btree.h" 30#include "xfs_da_btree.h"
31#include "xfs_attr_leaf.h" 31#include "xfs_attr_leaf.h"
32#include "xfs_bmap_btree.h"
32 33
33/* 34/*
34 * Calculate the maximum length in bytes that would be required for a local 35 * Calculate the maximum length in bytes that would be required for a local
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index 83f7810c53cd..da88f167af78 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -27,27 +27,20 @@
27#include "xfs_ag.h" 27#include "xfs_ag.h"
28#include "xfs_mount.h" 28#include "xfs_mount.h"
29#include "xfs_da_format.h" 29#include "xfs_da_format.h"
30#include "xfs_trans.h"
31#include "xfs_trans_priv.h"
32#include "xfs_log.h"
33#include "xfs_dir2.h"
34#include "xfs_bmap_btree.h"
35#include "xfs_alloc_btree.h"
36#include "xfs_ialloc_btree.h"
37#include "xfs_dinode.h"
38#include "xfs_inode.h" 30#include "xfs_inode.h"
39#include "xfs_btree.h" 31#include "xfs_dir2.h"
40#include "xfs_ialloc.h" 32#include "xfs_ialloc.h"
41#include "xfs_alloc.h" 33#include "xfs_alloc.h"
42#include "xfs_rtalloc.h" 34#include "xfs_rtalloc.h"
43#include "xfs_bmap.h" 35#include "xfs_bmap.h"
36#include "xfs_trans.h"
37#include "xfs_trans_priv.h"
38#include "xfs_log.h"
44#include "xfs_error.h" 39#include "xfs_error.h"
45#include "xfs_quota.h" 40#include "xfs_quota.h"
46#include "xfs_fsops.h" 41#include "xfs_fsops.h"
47#include "xfs_trace.h" 42#include "xfs_trace.h"
48#include "xfs_icache.h" 43#include "xfs_icache.h"
49#include "xfs_cksum.h"
50#include "xfs_buf_item.h"
51 44
52 45
53#ifdef HAVE_PERCPU_SB 46#ifdef HAVE_PERCPU_SB
diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
index e2f675644b4d..14a4996cfec6 100644
--- a/fs/xfs/xfs_qm.c
+++ b/fs/xfs/xfs_qm.c
@@ -17,33 +17,28 @@
17 */ 17 */
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_fs.h" 19#include "xfs_fs.h"
20#include "xfs_shared.h"
20#include "xfs_format.h" 21#include "xfs_format.h"
21#include "xfs_log_format.h" 22#include "xfs_log_format.h"
22#include "xfs_shared.h"
23#include "xfs_trans_resv.h" 23#include "xfs_trans_resv.h"
24#include "xfs_bit.h" 24#include "xfs_bit.h"
25#include "xfs_sb.h" 25#include "xfs_sb.h"
26#include "xfs_ag.h" 26#include "xfs_ag.h"
27#include "xfs_mount.h" 27#include "xfs_mount.h"
28#include "xfs_bmap_btree.h"
29#include "xfs_ialloc_btree.h"
30#include "xfs_dinode.h"
31#include "xfs_inode.h" 28#include "xfs_inode.h"
32#include "xfs_ialloc.h" 29#include "xfs_ialloc.h"
33#include "xfs_itable.h" 30#include "xfs_itable.h"
34#include "xfs_alloc.h"
35#include "xfs_rtalloc.h"
36#include "xfs_quota.h" 31#include "xfs_quota.h"
37#include "xfs_error.h" 32#include "xfs_error.h"
38#include "xfs_bmap.h" 33#include "xfs_bmap.h"
39#include "xfs_attr.h" 34#include "xfs_bmap_btree.h"
40#include "xfs_trans.h" 35#include "xfs_trans.h"
41#include "xfs_buf_item.h"
42#include "xfs_trans_space.h" 36#include "xfs_trans_space.h"
43#include "xfs_qm.h" 37#include "xfs_qm.h"
44#include "xfs_trace.h" 38#include "xfs_trace.h"
45#include "xfs_icache.h" 39#include "xfs_icache.h"
46#include "xfs_cksum.h" 40#include "xfs_cksum.h"
41#include "xfs_dinode.h"
47 42
48/* 43/*
49 * The global quota manager. There is only one of these for the entire 44 * The global quota manager. There is only one of these for the entire
diff --git a/fs/xfs/xfs_qm_bhv.c b/fs/xfs/xfs_qm_bhv.c
index 704628961159..e9be63abd8d2 100644
--- a/fs/xfs/xfs_qm_bhv.c
+++ b/fs/xfs/xfs_qm_bhv.c
@@ -22,18 +22,11 @@
22#include "xfs_trans_resv.h" 22#include "xfs_trans_resv.h"
23#include "xfs_sb.h" 23#include "xfs_sb.h"
24#include "xfs_ag.h" 24#include "xfs_ag.h"
25#include "xfs_alloc.h"
26#include "xfs_quota.h" 25#include "xfs_quota.h"
27#include "xfs_mount.h" 26#include "xfs_mount.h"
28#include "xfs_bmap_btree.h"
29#include "xfs_inode.h" 27#include "xfs_inode.h"
30#include "xfs_itable.h"
31#include "xfs_bmap.h"
32#include "xfs_rtalloc.h"
33#include "xfs_error.h" 28#include "xfs_error.h"
34#include "xfs_attr.h"
35#include "xfs_trans.h" 29#include "xfs_trans.h"
36#include "xfs_buf_item.h"
37#include "xfs_qm.h" 30#include "xfs_qm.h"
38 31
39 32
diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c
index ab2326aaaeda..437c9198031a 100644
--- a/fs/xfs/xfs_qm_syscalls.c
+++ b/fs/xfs/xfs_qm_syscalls.c
@@ -27,19 +27,11 @@
27#include "xfs_bit.h" 27#include "xfs_bit.h"
28#include "xfs_sb.h" 28#include "xfs_sb.h"
29#include "xfs_ag.h" 29#include "xfs_ag.h"
30#include "xfs_alloc.h"
31#include "xfs_quota.h"
32#include "xfs_mount.h" 30#include "xfs_mount.h"
33#include "xfs_bmap_btree.h"
34#include "xfs_inode.h" 31#include "xfs_inode.h"
35#include "xfs_trans.h" 32#include "xfs_trans.h"
36#include "xfs_inode_item.h"
37#include "xfs_itable.h"
38#include "xfs_bmap.h"
39#include "xfs_rtalloc.h"
40#include "xfs_error.h" 33#include "xfs_error.h"
41#include "xfs_attr.h" 34#include "xfs_quota.h"
42#include "xfs_buf_item.h"
43#include "xfs_qm.h" 35#include "xfs_qm.h"
44#include "xfs_trace.h" 36#include "xfs_trace.h"
45#include "xfs_icache.h" 37#include "xfs_icache.h"
diff --git a/fs/xfs/xfs_quotaops.c b/fs/xfs/xfs_quotaops.c
index 2dd467b0b475..af33cafe69b6 100644
--- a/fs/xfs/xfs_quotaops.c
+++ b/fs/xfs/xfs_quotaops.c
@@ -22,10 +22,9 @@
22#include "xfs_sb.h" 22#include "xfs_sb.h"
23#include "xfs_ag.h" 23#include "xfs_ag.h"
24#include "xfs_mount.h" 24#include "xfs_mount.h"
25#include "xfs_inode.h"
25#include "xfs_quota.h" 26#include "xfs_quota.h"
26#include "xfs_trans.h" 27#include "xfs_trans.h"
27#include "xfs_bmap_btree.h"
28#include "xfs_inode.h"
29#include "xfs_qm.h" 28#include "xfs_qm.h"
30#include <linux/quota.h> 29#include <linux/quota.h>
31 30
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
index 23c5ca24a02d..d5da15578185 100644
--- a/fs/xfs/xfs_rtalloc.c
+++ b/fs/xfs/xfs_rtalloc.c
@@ -25,21 +25,18 @@
25#include "xfs_sb.h" 25#include "xfs_sb.h"
26#include "xfs_ag.h" 26#include "xfs_ag.h"
27#include "xfs_mount.h" 27#include "xfs_mount.h"
28#include "xfs_bmap_btree.h"
29#include "xfs_dinode.h"
30#include "xfs_inode.h" 28#include "xfs_inode.h"
31#include "xfs_alloc.h"
32#include "xfs_bmap.h" 29#include "xfs_bmap.h"
33#include "xfs_bmap_util.h" 30#include "xfs_bmap_util.h"
34#include "xfs_rtalloc.h" 31#include "xfs_bmap_btree.h"
35#include "xfs_fsops.h" 32#include "xfs_alloc.h"
36#include "xfs_error.h" 33#include "xfs_error.h"
37#include "xfs_trans.h" 34#include "xfs_trans.h"
38#include "xfs_inode_item.h"
39#include "xfs_trans_space.h" 35#include "xfs_trans_space.h"
40#include "xfs_trace.h" 36#include "xfs_trace.h"
41#include "xfs_buf.h" 37#include "xfs_buf.h"
42#include "xfs_icache.h" 38#include "xfs_icache.h"
39#include "xfs_dinode.h"
43 40
44 41
45/* 42/*
diff --git a/fs/xfs/xfs_sb.c b/fs/xfs/xfs_sb.c
index 1b0a6420f1b8..05b5493d2baa 100644
--- a/fs/xfs/xfs_sb.c
+++ b/fs/xfs/xfs_sb.c
@@ -21,31 +21,21 @@
21#include "xfs_log_format.h" 21#include "xfs_log_format.h"
22#include "xfs_trans_resv.h" 22#include "xfs_trans_resv.h"
23#include "xfs_bit.h" 23#include "xfs_bit.h"
24#include "xfs_inum.h"
25#include "xfs_sb.h" 24#include "xfs_sb.h"
26#include "xfs_ag.h" 25#include "xfs_ag.h"
27#include "xfs_mount.h" 26#include "xfs_mount.h"
28#include "xfs_da_format.h"
29#include "xfs_da_btree.h"
30#include "xfs_dir2.h"
31#include "xfs_bmap_btree.h"
32#include "xfs_alloc_btree.h"
33#include "xfs_ialloc_btree.h"
34#include "xfs_dinode.h"
35#include "xfs_inode.h" 27#include "xfs_inode.h"
36#include "xfs_btree.h"
37#include "xfs_ialloc.h" 28#include "xfs_ialloc.h"
38#include "xfs_alloc.h" 29#include "xfs_alloc.h"
39#include "xfs_rtalloc.h"
40#include "xfs_bmap.h"
41#include "xfs_error.h" 30#include "xfs_error.h"
42#include "xfs_quota.h"
43#include "xfs_fsops.h"
44#include "xfs_trace.h" 31#include "xfs_trace.h"
45#include "xfs_cksum.h" 32#include "xfs_cksum.h"
46#include "xfs_trans.h" 33#include "xfs_trans.h"
47#include "xfs_trans_priv.h"
48#include "xfs_buf_item.h" 34#include "xfs_buf_item.h"
35#include "xfs_dinode.h"
36#include "xfs_bmap_btree.h"
37#include "xfs_alloc_btree.h"
38#include "xfs_ialloc_btree.h"
49 39
50/* 40/*
51 * Physical superblock buffer manipulations. Shared with libxfs in userspace. 41 * Physical superblock buffer manipulations. Shared with libxfs in userspace.
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 4e20b420ff72..4eb63ad87d7d 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -24,29 +24,18 @@
24#include "xfs_inum.h" 24#include "xfs_inum.h"
25#include "xfs_sb.h" 25#include "xfs_sb.h"
26#include "xfs_ag.h" 26#include "xfs_ag.h"
27#include "xfs_alloc.h"
28#include "xfs_quota.h"
29#include "xfs_mount.h" 27#include "xfs_mount.h"
30#include "xfs_da_format.h" 28#include "xfs_da_format.h"
31#include "xfs_bmap_btree.h"
32#include "xfs_alloc_btree.h"
33#include "xfs_ialloc_btree.h"
34#include "xfs_dinode.h"
35#include "xfs_inode.h" 29#include "xfs_inode.h"
36#include "xfs_btree.h" 30#include "xfs_btree.h"
37#include "xfs_ialloc.h"
38#include "xfs_bmap.h" 31#include "xfs_bmap.h"
39#include "xfs_rtalloc.h" 32#include "xfs_alloc.h"
40#include "xfs_error.h" 33#include "xfs_error.h"
41#include "xfs_itable.h"
42#include "xfs_fsops.h" 34#include "xfs_fsops.h"
43#include "xfs_attr.h"
44#include "xfs_trans.h" 35#include "xfs_trans.h"
45#include "xfs_buf_item.h" 36#include "xfs_buf_item.h"
46#include "xfs_log.h" 37#include "xfs_log.h"
47#include "xfs_log_priv.h" 38#include "xfs_log_priv.h"
48#include "xfs_trans_priv.h"
49#include "xfs_filestream.h"
50#include "xfs_da_btree.h" 39#include "xfs_da_btree.h"
51#include "xfs_dir2.h" 40#include "xfs_dir2.h"
52#include "xfs_extfree_item.h" 41#include "xfs_extfree_item.h"
@@ -55,6 +44,9 @@
55#include "xfs_icache.h" 44#include "xfs_icache.h"
56#include "xfs_trace.h" 45#include "xfs_trace.h"
57#include "xfs_icreate_item.h" 46#include "xfs_icreate_item.h"
47#include "xfs_dinode.h"
48#include "xfs_filestream.h"
49#include "xfs_quota.h"
58 50
59#include <linux/namei.h> 51#include <linux/namei.h>
60#include <linux/init.h> 52#include <linux/init.h>
diff --git a/fs/xfs/xfs_symlink.c b/fs/xfs/xfs_symlink.c
index 93fc72c96fad..14e58f2c96bd 100644
--- a/fs/xfs/xfs_symlink.c
+++ b/fs/xfs/xfs_symlink.c
@@ -28,13 +28,11 @@
28#include "xfs_mount.h" 28#include "xfs_mount.h"
29#include "xfs_da_format.h" 29#include "xfs_da_format.h"
30#include "xfs_dir2.h" 30#include "xfs_dir2.h"
31#include "xfs_bmap_btree.h"
32#include "xfs_ialloc_btree.h"
33#include "xfs_dinode.h"
34#include "xfs_inode.h" 31#include "xfs_inode.h"
35#include "xfs_ialloc.h" 32#include "xfs_ialloc.h"
36#include "xfs_alloc.h" 33#include "xfs_alloc.h"
37#include "xfs_bmap.h" 34#include "xfs_bmap.h"
35#include "xfs_bmap_btree.h"
38#include "xfs_bmap_util.h" 36#include "xfs_bmap_util.h"
39#include "xfs_error.h" 37#include "xfs_error.h"
40#include "xfs_quota.h" 38#include "xfs_quota.h"
@@ -42,8 +40,8 @@
42#include "xfs_trace.h" 40#include "xfs_trace.h"
43#include "xfs_symlink.h" 41#include "xfs_symlink.h"
44#include "xfs_trans.h" 42#include "xfs_trans.h"
45#include "xfs_buf_item.h"
46#include "xfs_log.h" 43#include "xfs_log.h"
44#include "xfs_dinode.h"
47 45
48/* ----- Kernel only functions below ----- */ 46/* ----- Kernel only functions below ----- */
49STATIC int 47STATIC int
diff --git a/fs/xfs/xfs_trace.c b/fs/xfs/xfs_trace.c
index 889bb4233323..dee3279c095e 100644
--- a/fs/xfs/xfs_trace.c
+++ b/fs/xfs/xfs_trace.c
@@ -25,10 +25,6 @@
25#include "xfs_ag.h" 25#include "xfs_ag.h"
26#include "xfs_mount.h" 26#include "xfs_mount.h"
27#include "xfs_da_format.h" 27#include "xfs_da_format.h"
28#include "xfs_bmap_btree.h"
29#include "xfs_alloc_btree.h"
30#include "xfs_ialloc_btree.h"
31#include "xfs_dinode.h"
32#include "xfs_inode.h" 28#include "xfs_inode.h"
33#include "xfs_btree.h" 29#include "xfs_btree.h"
34#include "xfs_da_btree.h" 30#include "xfs_da_btree.h"
@@ -49,6 +45,7 @@
49#include "xfs_dquot.h" 45#include "xfs_dquot.h"
50#include "xfs_log_recover.h" 46#include "xfs_log_recover.h"
51#include "xfs_inode_item.h" 47#include "xfs_inode_item.h"
48#include "xfs_bmap_btree.h"
52 49
53/* 50/*
54 * We include this last to have the helpers above available for the trace 51 * We include this last to have the helpers above available for the trace
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
index 8d1595f9fd50..c812c5c060de 100644
--- a/fs/xfs/xfs_trans.c
+++ b/fs/xfs/xfs_trans.c
@@ -25,28 +25,14 @@
25#include "xfs_sb.h" 25#include "xfs_sb.h"
26#include "xfs_ag.h" 26#include "xfs_ag.h"
27#include "xfs_mount.h" 27#include "xfs_mount.h"
28#include "xfs_error.h"
29#include "xfs_da_format.h"
30#include "xfs_bmap_btree.h"
31#include "xfs_alloc_btree.h"
32#include "xfs_ialloc_btree.h"
33#include "xfs_dinode.h"
34#include "xfs_inode.h" 28#include "xfs_inode.h"
35#include "xfs_btree.h"
36#include "xfs_ialloc.h"
37#include "xfs_alloc.h"
38#include "xfs_extent_busy.h" 29#include "xfs_extent_busy.h"
39#include "xfs_bmap.h"
40#include "xfs_quota.h" 30#include "xfs_quota.h"
41#include "xfs_trans.h" 31#include "xfs_trans.h"
42#include "xfs_trans_priv.h" 32#include "xfs_trans_priv.h"
43#include "xfs_trans_space.h"
44#include "xfs_qm.h"
45#include "xfs_inode_item.h"
46#include "xfs_log.h" 33#include "xfs_log.h"
47#include "xfs_log_priv.h"
48#include "xfs_buf_item.h"
49#include "xfs_trace.h" 34#include "xfs_trace.h"
35#include "xfs_error.h"
50 36
51kmem_zone_t *xfs_trans_zone; 37kmem_zone_t *xfs_trans_zone;
52kmem_zone_t *xfs_log_item_desc_zone; 38kmem_zone_t *xfs_log_item_desc_zone;
diff --git a/fs/xfs/xfs_trans.h b/fs/xfs/xfs_trans.h
index 9cc5fbed4f26..9b96d35e483d 100644
--- a/fs/xfs/xfs_trans.h
+++ b/fs/xfs/xfs_trans.h
@@ -234,6 +234,11 @@ void xfs_trans_cancel(xfs_trans_t *, int);
234int xfs_trans_ail_init(struct xfs_mount *); 234int xfs_trans_ail_init(struct xfs_mount *);
235void xfs_trans_ail_destroy(struct xfs_mount *); 235void xfs_trans_ail_destroy(struct xfs_mount *);
236 236
237void xfs_trans_buf_set_type(struct xfs_trans *, struct xfs_buf *,
238 enum xfs_blft);
239void xfs_trans_buf_copy_type(struct xfs_buf *dst_bp,
240 struct xfs_buf *src_bp);
241
237extern kmem_zone_t *xfs_trans_zone; 242extern kmem_zone_t *xfs_trans_zone;
238extern kmem_zone_t *xfs_log_item_desc_zone; 243extern kmem_zone_t *xfs_log_item_desc_zone;
239 244
diff --git a/fs/xfs/xfs_trans_buf.c b/fs/xfs/xfs_trans_buf.c
index 6b1b993257d6..c035d11b7734 100644
--- a/fs/xfs/xfs_trans_buf.c
+++ b/fs/xfs/xfs_trans_buf.c
@@ -18,15 +18,12 @@
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_fs.h" 19#include "xfs_fs.h"
20#include "xfs_shared.h" 20#include "xfs_shared.h"
21#include "xfs_format.h"
21#include "xfs_log_format.h" 22#include "xfs_log_format.h"
22#include "xfs_trans_resv.h" 23#include "xfs_trans_resv.h"
23#include "xfs_sb.h" 24#include "xfs_sb.h"
24#include "xfs_ag.h" 25#include "xfs_ag.h"
25#include "xfs_mount.h" 26#include "xfs_mount.h"
26#include "xfs_bmap_btree.h"
27#include "xfs_alloc_btree.h"
28#include "xfs_ialloc_btree.h"
29#include "xfs_dinode.h"
30#include "xfs_inode.h" 27#include "xfs_inode.h"
31#include "xfs_trans.h" 28#include "xfs_trans.h"
32#include "xfs_buf_item.h" 29#include "xfs_buf_item.h"
diff --git a/fs/xfs/xfs_trans_dquot.c b/fs/xfs/xfs_trans_dquot.c
index 2025f6eea4aa..cd2a10e15d3a 100644
--- a/fs/xfs/xfs_trans_dquot.c
+++ b/fs/xfs/xfs_trans_dquot.c
@@ -23,19 +23,12 @@
23#include "xfs_trans_resv.h" 23#include "xfs_trans_resv.h"
24#include "xfs_sb.h" 24#include "xfs_sb.h"
25#include "xfs_ag.h" 25#include "xfs_ag.h"
26#include "xfs_alloc.h"
27#include "xfs_quota.h"
28#include "xfs_mount.h" 26#include "xfs_mount.h"
29#include "xfs_bmap_btree.h"
30#include "xfs_inode.h" 27#include "xfs_inode.h"
31#include "xfs_itable.h"
32#include "xfs_bmap.h"
33#include "xfs_rtalloc.h"
34#include "xfs_error.h" 28#include "xfs_error.h"
35#include "xfs_attr.h"
36#include "xfs_trans.h" 29#include "xfs_trans.h"
37#include "xfs_buf_item.h"
38#include "xfs_trans_priv.h" 30#include "xfs_trans_priv.h"
31#include "xfs_quota.h"
39#include "xfs_qm.h" 32#include "xfs_qm.h"
40 33
41STATIC void xfs_trans_alloc_dqinfo(xfs_trans_t *); 34STATIC void xfs_trans_alloc_dqinfo(xfs_trans_t *);
diff --git a/fs/xfs/xfs_trans_inode.c b/fs/xfs/xfs_trans_inode.c
index b1a0efa6b32a..1bba7f60d94c 100644
--- a/fs/xfs/xfs_trans_inode.c
+++ b/fs/xfs/xfs_trans_inode.c
@@ -18,17 +18,13 @@
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_fs.h" 19#include "xfs_fs.h"
20#include "xfs_shared.h" 20#include "xfs_shared.h"
21#include "xfs_format.h"
21#include "xfs_log_format.h" 22#include "xfs_log_format.h"
22#include "xfs_trans_resv.h" 23#include "xfs_trans_resv.h"
23#include "xfs_sb.h" 24#include "xfs_sb.h"
24#include "xfs_ag.h" 25#include "xfs_ag.h"
25#include "xfs_mount.h" 26#include "xfs_mount.h"
26#include "xfs_bmap_btree.h"
27#include "xfs_alloc_btree.h"
28#include "xfs_ialloc_btree.h"
29#include "xfs_dinode.h"
30#include "xfs_inode.h" 27#include "xfs_inode.h"
31#include "xfs_btree.h"
32#include "xfs_trans.h" 28#include "xfs_trans.h"
33#include "xfs_trans_priv.h" 29#include "xfs_trans_priv.h"
34#include "xfs_inode_item.h" 30#include "xfs_inode_item.h"
diff --git a/fs/xfs/xfs_trans_resv.c b/fs/xfs/xfs_trans_resv.c
index 89de046331da..d53d9f0627a7 100644
--- a/fs/xfs/xfs_trans_resv.c
+++ b/fs/xfs/xfs_trans_resv.c
@@ -26,19 +26,9 @@
26#include "xfs_ag.h" 26#include "xfs_ag.h"
27#include "xfs_mount.h" 27#include "xfs_mount.h"
28#include "xfs_da_format.h" 28#include "xfs_da_format.h"
29#include "xfs_error.h"
30#include "xfs_da_btree.h"
31#include "xfs_bmap_btree.h"
32#include "xfs_alloc_btree.h"
33#include "xfs_ialloc_btree.h"
34#include "xfs_dinode.h"
35#include "xfs_inode.h" 29#include "xfs_inode.h"
36#include "xfs_btree.h" 30#include "xfs_bmap_btree.h"
37#include "xfs_ialloc.h" 31#include "xfs_ialloc.h"
38#include "xfs_alloc.h"
39#include "xfs_extent_busy.h"
40#include "xfs_bmap.h"
41#include "xfs_bmap_util.h"
42#include "xfs_quota.h" 32#include "xfs_quota.h"
43#include "xfs_trans.h" 33#include "xfs_trans.h"
44#include "xfs_qm.h" 34#include "xfs_qm.h"
diff --git a/fs/xfs/xfs_xattr.c b/fs/xfs/xfs_xattr.c
index 23052992c7e2..9d479073ba41 100644
--- a/fs/xfs/xfs_xattr.c
+++ b/fs/xfs/xfs_xattr.c
@@ -17,13 +17,13 @@
17 */ 17 */
18 18
19#include "xfs.h" 19#include "xfs.h"
20#include "xfs_format.h"
20#include "xfs_log_format.h" 21#include "xfs_log_format.h"
21#include "xfs_trans_resv.h" 22#include "xfs_trans_resv.h"
22#include "xfs_sb.h" 23#include "xfs_sb.h"
23#include "xfs_ag.h" 24#include "xfs_ag.h"
24#include "xfs_mount.h" 25#include "xfs_mount.h"
25#include "xfs_da_format.h" 26#include "xfs_da_format.h"
26#include "xfs_bmap_btree.h"
27#include "xfs_inode.h" 27#include "xfs_inode.h"
28#include "xfs_attr.h" 28#include "xfs_attr.h"
29#include "xfs_attr_leaf.h" 29#include "xfs_attr_leaf.h"