[XFS] Remove xfs_macros.c, xfs_macros.h, rework headers a whole lot.
authorNathan Scott <nathans@sgi.com>
Wed, 2 Nov 2005 03:38:42 +0000 (14:38 +1100)
committerNathan Scott <nathans@sgi.com>
Wed, 2 Nov 2005 03:38:42 +0000 (14:38 +1100)
SGI-PV: 943122
SGI-Modid: xfs-linux:xfs-kern:23901a

Signed-off-by: Nathan Scott <nathans@sgi.com>
93 files changed:
fs/xfs/linux-2.6/xfs_aops.c
fs/xfs/linux-2.6/xfs_file.c
fs/xfs/linux-2.6/xfs_ioctl.c
fs/xfs/linux-2.6/xfs_iops.c
fs/xfs/linux-2.6/xfs_lrw.c
fs/xfs/linux-2.6/xfs_lrw.h
fs/xfs/linux-2.6/xfs_super.c
fs/xfs/linux-2.6/xfs_sysctl.c
fs/xfs/linux-2.6/xfs_vfs.c
fs/xfs/quota/xfs_dquot.c
fs/xfs/quota/xfs_dquot_item.c
fs/xfs/quota/xfs_qm.c
fs/xfs/quota/xfs_qm_bhv.c
fs/xfs/quota/xfs_qm_stats.c
fs/xfs/quota/xfs_qm_syscalls.c
fs/xfs/quota/xfs_trans_dquot.c
fs/xfs/xfs.h
fs/xfs/xfs_acl.c
fs/xfs/xfs_ag.h
fs/xfs/xfs_alloc.c
fs/xfs/xfs_alloc_btree.c
fs/xfs/xfs_alloc_btree.h
fs/xfs/xfs_attr.c
fs/xfs/xfs_attr_leaf.c
fs/xfs/xfs_attr_leaf.h
fs/xfs/xfs_attr_sf.h
fs/xfs/xfs_bit.h
fs/xfs/xfs_bmap.c
fs/xfs/xfs_bmap.h
fs/xfs/xfs_bmap_btree.c
fs/xfs/xfs_bmap_btree.h
fs/xfs/xfs_btree.c
fs/xfs/xfs_btree.h
fs/xfs/xfs_buf_item.c
fs/xfs/xfs_da_btree.c
fs/xfs/xfs_da_btree.h
fs/xfs/xfs_dfrag.c
fs/xfs/xfs_dinode.h
fs/xfs/xfs_dir.c
fs/xfs/xfs_dir2.c
fs/xfs/xfs_dir2_block.c
fs/xfs/xfs_dir2_block.h
fs/xfs/xfs_dir2_data.c
fs/xfs/xfs_dir2_data.h
fs/xfs/xfs_dir2_leaf.c
fs/xfs/xfs_dir2_leaf.h
fs/xfs/xfs_dir2_node.c
fs/xfs/xfs_dir2_node.h
fs/xfs/xfs_dir2_sf.c
fs/xfs/xfs_dir2_sf.h
fs/xfs/xfs_dir2_trace.c
fs/xfs/xfs_dir_leaf.c
fs/xfs/xfs_dir_leaf.h
fs/xfs/xfs_dir_sf.h
fs/xfs/xfs_dmops.c
fs/xfs/xfs_error.c
fs/xfs/xfs_error.h
fs/xfs/xfs_extfree_item.c
fs/xfs/xfs_fsops.c
fs/xfs/xfs_ialloc.c
fs/xfs/xfs_ialloc.h
fs/xfs/xfs_ialloc_btree.c
fs/xfs/xfs_ialloc_btree.h
fs/xfs/xfs_iget.c
fs/xfs/xfs_inode.c
fs/xfs/xfs_inode.h
fs/xfs/xfs_inode_item.c
fs/xfs/xfs_inode_item.h
fs/xfs/xfs_inum.h
fs/xfs/xfs_iocore.c
fs/xfs/xfs_iomap.c
fs/xfs/xfs_itable.c
fs/xfs/xfs_log.c
fs/xfs/xfs_log_priv.h
fs/xfs/xfs_log_recover.c
fs/xfs/xfs_mount.c
fs/xfs/xfs_mount.h
fs/xfs/xfs_qmops.c
fs/xfs/xfs_rename.c
fs/xfs/xfs_rtalloc.c
fs/xfs/xfs_rw.c
fs/xfs/xfs_rw.h
fs/xfs/xfs_sb.h
fs/xfs/xfs_trans.c
fs/xfs/xfs_trans.h
fs/xfs/xfs_trans_ail.c
fs/xfs/xfs_trans_buf.c
fs/xfs/xfs_trans_extfree.c
fs/xfs/xfs_trans_inode.c
fs/xfs/xfs_trans_item.c
fs/xfs/xfs_utils.c
fs/xfs/xfs_vfsops.c
fs/xfs/xfs_vnodeops.c

index 7aa398724706a9d1d8d6e2dada0fd7126acae9d4..8c05c3c30741c85a49f1ca288fbef0d4386619af 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
 #include "xfs.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_sb.h"
+#include "xfs_ag.h"
 #include "xfs_dir.h"
 #include "xfs_dir2.h"
 #include "xfs_trans.h"
 #include "xfs_bmap_btree.h"
 #include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
-#include "xfs_alloc.h"
-#include "xfs_btree.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
 #include "xfs_inode.h"
+#include "xfs_alloc.h"
+#include "xfs_btree.h"
 #include "xfs_error.h"
 #include "xfs_rw.h"
 #include "xfs_iomap.h"
index 3881622bcf081abcf35d81dbe720f184a7720d3d..b0c00eaa79e484becf969a25d0901582f07f4175 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
 #include "xfs.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_sb.h"
+#include "xfs_ag.h"
 #include "xfs_dir.h"
 #include "xfs_dir2.h"
 #include "xfs_trans.h"
index 6a3326bcd8d015f86c5a66a00263b0229a1396ef..d880e9c65fcdbf728d2217be174a5023a1c3c188 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
 #include "xfs.h"
-
 #include "xfs_fs.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
+#include "xfs_ag.h"
 #include "xfs_dir.h"
 #include "xfs_dir2.h"
 #include "xfs_alloc.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
-#include "xfs_alloc_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
-#include "xfs_btree.h"
-#include "xfs_ialloc.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dir2_sf.h"
 #include "xfs_dinode.h"
 #include "xfs_inode.h"
-#include "xfs_bmap.h"
-#include "xfs_bit.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
 #include "xfs_rtalloc.h"
-#include "xfs_error.h"
 #include "xfs_itable.h"
+#include "xfs_error.h"
 #include "xfs_rw.h"
 #include "xfs_acl.h"
 #include "xfs_cap.h"
 #include "xfs_mac.h"
 #include "xfs_attr.h"
+#include "xfs_bmap.h"
 #include "xfs_buf_item.h"
 #include "xfs_utils.h"
 #include "xfs_dfrag.h"
index 68c83ec31143fdaba0b9575de4df6b6da0237af3..12d2a702c6c3b45016b5f1f18adfc51fad2f24d2 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
 #include "xfs.h"
 #include "xfs_fs.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
 #include "xfs_dmapi.h"
 #include "xfs_quota.h"
 #include "xfs_mount.h"
-#include "xfs_alloc_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
-#include "xfs_btree.h"
-#include "xfs_ialloc.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
 #include "xfs_inode.h"
 #include "xfs_bmap.h"
-#include "xfs_bit.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
 #include "xfs_rtalloc.h"
 #include "xfs_error.h"
 #include "xfs_itable.h"
index c04f0c063c58577a153102fd1262fccfc41fa0bf..36dc8b0368b79a1bf51ca6873a5352644b2ba5ad 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-/*
- *  fs/xfs/linux/xfs_lrw.c (Linux Read Write stuff)
- *
- */
-
 #include "xfs.h"
-
 #include "xfs_fs.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
 #include "xfs_dmapi.h"
 #include "xfs_quota.h"
 #include "xfs_mount.h"
-#include "xfs_alloc_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
-#include "xfs_btree.h"
-#include "xfs_ialloc.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
 #include "xfs_inode.h"
 #include "xfs_bmap.h"
-#include "xfs_bit.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
 #include "xfs_rtalloc.h"
 #include "xfs_error.h"
 #include "xfs_itable.h"
index 6294dcdb797cc97ae98b7e24aebed23292a6f2f4..0647e48a8a15c359b65c6bd864a8bb6c2660cf6c 100644 (file)
@@ -107,9 +107,4 @@ extern ssize_t xfs_sendfile(struct bhv_desc *, struct file *,
 
 extern int xfs_dev_is_read_only(struct xfs_mount *, char *);
 
-#define XFS_FSB_TO_DB_IO(io,fsb) \
-               (((io)->io_flags & XFS_IOCORE_RT) ? \
-                XFS_FSB_TO_BB((io)->io_mount, (fsb)) : \
-                XFS_FSB_TO_DADDR((io)->io_mount, (fsb)))
-
 #endif /* __XFS_LRW_H__ */
index f6f6b6750d4f1172127c160e74a4bcec8c8ee604..fac4862d09a6c0fb7179a786636edd56f7473c7d 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
 #include "xfs.h"
-
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
 #include "xfs_clnt.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
+#include "xfs_ag.h"
 #include "xfs_dir.h"
 #include "xfs_dir2.h"
 #include "xfs_alloc.h"
 #include "xfs_dmapi.h"
 #include "xfs_quota.h"
 #include "xfs_mount.h"
-#include "xfs_alloc_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
-#include "xfs_btree.h"
-#include "xfs_ialloc.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
 #include "xfs_inode.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
 #include "xfs_bmap.h"
-#include "xfs_bit.h"
 #include "xfs_rtalloc.h"
 #include "xfs_error.h"
 #include "xfs_itable.h"
index 0dc010356f4dd4fad46ee960ef027a1e941ec208..3dbd57fda2d63b24175e58175c7deb0284484c24 100644 (file)
@@ -29,9 +29,7 @@
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
 #include "xfs.h"
-#include "xfs_rw.h"
 #include <linux/sysctl.h>
 #include <linux/proc_fs.h>
 
@@ -76,7 +74,7 @@ xfs_stats_clear_proc_handler(
 STATIC ctl_table xfs_table[] = {
        {XFS_RESTRICT_CHOWN, "restrict_chown", &xfs_params.restrict_chown.val,
        sizeof(int), 0644, NULL, &proc_dointvec_minmax,
-       &sysctl_intvec, NULL, 
+       &sysctl_intvec, NULL,
        &xfs_params.restrict_chown.min, &xfs_params.restrict_chown.max},
 
        {XFS_SGID_INHERIT, "irix_sgid_inherit", &xfs_params.sgid_inherit.val,
@@ -86,22 +84,22 @@ STATIC ctl_table xfs_table[] = {
 
        {XFS_SYMLINK_MODE, "irix_symlink_mode", &xfs_params.symlink_mode.val,
        sizeof(int), 0644, NULL, &proc_dointvec_minmax,
-       &sysctl_intvec, NULL, 
+       &sysctl_intvec, NULL,
        &xfs_params.symlink_mode.min, &xfs_params.symlink_mode.max},
 
        {XFS_PANIC_MASK, "panic_mask", &xfs_params.panic_mask.val,
        sizeof(int), 0644, NULL, &proc_dointvec_minmax,
-       &sysctl_intvec, NULL, 
+       &sysctl_intvec, NULL,
        &xfs_params.panic_mask.min, &xfs_params.panic_mask.max},
 
        {XFS_ERRLEVEL, "error_level", &xfs_params.error_level.val,
        sizeof(int), 0644, NULL, &proc_dointvec_minmax,
-       &sysctl_intvec, NULL, 
+       &sysctl_intvec, NULL,
        &xfs_params.error_level.min, &xfs_params.error_level.max},
 
        {XFS_SYNCD_TIMER, "xfssyncd_centisecs", &xfs_params.syncd_timer.val,
        sizeof(int), 0644, NULL, &proc_dointvec_minmax,
-       &sysctl_intvec, NULL, 
+       &sysctl_intvec, NULL,
        &xfs_params.syncd_timer.min, &xfs_params.syncd_timer.max},
 
        {XFS_INHERIT_SYNC, "inherit_sync", &xfs_params.inherit_sync.val,
@@ -118,7 +116,7 @@ STATIC ctl_table xfs_table[] = {
        sizeof(int), 0644, NULL, &proc_dointvec_minmax,
        &sysctl_intvec, NULL,
        &xfs_params.inherit_noatim.min, &xfs_params.inherit_noatim.max},
-       
+
        {XFS_BUF_TIMER, "xfsbufd_centisecs", &xfs_params.xfs_buf_timer.val,
        sizeof(int), 0644, NULL, &proc_dointvec_minmax,
        &sysctl_intvec, NULL,
@@ -136,14 +134,14 @@ STATIC ctl_table xfs_table[] = {
 
        {XFS_ROTORSTEP, "rotorstep", &xfs_params.rotorstep.val,
        sizeof(int), 0644, NULL, &proc_dointvec_minmax,
-       &sysctl_intvec, NULL, 
+       &sysctl_intvec, NULL,
        &xfs_params.rotorstep.min, &xfs_params.rotorstep.max},
 
        /* please keep this the last entry */
 #ifdef CONFIG_PROC_FS
        {XFS_STATS_CLEAR, "stats_clear", &xfs_params.stats_clear.val,
        sizeof(int), 0644, NULL, &xfs_stats_clear_proc_handler,
-       &sysctl_intvec, NULL, 
+       &sysctl_intvec, NULL,
        &xfs_params.stats_clear.min, &xfs_params.stats_clear.max},
 #endif /* CONFIG_PROC_FS */
 
index 34cc902ec11949c4395f35e1ee70db3038022443..1a08a1d842524f2835a645a3c9648d548542bd11 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
 #include "xfs.h"
 #include "xfs_fs.h"
-#include "xfs_macros.h"
 #include "xfs_inum.h"
 #include "xfs_log.h"
 #include "xfs_clnt.h"
index 9987977a4927acca9a0193ce9974c97ea4c37a1c..5971f6f6ec78dfb6d715a0bea82a3234cb740dcb 100644 (file)
@@ -32,8 +32,9 @@
 
 #include "xfs.h"
 #include "xfs_fs.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
 #include "xfs_dmapi.h"
 #include "xfs_quota.h"
 #include "xfs_mount.h"
-#include "xfs_alloc_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
-#include "xfs_btree.h"
-#include "xfs_ialloc.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
 #include "xfs_inode.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
 #include "xfs_bmap.h"
-#include "xfs_bit.h"
 #include "xfs_rtalloc.h"
 #include "xfs_error.h"
 #include "xfs_itable.h"
index e74eaa7dd1bc6914a51f1e775d919354778432ca..86f2230327511ace601c3ed802fdde6f275497a3 100644 (file)
@@ -32,8 +32,9 @@
 
 #include "xfs.h"
 #include "xfs_fs.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
 #include "xfs_dmapi.h"
 #include "xfs_quota.h"
 #include "xfs_mount.h"
-#include "xfs_alloc_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
-#include "xfs_btree.h"
-#include "xfs_ialloc.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
 #include "xfs_inode.h"
 #include "xfs_bmap.h"
-#include "xfs_bit.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
 #include "xfs_rtalloc.h"
 #include "xfs_error.h"
 #include "xfs_itable.h"
@@ -65,7 +65,6 @@
 #include "xfs_attr.h"
 #include "xfs_buf_item.h"
 #include "xfs_trans_priv.h"
-
 #include "xfs_qm.h"
 
 
index efde16e0a91345b182aa1731c42f8388dd8cf31e..9041ea8452e10c9c79f224b266ce18ed37b9d32e 100644 (file)
@@ -32,8 +32,9 @@
 
 #include "xfs.h"
 #include "xfs_fs.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_clnt.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_dmapi.h"
 #include "xfs_quota.h"
 #include "xfs_mount.h"
-#include "xfs_alloc_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
-#include "xfs_btree.h"
-#include "xfs_ialloc.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
 #include "xfs_inode.h"
-#include "xfs_bmap.h"
-#include "xfs_bit.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_itable.h"
 #include "xfs_rtalloc.h"
 #include "xfs_error.h"
-#include "xfs_itable.h"
+#include "xfs_bmap.h"
 #include "xfs_rw.h"
 #include "xfs_acl.h"
 #include "xfs_cap.h"
@@ -67,7 +67,6 @@
 #include "xfs_buf_item.h"
 #include "xfs_trans_space.h"
 #include "xfs_utils.h"
-
 #include "xfs_qm.h"
 
 /*
index 8890a18a99d8cc98857d694fc55368eb41ede195..dac7cf8d729c3fa9e320a3af2c288e00e2e27063 100644 (file)
 
 #include "xfs.h"
 #include "xfs_fs.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_clnt.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
+#include "xfs_ag.h"
 #include "xfs_dir.h"
 #include "xfs_dir2.h"
 #include "xfs_alloc.h"
 #include "xfs_dmapi.h"
 #include "xfs_quota.h"
 #include "xfs_mount.h"
-#include "xfs_alloc_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
-#include "xfs_btree.h"
-#include "xfs_ialloc.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
 #include "xfs_inode.h"
+#include "xfs_ialloc.h"
+#include "xfs_itable.h"
+#include "xfs_btree.h"
 #include "xfs_bmap.h"
-#include "xfs_bit.h"
 #include "xfs_rtalloc.h"
 #include "xfs_error.h"
-#include "xfs_itable.h"
 #include "xfs_rw.h"
 #include "xfs_acl.h"
 #include "xfs_cap.h"
 #include "xfs_mac.h"
 #include "xfs_attr.h"
 #include "xfs_buf_item.h"
-
 #include "xfs_qm.h"
 
 #define MNTOPT_QUOTA   "quota"         /* disk quotas (user) */
index 29978e037fee490081226fd28f8d28e5c8114206..b8befe1c90ec8e4dce44a005889604b416c41d32 100644 (file)
 
 #include "xfs.h"
 #include "xfs_fs.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
+#include "xfs_ag.h"
 #include "xfs_dir.h"
 #include "xfs_dir2.h"
 #include "xfs_alloc.h"
 #include "xfs_dmapi.h"
 #include "xfs_quota.h"
 #include "xfs_mount.h"
-#include "xfs_alloc_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
-#include "xfs_btree.h"
-#include "xfs_ialloc.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
 #include "xfs_inode.h"
+#include "xfs_ialloc.h"
+#include "xfs_itable.h"
 #include "xfs_bmap.h"
-#include "xfs_bit.h"
+#include "xfs_btree.h"
 #include "xfs_rtalloc.h"
 #include "xfs_error.h"
-#include "xfs_itable.h"
 #include "xfs_rw.h"
 #include "xfs_acl.h"
 #include "xfs_cap.h"
index 485f83d41191b9b2cfb3a7d047ba25fbc61a6ea3..ba320f6431a329939dd920584a00dfab3724099e 100644 (file)
 
 #include "xfs.h"
 #include "xfs_fs.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
+#include "xfs_ag.h"
 #include "xfs_dir.h"
 #include "xfs_dir2.h"
 #include "xfs_alloc.h"
 #include "xfs_dmapi.h"
 #include "xfs_quota.h"
 #include "xfs_mount.h"
-#include "xfs_alloc_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
-#include "xfs_btree.h"
-#include "xfs_ialloc.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
 #include "xfs_inode.h"
+#include "xfs_ialloc.h"
+#include "xfs_itable.h"
 #include "xfs_bmap.h"
-#include "xfs_bit.h"
+#include "xfs_btree.h"
 #include "xfs_rtalloc.h"
 #include "xfs_error.h"
-#include "xfs_itable.h"
 #include "xfs_rw.h"
 #include "xfs_acl.h"
 #include "xfs_cap.h"
@@ -64,7 +65,6 @@
 #include "xfs_attr.h"
 #include "xfs_buf_item.h"
 #include "xfs_utils.h"
-
 #include "xfs_qm.h"
 
 #ifdef DEBUG
index 3b99daf8a640f3dd3a6691558fbf70ba5fa0a462..afa3bb57e5d1e94be369f659a009df84448671ea 100644 (file)
@@ -32,8 +32,9 @@
 
 #include "xfs.h"
 #include "xfs_fs.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
 #include "xfs_dmapi.h"
 #include "xfs_quota.h"
 #include "xfs_mount.h"
-#include "xfs_alloc_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
-#include "xfs_btree.h"
-#include "xfs_ialloc.h"
 #include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
 #include "xfs_dinode.h"
 #include "xfs_inode.h"
+#include "xfs_ialloc.h"
+#include "xfs_itable.h"
+#include "xfs_btree.h"
 #include "xfs_bmap.h"
-#include "xfs_bit.h"
 #include "xfs_rtalloc.h"
 #include "xfs_error.h"
-#include "xfs_itable.h"
 #include "xfs_rw.h"
 #include "xfs_acl.h"
 #include "xfs_cap.h"
index 7e276dcaf4dc237af2166d3e9459e86df6ea11fc..30c4ab4f9c454db466ce524043fc5affd72868ee 100644 (file)
@@ -34,7 +34,4 @@
 
 #include <linux-2.6/xfs_linux.h>
 
-#include <xfs_fs.h> 
-#include <xfs_macros.h>
-
 #endif /* __XFS_H__ */
index 49fdc392fc8a3c4256d0403f5b55472f7426aca3..33c5f402b4ed143111e6e112f7b684d9e9b9fa93 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
 #include "xfs.h"
-
+#include "xfs_fs.h"
+#include "xfs_types.h"
+#include "xfs_bit.h"
 #include "xfs_inum.h"
+#include "xfs_ag.h"
 #include "xfs_dir.h"
 #include "xfs_dir2.h"
-#include "xfs_alloc_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
-#include "xfs_btree.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
 #include "xfs_inode.h"
+#include "xfs_btree.h"
 #include "xfs_acl.h"
 #include "xfs_mac.h"
 #include "xfs_attr.h"
index 96b70f7fba397ba4d035767c4980934e9b50fa5a..7d15ef341a90a9d4fee973cc95751da6714c2715 100644 (file)
@@ -46,18 +46,9 @@ struct xfs_trans;
 #define        XFS_AGI_MAGIC   0x58414749      /* 'XAGI' */
 #define        XFS_AGF_VERSION 1
 #define        XFS_AGI_VERSION 1
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AGF_GOOD_VERSION)
-int xfs_agf_good_version(unsigned v);
-#define        XFS_AGF_GOOD_VERSION(v) xfs_agf_good_version(v)
-#else
-#define XFS_AGF_GOOD_VERSION(v)                ((v) == XFS_AGF_VERSION)
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AGI_GOOD_VERSION)
-int xfs_agi_good_version(unsigned v);
-#define        XFS_AGI_GOOD_VERSION(v) xfs_agi_good_version(v)
-#else
-#define XFS_AGI_GOOD_VERSION(v)                ((v) == XFS_AGI_VERSION)
-#endif
+
+#define        XFS_AGF_GOOD_VERSION(v) ((v) == XFS_AGF_VERSION)
+#define        XFS_AGI_GOOD_VERSION(v) ((v) == XFS_AGI_VERSION)
 
 /*
  * Btree number 0 is bno, 1 is cnt.  This value gives the size of the
@@ -110,12 +101,9 @@ typedef struct xfs_agf
 
 /* disk block (xfs_daddr_t) in the AG */
 #define XFS_AGF_DADDR(mp)      ((xfs_daddr_t)(1 << (mp)->m_sectbb_log))
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AGF_BLOCK)
-xfs_agblock_t xfs_agf_block(struct xfs_mount *mp);
-#define        XFS_AGF_BLOCK(mp)       xfs_agf_block(mp)
-#else
-#define XFS_AGF_BLOCK(mp)      XFS_HDR_BLOCK(mp, XFS_AGF_DADDR(mp))
-#endif
+#define        XFS_AGF_BLOCK(mp)       XFS_HDR_BLOCK(mp, XFS_AGF_DADDR(mp))
+#define        XFS_BUF_TO_AGF(bp)      ((xfs_agf_t *)XFS_BUF_PTR(bp))
+
 
 /*
  * Size of the unlinked inode hash table in the agi.
@@ -165,25 +153,17 @@ typedef struct xfs_agi
 
 /* disk block (xfs_daddr_t) in the AG */
 #define XFS_AGI_DADDR(mp)      ((xfs_daddr_t)(2 << (mp)->m_sectbb_log))
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AGI_BLOCK)
-xfs_agblock_t xfs_agi_block(struct xfs_mount *mp);
-#define        XFS_AGI_BLOCK(mp)       xfs_agi_block(mp)
-#else
-#define XFS_AGI_BLOCK(mp)      XFS_HDR_BLOCK(mp, XFS_AGI_DADDR(mp))
-#endif
+#define        XFS_AGI_BLOCK(mp)       XFS_HDR_BLOCK(mp, XFS_AGI_DADDR(mp))
+#define        XFS_BUF_TO_AGI(bp)      ((xfs_agi_t *)XFS_BUF_PTR(bp))
 
 /*
  * The third a.g. block contains the a.g. freelist, an array
  * of block pointers to blocks owned by the allocation btree code.
  */
 #define XFS_AGFL_DADDR(mp)     ((xfs_daddr_t)(3 << (mp)->m_sectbb_log))
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AGFL_BLOCK)
-xfs_agblock_t xfs_agfl_block(struct xfs_mount *mp);
-#define        XFS_AGFL_BLOCK(mp)      xfs_agfl_block(mp)
-#else
-#define XFS_AGFL_BLOCK(mp)     XFS_HDR_BLOCK(mp, XFS_AGFL_DADDR(mp))
-#endif
+#define        XFS_AGFL_BLOCK(mp)      XFS_HDR_BLOCK(mp, XFS_AGFL_DADDR(mp))
 #define XFS_AGFL_SIZE(mp)      ((mp)->m_sb.sb_sectsize / sizeof(xfs_agblock_t))
+#define        XFS_BUF_TO_AGFL(bp)     ((xfs_agfl_t *)XFS_BUF_PTR(bp))
 
 typedef struct xfs_agfl {
        xfs_agblock_t   agfl_bno[1];    /* actually XFS_AGFL_SIZE(mp) */
@@ -230,116 +210,38 @@ typedef struct xfs_perag
        xfs_perag_busy_t *pagb_list;    /* unstable blocks */
 } xfs_perag_t;
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AG_MAXLEVELS)
-int xfs_ag_maxlevels(struct xfs_mount *mp);
-#define        XFS_AG_MAXLEVELS(mp)            xfs_ag_maxlevels(mp)
-#else
-#define        XFS_AG_MAXLEVELS(mp)    ((mp)->m_ag_maxlevels)
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_MIN_FREELIST)
-int xfs_min_freelist(xfs_agf_t *a, struct xfs_mount *mp);
-#define        XFS_MIN_FREELIST(a,mp)          xfs_min_freelist(a,mp)
-#else
-#define        XFS_MIN_FREELIST(a,mp)  \
-       XFS_MIN_FREELIST_RAW(   \
+#define        XFS_AG_MAXLEVELS(mp)            ((mp)->m_ag_maxlevels)
+#define        XFS_MIN_FREELIST_RAW(bl,cl,mp)  \
+       (MIN(bl + 1, XFS_AG_MAXLEVELS(mp)) + MIN(cl + 1, XFS_AG_MAXLEVELS(mp)))
+#define        XFS_MIN_FREELIST(a,mp)          \
+       (XFS_MIN_FREELIST_RAW(          \
                INT_GET((a)->agf_levels[XFS_BTNUM_BNOi], ARCH_CONVERT), \
-               INT_GET((a)->agf_levels[XFS_BTNUM_CNTi], ARCH_CONVERT), mp)
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_MIN_FREELIST_PAG)
-int xfs_min_freelist_pag(xfs_perag_t *pag, struct xfs_mount *mp);
-#define        XFS_MIN_FREELIST_PAG(pag,mp)    xfs_min_freelist_pag(pag,mp)
-#else
+               INT_GET((a)->agf_levels[XFS_BTNUM_CNTi], ARCH_CONVERT), mp))
 #define        XFS_MIN_FREELIST_PAG(pag,mp)    \
-       XFS_MIN_FREELIST_RAW((uint_t)(pag)->pagf_levels[XFS_BTNUM_BNOi], \
-                            (uint_t)(pag)->pagf_levels[XFS_BTNUM_CNTi], mp)
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_MIN_FREELIST_RAW)
-int xfs_min_freelist_raw(int bl, int cl, struct xfs_mount *mp);
-#define        XFS_MIN_FREELIST_RAW(bl,cl,mp)  xfs_min_freelist_raw(bl,cl,mp)
-#else
-#define        XFS_MIN_FREELIST_RAW(bl,cl,mp)  \
-       (MIN(bl + 1, XFS_AG_MAXLEVELS(mp)) + \
-        MIN(cl + 1, XFS_AG_MAXLEVELS(mp)))
-#endif
+       (XFS_MIN_FREELIST_RAW(          \
+               (uint_t)(pag)->pagf_levels[XFS_BTNUM_BNOi], \
+               (uint_t)(pag)->pagf_levels[XFS_BTNUM_CNTi], mp))
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AGB_TO_FSB)
-xfs_fsblock_t xfs_agb_to_fsb(struct xfs_mount *mp, xfs_agnumber_t agno,
-                            xfs_agblock_t agbno);
-#define XFS_AGB_TO_FSB(mp,agno,agbno)  xfs_agb_to_fsb(mp,agno,agbno)
-#else
-#define        XFS_AGB_TO_FSB(mp,agno,agbno) \
+#define XFS_AGB_TO_FSB(mp,agno,agbno)  \
        (((xfs_fsblock_t)(agno) << (mp)->m_sb.sb_agblklog) | (agbno))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_FSB_TO_AGNO)
-xfs_agnumber_t xfs_fsb_to_agno(struct xfs_mount *mp, xfs_fsblock_t fsbno);
-#define        XFS_FSB_TO_AGNO(mp,fsbno)       xfs_fsb_to_agno(mp,fsbno)
-#else
-#define        XFS_FSB_TO_AGNO(mp,fsbno) \
+#define        XFS_FSB_TO_AGNO(mp,fsbno)       \
        ((xfs_agnumber_t)((fsbno) >> (mp)->m_sb.sb_agblklog))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_FSB_TO_AGBNO)
-xfs_agblock_t xfs_fsb_to_agbno(struct xfs_mount *mp, xfs_fsblock_t fsbno);
-#define        XFS_FSB_TO_AGBNO(mp,fsbno)      xfs_fsb_to_agbno(mp,fsbno)
-#else
-#define        XFS_FSB_TO_AGBNO(mp,fsbno) \
+#define        XFS_FSB_TO_AGBNO(mp,fsbno)      \
        ((xfs_agblock_t)((fsbno) & XFS_MASK32LO((mp)->m_sb.sb_agblklog)))
-#endif
-
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AGB_TO_DADDR)
-xfs_daddr_t xfs_agb_to_daddr(struct xfs_mount *mp, xfs_agnumber_t agno,
-                               xfs_agblock_t agbno);
-#define        XFS_AGB_TO_DADDR(mp,agno,agbno) xfs_agb_to_daddr(mp,agno,agbno)
-#else
-#define        XFS_AGB_TO_DADDR(mp,agno,agbno) \
-       ((xfs_daddr_t)(XFS_FSB_TO_BB(mp, \
-               (xfs_fsblock_t)(agno) * (mp)->m_sb.sb_agblocks + (agbno))))
-#endif
-/*
- * XFS_DADDR_TO_AGNO and XFS_DADDR_TO_AGBNO moved to xfs_mount.h
- * to avoid header file ordering change
- */
-
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AG_DADDR)
-xfs_daddr_t xfs_ag_daddr(struct xfs_mount *mp, xfs_agnumber_t agno,
-                               xfs_daddr_t d);
-#define        XFS_AG_DADDR(mp,agno,d)         xfs_ag_daddr(mp,agno,d)
-#else
-#define        XFS_AG_DADDR(mp,agno,d) (XFS_AGB_TO_DADDR(mp, agno, 0) + (d))
-#endif
-
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BUF_TO_AGF)
-xfs_agf_t *xfs_buf_to_agf(struct xfs_buf *bp);
-#define        XFS_BUF_TO_AGF(bp)              xfs_buf_to_agf(bp)
-#else
-#define        XFS_BUF_TO_AGF(bp)      ((xfs_agf_t *)XFS_BUF_PTR(bp))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BUF_TO_AGI)
-xfs_agi_t *xfs_buf_to_agi(struct xfs_buf *bp);
-#define        XFS_BUF_TO_AGI(bp)              xfs_buf_to_agi(bp)
-#else
-#define        XFS_BUF_TO_AGI(bp)      ((xfs_agi_t *)XFS_BUF_PTR(bp))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BUF_TO_AGFL)
-xfs_agfl_t *xfs_buf_to_agfl(struct xfs_buf *bp);
-#define        XFS_BUF_TO_AGFL(bp)             xfs_buf_to_agfl(bp)
-#else
-#define        XFS_BUF_TO_AGFL(bp)     ((xfs_agfl_t *)XFS_BUF_PTR(bp))
-#endif
+#define        XFS_AGB_TO_DADDR(mp,agno,agbno) \
+       ((xfs_daddr_t)XFS_FSB_TO_BB(mp, \
+               (xfs_fsblock_t)(agno) * (mp)->m_sb.sb_agblocks + (agbno)))
+#define        XFS_AG_DADDR(mp,agno,d)         (XFS_AGB_TO_DADDR(mp, agno, 0) + (d))
 
 /*
  * For checking for bad ranges of xfs_daddr_t's, covering multiple
  * allocation groups or a single xfs_daddr_t that's a superblock copy.
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AG_CHECK_DADDR)
-void xfs_ag_check_daddr(struct xfs_mount *mp, xfs_daddr_t d, xfs_extlen_t len);
-#define        XFS_AG_CHECK_DADDR(mp,d,len)    xfs_ag_check_daddr(mp,d,len)
-#else
 #define        XFS_AG_CHECK_DADDR(mp,d,len)    \
        ((len) == 1 ? \
            ASSERT((d) == XFS_SB_DADDR || \
                   XFS_DADDR_TO_AGBNO(mp, d) != XFS_SB_DADDR) : \
            ASSERT(XFS_DADDR_TO_AGNO(mp, d) == \
                   XFS_DADDR_TO_AGNO(mp, (d) + (len) - 1)))
-#endif
 
 #endif /* __XFS_AG_H__ */
index dcfe1970362016637854091e53715f6f2f30f569..c3a30e14bd1366b5779c3c4f680b0ca8f99149f8 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
-/*
- * Free space allocation for XFS.
- */
 #include "xfs.h"
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
 #include "xfs_dir.h"
+#include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
-#include "xfs_alloc_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
 #include "xfs_btree.h"
 #include "xfs_ialloc.h"
 #include "xfs_alloc.h"
-#include "xfs_bit.h"
 #include "xfs_error.h"
 
 
index e0355a12d946ae10729bbde88713a823110f3fa3..ccc421b438fff64d27f21032eca2304d27593d0a 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
-/*
- * Free space allocation for XFS.
- */
-
 #include "xfs.h"
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
 #include "xfs_dir.h"
+#include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
+#include "xfs_bmap_btree.h"
 #include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
-#include "xfs_bmap_btree.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
 #include "xfs_btree.h"
 #include "xfs_ialloc.h"
 #include "xfs_alloc.h"
index ed5161a572ef683d8139f76ef978c375a14451b6..f857b0f248d3639e29ed40ce1216830b8cda1d50 100644 (file)
@@ -62,38 +62,14 @@ typedef xfs_agblock_t xfs_alloc_ptr_t;      /* btree pointer type */
                                        /* btree block header type */
 typedef        struct xfs_btree_sblock xfs_alloc_block_t;
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BUF_TO_ALLOC_BLOCK)
-xfs_alloc_block_t *xfs_buf_to_alloc_block(struct xfs_buf *bp);
-#define        XFS_BUF_TO_ALLOC_BLOCK(bp)      xfs_buf_to_alloc_block(bp)
-#else
-#define        XFS_BUF_TO_ALLOC_BLOCK(bp) ((xfs_alloc_block_t *)(XFS_BUF_PTR(bp)))
-#endif
+#define        XFS_BUF_TO_ALLOC_BLOCK(bp)      ((xfs_alloc_block_t *)XFS_BUF_PTR(bp))
 
 /*
  * Real block structures have a size equal to the disk block size.
  */
-
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ALLOC_BLOCK_SIZE)
-int xfs_alloc_block_size(int lev, struct xfs_btree_cur *cur);
-#define        XFS_ALLOC_BLOCK_SIZE(lev,cur)   xfs_alloc_block_size(lev,cur)
-#else
 #define        XFS_ALLOC_BLOCK_SIZE(lev,cur)   (1 << (cur)->bc_blocklog)
-#endif
-
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ALLOC_BLOCK_MAXRECS)
-int xfs_alloc_block_maxrecs(int lev, struct xfs_btree_cur *cur);
-#define        XFS_ALLOC_BLOCK_MAXRECS(lev,cur)        xfs_alloc_block_maxrecs(lev,cur)
-#else
-#define        XFS_ALLOC_BLOCK_MAXRECS(lev,cur)        \
-       ((cur)->bc_mp->m_alloc_mxr[lev != 0])
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ALLOC_BLOCK_MINRECS)
-int xfs_alloc_block_minrecs(int lev, struct xfs_btree_cur *cur);
-#define        XFS_ALLOC_BLOCK_MINRECS(lev,cur)        xfs_alloc_block_minrecs(lev,cur)
-#else
-#define        XFS_ALLOC_BLOCK_MINRECS(lev,cur)        \
-       ((cur)->bc_mp->m_alloc_mnr[lev != 0])
-#endif
+#define        XFS_ALLOC_BLOCK_MAXRECS(lev,cur) ((cur)->bc_mp->m_alloc_mxr[lev != 0])
+#define        XFS_ALLOC_BLOCK_MINRECS(lev,cur) ((cur)->bc_mp->m_alloc_mnr[lev != 0])
 
 /*
  * Minimum and maximum blocksize and sectorsize.
@@ -113,145 +89,80 @@ int xfs_alloc_block_minrecs(int lev, struct xfs_btree_cur *cur);
  * Block numbers in the AG:
  * SB is sector 0, AGF is sector 1, AGI is sector 2, AGFL is sector 3.
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BNO_BLOCK)
-xfs_agblock_t xfs_bno_block(struct xfs_mount *mp);
-#define        XFS_BNO_BLOCK(mp)       xfs_bno_block(mp)
-#else
 #define        XFS_BNO_BLOCK(mp)       ((xfs_agblock_t)(XFS_AGFL_BLOCK(mp) + 1))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_CNT_BLOCK)
-xfs_agblock_t xfs_cnt_block(struct xfs_mount *mp);
-#define        XFS_CNT_BLOCK(mp)       xfs_cnt_block(mp)
-#else
 #define        XFS_CNT_BLOCK(mp)       ((xfs_agblock_t)(XFS_BNO_BLOCK(mp) + 1))
-#endif
 
 /*
  * Record, key, and pointer address macros for btree blocks.
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ALLOC_REC_ADDR)
-xfs_alloc_rec_t *xfs_alloc_rec_addr(xfs_alloc_block_t *bb, int i,
-                                   struct xfs_btree_cur *cur);
-#define        XFS_ALLOC_REC_ADDR(bb,i,cur)    xfs_alloc_rec_addr(bb,i,cur)
-#else
 #define        XFS_ALLOC_REC_ADDR(bb,i,cur)    \
-       XFS_BTREE_REC_ADDR(XFS_ALLOC_BLOCK_SIZE(0,cur), xfs_alloc, bb, i, \
-               XFS_ALLOC_BLOCK_MAXRECS(0, cur))
-#endif
+       XFS_BTREE_REC_ADDR(XFS_ALLOC_BLOCK_SIZE(0,cur), xfs_alloc, \
+                               bb, i, XFS_ALLOC_BLOCK_MAXRECS(0, cur))
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ALLOC_KEY_ADDR)
-xfs_alloc_key_t *xfs_alloc_key_addr(xfs_alloc_block_t *bb, int i,
-                                   struct xfs_btree_cur *cur);
-#define        XFS_ALLOC_KEY_ADDR(bb,i,cur)    xfs_alloc_key_addr(bb,i,cur)
-#else
 #define        XFS_ALLOC_KEY_ADDR(bb,i,cur)    \
-       XFS_BTREE_KEY_ADDR(XFS_ALLOC_BLOCK_SIZE(1,cur), xfs_alloc, bb, i, \
-               XFS_ALLOC_BLOCK_MAXRECS(1, cur))
-#endif
+       XFS_BTREE_KEY_ADDR(XFS_ALLOC_BLOCK_SIZE(1,cur), xfs_alloc, \
+                               bb, i, XFS_ALLOC_BLOCK_MAXRECS(1, cur))
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ALLOC_PTR_ADDR)
-xfs_alloc_ptr_t *xfs_alloc_ptr_addr(xfs_alloc_block_t *bb, int i,
-                                   struct xfs_btree_cur *cur);
-#define        XFS_ALLOC_PTR_ADDR(bb,i,cur)    xfs_alloc_ptr_addr(bb,i,cur)
-#else
 #define        XFS_ALLOC_PTR_ADDR(bb,i,cur)    \
-       XFS_BTREE_PTR_ADDR(XFS_ALLOC_BLOCK_SIZE(1,cur), xfs_alloc, bb, i, \
-               XFS_ALLOC_BLOCK_MAXRECS(1, cur))
-#endif
-
-/*
- * Prototypes for externally visible routines.
- */
+       XFS_BTREE_PTR_ADDR(XFS_ALLOC_BLOCK_SIZE(1,cur), xfs_alloc, \
+                               bb, i, XFS_ALLOC_BLOCK_MAXRECS(1, cur))
 
 /*
  * Decrement cursor by one record at the level.
  * For nonzero levels the leaf-ward information is untouched.
  */
-int                                    /* error */
-xfs_alloc_decrement(
-       struct xfs_btree_cur    *cur,   /* btree cursor */
-       int                     level,  /* level in btree, 0 is leaf */
-       int                     *stat); /* success/failure */
+extern int xfs_alloc_decrement(struct xfs_btree_cur *cur, int level, int *stat);
 
 /*
  * Delete the record pointed to by cur.
  * The cursor refers to the place where the record was (could be inserted)
  * when the operation returns.
  */
-int                                    /* error */
-xfs_alloc_delete(
-       struct xfs_btree_cur    *cur,   /* btree cursor */
-       int                     *stat); /* success/failure */
+extern int xfs_alloc_delete(struct xfs_btree_cur *cur, int *stat);
 
 /*
  * Get the data from the pointed-to record.
  */
-int                                    /* error */
-xfs_alloc_get_rec(
-       struct xfs_btree_cur    *cur,   /* btree cursor */
-       xfs_agblock_t           *bno,   /* output: starting block of extent */
-       xfs_extlen_t            *len,   /* output: length of extent */
-       int                     *stat); /* output: success/failure */
+extern int xfs_alloc_get_rec(struct xfs_btree_cur *cur,        xfs_agblock_t *bno,
+                               xfs_extlen_t *len, int *stat);
 
 /*
  * Increment cursor by one record at the level.
  * For nonzero levels the leaf-ward information is untouched.
  */
-int                                    /* error */
-xfs_alloc_increment(
-       struct xfs_btree_cur    *cur,   /* btree cursor */
-       int                     level,  /* level in btree, 0 is leaf */
-       int                     *stat); /* success/failure */
+extern int xfs_alloc_increment(struct xfs_btree_cur *cur, int level, int *stat);
 
 /*
  * Insert the current record at the point referenced by cur.
  * The cursor may be inconsistent on return if splits have been done.
  */
-int                                    /* error */
-xfs_alloc_insert(
-       struct xfs_btree_cur    *cur,   /* btree cursor */
-       int                     *stat); /* success/failure */
+extern int xfs_alloc_insert(struct xfs_btree_cur *cur, int *stat);
 
 /*
  * Lookup the record equal to [bno, len] in the btree given by cur.
  */
-int                                    /* error */
-xfs_alloc_lookup_eq(
-       struct xfs_btree_cur    *cur,   /* btree cursor */
-       xfs_agblock_t           bno,    /* starting block of extent */
-       xfs_extlen_t            len,    /* length of extent */
-       int                     *stat); /* success/failure */
+extern int xfs_alloc_lookup_eq(struct xfs_btree_cur *cur, xfs_agblock_t bno,
+                               xfs_extlen_t len, int *stat);
 
 /*
  * Lookup the first record greater than or equal to [bno, len]
  * in the btree given by cur.
  */
-int                                    /* error */
-xfs_alloc_lookup_ge(
-       struct xfs_btree_cur    *cur,   /* btree cursor */
-       xfs_agblock_t           bno,    /* starting block of extent */
-       xfs_extlen_t            len,    /* length of extent */
-       int                     *stat); /* success/failure */
+extern int xfs_alloc_lookup_ge(struct xfs_btree_cur *cur, xfs_agblock_t bno,
+                               xfs_extlen_t len, int *stat);
 
 /*
  * Lookup the first record less than or equal to [bno, len]
  * in the btree given by cur.
  */
-int                                    /* error */
-xfs_alloc_lookup_le(
-       struct xfs_btree_cur    *cur,   /* btree cursor */
-       xfs_agblock_t           bno,    /* starting block of extent */
-       xfs_extlen_t            len,    /* length of extent */
-       int                     *stat); /* success/failure */
+extern int xfs_alloc_lookup_le(struct xfs_btree_cur *cur, xfs_agblock_t bno,
+                               xfs_extlen_t len, int *stat);
 
 /*
  * Update the record referred to by cur, to the value given by [bno, len].
  * This either works (return 0) or gets an EFSCORRUPTED error.
  */
-int                                    /* error */
-xfs_alloc_update(
-       struct xfs_btree_cur    *cur,   /* btree cursor */
-       xfs_agblock_t           bno,    /* starting block of extent */
-       xfs_extlen_t            len);   /* length of extent */
+extern int xfs_alloc_update(struct xfs_btree_cur *cur, xfs_agblock_t bno,
+                               xfs_extlen_t len);
 
 #endif /* __XFS_ALLOC_BTREE_H__ */
index c2c14b2103f1d59ea7a8e68f538960e0f5bbea3c..7db18e9649df6c1766127cfb20471c993dd4db32 100644 (file)
  */
 
 #include "xfs.h"
-
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
 #include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
-#include "xfs_alloc_btree.h"
+#include "xfs_da_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
-#include "xfs_alloc.h"
-#include "xfs_btree.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
-#include "xfs_inode_item.h"
 #include "xfs_inode.h"
+#include "xfs_alloc.h"
+#include "xfs_btree.h"
+#include "xfs_inode_item.h"
 #include "xfs_bmap.h"
-#include "xfs_da_btree.h"
 #include "xfs_attr.h"
 #include "xfs_attr_leaf.h"
 #include "xfs_error.h"
-#include "xfs_bit.h"
 #include "xfs_quota.h"
-#include "xfs_rw.h"
 #include "xfs_trans_space.h"
 #include "xfs_acl.h"
+#include "xfs_rw.h"
 
 /*
  * xfs_attr.c
index 63c473f8d6db9f35abfa69d2ed008b13328670dd..be82014b95220ddb53f301e7b12b05257a6a1c23 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-/*
- * xfs_attr_leaf.c
- *
- * GROT: figure out how to recover gracefully when bmap returns ENOSPC.
- */
-
 #include "xfs.h"
-
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
 #include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
-#include "xfs_alloc_btree.h"
+#include "xfs_da_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
 #include "xfs_alloc.h"
 #include "xfs_btree.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
-#include "xfs_inode_item.h"
 #include "xfs_inode.h"
+#include "xfs_inode_item.h"
 #include "xfs_bmap.h"
-#include "xfs_da_btree.h"
 #include "xfs_attr.h"
 #include "xfs_attr_leaf.h"
 #include "xfs_error.h"
-#include "xfs_bit.h"
 
 /*
  * xfs_attr_leaf.c
index 326802f80d54f66a724d6cb9832bb0a2a0d6198d..ef5f5eaa60d098d508a4d74270419c4e1cf57efc 100644 (file)
@@ -147,65 +147,58 @@ typedef struct xfs_attr_leaf_name_remote xfs_attr_leaf_name_remote_t;
 /*
  * Cast typed pointers for "local" and "remote" name/value structs.
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ATTR_LEAF_NAME_REMOTE)
-xfs_attr_leaf_name_remote_t *
-xfs_attr_leaf_name_remote(xfs_attr_leafblock_t *leafp, int idx);
 #define XFS_ATTR_LEAF_NAME_REMOTE(leafp,idx)   \
        xfs_attr_leaf_name_remote(leafp,idx)
-#else
-#define XFS_ATTR_LEAF_NAME_REMOTE(leafp,idx)   /* remote name struct ptr */ \
-       ((xfs_attr_leaf_name_remote_t *)                \
-        &((char *)(leafp))[ INT_GET((leafp)->entries[idx].nameidx, ARCH_CONVERT) ])
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ATTR_LEAF_NAME_LOCAL)
-xfs_attr_leaf_name_local_t *
-xfs_attr_leaf_name_local(xfs_attr_leafblock_t *leafp, int idx);
+static inline xfs_attr_leaf_name_remote_t *
+xfs_attr_leaf_name_remote(xfs_attr_leafblock_t *leafp, int idx)
+{
+       return (xfs_attr_leaf_name_remote_t *) &((char *)
+               (leafp))[INT_GET((leafp)->entries[idx].nameidx, ARCH_CONVERT)];
+}
+
 #define XFS_ATTR_LEAF_NAME_LOCAL(leafp,idx)    \
        xfs_attr_leaf_name_local(leafp,idx)
-#else
-#define XFS_ATTR_LEAF_NAME_LOCAL(leafp,idx)    /* local name struct ptr */ \
-       ((xfs_attr_leaf_name_local_t *)         \
-        &((char *)(leafp))[ INT_GET((leafp)->entries[idx].nameidx, ARCH_CONVERT) ])
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ATTR_LEAF_NAME)
-char *xfs_attr_leaf_name(xfs_attr_leafblock_t *leafp, int idx);
+static inline xfs_attr_leaf_name_local_t *
+xfs_attr_leaf_name_local(xfs_attr_leafblock_t *leafp, int idx)
+{
+       return (xfs_attr_leaf_name_local_t *) &((char *)
+               (leafp))[INT_GET((leafp)->entries[idx].nameidx, ARCH_CONVERT)];
+}
+
 #define XFS_ATTR_LEAF_NAME(leafp,idx)          xfs_attr_leaf_name(leafp,idx)
-#else
-#define XFS_ATTR_LEAF_NAME(leafp,idx)          /* generic name struct ptr */ \
-       (&((char *)(leafp))[ INT_GET((leafp)->entries[idx].nameidx, ARCH_CONVERT) ])
-#endif
+static inline char *xfs_attr_leaf_name(xfs_attr_leafblock_t *leafp, int idx)
+{
+       return (&((char *)
+               (leafp))[INT_GET((leafp)->entries[idx].nameidx, ARCH_CONVERT)]);
+}
 
 /*
  * Calculate total bytes used (including trailing pad for alignment) for
  * a "local" name/value structure, a "remote" name/value structure, and
  * a pointer which might be either.
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ATTR_LEAF_ENTSIZE_REMOTE)
-int xfs_attr_leaf_entsize_remote(int nlen);
 #define XFS_ATTR_LEAF_ENTSIZE_REMOTE(nlen)     \
        xfs_attr_leaf_entsize_remote(nlen)
-#else
-#define XFS_ATTR_LEAF_ENTSIZE_REMOTE(nlen)     /* space for remote struct */ \
-       (((uint)sizeof(xfs_attr_leaf_name_remote_t) - 1 + (nlen) + \
-         XFS_ATTR_LEAF_NAME_ALIGN - 1) & ~(XFS_ATTR_LEAF_NAME_ALIGN - 1))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ATTR_LEAF_ENTSIZE_LOCAL)
-int xfs_attr_leaf_entsize_local(int nlen, int vlen);
+static inline int xfs_attr_leaf_entsize_remote(int nlen)
+{
+       return ((uint)sizeof(xfs_attr_leaf_name_remote_t) - 1 + (nlen) + \
+               XFS_ATTR_LEAF_NAME_ALIGN - 1) & ~(XFS_ATTR_LEAF_NAME_ALIGN - 1);
+}
+
 #define XFS_ATTR_LEAF_ENTSIZE_LOCAL(nlen,vlen) \
        xfs_attr_leaf_entsize_local(nlen,vlen)
-#else
-#define XFS_ATTR_LEAF_ENTSIZE_LOCAL(nlen,vlen) /* space for local struct */ \
-       (((uint)sizeof(xfs_attr_leaf_name_local_t) - 1 + (nlen) + (vlen) + \
-         XFS_ATTR_LEAF_NAME_ALIGN - 1) & ~(XFS_ATTR_LEAF_NAME_ALIGN - 1))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ATTR_LEAF_ENTSIZE_LOCAL_MAX)
-int xfs_attr_leaf_entsize_local_max(int bsize);
+static inline int xfs_attr_leaf_entsize_local(int nlen, int vlen)
+{
+       return ((uint)sizeof(xfs_attr_leaf_name_local_t) - 1 + (nlen) + (vlen) +
+               XFS_ATTR_LEAF_NAME_ALIGN - 1) & ~(XFS_ATTR_LEAF_NAME_ALIGN - 1);
+}
+
 #define XFS_ATTR_LEAF_ENTSIZE_LOCAL_MAX(bsize) \
        xfs_attr_leaf_entsize_local_max(bsize)
-#else
-#define XFS_ATTR_LEAF_ENTSIZE_LOCAL_MAX(bsize) /* max local struct size */ \
-       (((bsize) >> 1) + ((bsize) >> 2))
-#endif
+static inline int xfs_attr_leaf_entsize_local_max(int bsize)
+{
+       return (((bsize) >> 1) + ((bsize) >> 2));
+}
 
 
 /*========================================================================
index ef7d2942d306074bbe8090e878a8d32bd947dc8c..c8001929deab98e6eebdaff6c8da90841f2ebbca 100644 (file)
@@ -71,38 +71,17 @@ typedef struct xfs_attr_sf_sort {
        char            *name;          /* name value, pointer into buffer */
 } xfs_attr_sf_sort_t;
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ATTR_SF_ENTSIZE_BYNAME)
-int xfs_attr_sf_entsize_byname(int nlen, int vlen);
-#define XFS_ATTR_SF_ENTSIZE_BYNAME(nlen,vlen)  \
-       xfs_attr_sf_entsize_byname(nlen,vlen)
-#else
 #define XFS_ATTR_SF_ENTSIZE_BYNAME(nlen,vlen)  /* space name/value uses */ \
-       ((int)sizeof(xfs_attr_sf_entry_t)-1 + (nlen)+(vlen))
-#endif
+       (((int)sizeof(xfs_attr_sf_entry_t)-1 + (nlen)+(vlen)))
 #define XFS_ATTR_SF_ENTSIZE_MAX                        /* max space for name&value */ \
        ((1 << (NBBY*(int)sizeof(__uint8_t))) - 1)
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ATTR_SF_ENTSIZE)
-int xfs_attr_sf_entsize(xfs_attr_sf_entry_t *sfep);
-#define XFS_ATTR_SF_ENTSIZE(sfep)      xfs_attr_sf_entsize(sfep)
-#else
 #define XFS_ATTR_SF_ENTSIZE(sfep)              /* space an entry uses */ \
        ((int)sizeof(xfs_attr_sf_entry_t)-1 + (sfep)->namelen+(sfep)->valuelen)
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ATTR_SF_NEXTENTRY)
-xfs_attr_sf_entry_t *xfs_attr_sf_nextentry(xfs_attr_sf_entry_t *sfep);
-#define XFS_ATTR_SF_NEXTENTRY(sfep)    xfs_attr_sf_nextentry(sfep)
-#else
 #define XFS_ATTR_SF_NEXTENTRY(sfep)            /* next entry in struct */ \
-       ((xfs_attr_sf_entry_t *) \
-               ((char *)(sfep) + XFS_ATTR_SF_ENTSIZE(sfep)))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ATTR_SF_TOTSIZE)
-int xfs_attr_sf_totsize(struct xfs_inode *dp);
-#define XFS_ATTR_SF_TOTSIZE(dp)                xfs_attr_sf_totsize(dp)
-#else
+       ((xfs_attr_sf_entry_t *)((char *)(sfep) + XFS_ATTR_SF_ENTSIZE(sfep)))
 #define XFS_ATTR_SF_TOTSIZE(dp)                        /* total space in use */ \
-       (INT_GET(((xfs_attr_shortform_t *)((dp)->i_afp->if_u1.if_data))->hdr.totsize, ARCH_CONVERT))
-#endif
+       (INT_GET(((xfs_attr_shortform_t *)      \
+               ((dp)->i_afp->if_u1.if_data))->hdr.totsize, ARCH_CONVERT))
 
 #if defined(XFS_ATTR_TRACE)
 /*
index 1e7f57ddf7a864cbdb619f8e77545969553e18c5..041e82485064d442650748ed9831f88411c1d9a4 100644 (file)
 /*
  * masks with n high/low bits set, 32-bit values & 64-bit values
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_MASK32HI)
-__uint32_t xfs_mask32hi(int n);
 #define        XFS_MASK32HI(n)         xfs_mask32hi(n)
-#else
-#define        XFS_MASK32HI(n)         ((__uint32_t)-1 << (32 - (n)))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_MASK64HI)
-__uint64_t xfs_mask64hi(int n);
+static inline __uint32_t xfs_mask32hi(int n)
+{
+       return (__uint32_t)-1 << (32 - (n));
+}
 #define        XFS_MASK64HI(n)         xfs_mask64hi(n)
-#else
-#define        XFS_MASK64HI(n)         ((__uint64_t)-1 << (64 - (n)))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_MASK32LO)
-__uint32_t xfs_mask32lo(int n);
+static inline __uint64_t xfs_mask64hi(int n)
+{
+       return (__uint64_t)-1 << (64 - (n));
+}
 #define        XFS_MASK32LO(n)         xfs_mask32lo(n)
-#else
-#define        XFS_MASK32LO(n)         (((__uint32_t)1 << (n)) - 1)
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_MASK64LO)
-__uint64_t xfs_mask64lo(int n);
+static inline __uint32_t xfs_mask32lo(int n)
+{
+       return ((__uint32_t)1 << (n)) - 1;
+}
 #define        XFS_MASK64LO(n)         xfs_mask64lo(n)
-#else
-#define        XFS_MASK64LO(n)         (((__uint64_t)1 << (n)) - 1)
-#endif
+static inline __uint64_t xfs_mask64lo(int n)
+{
+       return ((__uint64_t)1 << (n)) - 1;
+}
 
 /* Get high bit set out of 32-bit argument, -1 if none set */
 extern int xfs_highbit32(__uint32_t v);
index 3e013530d00d94a126e6dbd65930d0bf7b3156c2..f8e3357c1e8691ef57e7ee98037aae6e1fb97c64 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
 #include "xfs.h"
-
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
 #include "xfs_dir.h"
 #include "xfs_dir2.h"
-#include "xfs_dmapi.h"
-#include "xfs_mount.h"
-#include "xfs_alloc_btree.h"
+#include "xfs_da_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
-#include "xfs_btree.h"
-#include "xfs_ialloc.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
-#include "xfs_inode_item.h"
 #include "xfs_inode.h"
+#include "xfs_btree.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_ialloc.h"
 #include "xfs_itable.h"
+#include "xfs_inode_item.h"
 #include "xfs_extfree_item.h"
 #include "xfs_alloc.h"
 #include "xfs_bmap.h"
 #include "xfs_rtalloc.h"
 #include "xfs_error.h"
-#include "xfs_da_btree.h"
 #include "xfs_dir_leaf.h"
 #include "xfs_attr_leaf.h"
-#include "xfs_bit.h"
 #include "xfs_rw.h"
 #include "xfs_quota.h"
 #include "xfs_trans_space.h"
index e42d1b7777e1bb9face92a2a093deee7847bebe0..51a9c82f0f624b47d0993e12cea4e4664066518f 100644 (file)
@@ -77,12 +77,11 @@ typedef     struct xfs_bmap_free
                                        /* combine contig. space */
 #define        XFS_BMAPI_CONTIG        0x400   /* must allocate only one extent */
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BMAPI_AFLAG)
-int xfs_bmapi_aflag(int w);
 #define        XFS_BMAPI_AFLAG(w)      xfs_bmapi_aflag(w)
-#else
-#define        XFS_BMAPI_AFLAG(w)      ((w) == XFS_ATTR_FORK ? XFS_BMAPI_ATTRFORK : 0)
-#endif
+static inline int xfs_bmapi_aflag(int w)
+{
+       return (w == XFS_ATTR_FORK ? XFS_BMAPI_ATTRFORK : 0);
+}
 
 /*
  * Special values for xfs_bmbt_irec_t br_startblock field.
@@ -90,14 +89,12 @@ int xfs_bmapi_aflag(int w);
 #define        DELAYSTARTBLOCK         ((xfs_fsblock_t)-1LL)
 #define        HOLESTARTBLOCK          ((xfs_fsblock_t)-2LL)
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BMAP_INIT)
-void xfs_bmap_init(xfs_bmap_free_t *flp, xfs_fsblock_t *fbp);
 #define        XFS_BMAP_INIT(flp,fbp)  xfs_bmap_init(flp,fbp)
-#else
-#define        XFS_BMAP_INIT(flp,fbp)  \
+static inline void xfs_bmap_init(xfs_bmap_free_t *flp, xfs_fsblock_t *fbp)
+{
        ((flp)->xbf_first = NULL, (flp)->xbf_count = 0, \
-        (flp)->xbf_low = 0, *(fbp) = NULLFSBLOCK)
-#endif
+               (flp)->xbf_low = 0, *(fbp) = NULLFSBLOCK);
+}
 
 /*
  * Argument structure for xfs_bmap_alloc.
index 09a77b17565b06c9c4fde3a8cde2e2e739a4f708..cc72f77f9824a3b4dccd978a01aca7217007920a 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
 #include "xfs.h"
-
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
 #include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
-#include "xfs_alloc_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
-#include "xfs_btree.h"
-#include "xfs_ialloc.h"
-#include "xfs_itable.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
-#include "xfs_inode_item.h"
 #include "xfs_inode.h"
+#include "xfs_inode_item.h"
 #include "xfs_alloc.h"
-#include "xfs_bit.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_itable.h"
 #include "xfs_bmap.h"
 #include "xfs_error.h"
 #include "xfs_quota.h"
index 2cf4fe45cbcb16f73a8e1accd97512dae046623b..ff0102d14918b82ab29773769794ca2dcc3e64d5 100644 (file)
@@ -114,31 +114,31 @@ typedef xfs_bmbt_rec_64_t xfs_bmbt_rec_t, xfs_bmdr_rec_t;
        (((((xfs_fsblock_t)1) << STARTBLOCKMASKBITS) - 1) << STARTBLOCKVALBITS)
 #define DSTARTBLOCKMASK                \
        (((((xfs_dfsbno_t)1) << DSTARTBLOCKMASKBITS) - 1) << STARTBLOCKVALBITS)
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_ISNULLSTARTBLOCK)
-int isnullstartblock(xfs_fsblock_t x);
+
 #define ISNULLSTARTBLOCK(x)    isnullstartblock(x)
-#else
-#define ISNULLSTARTBLOCK(x)    (((x) & STARTBLOCKMASK) == STARTBLOCKMASK)
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_ISNULLDSTARTBLOCK)
-int isnulldstartblock(xfs_dfsbno_t x);
+static inline int isnullstartblock(xfs_fsblock_t x)
+{
+       return ((x) & STARTBLOCKMASK) == STARTBLOCKMASK;
+}
+
 #define ISNULLDSTARTBLOCK(x)   isnulldstartblock(x)
-#else
-#define ISNULLDSTARTBLOCK(x)   (((x) & DSTARTBLOCKMASK) == DSTARTBLOCKMASK)
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_NULLSTARTBLOCK)
-xfs_fsblock_t nullstartblock(int k);
+static inline int isnulldstartblock(xfs_dfsbno_t x)
+{
+       return ((x) & DSTARTBLOCKMASK) == DSTARTBLOCKMASK;
+}
+
 #define NULLSTARTBLOCK(k)      nullstartblock(k)
-#else
-#define NULLSTARTBLOCK(k)      \
-       ((ASSERT(k < (1 << STARTBLOCKVALBITS))), (STARTBLOCKMASK | (k)))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_STARTBLOCKVAL)
-xfs_filblks_t startblockval(xfs_fsblock_t x);
+static inline xfs_fsblock_t nullstartblock(int k)
+{
+       ASSERT(k < (1 << STARTBLOCKVALBITS));
+       return STARTBLOCKMASK | (k);
+}
+
 #define STARTBLOCKVAL(x)       startblockval(x)
-#else
-#define STARTBLOCKVAL(x)       ((xfs_filblks_t)((x) & ~STARTBLOCKMASK))
-#endif
+static inline xfs_filblks_t startblockval(xfs_fsblock_t x)
+{
+       return (xfs_filblks_t)((x) & ~STARTBLOCKMASK);
+}
 
 /*
  * Possible extent formats.
@@ -159,14 +159,9 @@ typedef enum {
 /*
  * Extent state and extent format macros.
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_EXTFMT_INODE )
-xfs_exntfmt_t xfs_extfmt_inode(struct xfs_inode *ip);
-#define XFS_EXTFMT_INODE(x)    xfs_extfmt_inode(x)
-#else
-#define XFS_EXTFMT_INODE(x) \
-  (XFS_SB_VERSION_HASEXTFLGBIT(&((x)->i_mount->m_sb)) ? \
-       XFS_EXTFMT_HASSTATE : XFS_EXTFMT_NOSTATE)
-#endif
+#define XFS_EXTFMT_INODE(x)    \
+       (XFS_SB_VERSION_HASEXTFLGBIT(&((x)->i_mount->m_sb)) ? \
+               XFS_EXTFMT_HASSTATE : XFS_EXTFMT_NOSTATE)
 #define ISUNWRITTEN(x) ((x)->br_state == XFS_EXT_UNWRITTEN)
 
 /*
@@ -192,248 +187,111 @@ typedef xfs_dfsbno_t xfs_bmbt_ptr_t, xfs_bmdr_ptr_t;    /* btree pointer type */
                                        /* btree block header type */
 typedef struct xfs_btree_lblock xfs_bmbt_block_t;
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BUF_TO_BMBT_BLOCK)
-xfs_bmbt_block_t *xfs_buf_to_bmbt_block(struct xfs_buf *bp);
-#define XFS_BUF_TO_BMBT_BLOCK(bp)              xfs_buf_to_bmbt_block(bp)
-#else
-#define XFS_BUF_TO_BMBT_BLOCK(bp) ((xfs_bmbt_block_t *)(XFS_BUF_PTR(bp)))
-#endif
+#define XFS_BUF_TO_BMBT_BLOCK(bp)      ((xfs_bmbt_block_t *)XFS_BUF_PTR(bp))
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BMAP_RBLOCK_DSIZE)
-int xfs_bmap_rblock_dsize(int lev, struct xfs_btree_cur *cur);
-#define XFS_BMAP_RBLOCK_DSIZE(lev,cur)         xfs_bmap_rblock_dsize(lev,cur)
-#else
-#define XFS_BMAP_RBLOCK_DSIZE(lev,cur) ((cur)->bc_private.b.forksize)
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BMAP_RBLOCK_ISIZE)
-int xfs_bmap_rblock_isize(int lev, struct xfs_btree_cur *cur);
-#define XFS_BMAP_RBLOCK_ISIZE(lev,cur)         xfs_bmap_rblock_isize(lev,cur)
-#else
-#define XFS_BMAP_RBLOCK_ISIZE(lev,cur) \
+#define XFS_BMAP_IBLOCK_SIZE(lev,cur)  (1 << (cur)->bc_blocklog)
+#define XFS_BMAP_RBLOCK_DSIZE(lev,cur) ((cur)->bc_private.b.forksize)
+#define XFS_BMAP_RBLOCK_ISIZE(lev,cur) \
        ((int)XFS_IFORK_PTR((cur)->bc_private.b.ip, \
-                           (cur)->bc_private.b.whichfork)->if_broot_bytes)
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BMAP_IBLOCK_SIZE)
-int xfs_bmap_iblock_size(int lev, struct xfs_btree_cur *cur);
-#define XFS_BMAP_IBLOCK_SIZE(lev,cur)          xfs_bmap_iblock_size(lev,cur)
-#else
-#define XFS_BMAP_IBLOCK_SIZE(lev,cur) (1 << (cur)->bc_blocklog)
-#endif
+                   (cur)->bc_private.b.whichfork)->if_broot_bytes)
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BMAP_BLOCK_DSIZE)
-int xfs_bmap_block_dsize(int lev, struct xfs_btree_cur *cur);
-#define XFS_BMAP_BLOCK_DSIZE(lev,cur)          xfs_bmap_block_dsize(lev,cur)
-#else
-#define XFS_BMAP_BLOCK_DSIZE(lev,cur) \
-       ((lev) == (cur)->bc_nlevels - 1 ? \
-               XFS_BMAP_RBLOCK_DSIZE(lev,cur) : \
-               XFS_BMAP_IBLOCK_SIZE(lev,cur))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BMAP_BLOCK_ISIZE)
-int xfs_bmap_block_isize(int lev, struct xfs_btree_cur *cur);
-#define XFS_BMAP_BLOCK_ISIZE(lev,cur)          xfs_bmap_block_isize(lev,cur)
-#else
-#define XFS_BMAP_BLOCK_ISIZE(lev,cur) \
-       ((lev) == (cur)->bc_nlevels - 1 ? \
-               XFS_BMAP_RBLOCK_ISIZE(lev,cur) : \
-               XFS_BMAP_IBLOCK_SIZE(lev,cur))
-#endif
+#define XFS_BMAP_BLOCK_DSIZE(lev,cur)  \
+       (((lev) == (cur)->bc_nlevels - 1 ? \
+               XFS_BMAP_RBLOCK_DSIZE(lev,cur) : XFS_BMAP_IBLOCK_SIZE(lev,cur)))
+#define XFS_BMAP_BLOCK_ISIZE(lev,cur)  \
+       (((lev) == (cur)->bc_nlevels - 1 ? \
+               XFS_BMAP_RBLOCK_ISIZE(lev,cur) : XFS_BMAP_IBLOCK_SIZE(lev,cur)))
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BMAP_BLOCK_DMAXRECS)
-int xfs_bmap_block_dmaxrecs(int lev, struct xfs_btree_cur *cur);
-#define XFS_BMAP_BLOCK_DMAXRECS(lev,cur)       xfs_bmap_block_dmaxrecs(lev,cur)
-#else
 #define XFS_BMAP_BLOCK_DMAXRECS(lev,cur) \
-       ((lev) == (cur)->bc_nlevels - 1 ? \
+       (((lev) == (cur)->bc_nlevels - 1 ? \
                XFS_BTREE_BLOCK_MAXRECS(XFS_BMAP_RBLOCK_DSIZE(lev,cur), \
                        xfs_bmdr, (lev) == 0) : \
-               ((cur)->bc_mp->m_bmap_dmxr[(lev) != 0]))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BMAP_BLOCK_IMAXRECS)
-int xfs_bmap_block_imaxrecs(int lev, struct xfs_btree_cur *cur);
-#define XFS_BMAP_BLOCK_IMAXRECS(lev,cur)       xfs_bmap_block_imaxrecs(lev,cur)
-#else
+               ((cur)->bc_mp->m_bmap_dmxr[(lev) != 0])))
 #define XFS_BMAP_BLOCK_IMAXRECS(lev,cur) \
-       ((lev) == (cur)->bc_nlevels - 1 ? \
-               XFS_BTREE_BLOCK_MAXRECS(XFS_BMAP_RBLOCK_ISIZE(lev,cur), \
-                       xfs_bmbt, (lev) == 0) : \
-               ((cur)->bc_mp->m_bmap_dmxr[(lev) != 0]))
-#endif
+       (((lev) == (cur)->bc_nlevels - 1 ? \
+                       XFS_BTREE_BLOCK_MAXRECS(XFS_BMAP_RBLOCK_ISIZE(lev,cur),\
+                               xfs_bmbt, (lev) == 0) : \
+                       ((cur)->bc_mp->m_bmap_dmxr[(lev) != 0])))
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BMAP_BLOCK_DMINRECS)
-int xfs_bmap_block_dminrecs(int lev, struct xfs_btree_cur *cur);
-#define XFS_BMAP_BLOCK_DMINRECS(lev,cur)       xfs_bmap_block_dminrecs(lev,cur)
-#else
 #define XFS_BMAP_BLOCK_DMINRECS(lev,cur) \
-       ((lev) == (cur)->bc_nlevels - 1 ? \
-               XFS_BTREE_BLOCK_MINRECS(XFS_BMAP_RBLOCK_DSIZE(lev,cur), \
-                       xfs_bmdr, (lev) == 0) : \
-               ((cur)->bc_mp->m_bmap_dmnr[(lev) != 0]))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BMAP_BLOCK_IMINRECS)
-int xfs_bmap_block_iminrecs(int lev, struct xfs_btree_cur *cur);
-#define XFS_BMAP_BLOCK_IMINRECS(lev,cur)       xfs_bmap_block_iminrecs(lev,cur)
-#else
+       (((lev) == (cur)->bc_nlevels - 1 ? \
+                       XFS_BTREE_BLOCK_MINRECS(XFS_BMAP_RBLOCK_DSIZE(lev,cur),\
+                               xfs_bmdr, (lev) == 0) : \
+                       ((cur)->bc_mp->m_bmap_dmnr[(lev) != 0])))
 #define XFS_BMAP_BLOCK_IMINRECS(lev,cur) \
-       ((lev) == (cur)->bc_nlevels - 1 ? \
-               XFS_BTREE_BLOCK_MINRECS(XFS_BMAP_RBLOCK_ISIZE(lev,cur), \
-                       xfs_bmbt, (lev) == 0) : \
-               ((cur)->bc_mp->m_bmap_dmnr[(lev) != 0]))
-#endif
-
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BMAP_REC_DADDR)
-xfs_bmbt_rec_t *
-xfs_bmap_rec_daddr(xfs_bmbt_block_t *bb, int i, struct xfs_btree_cur *cur);
-#define XFS_BMAP_REC_DADDR(bb,i,cur)           xfs_bmap_rec_daddr(bb,i,cur)
-#else
-#define XFS_BMAP_REC_DADDR(bb,i,cur) \
-       XFS_BTREE_REC_ADDR(XFS_BMAP_BLOCK_DSIZE(                \
-               INT_GET((bb)->bb_level, ARCH_CONVERT), cur),    \
-               xfs_bmbt, bb, i, XFS_BMAP_BLOCK_DMAXRECS(       \
-                       INT_GET((bb)->bb_level, ARCH_CONVERT), cur))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BMAP_REC_IADDR)
-xfs_bmbt_rec_t *
-xfs_bmap_rec_iaddr(xfs_bmbt_block_t *bb, int i, struct xfs_btree_cur *cur);
-#define XFS_BMAP_REC_IADDR(bb,i,cur)           xfs_bmap_rec_iaddr(bb,i,cur)
-#else
-#define XFS_BMAP_REC_IADDR(bb,i,cur) \
-       XFS_BTREE_REC_ADDR(XFS_BMAP_BLOCK_ISIZE(                \
-               INT_GET((bb)->bb_level, ARCH_CONVERT), cur),    \
-               xfs_bmbt, bb, i, XFS_BMAP_BLOCK_IMAXRECS(       \
-                       INT_GET((bb)->bb_level, ARCH_CONVERT), cur))
-#endif
-
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BMAP_KEY_DADDR)
-xfs_bmbt_key_t *
-xfs_bmap_key_daddr(xfs_bmbt_block_t *bb, int i, struct xfs_btree_cur *cur);
-#define XFS_BMAP_KEY_DADDR(bb,i,cur)           xfs_bmap_key_daddr(bb,i,cur)
-#else
-#define XFS_BMAP_KEY_DADDR(bb,i,cur) \
-       XFS_BTREE_KEY_ADDR(XFS_BMAP_BLOCK_DSIZE(                \
-               INT_GET((bb)->bb_level, ARCH_CONVERT), cur),    \
-               xfs_bmbt, bb, i, XFS_BMAP_BLOCK_DMAXRECS(       \
-                       INT_GET((bb)->bb_level, ARCH_CONVERT), cur))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BMAP_KEY_IADDR)
-xfs_bmbt_key_t *
-xfs_bmap_key_iaddr(xfs_bmbt_block_t *bb, int i, struct xfs_btree_cur *cur);
-#define XFS_BMAP_KEY_IADDR(bb,i,cur)           xfs_bmap_key_iaddr(bb,i,cur)
-#else
-#define XFS_BMAP_KEY_IADDR(bb,i,cur) \
-       XFS_BTREE_KEY_ADDR(XFS_BMAP_BLOCK_ISIZE(                \
-               INT_GET((bb)->bb_level, ARCH_CONVERT), cur),    \
-               xfs_bmbt, bb, i, XFS_BMAP_BLOCK_IMAXRECS(       \
-                       INT_GET((bb)->bb_level, ARCH_CONVERT), cur))
-#endif
-
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BMAP_PTR_DADDR)
-xfs_bmbt_ptr_t *
-xfs_bmap_ptr_daddr(xfs_bmbt_block_t *bb, int i, struct xfs_btree_cur *cur);
-#define XFS_BMAP_PTR_DADDR(bb,i,cur)           xfs_bmap_ptr_daddr(bb,i,cur)
-#else
-#define XFS_BMAP_PTR_DADDR(bb,i,cur) \
-       XFS_BTREE_PTR_ADDR(XFS_BMAP_BLOCK_DSIZE(                \
-               INT_GET((bb)->bb_level, ARCH_CONVERT), cur),    \
-               xfs_bmbt, bb, i, XFS_BMAP_BLOCK_DMAXRECS(       \
-                       INT_GET((bb)->bb_level, ARCH_CONVERT), cur))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BMAP_PTR_IADDR)
-xfs_bmbt_ptr_t *
-xfs_bmap_ptr_iaddr(xfs_bmbt_block_t *bb, int i, struct xfs_btree_cur *cur);
-#define XFS_BMAP_PTR_IADDR(bb,i,cur)           xfs_bmap_ptr_iaddr(bb,i,cur)
-#else
-#define XFS_BMAP_PTR_IADDR(bb,i,cur) \
-       XFS_BTREE_PTR_ADDR(XFS_BMAP_BLOCK_ISIZE(                \
-               INT_GET((bb)->bb_level, ARCH_CONVERT), cur),    \
-               xfs_bmbt, bb, i, XFS_BMAP_BLOCK_IMAXRECS(       \
-                       INT_GET((bb)->bb_level, ARCH_CONVERT), cur))
-#endif
+       (((lev) == (cur)->bc_nlevels - 1 ? \
+                       XFS_BTREE_BLOCK_MINRECS(XFS_BMAP_RBLOCK_ISIZE(lev,cur),\
+                               xfs_bmbt, (lev) == 0) : \
+                       ((cur)->bc_mp->m_bmap_dmnr[(lev) != 0])))
+
+#define XFS_BMAP_REC_DADDR(bb,i,cur)   \
+       (XFS_BTREE_REC_ADDR(XFS_BMAP_BLOCK_DSIZE(                       \
+                       INT_GET((bb)->bb_level, ARCH_CONVERT), cur),    \
+                       xfs_bmbt, bb, i, XFS_BMAP_BLOCK_DMAXRECS(       \
+                               INT_GET((bb)->bb_level, ARCH_CONVERT), cur)))
+#define XFS_BMAP_REC_IADDR(bb,i,cur)   \
+       (XFS_BTREE_REC_ADDR(XFS_BMAP_BLOCK_ISIZE(                       \
+                       INT_GET((bb)->bb_level, ARCH_CONVERT), cur),    \
+                       xfs_bmbt, bb, i, XFS_BMAP_BLOCK_IMAXRECS(       \
+                               INT_GET((bb)->bb_level, ARCH_CONVERT), cur)))
+
+#define XFS_BMAP_KEY_DADDR(bb,i,cur)   \
+       (XFS_BTREE_KEY_ADDR(XFS_BMAP_BLOCK_DSIZE(                       \
+                       INT_GET((bb)->bb_level, ARCH_CONVERT), cur),    \
+                       xfs_bmbt, bb, i, XFS_BMAP_BLOCK_DMAXRECS(       \
+                               INT_GET((bb)->bb_level, ARCH_CONVERT), cur)))
+#define XFS_BMAP_KEY_IADDR(bb,i,cur)   \
+       (XFS_BTREE_KEY_ADDR(XFS_BMAP_BLOCK_ISIZE(                       \
+                       INT_GET((bb)->bb_level, ARCH_CONVERT), cur),    \
+                       xfs_bmbt, bb, i, XFS_BMAP_BLOCK_IMAXRECS(       \
+                               INT_GET((bb)->bb_level, ARCH_CONVERT), cur)))
+
+#define XFS_BMAP_PTR_DADDR(bb,i,cur)   \
+       (XFS_BTREE_PTR_ADDR(XFS_BMAP_BLOCK_DSIZE(                       \
+                       INT_GET((bb)->bb_level, ARCH_CONVERT), cur),    \
+                       xfs_bmbt, bb, i, XFS_BMAP_BLOCK_DMAXRECS(       \
+                               INT_GET((bb)->bb_level, ARCH_CONVERT), cur)))
+#define XFS_BMAP_PTR_IADDR(bb,i,cur)   \
+       (XFS_BTREE_PTR_ADDR(XFS_BMAP_BLOCK_ISIZE(                       \
+                       INT_GET((bb)->bb_level, ARCH_CONVERT), cur),    \
+                       xfs_bmbt, bb, i, XFS_BMAP_BLOCK_IMAXRECS(       \
+                               INT_GET((bb)->bb_level, ARCH_CONVERT), cur)))
 
 /*
  * These are to be used when we know the size of the block and
  * we don't have a cursor.
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BMAP_BROOT_REC_ADDR)
-xfs_bmbt_rec_t *xfs_bmap_broot_rec_addr(xfs_bmbt_block_t *bb, int i, int sz);
-#define XFS_BMAP_BROOT_REC_ADDR(bb,i,sz)       xfs_bmap_broot_rec_addr(bb,i,sz)
-#else
 #define XFS_BMAP_BROOT_REC_ADDR(bb,i,sz) \
-       XFS_BTREE_REC_ADDR(sz,xfs_bmbt,bb,i,XFS_BMAP_BROOT_MAXRECS(sz))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BMAP_BROOT_KEY_ADDR)
-xfs_bmbt_key_t *xfs_bmap_broot_key_addr(xfs_bmbt_block_t *bb, int i, int sz);
-#define XFS_BMAP_BROOT_KEY_ADDR(bb,i,sz)       xfs_bmap_broot_key_addr(bb,i,sz)
-#else
+       (XFS_BTREE_REC_ADDR(sz,xfs_bmbt,bb,i,XFS_BMAP_BROOT_MAXRECS(sz)))
 #define XFS_BMAP_BROOT_KEY_ADDR(bb,i,sz) \
-       XFS_BTREE_KEY_ADDR(sz,xfs_bmbt,bb,i,XFS_BMAP_BROOT_MAXRECS(sz))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BMAP_BROOT_PTR_ADDR)
-xfs_bmbt_ptr_t *xfs_bmap_broot_ptr_addr(xfs_bmbt_block_t *bb, int i, int sz);
-#define XFS_BMAP_BROOT_PTR_ADDR(bb,i,sz)       xfs_bmap_broot_ptr_addr(bb,i,sz)
-#else
+       (XFS_BTREE_KEY_ADDR(sz,xfs_bmbt,bb,i,XFS_BMAP_BROOT_MAXRECS(sz)))
 #define XFS_BMAP_BROOT_PTR_ADDR(bb,i,sz) \
-       XFS_BTREE_PTR_ADDR(sz,xfs_bmbt,bb,i,XFS_BMAP_BROOT_MAXRECS(sz))
-#endif
+       (XFS_BTREE_PTR_ADDR(sz,xfs_bmbt,bb,i,XFS_BMAP_BROOT_MAXRECS(sz)))
+
+#define XFS_BMAP_BROOT_NUMRECS(bb)     INT_GET((bb)->bb_numrecs, ARCH_CONVERT)
+#define XFS_BMAP_BROOT_MAXRECS(sz)     XFS_BTREE_BLOCK_MAXRECS(sz,xfs_bmbt,0)
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BMAP_BROOT_NUMRECS)
-int xfs_bmap_broot_numrecs(xfs_bmdr_block_t *bb);
-#define XFS_BMAP_BROOT_NUMRECS(bb)             xfs_bmap_broot_numrecs(bb)
-#else
-#define XFS_BMAP_BROOT_NUMRECS(bb) (INT_GET((bb)->bb_numrecs, ARCH_CONVERT))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BMAP_BROOT_MAXRECS)
-int xfs_bmap_broot_maxrecs(int sz);
-#define XFS_BMAP_BROOT_MAXRECS(sz)             xfs_bmap_broot_maxrecs(sz)
-#else
-#define XFS_BMAP_BROOT_MAXRECS(sz) XFS_BTREE_BLOCK_MAXRECS(sz,xfs_bmbt,0)
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BMAP_BROOT_SPACE_CALC)
-int xfs_bmap_broot_space_calc(int nrecs);
-#define XFS_BMAP_BROOT_SPACE_CALC(nrecs)       xfs_bmap_broot_space_calc(nrecs)
-#else
 #define XFS_BMAP_BROOT_SPACE_CALC(nrecs) \
-       ((int)(sizeof(xfs_bmbt_block_t) + \
-              ((nrecs) * (sizeof(xfs_bmbt_key_t) + sizeof(xfs_bmbt_ptr_t)))))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BMAP_BROOT_SPACE)
-int xfs_bmap_broot_space(xfs_bmdr_block_t *bb);
-#define XFS_BMAP_BROOT_SPACE(bb)               xfs_bmap_broot_space(bb)
-#else
+       (int)(sizeof(xfs_bmbt_block_t) + \
+              ((nrecs) * (sizeof(xfs_bmbt_key_t) + sizeof(xfs_bmbt_ptr_t))))
+
 #define XFS_BMAP_BROOT_SPACE(bb) \
-       XFS_BMAP_BROOT_SPACE_CALC(INT_GET((bb)->bb_numrecs, ARCH_CONVERT))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BMDR_SPACE_CALC)
-int xfs_bmdr_space_calc(int nrecs);
-#define XFS_BMDR_SPACE_CALC(nrecs)             xfs_bmdr_space_calc(nrecs)
-#else
-#define XFS_BMDR_SPACE_CALC(nrecs)     \
-       ((int)(sizeof(xfs_bmdr_block_t) + \
-              ((nrecs) * (sizeof(xfs_bmbt_key_t) + sizeof(xfs_bmbt_ptr_t)))))
-#endif
+       (XFS_BMAP_BROOT_SPACE_CALC(INT_GET((bb)->bb_numrecs, ARCH_CONVERT)))
+#define XFS_BMDR_SPACE_CALC(nrecs) \
+       (int)(sizeof(xfs_bmdr_block_t) + \
+              ((nrecs) * (sizeof(xfs_bmbt_key_t) + sizeof(xfs_bmbt_ptr_t))))
 
 /*
  * Maximum number of bmap btree levels.
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BM_MAXLEVELS)
-int xfs_bm_maxlevels(struct xfs_mount *mp, int w);
-#define XFS_BM_MAXLEVELS(mp,w)                 xfs_bm_maxlevels(mp,w)
-#else
-#define XFS_BM_MAXLEVELS(mp,w)         ((mp)->m_bm_maxlevels[w])
-#endif
+#define XFS_BM_MAXLEVELS(mp,w)         ((mp)->m_bm_maxlevels[(w)])
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BMAP_SANITY_CHECK)
-int xfs_bmap_sanity_check(struct xfs_mount *mp, xfs_bmbt_block_t *bb,
-       int level);
-#define XFS_BMAP_SANITY_CHECK(mp,bb,level)     \
-       xfs_bmap_sanity_check(mp,bb,level)
-#else
-#define XFS_BMAP_SANITY_CHECK(mp,bb,level)     \
+#define XFS_BMAP_SANITY_CHECK(mp,bb,level) \
        (INT_GET((bb)->bb_magic, ARCH_CONVERT) == XFS_BMAP_MAGIC && \
         INT_GET((bb)->bb_level, ARCH_CONVERT) == level && \
         INT_GET((bb)->bb_numrecs, ARCH_CONVERT) > 0 && \
-        INT_GET((bb)->bb_numrecs, ARCH_CONVERT) <= (mp)->m_bmap_dmxr[(level) != 0])
-#endif
+        INT_GET((bb)->bb_numrecs, ARCH_CONVERT) <= \
+                        (mp)->m_bmap_dmxr[(level) != 0])
 
 
 #ifdef __KERNEL__
@@ -459,234 +317,84 @@ extern ktrace_t  *xfs_bmbt_trace_buf;
 /*
  * Prototypes for xfs_bmap.c to call.
  */
-
-void
-xfs_bmdr_to_bmbt(
-       xfs_bmdr_block_t *,
-       int,
-       xfs_bmbt_block_t *,
-       int);
-
-int
-xfs_bmbt_decrement(
-       struct xfs_btree_cur *,
-       int,
-       int *);
-
-int
-xfs_bmbt_delete(
-       struct xfs_btree_cur *,
-       int *);
-
-void
-xfs_bmbt_get_all(
-       xfs_bmbt_rec_t  *r,
-       xfs_bmbt_irec_t *s);
-
-xfs_bmbt_block_t *
-xfs_bmbt_get_block(
-       struct xfs_btree_cur    *cur,
-       int                     level,
-       struct xfs_buf          **bpp);
-
-xfs_filblks_t
-xfs_bmbt_get_blockcount(
-       xfs_bmbt_rec_t  *r);
-
-xfs_fsblock_t
-xfs_bmbt_get_startblock(
-       xfs_bmbt_rec_t  *r);
-
-xfs_fileoff_t
-xfs_bmbt_get_startoff(
-       xfs_bmbt_rec_t  *r);
-
-xfs_exntst_t
-xfs_bmbt_get_state(
-       xfs_bmbt_rec_t  *r);
+extern void xfs_bmdr_to_bmbt(xfs_bmdr_block_t *, int, xfs_bmbt_block_t *, int);
+extern int xfs_bmbt_decrement(struct xfs_btree_cur *, int, int *);
+extern int xfs_bmbt_delete(struct xfs_btree_cur *, int *);
+extern void xfs_bmbt_get_all(xfs_bmbt_rec_t *r, xfs_bmbt_irec_t *s);
+extern xfs_bmbt_block_t *xfs_bmbt_get_block(struct xfs_btree_cur *cur,
+                                               int, struct xfs_buf **bpp);
+extern xfs_filblks_t xfs_bmbt_get_blockcount(xfs_bmbt_rec_t *r);
+extern xfs_fsblock_t xfs_bmbt_get_startblock(xfs_bmbt_rec_t *r);
+extern xfs_fileoff_t xfs_bmbt_get_startoff(xfs_bmbt_rec_t *r);
+extern xfs_exntst_t xfs_bmbt_get_state(xfs_bmbt_rec_t *r);
 
 #ifndef XFS_NATIVE_HOST
-void
-xfs_bmbt_disk_get_all(
-       xfs_bmbt_rec_t  *r,
-       xfs_bmbt_irec_t *s);
-
-xfs_exntst_t
-xfs_bmbt_disk_get_state(
-       xfs_bmbt_rec_t  *r);
-
-xfs_filblks_t
-xfs_bmbt_disk_get_blockcount(
-       xfs_bmbt_rec_t  *r);
-
-xfs_fsblock_t
-xfs_bmbt_disk_get_startblock(
-       xfs_bmbt_rec_t  *r);
-
-xfs_fileoff_t
-xfs_bmbt_disk_get_startoff(
-       xfs_bmbt_rec_t  *r);
-
-#else
-#define xfs_bmbt_disk_get_all(r, s) \
-       xfs_bmbt_get_all(r, s)
-#define xfs_bmbt_disk_get_state(r) \
-       xfs_bmbt_get_state(r)
-#define xfs_bmbt_disk_get_blockcount(r) \
-       xfs_bmbt_get_blockcount(r)
-#define xfs_bmbt_disk_get_startblock(r) \
-       xfs_bmbt_get_blockcount(r)
-#define xfs_bmbt_disk_get_startoff(r) \
-       xfs_bmbt_get_startoff(r)
+extern void xfs_bmbt_disk_get_all(xfs_bmbt_rec_t *r, xfs_bmbt_irec_t *s);
+extern xfs_exntst_t xfs_bmbt_disk_get_state(xfs_bmbt_rec_t *r);
+extern xfs_filblks_t xfs_bmbt_disk_get_blockcount(xfs_bmbt_rec_t *r);
+extern xfs_fsblock_t xfs_bmbt_disk_get_startblock(xfs_bmbt_rec_t *r);
+extern xfs_fileoff_t xfs_bmbt_disk_get_startoff(xfs_bmbt_rec_t *r);
+#else
+#define xfs_bmbt_disk_get_all(r, s)    xfs_bmbt_get_all(r, s)
+#define xfs_bmbt_disk_get_state(r)     xfs_bmbt_get_state(r)
+#define xfs_bmbt_disk_get_blockcount(r)        xfs_bmbt_get_blockcount(r)
+#define xfs_bmbt_disk_get_startblock(r)        xfs_bmbt_get_blockcount(r)
+#define xfs_bmbt_disk_get_startoff(r)  xfs_bmbt_get_startoff(r)
 #endif /* XFS_NATIVE_HOST */
 
-int
-xfs_bmbt_increment(
-       struct xfs_btree_cur *,
-       int,
-       int *);
-
-int
-xfs_bmbt_insert(
-       struct xfs_btree_cur *,
-       int *);
-
-void
-xfs_bmbt_log_block(
-       struct xfs_btree_cur *,
-       struct xfs_buf *,
-       int);
-
-void
-xfs_bmbt_log_recs(
-       struct xfs_btree_cur *,
-       struct xfs_buf *,
-       int,
-       int);
-
-int
-xfs_bmbt_lookup_eq(
-       struct xfs_btree_cur *,
-       xfs_fileoff_t,
-       xfs_fsblock_t,
-       xfs_filblks_t,
-       int *);
-
-int
-xfs_bmbt_lookup_ge(
-       struct xfs_btree_cur *,
-       xfs_fileoff_t,
-       xfs_fsblock_t,
-       xfs_filblks_t,
-       int *);
+extern int xfs_bmbt_increment(struct xfs_btree_cur *, int, int *);
+extern int xfs_bmbt_insert(struct xfs_btree_cur *, int *);
+extern void xfs_bmbt_log_block(struct xfs_btree_cur *, struct xfs_buf *, int);
+extern void xfs_bmbt_log_recs(struct xfs_btree_cur *, struct xfs_buf *, int,
+                               int);
+extern int xfs_bmbt_lookup_eq(struct xfs_btree_cur *, xfs_fileoff_t,
+                               xfs_fsblock_t, xfs_filblks_t, int *);
+extern int xfs_bmbt_lookup_ge(struct xfs_btree_cur *, xfs_fileoff_t,
+                               xfs_fsblock_t, xfs_filblks_t, int *);
 
 /*
  * Give the bmap btree a new root block.  Copy the old broot contents
  * down into a real block and make the broot point to it.
  */
-int                                            /* error */
-xfs_bmbt_newroot(
-       struct xfs_btree_cur    *cur,           /* btree cursor */
-       int                     *logflags,      /* logging flags for inode */
-       int                     *stat);         /* return status - 0 fail */
-
-void
-xfs_bmbt_set_all(
-       xfs_bmbt_rec_t  *r,
-       xfs_bmbt_irec_t *s);
-
-void
-xfs_bmbt_set_allf(
-       xfs_bmbt_rec_t  *r,
-       xfs_fileoff_t   o,
-       xfs_fsblock_t   b,
-       xfs_filblks_t   c,
-       xfs_exntst_t    v);
-
-void
-xfs_bmbt_set_blockcount(
-       xfs_bmbt_rec_t  *r,
-       xfs_filblks_t   v);
-
-void
-xfs_bmbt_set_startblock(
-       xfs_bmbt_rec_t  *r,
-       xfs_fsblock_t   v);
-
-void
-xfs_bmbt_set_startoff(
-       xfs_bmbt_rec_t  *r,
-       xfs_fileoff_t   v);
-
-void
-xfs_bmbt_set_state(
-       xfs_bmbt_rec_t  *r,
-       xfs_exntst_t    v);
+extern int xfs_bmbt_newroot(struct xfs_btree_cur *cur, int *lflags, int *stat);
+
+extern void xfs_bmbt_set_all(xfs_bmbt_rec_t *r, xfs_bmbt_irec_t *s);
+extern void xfs_bmbt_set_allf(xfs_bmbt_rec_t *r, xfs_fileoff_t o,
+                       xfs_fsblock_t b, xfs_filblks_t c, xfs_exntst_t v);
+extern void xfs_bmbt_set_blockcount(xfs_bmbt_rec_t *r, xfs_filblks_t v);
+extern void xfs_bmbt_set_startblock(xfs_bmbt_rec_t *r, xfs_fsblock_t v);
+extern void xfs_bmbt_set_startoff(xfs_bmbt_rec_t *r, xfs_fileoff_t v);
+extern void xfs_bmbt_set_state(xfs_bmbt_rec_t *r, xfs_exntst_t v);
 
 #ifndef XFS_NATIVE_HOST
-void
-xfs_bmbt_disk_set_all(
-       xfs_bmbt_rec_t  *r,
-       xfs_bmbt_irec_t *s);
-
-void
-xfs_bmbt_disk_set_allf(
-       xfs_bmbt_rec_t  *r,
-       xfs_fileoff_t   o,
-       xfs_fsblock_t   b,
-       xfs_filblks_t   c,
-       xfs_exntst_t    v);
+extern void xfs_bmbt_disk_set_all(xfs_bmbt_rec_t *r, xfs_bmbt_irec_t *s);
+extern void xfs_bmbt_disk_set_allf(xfs_bmbt_rec_t *r, xfs_fileoff_t o,
+                       xfs_fsblock_t b, xfs_filblks_t c, xfs_exntst_t v);
 #else
-#define xfs_bmbt_disk_set_all(r, s) \
-       xfs_bmbt_set_all(r, s)
-#define xfs_bmbt_disk_set_allf(r, o, b, c, v) \
-       xfs_bmbt_set_allf(r, o, b, c, v)
+#define xfs_bmbt_disk_set_all(r, s)            xfs_bmbt_set_all(r, s)
+#define xfs_bmbt_disk_set_allf(r, o, b, c, v)  xfs_bmbt_set_allf(r, o, b, c, v)
 #endif /* XFS_NATIVE_HOST */
 
-void
-xfs_bmbt_to_bmdr(
-       xfs_bmbt_block_t *,
-       int,
-       xfs_bmdr_block_t *,
-       int);
-
-int
-xfs_bmbt_update(
-       struct xfs_btree_cur *,
-       xfs_fileoff_t,
-       xfs_fsblock_t,
-       xfs_filblks_t,
-       xfs_exntst_t);
+extern void xfs_bmbt_to_bmdr(xfs_bmbt_block_t *, int, xfs_bmdr_block_t *, int);
+extern int xfs_bmbt_update(struct xfs_btree_cur *, xfs_fileoff_t,
+                               xfs_fsblock_t, xfs_filblks_t, xfs_exntst_t);
 
 #ifdef DEBUG
 /*
  * Get the data from the pointed-to record.
  */
-int
-xfs_bmbt_get_rec(
-       struct xfs_btree_cur *,
-       xfs_fileoff_t *,
-       xfs_fsblock_t *,
-       xfs_filblks_t *,
-       xfs_exntst_t *,
-       int *);
+extern int xfs_bmbt_get_rec(struct xfs_btree_cur *, xfs_fileoff_t *,
+                               xfs_fsblock_t *, xfs_filblks_t *,
+                               xfs_exntst_t *, int *);
 #endif
 
-
 /*
  * Search an extent list for the extent which includes block
  * bno.
  */
-xfs_bmbt_rec_t *
-xfs_bmap_do_search_extents(
-       xfs_bmbt_rec_t *,
-       xfs_extnum_t,
-       xfs_extnum_t,
-       xfs_fileoff_t,
-       int *,
-       xfs_extnum_t *,
-       xfs_bmbt_irec_t *,
-       xfs_bmbt_irec_t *);
+xfs_bmbt_rec_t *xfs_bmap_do_search_extents(xfs_bmbt_rec_t *,
+                       xfs_extnum_t, xfs_extnum_t, xfs_fileoff_t, int *,
+                       xfs_extnum_t *, xfs_bmbt_irec_t *, xfs_bmbt_irec_t *);
 
 #endif /* __KERNEL__ */
 
index 0cc63d657a14ed2937df63826b3445aac41ef600..4d63f1c490fe143e6b55410597ae6f7cb7b4d6e3 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
-/*
- * This file contains common code for the space manager's btree implementations.
- */
-
 #include "xfs.h"
-
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
 #include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
-#include "xfs_alloc_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
-#include "xfs_btree.h"
-#include "xfs_ialloc.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
 #include "xfs_inode.h"
-#include "xfs_bit.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
 #include "xfs_error.h"
 
 /*
index 09b4e1532a351da8e00a1c372b01380ff82687a5..30ee83712c7907926b8bb240942869467be8af0c 100644 (file)
@@ -113,12 +113,7 @@ typedef struct xfs_btree_block
 /*
  * Boolean to select which form of xfs_btree_block_t.bb_u to use.
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BTREE_LONG_PTRS)
-int xfs_btree_long_ptrs(xfs_btnum_t btnum);
 #define        XFS_BTREE_LONG_PTRS(btnum)      ((btnum) == XFS_BTNUM_BMAP)
-#else
-#define        XFS_BTREE_LONG_PTRS(btnum)      ((btnum) == XFS_BTNUM_BMAP)
-#endif
 
 /*
  * Magic numbers for btree blocks.
@@ -205,24 +200,10 @@ typedef struct xfs_btree_cur
 /*
  * Convert from buffer to btree block header.
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BUF_TO_BLOCK)
-xfs_btree_block_t *xfs_buf_to_block(struct xfs_buf *bp);
-#define        XFS_BUF_TO_BLOCK(bp)    xfs_buf_to_block(bp)
-#else
-#define        XFS_BUF_TO_BLOCK(bp)    ((xfs_btree_block_t *)(XFS_BUF_PTR(bp)))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BUF_TO_LBLOCK)
-xfs_btree_lblock_t *xfs_buf_to_lblock(struct xfs_buf *bp);
-#define        XFS_BUF_TO_LBLOCK(bp)   xfs_buf_to_lblock(bp)
-#else
-#define        XFS_BUF_TO_LBLOCK(bp)   ((xfs_btree_lblock_t *)(XFS_BUF_PTR(bp)))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BUF_TO_SBLOCK)
-xfs_btree_sblock_t *xfs_buf_to_sblock(struct xfs_buf *bp);
-#define        XFS_BUF_TO_SBLOCK(bp)   xfs_buf_to_sblock(bp)
-#else
-#define        XFS_BUF_TO_SBLOCK(bp)   ((xfs_btree_sblock_t *)(XFS_BUF_PTR(bp)))
-#endif
+#define        XFS_BUF_TO_BLOCK(bp)    ((xfs_btree_block_t *)XFS_BUF_PTR(bp))
+#define        XFS_BUF_TO_LBLOCK(bp)   ((xfs_btree_lblock_t *)XFS_BUF_PTR(bp))
+#define        XFS_BUF_TO_SBLOCK(bp)   ((xfs_btree_sblock_t *)XFS_BUF_PTR(bp))
+
 
 #ifdef __KERNEL__
 
@@ -477,106 +458,33 @@ xfs_btree_setbuf(
 /*
  * Min and max functions for extlen, agblock, fileoff, and filblks types.
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_EXTLEN_MIN)
-xfs_extlen_t xfs_extlen_min(xfs_extlen_t a, xfs_extlen_t b);
-#define        XFS_EXTLEN_MIN(a,b)     xfs_extlen_min(a,b)
-#else
 #define        XFS_EXTLEN_MIN(a,b)     \
        ((xfs_extlen_t)(a) < (xfs_extlen_t)(b) ? \
-        (xfs_extlen_t)(a) : (xfs_extlen_t)(b))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_EXTLEN_MAX)
-xfs_extlen_t xfs_extlen_max(xfs_extlen_t a, xfs_extlen_t b);
-#define        XFS_EXTLEN_MAX(a,b)     xfs_extlen_max(a,b)
-#else
+               (xfs_extlen_t)(a) : (xfs_extlen_t)(b))
 #define        XFS_EXTLEN_MAX(a,b)     \
        ((xfs_extlen_t)(a) > (xfs_extlen_t)(b) ? \
-        (xfs_extlen_t)(a) : (xfs_extlen_t)(b))
-#endif
-
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AGBLOCK_MIN)
-xfs_agblock_t xfs_agblock_min(xfs_agblock_t a, xfs_agblock_t b);
-#define        XFS_AGBLOCK_MIN(a,b)    xfs_agblock_min(a,b)
-#else
+               (xfs_extlen_t)(a) : (xfs_extlen_t)(b))
 #define        XFS_AGBLOCK_MIN(a,b)    \
        ((xfs_agblock_t)(a) < (xfs_agblock_t)(b) ? \
-        (xfs_agblock_t)(a) : (xfs_agblock_t)(b))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AGBLOCK_MAX)
-xfs_agblock_t xfs_agblock_max(xfs_agblock_t a, xfs_agblock_t b);
-#define        XFS_AGBLOCK_MAX(a,b)    xfs_agblock_max(a,b)
-#else
+               (xfs_agblock_t)(a) : (xfs_agblock_t)(b))
 #define        XFS_AGBLOCK_MAX(a,b)    \
        ((xfs_agblock_t)(a) > (xfs_agblock_t)(b) ? \
-        (xfs_agblock_t)(a) : (xfs_agblock_t)(b))
-#endif
-
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_FILEOFF_MIN)
-xfs_fileoff_t xfs_fileoff_min(xfs_fileoff_t a, xfs_fileoff_t b);
-#define        XFS_FILEOFF_MIN(a,b)    xfs_fileoff_min(a,b)
-#else
+               (xfs_agblock_t)(a) : (xfs_agblock_t)(b))
 #define        XFS_FILEOFF_MIN(a,b)    \
        ((xfs_fileoff_t)(a) < (xfs_fileoff_t)(b) ? \
-        (xfs_fileoff_t)(a) : (xfs_fileoff_t)(b))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_FILEOFF_MAX)
-xfs_fileoff_t xfs_fileoff_max(xfs_fileoff_t a, xfs_fileoff_t b);
-#define        XFS_FILEOFF_MAX(a,b)    xfs_fileoff_max(a,b)
-#else
+               (xfs_fileoff_t)(a) : (xfs_fileoff_t)(b))
 #define        XFS_FILEOFF_MAX(a,b)    \
        ((xfs_fileoff_t)(a) > (xfs_fileoff_t)(b) ? \
-        (xfs_fileoff_t)(a) : (xfs_fileoff_t)(b))
-#endif
-
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_FILBLKS_MIN)
-xfs_filblks_t xfs_filblks_min(xfs_filblks_t a, xfs_filblks_t b);
-#define        XFS_FILBLKS_MIN(a,b)    xfs_filblks_min(a,b)
-#else
+               (xfs_fileoff_t)(a) : (xfs_fileoff_t)(b))
 #define        XFS_FILBLKS_MIN(a,b)    \
        ((xfs_filblks_t)(a) < (xfs_filblks_t)(b) ? \
-        (xfs_filblks_t)(a) : (xfs_filblks_t)(b))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_FILBLKS_MAX)
-xfs_filblks_t xfs_filblks_max(xfs_filblks_t a, xfs_filblks_t b);
-#define        XFS_FILBLKS_MAX(a,b)    xfs_filblks_max(a,b)
-#else
+               (xfs_filblks_t)(a) : (xfs_filblks_t)(b))
 #define        XFS_FILBLKS_MAX(a,b)    \
        ((xfs_filblks_t)(a) > (xfs_filblks_t)(b) ? \
-        (xfs_filblks_t)(a) : (xfs_filblks_t)(b))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_FSB_SANITY_CHECK)
-int xfs_fsb_sanity_check(struct xfs_mount *mp, xfs_fsblock_t fsb);
-#define        XFS_FSB_SANITY_CHECK(mp,fsb)    xfs_fsb_sanity_check(mp,fsb)
-#else
+               (xfs_filblks_t)(a) : (xfs_filblks_t)(b))
+
 #define        XFS_FSB_SANITY_CHECK(mp,fsb)    \
        (XFS_FSB_TO_AGNO(mp, fsb) < mp->m_sb.sb_agcount && \
-        XFS_FSB_TO_AGBNO(mp, fsb) < mp->m_sb.sb_agblocks)
-#endif
-
-/*
- * Macros to set EFSCORRUPTED & return/branch.
- */
-#define        XFS_WANT_CORRUPTED_GOTO(x,l)    \
-       { \
-               int fs_is_ok = (x); \
-               ASSERT(fs_is_ok); \
-               if (unlikely(!fs_is_ok)) { \
-                       XFS_ERROR_REPORT("XFS_WANT_CORRUPTED_GOTO", \
-                                        XFS_ERRLEVEL_LOW, NULL); \
-                       error = XFS_ERROR(EFSCORRUPTED); \
-                       goto l; \
-               } \
-       }
-
-#define        XFS_WANT_CORRUPTED_RETURN(x)    \
-       { \
-               int fs_is_ok = (x); \
-               ASSERT(fs_is_ok); \
-               if (unlikely(!fs_is_ok)) { \
-                       XFS_ERROR_REPORT("XFS_WANT_CORRUPTED_RETURN", \
-                                        XFS_ERRLEVEL_LOW, NULL); \
-                       return XFS_ERROR(EFSCORRUPTED); \
-               } \
-       }
+               XFS_FSB_TO_AGBNO(mp, fsb) < mp->m_sb.sb_agblocks)
 
 #endif /* __XFS_BTREE_H__ */
index a264657acfd9ed069452fc59725e170ba77222ea..a37ffc38bb163eea8f821e40cdb225b7df95ab80 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
-/*
- * This file contains the implementation of the xfs_buf_log_item.
- * It contains the item operations used to manipulate the buf log
- * items as well as utility routines used by the buffer specific
- * transaction routines.
- */
-
 #include "xfs.h"
-
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
-#include "xfs_buf_item.h"
 #include "xfs_sb.h"
 #include "xfs_dir.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
+#include "xfs_buf_item.h"
 #include "xfs_trans_priv.h"
-#include "xfs_rw.h"
-#include "xfs_bit.h"
 #include "xfs_error.h"
 
 
index 7e086c60485f2fd65644152ab4119ede1b311db5..b4075ec75453de23fd1de95a61c10145bfccb595 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
 #include "xfs.h"
-
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
 #include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
-#include "xfs_alloc_btree.h"
+#include "xfs_da_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
-#include "xfs_alloc.h"
-#include "xfs_btree.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
-#include "xfs_inode_item.h"
 #include "xfs_inode.h"
+#include "xfs_inode_item.h"
+#include "xfs_alloc.h"
+#include "xfs_btree.h"
 #include "xfs_bmap.h"
-#include "xfs_da_btree.h"
 #include "xfs_attr.h"
 #include "xfs_attr_leaf.h"
 #include "xfs_dir_leaf.h"
@@ -64,7 +63,6 @@
 #include "xfs_dir2_block.h"
 #include "xfs_dir2_node.h"
 #include "xfs_error.h"
-#include "xfs_bit.h"
 
 /*
  * xfs_da_btree.c
index a2199578b4c0a1a7266dfaefcbc4126c993eb5cf..654956e9787c7347eb5d68b05272ed757627d55d 100644 (file)
@@ -92,72 +92,24 @@ typedef struct xfs_da_node_entry xfs_da_node_entry_t;
 
 #define XFS_DA_MAXHASH ((xfs_dahash_t)-1) /* largest valid hash value */
 
-/*
- * Macros used by directory code to interface to the filesystem.
- */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LBSIZE)
-int xfs_lbsize(struct xfs_mount *mp);
-#define        XFS_LBSIZE(mp)                  xfs_lbsize(mp)
-#else
-#define        XFS_LBSIZE(mp)  ((mp)->m_sb.sb_blocksize)
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LBLOG)
-int xfs_lblog(struct xfs_mount *mp);
-#define        XFS_LBLOG(mp)                   xfs_lblog(mp)
-#else
-#define        XFS_LBLOG(mp)   ((mp)->m_sb.sb_blocklog)
-#endif
-
-/*
- * Macros used by directory code to interface to the kernel
- */
+#define        XFS_LBSIZE(mp)  (mp)->m_sb.sb_blocksize
+#define        XFS_LBLOG(mp)   (mp)->m_sb.sb_blocklog
 
-/*
- * Macros used to manipulate directory off_t's
- */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DA_MAKE_BNOENTRY)
-__uint32_t xfs_da_make_bnoentry(struct xfs_mount *mp, xfs_dablk_t bno,
-                               int entry);
 #define        XFS_DA_MAKE_BNOENTRY(mp,bno,entry)      \
-       xfs_da_make_bnoentry(mp,bno,entry)
-#else
-#define        XFS_DA_MAKE_BNOENTRY(mp,bno,entry) \
        (((bno) << (mp)->m_dircook_elog) | (entry))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DA_MAKE_COOKIE)
-xfs_off_t xfs_da_make_cookie(struct xfs_mount *mp, xfs_dablk_t bno, int entry,
-                               xfs_dahash_t hash);
 #define        XFS_DA_MAKE_COOKIE(mp,bno,entry,hash)   \
-       xfs_da_make_cookie(mp,bno,entry,hash)
-#else
-#define        XFS_DA_MAKE_COOKIE(mp,bno,entry,hash) \
        (((xfs_off_t)XFS_DA_MAKE_BNOENTRY(mp, bno, entry) << 32) | (hash))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DA_COOKIE_HASH)
-xfs_dahash_t xfs_da_cookie_hash(struct xfs_mount *mp, xfs_off_t cookie);
-#define        XFS_DA_COOKIE_HASH(mp,cookie)           xfs_da_cookie_hash(mp,cookie)
-#else
-#define        XFS_DA_COOKIE_HASH(mp,cookie)   ((xfs_dahash_t)(cookie))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DA_COOKIE_BNO)
-xfs_dablk_t xfs_da_cookie_bno(struct xfs_mount *mp, xfs_off_t cookie);
-#define        XFS_DA_COOKIE_BNO(mp,cookie)            xfs_da_cookie_bno(mp,cookie)
-#else
-#define        XFS_DA_COOKIE_BNO(mp,cookie) \
-       (((xfs_off_t)(cookie) >> 31) == -1LL ? \
+#define        XFS_DA_COOKIE_HASH(mp,cookie)           ((xfs_dahash_t)cookie)
+#define        XFS_DA_COOKIE_BNO(mp,cookie)            \
+       ((((xfs_off_t)(cookie) >> 31) == -1LL ? \
                (xfs_dablk_t)0 : \
-               (xfs_dablk_t)((xfs_off_t)(cookie) >> ((mp)->m_dircook_elog + 32)))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DA_COOKIE_ENTRY)
-int xfs_da_cookie_entry(struct xfs_mount *mp, xfs_off_t cookie);
-#define        XFS_DA_COOKIE_ENTRY(mp,cookie)          xfs_da_cookie_entry(mp,cookie)
-#else
-#define        XFS_DA_COOKIE_ENTRY(mp,cookie) \
-       (((xfs_off_t)(cookie) >> 31) == -1LL ? \
+               (xfs_dablk_t)((xfs_off_t)(cookie) >> \
+                               ((mp)->m_dircook_elog + 32))))
+#define        XFS_DA_COOKIE_ENTRY(mp,cookie)          \
+       ((((xfs_off_t)(cookie) >> 31) == -1LL ? \
                (xfs_dablk_t)0 : \
                (xfs_dablk_t)(((xfs_off_t)(cookie) >> 32) & \
-                             ((1 << (mp)->m_dircook_elog) - 1)))
-#endif
+                               ((1 << (mp)->m_dircook_elog) - 1))))
 
 
 /*========================================================================
index 8dd7a3923f6480e04c94ca37ba5a748a67c9d61e..925b0a22c6641021fb05bb94d17481c3682432f0 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
 #include "xfs.h"
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
+#include "xfs_ag.h"
 #include "xfs_dir.h"
 #include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
-#include "xfs_ag.h"
-#include "xfs_alloc_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
-#include "xfs_btree.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
-#include "xfs_inode_item.h"
 #include "xfs_inode.h"
+#include "xfs_inode_item.h"
 #include "xfs_bmap.h"
+#include "xfs_btree.h"
 #include "xfs_ialloc.h"
 #include "xfs_itable.h"
 #include "xfs_dfrag.h"
index f5c932b064e6c56ffee619ff29a785da37662945..9e1fd2323255ace8c7bb0f5a2df208c5561b0919 100644 (file)
@@ -37,13 +37,8 @@ struct xfs_mount;
 
 #define        XFS_DINODE_VERSION_1    1
 #define        XFS_DINODE_VERSION_2    2
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DINODE_GOOD_VERSION)
-int xfs_dinode_good_version(int v);
-#define XFS_DINODE_GOOD_VERSION(v)     xfs_dinode_good_version(v)
-#else
-#define XFS_DINODE_GOOD_VERSION(v)     (((v) == XFS_DINODE_VERSION_1) || \
-                                        ((v) == XFS_DINODE_VERSION_2))
-#endif
+#define XFS_DINODE_GOOD_VERSION(v)     \
+       (((v) == XFS_DINODE_VERSION_1 || (v) == XFS_DINODE_VERSION_2))
 #define        XFS_DINODE_MAGIC        0x494e  /* 'IN' */
 
 /*
@@ -184,75 +179,30 @@ typedef enum xfs_dinode_fmt
 /*
  * Inode size for given fs.
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LITINO)
-int xfs_litino(struct xfs_mount *mp);
-#define        XFS_LITINO(mp)          xfs_litino(mp)
-#else
 #define        XFS_LITINO(mp)  ((mp)->m_litino)
-#endif
 #define        XFS_BROOT_SIZE_ADJ      \
        (sizeof(xfs_bmbt_block_t) - sizeof(xfs_bmdr_block_t))
 
-/*
- * Fork identifiers.  Here so utilities can use them without including
- * xfs_inode.h.
- */
-#define        XFS_DATA_FORK   0
-#define        XFS_ATTR_FORK   1
-
 /*
  * Inode data & attribute fork sizes, per inode.
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_CFORK_Q)
-int xfs_cfork_q_disk(xfs_dinode_core_t *dcp);
-int xfs_cfork_q(xfs_dinode_core_t *dcp);
-#define        XFS_CFORK_Q_DISK(dcp)               xfs_cfork_q_disk(dcp)
-#define        XFS_CFORK_Q(dcp)                    xfs_cfork_q(dcp)
-#else
-#define        XFS_CFORK_Q_DISK(dcp)               ((dcp)->di_forkoff != 0)
 #define XFS_CFORK_Q(dcp)                    ((dcp)->di_forkoff != 0)
+#define        XFS_CFORK_Q_DISK(dcp)               ((dcp)->di_forkoff != 0)
 
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_CFORK_BOFF)
-int xfs_cfork_boff_disk(xfs_dinode_core_t *dcp);
-int xfs_cfork_boff(xfs_dinode_core_t *dcp);
-#define        XFS_CFORK_BOFF_DISK(dcp)            xfs_cfork_boff_disk(dcp)
-#define        XFS_CFORK_BOFF(dcp)                 xfs_cfork_boff(dcp)
-#else
-#define        XFS_CFORK_BOFF_DISK(dcp)            ((int)(INT_GET((dcp)->di_forkoff, ARCH_CONVERT) << 3))
 #define XFS_CFORK_BOFF(dcp)                 ((int)((dcp)->di_forkoff << 3))
+#define        XFS_CFORK_BOFF_DISK(dcp) \
+       ((int)(INT_GET((dcp)->di_forkoff, ARCH_CONVERT) << 3))
 
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_CFORK_DSIZE)
-int xfs_cfork_dsize_disk(xfs_dinode_core_t *dcp, struct xfs_mount *mp);
-int xfs_cfork_dsize(xfs_dinode_core_t *dcp, struct xfs_mount *mp);
-#define        XFS_CFORK_DSIZE_DISK(dcp,mp)        xfs_cfork_dsize_disk(dcp,mp)
-#define        XFS_CFORK_DSIZE(dcp,mp)             xfs_cfork_dsize(dcp,mp)
-#else
 #define        XFS_CFORK_DSIZE_DISK(dcp,mp) \
        (XFS_CFORK_Q_DISK(dcp) ? XFS_CFORK_BOFF_DISK(dcp) : XFS_LITINO(mp))
 #define XFS_CFORK_DSIZE(dcp,mp) \
        (XFS_CFORK_Q(dcp) ? XFS_CFORK_BOFF(dcp) : XFS_LITINO(mp))
 
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_CFORK_ASIZE)
-int xfs_cfork_asize_disk(xfs_dinode_core_t *dcp, struct xfs_mount *mp);
-int xfs_cfork_asize(xfs_dinode_core_t *dcp, struct xfs_mount *mp);
-#define        XFS_CFORK_ASIZE_DISK(dcp,mp)        xfs_cfork_asize_disk(dcp,mp)
-#define        XFS_CFORK_ASIZE(dcp,mp)             xfs_cfork_asize(dcp,mp)
-#else
 #define        XFS_CFORK_ASIZE_DISK(dcp,mp) \
        (XFS_CFORK_Q_DISK(dcp) ? XFS_LITINO(mp) - XFS_CFORK_BOFF_DISK(dcp) : 0)
 #define XFS_CFORK_ASIZE(dcp,mp) \
        (XFS_CFORK_Q(dcp) ? XFS_LITINO(mp) - XFS_CFORK_BOFF(dcp) : 0)
 
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_CFORK_SIZE)
-int xfs_cfork_size_disk(xfs_dinode_core_t *dcp, struct xfs_mount *mp, int w);
-int xfs_cfork_size(xfs_dinode_core_t *dcp, struct xfs_mount *mp, int w);
-#define        XFS_CFORK_SIZE_DISK(dcp,mp,w)       xfs_cfork_size_disk(dcp,mp,w)
-#define        XFS_CFORK_SIZE(dcp,mp,w)            xfs_cfork_size(dcp,mp,w)
-#else
 #define        XFS_CFORK_SIZE_DISK(dcp,mp,w) \
        ((w) == XFS_DATA_FORK ? \
                XFS_CFORK_DSIZE_DISK(dcp, mp) : \
@@ -261,93 +211,26 @@ int xfs_cfork_size(xfs_dinode_core_t *dcp, struct xfs_mount *mp, int w);
        ((w) == XFS_DATA_FORK ? \
                XFS_CFORK_DSIZE(dcp, mp) : XFS_CFORK_ASIZE(dcp, mp))
 
-#endif
-
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DFORK_DSIZE)
-int xfs_dfork_dsize(xfs_dinode_t *dip, struct xfs_mount *mp);
-#define        XFS_DFORK_DSIZE(dip,mp)             xfs_dfork_dsize(dip,mp)
-#else
-#define XFS_DFORK_DSIZE(dip,mp)             XFS_CFORK_DSIZE_DISK(&(dip)->di_core, mp)
-
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DFORK_ASIZE)
-int xfs_dfork_asize(xfs_dinode_t *dip, struct xfs_mount *mp);
-#define        XFS_DFORK_ASIZE(dip,mp)             xfs_dfork_asize(dip,mp)
-#else
-#define XFS_DFORK_ASIZE(dip,mp)             XFS_CFORK_ASIZE_DISK(&(dip)->di_core, mp)
-
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DFORK_SIZE)
-int xfs_dfork_size(xfs_dinode_t *dip, struct xfs_mount *mp, int w);
-#define        XFS_DFORK_SIZE(dip,mp,w)            xfs_dfork_size(dip,mp,w)
-#else
-#define        XFS_DFORK_SIZE(dip,mp,w)            XFS_CFORK_SIZE_DISK(&(dip)->di_core, mp, w)
-
-#endif
+#define XFS_DFORK_DSIZE(dip,mp) \
+       XFS_CFORK_DSIZE_DISK(&(dip)->di_core, mp)
+#define XFS_DFORK_ASIZE(dip,mp) \
+       XFS_CFORK_ASIZE_DISK(&(dip)->di_core, mp)
+#define        XFS_DFORK_SIZE(dip,mp,w) \
+       XFS_CFORK_SIZE_DISK(&(dip)->di_core, mp, w)
 
-/*
- * Macros for accessing per-fork disk inode information.
- */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DFORK_Q)
-int xfs_dfork_q(xfs_dinode_t *dip);
-#define        XFS_DFORK_Q(dip)                    xfs_dfork_q(dip)
-#else
 #define        XFS_DFORK_Q(dip)                    XFS_CFORK_Q_DISK(&(dip)->di_core)
-
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DFORK_BOFF)
-int xfs_dfork_boff(xfs_dinode_t *dip);
-#define        XFS_DFORK_BOFF(dip)                 xfs_dfork_boff(dip)
-#else
 #define        XFS_DFORK_BOFF(dip)                 XFS_CFORK_BOFF_DISK(&(dip)->di_core)
-
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DFORK_DPTR)
-char *xfs_dfork_dptr(xfs_dinode_t *dip);
-#define        XFS_DFORK_DPTR(dip)                 xfs_dfork_dptr(dip)
-#else
 #define        XFS_DFORK_DPTR(dip)                 ((dip)->di_u.di_c)
-
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DFORK_APTR)
-char *xfs_dfork_aptr(xfs_dinode_t *dip);
-#define        XFS_DFORK_APTR(dip)                 xfs_dfork_aptr(dip)
-#else
-#define        XFS_DFORK_APTR(dip)                 ((dip)->di_u.di_c + XFS_DFORK_BOFF(dip))
-
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DFORK_PTR)
-char *xfs_dfork_ptr(xfs_dinode_t *dip, int w);
-#define        XFS_DFORK_PTR(dip,w)                xfs_dfork_ptr(dip,w)
-#else
+#define        XFS_DFORK_APTR(dip)     \
+       ((dip)->di_u.di_c + XFS_DFORK_BOFF(dip))
 #define        XFS_DFORK_PTR(dip,w)    \
        ((w) == XFS_DATA_FORK ? XFS_DFORK_DPTR(dip) : XFS_DFORK_APTR(dip))
-
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_CFORK_FORMAT)
-int xfs_cfork_format(xfs_dinode_core_t *dcp, int w);
-#define        XFS_CFORK_FORMAT(dcp,w)             xfs_cfork_format(dcp,w)
-#else
-#define        XFS_CFORK_FORMAT(dcp,w) \
+#define        XFS_CFORK_FORMAT(dcp,w) \
        ((w) == XFS_DATA_FORK ? (dcp)->di_format : (dcp)->di_aformat)
-
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_CFORK_FMT_SET)
-void xfs_cfork_fmt_set(xfs_dinode_core_t *dcp, int w, int n);
-#define        XFS_CFORK_FMT_SET(dcp,w,n)           xfs_cfork_fmt_set(dcp,w,n)
-#else
 #define        XFS_CFORK_FMT_SET(dcp,w,n) \
        ((w) == XFS_DATA_FORK ? \
-               ((dcp)->di_format = (n)) : \
-               ((dcp)->di_aformat = (n)))
+               ((dcp)->di_format = (n)) : ((dcp)->di_aformat = (n)))
 
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_CFORK_NEXTENTS)
-int xfs_cfork_nextents_disk(xfs_dinode_core_t *dcp, int w);
-int xfs_cfork_nextents(xfs_dinode_core_t *dcp, int w);
-#define        XFS_CFORK_NEXTENTS_DISK(dcp,w)       xfs_cfork_nextents_disk(dcp,w)
-#define        XFS_CFORK_NEXTENTS(dcp,w)            xfs_cfork_nextents(dcp,w)
-#else
 #define        XFS_CFORK_NEXTENTS_DISK(dcp,w) \
        ((w) == XFS_DATA_FORK ? \
                INT_GET((dcp)->di_nextents, ARCH_CONVERT) : \
@@ -355,31 +238,13 @@ int xfs_cfork_nextents(xfs_dinode_core_t *dcp, int w);
 #define XFS_CFORK_NEXTENTS(dcp,w) \
        ((w) == XFS_DATA_FORK ? (dcp)->di_nextents : (dcp)->di_anextents)
 
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_CFORK_NEXT_SET)
-void xfs_cfork_next_set(xfs_dinode_core_t *dcp, int w, int n);
-#define        XFS_CFORK_NEXT_SET(dcp,w,n)             xfs_cfork_next_set(dcp,w,n)
-#else
 #define        XFS_CFORK_NEXT_SET(dcp,w,n) \
        ((w) == XFS_DATA_FORK ? \
-               ((dcp)->di_nextents = (n)) : \
-               ((dcp)->di_anextents = (n)))
-
-#endif
+               ((dcp)->di_nextents = (n)) : ((dcp)->di_anextents = (n)))
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DFORK_NEXTENTS)
-int xfs_dfork_nextents(xfs_dinode_t *dip, int w);
-#define        XFS_DFORK_NEXTENTS(dip,w) xfs_dfork_nextents(dip,w)
-#else
 #define        XFS_DFORK_NEXTENTS(dip,w) XFS_CFORK_NEXTENTS_DISK(&(dip)->di_core, w)
-#endif
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BUF_TO_DINODE)
-xfs_dinode_t *xfs_buf_to_dinode(struct xfs_buf *bp);
-#define        XFS_BUF_TO_DINODE(bp)   xfs_buf_to_dinode(bp)
-#else
-#define        XFS_BUF_TO_DINODE(bp)   ((xfs_dinode_t *)(XFS_BUF_PTR(bp)))
-#endif
+#define        XFS_BUF_TO_DINODE(bp)   ((xfs_dinode_t *)XFS_BUF_PTR(bp))
 
 /*
  * Values for di_flags
index 53787f35338bd19e37146c8967dd9b27298106c2..d32824e8d86c1001b6eb416f40fa877ee67f130c 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
 #include "xfs.h"
-
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_dir.h"
 #include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
-#include "xfs_alloc_btree.h"
+#include "xfs_da_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
 #include "xfs_alloc.h"
 #include "xfs_btree.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
 #include "xfs_inode.h"
 #include "xfs_bmap.h"
-#include "xfs_da_btree.h"
 #include "xfs_dir_leaf.h"
 #include "xfs_error.h"
 
index 49fc0a3695ae49311cd456acb92cc66707059933..40a741c7e5c461fcafdf34fc7aa81a89092abc5d 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
-/*
- * XFS v2 directory implmentation.
- * Top-level and utility routines.
- */
-
 #include "xfs.h"
-
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
 #include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
-#include "xfs_alloc_btree.h"
+#include "xfs_da_btree.h"
 #include "xfs_bmap_btree.h"
-#include "xfs_attr_sf.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
-#include "xfs_inode_item.h"
 #include "xfs_inode.h"
+#include "xfs_inode_item.h"
 #include "xfs_bmap.h"
-#include "xfs_da_btree.h"
 #include "xfs_dir_leaf.h"
 #include "xfs_dir2_data.h"
 #include "xfs_dir2_leaf.h"
@@ -65,7 +59,6 @@
 #include "xfs_dir2_node.h"
 #include "xfs_dir2_trace.h"
 #include "xfs_error.h"
-#include "xfs_bit.h"
 
 /*
  * Declarations for interface routines.
index 088d3bdfac980699f473f11717bc3de3192ee3bc..47b5d2c4b9332ed8737e643e5f260d7aa5d0238c 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
-/*
- * xfs_dir2_block.c
- * XFS V2 directory implementation, single-block form.
- * See xfs_dir2_block.h for the format.
- */
-
 #include "xfs.h"
-
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_dir.h"
 #include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
+#include "xfs_da_btree.h"
 #include "xfs_bmap_btree.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
-#include "xfs_inode_item.h"
 #include "xfs_inode.h"
-#include "xfs_da_btree.h"
+#include "xfs_inode_item.h"
 #include "xfs_dir_leaf.h"
 #include "xfs_dir2_data.h"
 #include "xfs_dir2_leaf.h"
index 5a578b84e2466c71a7f6c2b91d5bd131b4d16a22..70dcbe8976f7f212eb3edb02044261a8e2e4b63c 100644 (file)
@@ -74,53 +74,37 @@ typedef struct xfs_dir2_block {
 /*
  * Pointer to the leaf header embedded in a data block (1-block format)
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_BLOCK_TAIL_P)
-xfs_dir2_block_tail_t *
-xfs_dir2_block_tail_p(struct xfs_mount *mp, xfs_dir2_block_t *block);
 #define        XFS_DIR2_BLOCK_TAIL_P(mp,block) xfs_dir2_block_tail_p(mp,block)
-#else
-#define        XFS_DIR2_BLOCK_TAIL_P(mp,block) \
-       (((xfs_dir2_block_tail_t *)((char *)(block) + (mp)->m_dirblksize)) - 1)
-#endif
+static inline xfs_dir2_block_tail_t *
+xfs_dir2_block_tail_p(struct xfs_mount *mp, xfs_dir2_block_t *block)
+{
+       return (((xfs_dir2_block_tail_t *)
+               ((char *)(block) + (mp)->m_dirblksize)) - 1);
+}
 
 /*
  * Pointer to the leaf entries embedded in a data block (1-block format)
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_BLOCK_LEAF_P)
-struct xfs_dir2_leaf_entry *xfs_dir2_block_leaf_p(xfs_dir2_block_tail_t *btp);
-#define        XFS_DIR2_BLOCK_LEAF_P(btp) \
-       xfs_dir2_block_leaf_p(btp)
-#else
-#define        XFS_DIR2_BLOCK_LEAF_P(btp)      \
-       (((struct xfs_dir2_leaf_entry *)(btp)) - INT_GET((btp)->count, ARCH_CONVERT))
-#endif
+#define        XFS_DIR2_BLOCK_LEAF_P(btp)      xfs_dir2_block_leaf_p(btp)
+static inline struct xfs_dir2_leaf_entry *
+xfs_dir2_block_leaf_p(xfs_dir2_block_tail_t *btp)
+{
+       return (((struct xfs_dir2_leaf_entry *)
+               (btp)) - INT_GET((btp)->count, ARCH_CONVERT));
+}
 
 /*
  * Function declarations.
  */
-
-extern int
-       xfs_dir2_block_addname(struct xfs_da_args *args);
-
-extern int
-       xfs_dir2_block_getdents(struct xfs_trans *tp, struct xfs_inode *dp,
-                               struct uio *uio, int *eofp, struct xfs_dirent *dbp,
-                               xfs_dir2_put_t put);
-
-extern int
-       xfs_dir2_block_lookup(struct xfs_da_args *args);
-
-extern int
-       xfs_dir2_block_removename(struct xfs_da_args *args);
-
-extern int
-       xfs_dir2_block_replace(struct xfs_da_args *args);
-
-extern int
-       xfs_dir2_leaf_to_block(struct xfs_da_args *args, struct xfs_dabuf *lbp,
-                              struct xfs_dabuf *dbp);
-
-extern int
-       xfs_dir2_sf_to_block(struct xfs_da_args *args);
+extern int xfs_dir2_block_addname(struct xfs_da_args *args);
+extern int xfs_dir2_block_getdents(struct xfs_trans *tp, struct xfs_inode *dp,
+                                  struct uio *uio, int *eofp,
+                                  struct xfs_dirent *dbp, xfs_dir2_put_t put);
+extern int xfs_dir2_block_lookup(struct xfs_da_args *args);
+extern int xfs_dir2_block_removename(struct xfs_da_args *args);
+extern int xfs_dir2_block_replace(struct xfs_da_args *args);
+extern int xfs_dir2_leaf_to_block(struct xfs_da_args *args,
+                                 struct xfs_dabuf *lbp, struct xfs_dabuf *dbp);
+extern int xfs_dir2_sf_to_block(struct xfs_da_args *args);
 
 #endif /* __XFS_DIR2_BLOCK_H__ */
index a0aa0e44ff9d6dfe3afa918c944ff6d27ec53577..4b25f7e7c8102090562fe8c87494218c6cc1c16b 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
-/*
- * xfs_dir2_data.c
- * Core data block handling routines for XFS V2 directories.
- * See xfs_dir2_data.h for data structures.
- */
-
 #include "xfs.h"
-
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_dir.h"
 #include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
+#include "xfs_da_btree.h"
 #include "xfs_bmap_btree.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
 #include "xfs_inode.h"
-#include "xfs_da_btree.h"
 #include "xfs_dir_leaf.h"
 #include "xfs_dir2_data.h"
 #include "xfs_dir2_leaf.h"
index 476cac920bf5037d5222f3423bba44367468dd91..eeff8557072328906e03e4ceff8482c7f141122c 100644 (file)
@@ -137,88 +137,65 @@ typedef struct xfs_dir2_data {
 /*
  * Size of a data entry.
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_DATA_ENTSIZE)
-int xfs_dir2_data_entsize(int n);
 #define XFS_DIR2_DATA_ENTSIZE(n)       xfs_dir2_data_entsize(n)
-#else
-#define        XFS_DIR2_DATA_ENTSIZE(n)        \
-       ((int)(roundup(offsetof(xfs_dir2_data_entry_t, name[0]) + (n) + \
-                (uint)sizeof(xfs_dir2_data_off_t), XFS_DIR2_DATA_ALIGN)))
-#endif
+static inline int xfs_dir2_data_entsize(int n)
+{
+       return (int)roundup(offsetof(xfs_dir2_data_entry_t, name[0]) + (n) + \
+                (uint)sizeof(xfs_dir2_data_off_t), XFS_DIR2_DATA_ALIGN);
+}
 
 /*
  * Pointer to an entry's tag word.
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_DATA_ENTRY_TAG_P)
-xfs_dir2_data_off_t *xfs_dir2_data_entry_tag_p(xfs_dir2_data_entry_t *dep);
 #define        XFS_DIR2_DATA_ENTRY_TAG_P(dep)  xfs_dir2_data_entry_tag_p(dep)
-#else
-#define        XFS_DIR2_DATA_ENTRY_TAG_P(dep)  \
-       ((xfs_dir2_data_off_t *)\
-        ((char *)(dep) + XFS_DIR2_DATA_ENTSIZE((dep)->namelen) - \
-         (uint)sizeof(xfs_dir2_data_off_t)))
-#endif
+static inline xfs_dir2_data_off_t *
+xfs_dir2_data_entry_tag_p(xfs_dir2_data_entry_t *dep)
+{
+       return (xfs_dir2_data_off_t *) \
+                ((char *)(dep) + XFS_DIR2_DATA_ENTSIZE((dep)->namelen) - \
+                 (uint)sizeof(xfs_dir2_data_off_t));
+}
 
 /*
  * Pointer to a freespace's tag word.
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_DATA_UNUSED_TAG_P)
-xfs_dir2_data_off_t *xfs_dir2_data_unused_tag_p(xfs_dir2_data_unused_t *dup);
 #define        XFS_DIR2_DATA_UNUSED_TAG_P(dup) \
        xfs_dir2_data_unused_tag_p(dup)
-#else
-#define        XFS_DIR2_DATA_UNUSED_TAG_P(dup) \
-       ((xfs_dir2_data_off_t *)\
-        ((char *)(dup) + INT_GET((dup)->length, ARCH_CONVERT) \
-                       - (uint)sizeof(xfs_dir2_data_off_t)))
-#endif
+static inline xfs_dir2_data_off_t *
+xfs_dir2_data_unused_tag_p(xfs_dir2_data_unused_t *dup)
+{
+       return (xfs_dir2_data_off_t *) \
+                ((char *)(dup) + INT_GET((dup)->length, ARCH_CONVERT) \
+                               - (uint)sizeof(xfs_dir2_data_off_t));
+}
 
 /*
  * Function declarations.
  */
-
 #ifdef DEBUG
-extern void
-       xfs_dir2_data_check(struct xfs_inode *dp, struct xfs_dabuf *bp);
+extern void xfs_dir2_data_check(struct xfs_inode *dp, struct xfs_dabuf *bp);
 #else
 #define        xfs_dir2_data_check(dp,bp)
 #endif
-
-extern xfs_dir2_data_free_t *
-       xfs_dir2_data_freefind(xfs_dir2_data_t *d,
-                              xfs_dir2_data_unused_t *dup);
-
-extern xfs_dir2_data_free_t *
-       xfs_dir2_data_freeinsert(xfs_dir2_data_t *d,
-                                xfs_dir2_data_unused_t *dup, int *loghead);
-
-extern void
-       xfs_dir2_data_freescan(struct xfs_mount *mp, xfs_dir2_data_t *d,
-                              int *loghead, char *aendp);
-
-extern int
-       xfs_dir2_data_init(struct xfs_da_args *args, xfs_dir2_db_t blkno,
-                          struct xfs_dabuf **bpp);
-
-extern void
-       xfs_dir2_data_log_entry(struct xfs_trans *tp, struct xfs_dabuf *bp,
+extern xfs_dir2_data_free_t *xfs_dir2_data_freefind(xfs_dir2_data_t *d,
+                               xfs_dir2_data_unused_t *dup);
+extern xfs_dir2_data_free_t *xfs_dir2_data_freeinsert(xfs_dir2_data_t *d,
+                               xfs_dir2_data_unused_t *dup, int *loghead);
+extern void xfs_dir2_data_freescan(struct xfs_mount *mp, xfs_dir2_data_t *d,
+                               int *loghead, char *aendp);
+extern int xfs_dir2_data_init(struct xfs_da_args *args, xfs_dir2_db_t blkno,
+                               struct xfs_dabuf **bpp);
+extern void xfs_dir2_data_log_entry(struct xfs_trans *tp, struct xfs_dabuf *bp,
                                xfs_dir2_data_entry_t *dep);
-
-extern void
-       xfs_dir2_data_log_header(struct xfs_trans *tp, struct xfs_dabuf *bp);
-
-extern void
-       xfs_dir2_data_log_unused(struct xfs_trans *tp, struct xfs_dabuf *bp,
-                                xfs_dir2_data_unused_t *dup);
-
-extern void
-       xfs_dir2_data_make_free(struct xfs_trans *tp, struct xfs_dabuf *bp,
+extern void xfs_dir2_data_log_header(struct xfs_trans *tp,
+                               struct xfs_dabuf *bp);
+extern void xfs_dir2_data_log_unused(struct xfs_trans *tp, struct xfs_dabuf *bp,
+                               xfs_dir2_data_unused_t *dup);
+extern void xfs_dir2_data_make_free(struct xfs_trans *tp, struct xfs_dabuf *bp,
                                xfs_dir2_data_aoff_t offset,
                                xfs_dir2_data_aoff_t len, int *needlogp,
                                int *needscanp);
-
-extern void
-       xfs_dir2_data_use_free(struct xfs_trans *tp, struct xfs_dabuf *bp,
+extern void xfs_dir2_data_use_free(struct xfs_trans *tp, struct xfs_dabuf *bp,
                               xfs_dir2_data_unused_t *dup,
                               xfs_dir2_data_aoff_t offset,
                               xfs_dir2_data_aoff_t len, int *needlogp,
index 056f5283904b981184b968e75944112ee109d20c..89e48877e0ea626290ecfa62bbb12ee9ff06f9d2 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
-/*
- * xfs_dir2_leaf.c
- * XFS directory version 2 implementation - single leaf form
- * see xfs_dir2_leaf.h for data structures.
- * These directories have multiple XFS_DIR2_DATA blocks and one
- * XFS_DIR2_LEAF1 block containing the hash table and freespace map.
- */
-
 #include "xfs.h"
-
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
@@ -51,6 +42,7 @@
 #include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
+#include "xfs_da_btree.h"
 #include "xfs_bmap_btree.h"
 #include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dinode.h"
 #include "xfs_inode.h"
 #include "xfs_bmap.h"
-#include "xfs_da_btree.h"
 #include "xfs_dir2_data.h"
 #include "xfs_dir2_leaf.h"
 #include "xfs_dir2_block.h"
 #include "xfs_dir2_node.h"
 #include "xfs_dir2_trace.h"
 #include "xfs_error.h"
-#include "xfs_bit.h"
 
 /*
  * Local function declarations.
index 3303cd6f4c0045362b4b1e87fa27918a2baf470d..43f0ec2131a910efa0466a78571fbc18e80c8878 100644 (file)
@@ -43,10 +43,6 @@ struct xfs_inode;
 struct xfs_mount;
 struct xfs_trans;
 
-/*
- * Constants.
- */
-
 /*
  * Offset of the leaf/node space.  First block in this space
  * is the btree root.
@@ -56,10 +52,6 @@ struct xfs_trans;
 #define        XFS_DIR2_LEAF_FIRSTDB(mp)       \
        XFS_DIR2_BYTE_TO_DB(mp, XFS_DIR2_LEAF_OFFSET)
 
-/*
- * Types.
- */
-
 /*
  * Offset in data space of a data entry.
  */
@@ -67,10 +59,6 @@ typedef      __uint32_t      xfs_dir2_dataptr_t;
 #define        XFS_DIR2_MAX_DATAPTR    ((xfs_dir2_dataptr_t)0xffffffff)
 #define        XFS_DIR2_NULL_DATAPTR   ((xfs_dir2_dataptr_t)0)
 
-/*
- * Structures.
- */
-
 /*
  * Leaf block header.
  */
@@ -109,245 +97,193 @@ typedef struct xfs_dir2_leaf {
 } xfs_dir2_leaf_t;
 
 /*
- * Macros.
- * The DB blocks are logical directory block numbers, not filesystem blocks.
+ * DB blocks here are logical directory block numbers, not filesystem blocks.
  */
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_MAX_LEAF_ENTS)
-int
-xfs_dir2_max_leaf_ents(struct xfs_mount *mp);
-#define        XFS_DIR2_MAX_LEAF_ENTS(mp)      \
-       xfs_dir2_max_leaf_ents(mp)
-#else
-#define        XFS_DIR2_MAX_LEAF_ENTS(mp)      \
-       ((int)(((mp)->m_dirblksize - (uint)sizeof(xfs_dir2_leaf_hdr_t)) / \
-              (uint)sizeof(xfs_dir2_leaf_entry_t)))
-#endif
+#define        XFS_DIR2_MAX_LEAF_ENTS(mp)      xfs_dir2_max_leaf_ents(mp)
+static inline int xfs_dir2_max_leaf_ents(struct xfs_mount *mp)
+{
+       return (int)(((mp)->m_dirblksize - (uint)sizeof(xfs_dir2_leaf_hdr_t)) /
+              (uint)sizeof(xfs_dir2_leaf_entry_t));
+}
 
 /*
  * Get address of the bestcount field in the single-leaf block.
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_LEAF_TAIL_P)
-xfs_dir2_leaf_tail_t *
-xfs_dir2_leaf_tail_p(struct xfs_mount *mp, xfs_dir2_leaf_t *lp);
-#define        XFS_DIR2_LEAF_TAIL_P(mp,lp)     \
-       xfs_dir2_leaf_tail_p(mp, lp)
-#else
-#define        XFS_DIR2_LEAF_TAIL_P(mp,lp)     \
-       ((xfs_dir2_leaf_tail_t *)\
-        ((char *)(lp) + (mp)->m_dirblksize - \
-         (uint)sizeof(xfs_dir2_leaf_tail_t)))
-#endif
+#define        XFS_DIR2_LEAF_TAIL_P(mp,lp)     xfs_dir2_leaf_tail_p(mp, lp)
+static inline xfs_dir2_leaf_tail_t *
+xfs_dir2_leaf_tail_p(struct xfs_mount *mp, xfs_dir2_leaf_t *lp)
+{
+       return (xfs_dir2_leaf_tail_t *)
+               ((char *)(lp) + (mp)->m_dirblksize - 
+                 (uint)sizeof(xfs_dir2_leaf_tail_t));
+}
 
 /*
  * Get address of the bests array in the single-leaf block.
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_LEAF_BESTS_P)
-xfs_dir2_data_off_t *
-xfs_dir2_leaf_bests_p(xfs_dir2_leaf_tail_t *ltp);
 #define        XFS_DIR2_LEAF_BESTS_P(ltp)      xfs_dir2_leaf_bests_p(ltp)
-#else
-#define        XFS_DIR2_LEAF_BESTS_P(ltp)      \
-       ((xfs_dir2_data_off_t *)(ltp) - INT_GET((ltp)->bestcount, ARCH_CONVERT))
-#endif
+static inline xfs_dir2_data_off_t *
+xfs_dir2_leaf_bests_p(xfs_dir2_leaf_tail_t *ltp)
+{
+       return (xfs_dir2_data_off_t *)
+               (ltp) - INT_GET((ltp)->bestcount, ARCH_CONVERT);
+}
 
 /*
  * Convert dataptr to byte in file space
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_DATAPTR_TO_BYTE)
-xfs_dir2_off_t
-xfs_dir2_dataptr_to_byte(struct xfs_mount *mp, xfs_dir2_dataptr_t dp);
 #define        XFS_DIR2_DATAPTR_TO_BYTE(mp,dp) xfs_dir2_dataptr_to_byte(mp, dp)
-#else
-#define        XFS_DIR2_DATAPTR_TO_BYTE(mp,dp) \
-       ((xfs_dir2_off_t)(dp) << XFS_DIR2_DATA_ALIGN_LOG)
-#endif
+static inline xfs_dir2_off_t
+xfs_dir2_dataptr_to_byte(struct xfs_mount *mp, xfs_dir2_dataptr_t dp)
+{
+       return (xfs_dir2_off_t)(dp) << XFS_DIR2_DATA_ALIGN_LOG;
+}
 
 /*
  * Convert byte in file space to dataptr.  It had better be aligned.
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_BYTE_TO_DATAPTR)
-xfs_dir2_dataptr_t
-xfs_dir2_byte_to_dataptr(struct xfs_mount *mp, xfs_dir2_off_t by);
 #define        XFS_DIR2_BYTE_TO_DATAPTR(mp,by) xfs_dir2_byte_to_dataptr(mp,by)
-#else
-#define        XFS_DIR2_BYTE_TO_DATAPTR(mp,by) \
-       ((xfs_dir2_dataptr_t)((by) >> XFS_DIR2_DATA_ALIGN_LOG))
-#endif
+static inline xfs_dir2_dataptr_t
+xfs_dir2_byte_to_dataptr(struct xfs_mount *mp, xfs_dir2_off_t by)
+{
+       return (xfs_dir2_dataptr_t)((by) >> XFS_DIR2_DATA_ALIGN_LOG);
+}
+
+/*
+ * Convert byte in space to (DB) block
+ */
+#define        XFS_DIR2_BYTE_TO_DB(mp,by)      xfs_dir2_byte_to_db(mp, by)
+static inline xfs_dir2_db_t
+xfs_dir2_byte_to_db(struct xfs_mount *mp, xfs_dir2_off_t by)
+{
+       return (xfs_dir2_db_t)((by) >> \
+                ((mp)->m_sb.sb_blocklog + (mp)->m_sb.sb_dirblklog));
+}
 
 /*
  * Convert dataptr to a block number
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_DATAPTR_TO_DB)
-xfs_dir2_db_t
-xfs_dir2_dataptr_to_db(struct xfs_mount *mp, xfs_dir2_dataptr_t dp);
 #define        XFS_DIR2_DATAPTR_TO_DB(mp,dp)   xfs_dir2_dataptr_to_db(mp, dp)
-#else
-#define        XFS_DIR2_DATAPTR_TO_DB(mp,dp)   \
-       XFS_DIR2_BYTE_TO_DB(mp, XFS_DIR2_DATAPTR_TO_BYTE(mp, dp))
-#endif
+static inline xfs_dir2_db_t
+xfs_dir2_dataptr_to_db(struct xfs_mount *mp, xfs_dir2_dataptr_t dp)
+{
+       return XFS_DIR2_BYTE_TO_DB(mp, XFS_DIR2_DATAPTR_TO_BYTE(mp, dp));
+}
+
+/*
+ * Convert byte in space to offset in a block
+ */
+#define        XFS_DIR2_BYTE_TO_OFF(mp,by)     xfs_dir2_byte_to_off(mp, by)
+static inline xfs_dir2_data_aoff_t
+xfs_dir2_byte_to_off(struct xfs_mount *mp, xfs_dir2_off_t by)
+{
+       return (xfs_dir2_data_aoff_t)((by) & \
+               ((1 << ((mp)->m_sb.sb_blocklog + (mp)->m_sb.sb_dirblklog)) - 1));
+}
 
 /*
  * Convert dataptr to a byte offset in a block
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_DATAPTR_TO_OFF)
-xfs_dir2_data_aoff_t
-xfs_dir2_dataptr_to_off(struct xfs_mount *mp, xfs_dir2_dataptr_t dp);
 #define        XFS_DIR2_DATAPTR_TO_OFF(mp,dp)  xfs_dir2_dataptr_to_off(mp, dp)
-#else
-#define        XFS_DIR2_DATAPTR_TO_OFF(mp,dp)  \
-       XFS_DIR2_BYTE_TO_OFF(mp, XFS_DIR2_DATAPTR_TO_BYTE(mp, dp))
-#endif
+static inline xfs_dir2_data_aoff_t
+xfs_dir2_dataptr_to_off(struct xfs_mount *mp, xfs_dir2_dataptr_t dp)
+{
+       return XFS_DIR2_BYTE_TO_OFF(mp, XFS_DIR2_DATAPTR_TO_BYTE(mp, dp));
+}
 
 /*
  * Convert block and offset to byte in space
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_DB_OFF_TO_BYTE)
-xfs_dir2_off_t
-xfs_dir2_db_off_to_byte(struct xfs_mount *mp, xfs_dir2_db_t db,
-                       xfs_dir2_data_aoff_t o);
 #define        XFS_DIR2_DB_OFF_TO_BYTE(mp,db,o)        \
        xfs_dir2_db_off_to_byte(mp, db, o)
-#else
-#define        XFS_DIR2_DB_OFF_TO_BYTE(mp,db,o)        \
-       (((xfs_dir2_off_t)(db) << \
-        ((mp)->m_sb.sb_blocklog + (mp)->m_sb.sb_dirblklog)) + (o))
-#endif
+static inline xfs_dir2_off_t
+xfs_dir2_db_off_to_byte(struct xfs_mount *mp, xfs_dir2_db_t db,
+                       xfs_dir2_data_aoff_t o)
+{
+       return ((xfs_dir2_off_t)(db) << \
+               ((mp)->m_sb.sb_blocklog + (mp)->m_sb.sb_dirblklog)) + (o);
+}
 
 /*
- * Convert byte in space to (DB) block
+ * Convert block (DB) to block (dablk)
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_BYTE_TO_DB)
-xfs_dir2_db_t xfs_dir2_byte_to_db(struct xfs_mount *mp, xfs_dir2_off_t by);
-#define        XFS_DIR2_BYTE_TO_DB(mp,by)      xfs_dir2_byte_to_db(mp, by)
-#else
-#define        XFS_DIR2_BYTE_TO_DB(mp,by)      \
-       ((xfs_dir2_db_t)((by) >> \
-                        ((mp)->m_sb.sb_blocklog + (mp)->m_sb.sb_dirblklog)))
-#endif
+#define        XFS_DIR2_DB_TO_DA(mp,db)        xfs_dir2_db_to_da(mp, db)
+static inline xfs_dablk_t
+xfs_dir2_db_to_da(struct xfs_mount *mp, xfs_dir2_db_t db)
+{
+       return (xfs_dablk_t)((db) << (mp)->m_sb.sb_dirblklog);
+}
 
 /*
  * Convert byte in space to (DA) block
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_BYTE_TO_DA)
-xfs_dablk_t xfs_dir2_byte_to_da(struct xfs_mount *mp, xfs_dir2_off_t by);
 #define        XFS_DIR2_BYTE_TO_DA(mp,by)      xfs_dir2_byte_to_da(mp, by)
-#else
-#define        XFS_DIR2_BYTE_TO_DA(mp,by)      \
-       XFS_DIR2_DB_TO_DA(mp, XFS_DIR2_BYTE_TO_DB(mp, by))
-#endif
-
-/*
- * Convert byte in space to offset in a block
- */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_BYTE_TO_OFF)
-xfs_dir2_data_aoff_t
-xfs_dir2_byte_to_off(struct xfs_mount *mp, xfs_dir2_off_t by);
-#define        XFS_DIR2_BYTE_TO_OFF(mp,by)     xfs_dir2_byte_to_off(mp, by)
-#else
-#define        XFS_DIR2_BYTE_TO_OFF(mp,by)     \
-       ((xfs_dir2_data_aoff_t)((by) & \
-                               ((1 << ((mp)->m_sb.sb_blocklog + \
-                                       (mp)->m_sb.sb_dirblklog)) - 1)))
-#endif
+static inline xfs_dablk_t
+xfs_dir2_byte_to_da(struct xfs_mount *mp, xfs_dir2_off_t by)
+{
+       return XFS_DIR2_DB_TO_DA(mp, XFS_DIR2_BYTE_TO_DB(mp, by));
+}
 
 /*
  * Convert block and offset to dataptr
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_DB_OFF_TO_DATAPTR)
-xfs_dir2_dataptr_t
-xfs_dir2_db_off_to_dataptr(struct xfs_mount *mp, xfs_dir2_db_t db,
-                          xfs_dir2_data_aoff_t o);
 #define        XFS_DIR2_DB_OFF_TO_DATAPTR(mp,db,o)     \
        xfs_dir2_db_off_to_dataptr(mp, db, o)
-#else
-#define        XFS_DIR2_DB_OFF_TO_DATAPTR(mp,db,o)     \
-       XFS_DIR2_BYTE_TO_DATAPTR(mp, XFS_DIR2_DB_OFF_TO_BYTE(mp, db, o))
-#endif
-
-/*
- * Convert block (DB) to block (dablk)
- */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_DB_TO_DA)
-xfs_dablk_t xfs_dir2_db_to_da(struct xfs_mount *mp, xfs_dir2_db_t db);
-#define        XFS_DIR2_DB_TO_DA(mp,db)        xfs_dir2_db_to_da(mp, db)
-#else
-#define        XFS_DIR2_DB_TO_DA(mp,db)        \
-       ((xfs_dablk_t)((db) << (mp)->m_sb.sb_dirblklog))
-#endif
+static inline xfs_dir2_dataptr_t
+xfs_dir2_db_off_to_dataptr(struct xfs_mount *mp, xfs_dir2_db_t db,
+                          xfs_dir2_data_aoff_t o)
+{
+       return XFS_DIR2_BYTE_TO_DATAPTR(mp, XFS_DIR2_DB_OFF_TO_BYTE(mp, db, o));
+}
 
 /*
  * Convert block (dablk) to block (DB)
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_DA_TO_DB)
-xfs_dir2_db_t xfs_dir2_da_to_db(struct xfs_mount *mp, xfs_dablk_t da);
 #define        XFS_DIR2_DA_TO_DB(mp,da)        xfs_dir2_da_to_db(mp, da)
-#else
-#define        XFS_DIR2_DA_TO_DB(mp,da)        \
-       ((xfs_dir2_db_t)((da) >> (mp)->m_sb.sb_dirblklog))
-#endif
+static inline xfs_dir2_db_t
+xfs_dir2_da_to_db(struct xfs_mount *mp, xfs_dablk_t da)
+{
+       return (xfs_dir2_db_t)((da) >> (mp)->m_sb.sb_dirblklog);
+}
 
 /*
  * Convert block (dablk) to byte offset in space
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_DA_TO_BYTE)
-xfs_dir2_off_t xfs_dir2_da_to_byte(struct xfs_mount *mp, xfs_dablk_t da);
 #define XFS_DIR2_DA_TO_BYTE(mp,da)     xfs_dir2_da_to_byte(mp, da)
-#else
-#define        XFS_DIR2_DA_TO_BYTE(mp,da)      \
-       XFS_DIR2_DB_OFF_TO_BYTE(mp, XFS_DIR2_DA_TO_DB(mp, da), 0)
-#endif
+static inline xfs_dir2_off_t
+xfs_dir2_da_to_byte(struct xfs_mount *mp, xfs_dablk_t da)
+{
+       return XFS_DIR2_DB_OFF_TO_BYTE(mp, XFS_DIR2_DA_TO_DB(mp, da), 0);
+}
 
 /*
  * Function declarations.
  */
-
-extern int
-       xfs_dir2_block_to_leaf(struct xfs_da_args *args, struct xfs_dabuf *dbp);
-
-extern int
-       xfs_dir2_leaf_addname(struct xfs_da_args *args);
-
-extern void
-       xfs_dir2_leaf_compact(struct xfs_da_args *args, struct xfs_dabuf *bp);
-
-extern void
-       xfs_dir2_leaf_compact_x1(struct xfs_dabuf *bp, int *indexp,
-                                int *lowstalep, int *highstalep, int *lowlogp,
-                                int *highlogp);
-
-extern int
-       xfs_dir2_leaf_getdents(struct xfs_trans *tp, struct xfs_inode *dp,
-                              struct uio *uio, int *eofp, struct xfs_dirent *dbp,
-                              xfs_dir2_put_t put);
-
-extern int
-       xfs_dir2_leaf_init(struct xfs_da_args *args, xfs_dir2_db_t bno,
-                          struct xfs_dabuf **bpp, int magic);
-
-extern void
-       xfs_dir2_leaf_log_ents(struct xfs_trans *tp, struct xfs_dabuf *bp,
-                              int first, int last);
-
-extern void
-       xfs_dir2_leaf_log_header(struct xfs_trans *tp, struct xfs_dabuf *bp);
-
-extern int
-       xfs_dir2_leaf_lookup(struct xfs_da_args *args);
-
-extern int
-       xfs_dir2_leaf_removename(struct xfs_da_args *args);
-
-extern int
-       xfs_dir2_leaf_replace(struct xfs_da_args *args);
-
-extern int
-       xfs_dir2_leaf_search_hash(struct xfs_da_args *args,
-                                 struct xfs_dabuf *lbp);
-extern int
-       xfs_dir2_leaf_trim_data(struct xfs_da_args *args, struct xfs_dabuf *lbp,                                xfs_dir2_db_t db);
-
-extern int
-       xfs_dir2_node_to_leaf(struct xfs_da_state *state);
+extern int xfs_dir2_block_to_leaf(struct xfs_da_args *args,
+                                 struct xfs_dabuf *dbp);
+extern int xfs_dir2_leaf_addname(struct xfs_da_args *args);
+extern void xfs_dir2_leaf_compact(struct xfs_da_args *args,
+                                 struct xfs_dabuf *bp);
+extern void xfs_dir2_leaf_compact_x1(struct xfs_dabuf *bp, int *indexp,
+                                    int *lowstalep, int *highstalep,
+                                    int *lowlogp, int *highlogp);
+extern int xfs_dir2_leaf_getdents(struct xfs_trans *tp, struct xfs_inode *dp,
+                                 struct uio *uio, int *eofp,
+                                 struct xfs_dirent *dbp, xfs_dir2_put_t put);
+extern int xfs_dir2_leaf_init(struct xfs_da_args *args, xfs_dir2_db_t bno,
+                             struct xfs_dabuf **bpp, int magic);
+extern void xfs_dir2_leaf_log_ents(struct xfs_trans *tp, struct xfs_dabuf *bp,
+                                  int first, int last);
+extern void xfs_dir2_leaf_log_header(struct xfs_trans *tp,
+                                    struct xfs_dabuf *bp);
+extern int xfs_dir2_leaf_lookup(struct xfs_da_args *args);
+extern int xfs_dir2_leaf_removename(struct xfs_da_args *args);
+extern int xfs_dir2_leaf_replace(struct xfs_da_args *args);
+extern int xfs_dir2_leaf_search_hash(struct xfs_da_args *args,
+                                    struct xfs_dabuf *lbp);
+extern int xfs_dir2_leaf_trim_data(struct xfs_da_args *args,
+                                  struct xfs_dabuf *lbp, xfs_dir2_db_t db);
+extern int xfs_dir2_node_to_leaf(struct xfs_da_state *state);
 
 #endif /* __XFS_DIR2_LEAF_H__ */
index a7615d86bfb7fec792dced881905fafc5822a7c4..2517460430d3cf01fe489f2fbbf515083f952606 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
-/*
- * xfs_dir2_node.c
- * XFS directory implementation, version 2, node form files
- * See data structures in xfs_dir2_node.h and xfs_da_btree.h.
- */
-
 #include "xfs.h"
-
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_dir.h"
 #include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
+#include "xfs_da_btree.h"
 #include "xfs_bmap_btree.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
 #include "xfs_inode.h"
 #include "xfs_bmap.h"
-#include "xfs_da_btree.h"
 #include "xfs_dir2_data.h"
 #include "xfs_dir2_leaf.h"
 #include "xfs_dir2_block.h"
index 96db420c7c5cda156709ee766bb5c2093a1a70ac..70fa0797c2074d47ba42d39be1c4474d305dc30b 100644 (file)
@@ -44,10 +44,6 @@ struct xfs_da_state_blk;
 struct xfs_inode;
 struct xfs_trans;
 
-/*
- * Constants.
- */
-
 /*
  * Offset of the freespace index.
  */
@@ -58,9 +54,6 @@ struct xfs_trans;
 
 #define        XFS_DIR2_FREE_MAGIC     0x58443246      /* XD2F */
 
-/*
- * Structures.
- */
 typedef        struct xfs_dir2_free_hdr {
        __uint32_t              magic;          /* XFS_DIR2_FREE_MAGIC */
        __int32_t               firstdb;        /* db of first entry */
@@ -73,87 +66,53 @@ typedef struct xfs_dir2_free {
        xfs_dir2_data_off_t     bests[1];       /* best free counts */
                                                /* unused entries are -1 */
 } xfs_dir2_free_t;
+
 #define        XFS_DIR2_MAX_FREE_BESTS(mp)     \
        (((mp)->m_dirblksize - (uint)sizeof(xfs_dir2_free_hdr_t)) / \
         (uint)sizeof(xfs_dir2_data_off_t))
 
-/*
- * Macros.
- */
-
 /*
  * Convert data space db to the corresponding free db.
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_DB_TO_FDB)
-xfs_dir2_db_t
-xfs_dir2_db_to_fdb(struct xfs_mount *mp, xfs_dir2_db_t db);
 #define        XFS_DIR2_DB_TO_FDB(mp,db)       xfs_dir2_db_to_fdb(mp, db)
-#else
-#define        XFS_DIR2_DB_TO_FDB(mp,db)       \
-       (XFS_DIR2_FREE_FIRSTDB(mp) + (db) / XFS_DIR2_MAX_FREE_BESTS(mp))
-#endif
+static inline xfs_dir2_db_t
+xfs_dir2_db_to_fdb(struct xfs_mount *mp, xfs_dir2_db_t db)
+{
+       return (XFS_DIR2_FREE_FIRSTDB(mp) + (db) / XFS_DIR2_MAX_FREE_BESTS(mp));
+}
 
 /*
  * Convert data space db to the corresponding index in a free db.
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_DB_TO_FDINDEX)
-int
-xfs_dir2_db_to_fdindex(struct xfs_mount *mp, xfs_dir2_db_t db);
 #define        XFS_DIR2_DB_TO_FDINDEX(mp,db)   xfs_dir2_db_to_fdindex(mp, db)
-#else
-#define        XFS_DIR2_DB_TO_FDINDEX(mp,db)   ((db) % XFS_DIR2_MAX_FREE_BESTS(mp))
-#endif
-
-/*
- * Functions.
- */
-
-extern void
-       xfs_dir2_free_log_bests(struct xfs_trans *tp, struct xfs_dabuf *bp,
-                               int first, int last);
-
-extern int
-       xfs_dir2_leaf_to_node(struct xfs_da_args *args, struct xfs_dabuf *lbp);
-
-extern xfs_dahash_t
-       xfs_dir2_leafn_lasthash(struct xfs_dabuf *bp, int *count);
-
-extern int
-       xfs_dir2_leafn_lookup_int(struct xfs_dabuf *bp,
-                                 struct xfs_da_args *args, int *indexp,
-                                 struct xfs_da_state *state);
-
-extern int
-       xfs_dir2_leafn_order(struct xfs_dabuf *leaf1_bp,
-                            struct xfs_dabuf *leaf2_bp);
-
-extern int
-       xfs_dir2_leafn_split(struct xfs_da_state *state,
-                            struct xfs_da_state_blk *oldblk,
-                            struct xfs_da_state_blk *newblk);
-
-extern int
-       xfs_dir2_leafn_toosmall(struct xfs_da_state *state, int *action);
-
-extern void
-       xfs_dir2_leafn_unbalance(struct xfs_da_state *state,
-                                struct xfs_da_state_blk *drop_blk,
-                                struct xfs_da_state_blk *save_blk);
-
-extern int
-       xfs_dir2_node_addname(struct xfs_da_args *args);
-
-extern int
-       xfs_dir2_node_lookup(struct xfs_da_args *args);
-
-extern int
-       xfs_dir2_node_removename(struct xfs_da_args *args);
-
-extern int
-       xfs_dir2_node_replace(struct xfs_da_args *args);
-
-extern int
-       xfs_dir2_node_trim_free(struct xfs_da_args *args, xfs_fileoff_t fo,
-                               int *rvalp);
+static inline int
+xfs_dir2_db_to_fdindex(struct xfs_mount *mp, xfs_dir2_db_t db)
+{
+       return ((db) % XFS_DIR2_MAX_FREE_BESTS(mp));
+}
+
+extern void xfs_dir2_free_log_bests(struct xfs_trans *tp, struct xfs_dabuf *bp,
+                                   int first, int last);
+extern int xfs_dir2_leaf_to_node(struct xfs_da_args *args,
+                                struct xfs_dabuf *lbp);
+extern xfs_dahash_t xfs_dir2_leafn_lasthash(struct xfs_dabuf *bp, int *count);
+extern int xfs_dir2_leafn_lookup_int(struct xfs_dabuf *bp,
+                                    struct xfs_da_args *args, int *indexp,
+                                    struct xfs_da_state *state);
+extern int xfs_dir2_leafn_order(struct xfs_dabuf *leaf1_bp,
+                               struct xfs_dabuf *leaf2_bp);
+extern int xfs_dir2_leafn_split(struct xfs_da_state *state,
+                               struct xfs_da_state_blk *oldblk,
+                               struct xfs_da_state_blk *newblk);
+extern int xfs_dir2_leafn_toosmall(struct xfs_da_state *state, int *action);
+extern void xfs_dir2_leafn_unbalance(struct xfs_da_state *state,
+                                    struct xfs_da_state_blk *drop_blk,
+                                    struct xfs_da_state_blk *save_blk);
+extern int xfs_dir2_node_addname(struct xfs_da_args *args);
+extern int xfs_dir2_node_lookup(struct xfs_da_args *args);
+extern int xfs_dir2_node_removename(struct xfs_da_args *args);
+extern int xfs_dir2_node_replace(struct xfs_da_args *args);
+extern int xfs_dir2_node_trim_free(struct xfs_da_args *args, xfs_fileoff_t fo,
+                                  int *rvalp);
 
 #endif /* __XFS_DIR2_NODE_H__ */
index 6bbc61674411cc87c73ebd2de6306b12a157882a..95e703d5bc05a5ed90c26a13a453056bff48449e 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
-/*
- * xfs_dir2_sf.c
- * Shortform directory implementation for v2 directories.
- */
-
 #include "xfs.h"
-
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_dir.h"
 #include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
+#include "xfs_da_btree.h"
 #include "xfs_bmap_btree.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
-#include "xfs_inode_item.h"
 #include "xfs_inode.h"
-#include "xfs_da_btree.h"
+#include "xfs_inode_item.h"
 #include "xfs_dir_leaf.h"
 #include "xfs_error.h"
 #include "xfs_dir2_data.h"
index bac6f5a2a312a78f6f38c2c1f5f37ad9b4288767..133464935ef1911faca5fb961d822c13526f6035 100644 (file)
@@ -104,140 +104,106 @@ typedef struct xfs_dir2_sf {
        xfs_dir2_sf_entry_t     list[1];        /* shortform entries */
 } xfs_dir2_sf_t;
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_SF_HDR_SIZE)
-int xfs_dir2_sf_hdr_size(int i8count);
 #define        XFS_DIR2_SF_HDR_SIZE(i8count)   xfs_dir2_sf_hdr_size(i8count)
-#else
-#define        XFS_DIR2_SF_HDR_SIZE(i8count)   \
-       ((uint)sizeof(xfs_dir2_sf_hdr_t) - \
-        ((i8count) == 0) * \
-        ((uint)sizeof(xfs_dir2_ino8_t) - (uint)sizeof(xfs_dir2_ino4_t)))
-#endif
-
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_SF_INUMBERP)
-xfs_dir2_inou_t *xfs_dir2_sf_inumberp(xfs_dir2_sf_entry_t *sfep);
+static inline int xfs_dir2_sf_hdr_size(int i8count)
+{
+       return ((uint)sizeof(xfs_dir2_sf_hdr_t) - \
+               ((i8count) == 0) * \
+               ((uint)sizeof(xfs_dir2_ino8_t) - (uint)sizeof(xfs_dir2_ino4_t)));
+}
+
 #define        XFS_DIR2_SF_INUMBERP(sfep)      xfs_dir2_sf_inumberp(sfep)
-#else
-#define        XFS_DIR2_SF_INUMBERP(sfep)      \
-       ((xfs_dir2_inou_t *)&(sfep)->name[(sfep)->namelen])
-#endif
-
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_SF_GET_INUMBER)
-xfs_intino_t xfs_dir2_sf_get_inumber(xfs_dir2_sf_t *sfp, xfs_dir2_inou_t *from);
-#define        XFS_DIR2_SF_GET_INUMBER(sfp, from)      \
-       xfs_dir2_sf_get_inumber(sfp, from)
+static inline xfs_dir2_inou_t *xfs_dir2_sf_inumberp(xfs_dir2_sf_entry_t *sfep)
+{
+       return (xfs_dir2_inou_t *)&(sfep)->name[(sfep)->namelen];
+}
 
-#else
-#define        XFS_DIR2_SF_GET_INUMBER(sfp, from)      \
-       ((sfp)->hdr.i8count == 0 ? \
+#define        XFS_DIR2_SF_GET_INUMBER(sfp, from) \
+       xfs_dir2_sf_get_inumber(sfp, from)
+static inline xfs_intino_t
+xfs_dir2_sf_get_inumber(xfs_dir2_sf_t *sfp, xfs_dir2_inou_t *from)
+{
+       return ((sfp)->hdr.i8count == 0 ? \
                (xfs_intino_t)XFS_GET_DIR_INO4((from)->i4) : \
-               (xfs_intino_t)XFS_GET_DIR_INO8((from)->i8))
-#endif
+               (xfs_intino_t)XFS_GET_DIR_INO8((from)->i8));
+}
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_SF_PUT_INUMBER)
-void xfs_dir2_sf_put_inumber(xfs_dir2_sf_t *sfp, xfs_ino_t *from,
-                                    xfs_dir2_inou_t *to);
-#define        XFS_DIR2_SF_PUT_INUMBER(sfp,from,to)    \
+#define        XFS_DIR2_SF_PUT_INUMBER(sfp,from,to) \
        xfs_dir2_sf_put_inumber(sfp,from,to)
-#else
-#define        XFS_DIR2_SF_PUT_INUMBER(sfp,from,to)    \
-       if ((sfp)->hdr.i8count == 0) { \
-               XFS_PUT_DIR_INO4(*(from), (to)->i4); \
-       } else { \
-               XFS_PUT_DIR_INO8(*(from), (to)->i8); \
-       }
-#endif
-
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_SF_GET_OFFSET)
-xfs_dir2_data_aoff_t xfs_dir2_sf_get_offset(xfs_dir2_sf_entry_t *sfep);
+static inline void xfs_dir2_sf_put_inumber(xfs_dir2_sf_t *sfp, xfs_ino_t *from,
+                                               xfs_dir2_inou_t *to)
+{
+       if ((sfp)->hdr.i8count == 0)
+               XFS_PUT_DIR_INO4(*(from), (to)->i4);
+       else
+               XFS_PUT_DIR_INO8(*(from), (to)->i8);
+}
+
 #define        XFS_DIR2_SF_GET_OFFSET(sfep)    \
        xfs_dir2_sf_get_offset(sfep)
-#else
-#define        XFS_DIR2_SF_GET_OFFSET(sfep)    \
-       INT_GET_UNALIGNED_16_BE(&(sfep)->offset.i)
-#endif
+static inline xfs_dir2_data_aoff_t
+xfs_dir2_sf_get_offset(xfs_dir2_sf_entry_t *sfep)
+{
+       return INT_GET_UNALIGNED_16_BE(&(sfep)->offset.i);
+}
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_SF_PUT_OFFSET)
-void xfs_dir2_sf_put_offset(xfs_dir2_sf_entry_t *sfep,
-                                   xfs_dir2_data_aoff_t off);
 #define        XFS_DIR2_SF_PUT_OFFSET(sfep,off) \
        xfs_dir2_sf_put_offset(sfep,off)
-#else
-#define        XFS_DIR2_SF_PUT_OFFSET(sfep,off)        \
-       INT_SET_UNALIGNED_16_BE(&(sfep)->offset.i,off)
-#endif
+static inline void
+xfs_dir2_sf_put_offset(xfs_dir2_sf_entry_t *sfep, xfs_dir2_data_aoff_t off)
+{
+       INT_SET_UNALIGNED_16_BE(&(sfep)->offset.i, off);
+}
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_SF_ENTSIZE_BYNAME)
-int xfs_dir2_sf_entsize_byname(xfs_dir2_sf_t *sfp, int len);
 #define XFS_DIR2_SF_ENTSIZE_BYNAME(sfp,len)    \
        xfs_dir2_sf_entsize_byname(sfp,len)
-#else
-#define XFS_DIR2_SF_ENTSIZE_BYNAME(sfp,len)    /* space a name uses */ \
-       ((uint)sizeof(xfs_dir2_sf_entry_t) - 1 + (len) - \
-        ((sfp)->hdr.i8count == 0) * \
-        ((uint)sizeof(xfs_dir2_ino8_t) - (uint)sizeof(xfs_dir2_ino4_t)))
-#endif
-
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_SF_ENTSIZE_BYENTRY)
-int xfs_dir2_sf_entsize_byentry(xfs_dir2_sf_t *sfp, xfs_dir2_sf_entry_t *sfep);
+static inline int xfs_dir2_sf_entsize_byname(xfs_dir2_sf_t *sfp, int len)
+{
+       return ((uint)sizeof(xfs_dir2_sf_entry_t) - 1 + (len) - \
+               ((sfp)->hdr.i8count == 0) * \
+               ((uint)sizeof(xfs_dir2_ino8_t) - (uint)sizeof(xfs_dir2_ino4_t)));
+}
+
 #define XFS_DIR2_SF_ENTSIZE_BYENTRY(sfp,sfep)  \
        xfs_dir2_sf_entsize_byentry(sfp,sfep)
-#else
-#define XFS_DIR2_SF_ENTSIZE_BYENTRY(sfp,sfep)  /* space an entry uses */ \
-       ((uint)sizeof(xfs_dir2_sf_entry_t) - 1 + (sfep)->namelen - \
-        ((sfp)->hdr.i8count == 0) * \
-        ((uint)sizeof(xfs_dir2_ino8_t) - (uint)sizeof(xfs_dir2_ino4_t)))
-#endif
-
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_SF_FIRSTENTRY)
-xfs_dir2_sf_entry_t *xfs_dir2_sf_firstentry(xfs_dir2_sf_t *sfp);
+static inline int
+xfs_dir2_sf_entsize_byentry(xfs_dir2_sf_t *sfp, xfs_dir2_sf_entry_t *sfep)
+{
+       return ((uint)sizeof(xfs_dir2_sf_entry_t) - 1 + (sfep)->namelen - \
+               ((sfp)->hdr.i8count == 0) * \
+               ((uint)sizeof(xfs_dir2_ino8_t) - (uint)sizeof(xfs_dir2_ino4_t)));
+}
+
 #define XFS_DIR2_SF_FIRSTENTRY(sfp)    xfs_dir2_sf_firstentry(sfp)
-#else
-#define XFS_DIR2_SF_FIRSTENTRY(sfp)    /* first entry in struct */ \
-       ((xfs_dir2_sf_entry_t *) \
-        ((char *)(sfp) + XFS_DIR2_SF_HDR_SIZE(sfp->hdr.i8count)))
-#endif
-
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_SF_NEXTENTRY)
-xfs_dir2_sf_entry_t *xfs_dir2_sf_nextentry(xfs_dir2_sf_t *sfp,
-                                          xfs_dir2_sf_entry_t *sfep);
-#define XFS_DIR2_SF_NEXTENTRY(sfp,sfep)                xfs_dir2_sf_nextentry(sfp,sfep)
-#else
-#define XFS_DIR2_SF_NEXTENTRY(sfp,sfep)                /* next entry in struct */ \
-       ((xfs_dir2_sf_entry_t *) \
-               ((char *)(sfep) + XFS_DIR2_SF_ENTSIZE_BYENTRY(sfp,sfep)))
-#endif
+static inline xfs_dir2_sf_entry_t *xfs_dir2_sf_firstentry(xfs_dir2_sf_t *sfp)
+{
+       return ((xfs_dir2_sf_entry_t *) \
+               ((char *)(sfp) + XFS_DIR2_SF_HDR_SIZE(sfp->hdr.i8count)));
+}
+
+#define XFS_DIR2_SF_NEXTENTRY(sfp,sfep)        xfs_dir2_sf_nextentry(sfp,sfep)
+static inline xfs_dir2_sf_entry_t *
+xfs_dir2_sf_nextentry(xfs_dir2_sf_t *sfp, xfs_dir2_sf_entry_t *sfep)
+{
+       return ((xfs_dir2_sf_entry_t *) \
+               ((char *)(sfep) + XFS_DIR2_SF_ENTSIZE_BYENTRY(sfp,sfep)));
+}
 
 /*
  * Functions.
  */
-
-extern int
-       xfs_dir2_block_sfsize(struct xfs_inode *dp,
-                             struct xfs_dir2_block *block,
-                             xfs_dir2_sf_hdr_t *sfhp);
-
-extern int
-       xfs_dir2_block_to_sf(struct xfs_da_args *args, struct xfs_dabuf *bp,
-                            int size, xfs_dir2_sf_hdr_t *sfhp);
-
-extern int
-       xfs_dir2_sf_addname(struct xfs_da_args *args);
-
-extern int
-       xfs_dir2_sf_create(struct xfs_da_args *args, xfs_ino_t pino);
-
-extern int
-       xfs_dir2_sf_getdents(struct xfs_inode *dp, struct uio *uio, int *eofp,
-                            struct xfs_dirent *dbp, xfs_dir2_put_t put);
-
-extern int
-       xfs_dir2_sf_lookup(struct xfs_da_args *args);
-
-extern int
-       xfs_dir2_sf_removename(struct xfs_da_args *args);
-
-extern int
-       xfs_dir2_sf_replace(struct xfs_da_args *args);
+extern int xfs_dir2_block_sfsize(struct xfs_inode *dp,
+                                struct xfs_dir2_block *block,
+                                xfs_dir2_sf_hdr_t *sfhp);
+extern int xfs_dir2_block_to_sf(struct xfs_da_args *args, struct xfs_dabuf *bp,
+                               int size, xfs_dir2_sf_hdr_t *sfhp);
+extern int xfs_dir2_sf_addname(struct xfs_da_args *args);
+extern int xfs_dir2_sf_create(struct xfs_da_args *args, xfs_ino_t pino);
+extern int xfs_dir2_sf_getdents(struct xfs_inode *dp, struct uio *uio,
+                               int *eofp, struct xfs_dirent *dbp,
+                               xfs_dir2_put_t put);
+extern int xfs_dir2_sf_lookup(struct xfs_da_args *args);
+extern int xfs_dir2_sf_removename(struct xfs_da_args *args);
+extern int xfs_dir2_sf_replace(struct xfs_da_args *args);
 
 #endif /* __XFS_DIR2_SF_H__ */
index 9d64173931408d166a90f247ee3bb7f6d3721957..34e5138c670ab40a6960d80731ed008886caf564 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
-/*
- * xfs_dir2_trace.c
- * Tracing for xfs v2 directories.
- */
 #include "xfs.h"
-
+#include "xfs_fs.h"
 #include "xfs_types.h"
 #include "xfs_inum.h"
 #include "xfs_dir.h"
 #include "xfs_dir2.h"
+#include "xfs_da_btree.h"
 #include "xfs_bmap_btree.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
 #include "xfs_inode.h"
-#include "xfs_da_btree.h"
 #include "xfs_dir2_trace.h"
 
 #ifdef XFS_DIR2_TRACE
index ca9bc2d9ba08a39f4f84ed0407d7ecce5831ee5e..22997d314cf26df1e4e40a7d86c195ca114b3858 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
-/*
- * xfs_dir_leaf.c
- *
- * GROT: figure out how to recover gracefully when bmap returns ENOSPC.
- */
-
 #include "xfs.h"
-
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_dir.h"
 #include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
-#include "xfs_alloc_btree.h"
+#include "xfs_da_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
-#include "xfs_alloc.h"
-#include "xfs_btree.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
-#include "xfs_inode_item.h"
 #include "xfs_inode.h"
+#include "xfs_inode_item.h"
+#include "xfs_alloc.h"
+#include "xfs_btree.h"
 #include "xfs_bmap.h"
-#include "xfs_da_btree.h"
 #include "xfs_dir_leaf.h"
 #include "xfs_error.h"
 
index 480bffc1f29fd64cbd6df39c788ffc30a683b472..216d62693b72363b516844677d7aec93f0c6d072 100644 (file)
@@ -152,30 +152,26 @@ typedef struct xfs_dir_put_args
        struct uio      *uio;           /* uio control structure */
 } xfs_dir_put_args_t;
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR_LEAF_ENTSIZE_BYNAME)
-int xfs_dir_leaf_entsize_byname(int len);
 #define XFS_DIR_LEAF_ENTSIZE_BYNAME(len)       xfs_dir_leaf_entsize_byname(len)
-#else
-#define XFS_DIR_LEAF_ENTSIZE_BYNAME(len)       /* space a name will use */ \
-       ((uint)sizeof(xfs_dir_leaf_name_t)-1 + len)
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR_LEAF_ENTSIZE_BYENTRY)
-int xfs_dir_leaf_entsize_byentry(xfs_dir_leaf_entry_t *entry);
+static inline int xfs_dir_leaf_entsize_byname(int len)
+{
+       return (uint)sizeof(xfs_dir_leaf_name_t)-1 + len;
+}
+
 #define XFS_DIR_LEAF_ENTSIZE_BYENTRY(entry)    \
        xfs_dir_leaf_entsize_byentry(entry)
-#else
-#define XFS_DIR_LEAF_ENTSIZE_BYENTRY(entry)    /* space an entry will use */ \
-       ((uint)sizeof(xfs_dir_leaf_name_t)-1 + (entry)->namelen)
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR_LEAF_NAMESTRUCT)
-xfs_dir_leaf_name_t *
-xfs_dir_leaf_namestruct(xfs_dir_leafblock_t *leafp, int offset);
+static inline int xfs_dir_leaf_entsize_byentry(xfs_dir_leaf_entry_t *entry)
+{
+       return (uint)sizeof(xfs_dir_leaf_name_t)-1 + (entry)->namelen;
+}
+
 #define XFS_DIR_LEAF_NAMESTRUCT(leafp,offset)  \
        xfs_dir_leaf_namestruct(leafp,offset)
-#else
-#define XFS_DIR_LEAF_NAMESTRUCT(leafp,offset)  /* point to name struct */ \
-       ((xfs_dir_leaf_name_t *)&((char *)(leafp))[offset])
-#endif
+static inline xfs_dir_leaf_name_t *
+xfs_dir_leaf_namestruct(xfs_dir_leafblock_t *leafp, int offset)
+{
+       return (xfs_dir_leaf_name_t *)&((char *)(leafp))[offset];
+}
 
 /*========================================================================
  * Function prototypes for the kernel.
@@ -190,7 +186,7 @@ int xfs_dir_shortform_lookup(struct xfs_da_args *args);
 int xfs_dir_shortform_to_leaf(struct xfs_da_args *args);
 int xfs_dir_shortform_removename(struct xfs_da_args *args);
 int xfs_dir_shortform_getdents(struct xfs_inode *dp, struct uio *uio, int *eofp,
-                                     struct xfs_dirent *dbp, xfs_dir_put_t put);
+                              struct xfs_dirent *dbp, xfs_dir_put_t put);
 int xfs_dir_shortform_replace(struct xfs_da_args *args);
 
 /*
@@ -237,7 +233,6 @@ int xfs_dir_put_dirent64_direct(xfs_dir_put_args_t *pa);
 int    xfs_dir_put_dirent64_uio(xfs_dir_put_args_t *pa);
 int    xfs_dir_ino_validate(struct xfs_mount *mp, xfs_ino_t ino);
 
-
 /*
  * Global data.
  */
index a61bcfc2a87d270cf97a63cd9083da7a0153cf5d..2b75b767e152a746e53203c66193663e8cfdd7dd 100644 (file)
@@ -76,49 +76,44 @@ typedef struct xfs_dir_sf_sort {
        char            *name;          /* name value, pointer into buffer */
 } xfs_dir_sf_sort_t;
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR_SF_GET_DIRINO)
-void xfs_dir_sf_get_dirino(xfs_dir_ino_t *from, xfs_ino_t *to);
-#define        XFS_DIR_SF_GET_DIRINO(from,to)              xfs_dir_sf_get_dirino(from, to)
-#else
-#define        XFS_DIR_SF_GET_DIRINO(from,to)              (*(to) = XFS_GET_DIR_INO8(*from))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR_SF_PUT_DIRINO)
-void xfs_dir_sf_put_dirino(xfs_ino_t *from, xfs_dir_ino_t *to);
-#define        XFS_DIR_SF_PUT_DIRINO(from,to)    xfs_dir_sf_put_dirino(from, to)
-#else
-#define        XFS_DIR_SF_PUT_DIRINO(from,to)    XFS_PUT_DIR_INO8(*(from), *(to))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR_SF_ENTSIZE_BYNAME)
-int xfs_dir_sf_entsize_byname(int len);
-#define XFS_DIR_SF_ENTSIZE_BYNAME(len)         xfs_dir_sf_entsize_byname(len)
-#else
-#define XFS_DIR_SF_ENTSIZE_BYNAME(len)         /* space a name uses */ \
-       ((uint)sizeof(xfs_dir_sf_entry_t)-1 + (len))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR_SF_ENTSIZE_BYENTRY)
-int xfs_dir_sf_entsize_byentry(xfs_dir_sf_entry_t *sfep);
+#define        XFS_DIR_SF_GET_DIRINO(from,to)  xfs_dir_sf_get_dirino(from, to)
+static inline void xfs_dir_sf_get_dirino(xfs_dir_ino_t *from, xfs_ino_t *to)
+{
+       *(to) = XFS_GET_DIR_INO8(*from);
+}
+
+#define        XFS_DIR_SF_PUT_DIRINO(from,to)  xfs_dir_sf_put_dirino(from, to)
+static inline void xfs_dir_sf_put_dirino(xfs_ino_t *from, xfs_dir_ino_t *to)
+{
+       XFS_PUT_DIR_INO8(*(from), *(to));
+}
+
+#define XFS_DIR_SF_ENTSIZE_BYNAME(len) xfs_dir_sf_entsize_byname(len)
+static inline int xfs_dir_sf_entsize_byname(int len)
+{
+       return (uint)sizeof(xfs_dir_sf_entry_t)-1 + (len);
+}
+
 #define XFS_DIR_SF_ENTSIZE_BYENTRY(sfep)       xfs_dir_sf_entsize_byentry(sfep)
-#else
-#define XFS_DIR_SF_ENTSIZE_BYENTRY(sfep)       /* space an entry uses */ \
-       ((uint)sizeof(xfs_dir_sf_entry_t)-1 + (sfep)->namelen)
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR_SF_NEXTENTRY)
-xfs_dir_sf_entry_t *xfs_dir_sf_nextentry(xfs_dir_sf_entry_t *sfep);
+static inline int xfs_dir_sf_entsize_byentry(xfs_dir_sf_entry_t *sfep)
+{
+       return (uint)sizeof(xfs_dir_sf_entry_t)-1 + (sfep)->namelen;
+}
+
 #define XFS_DIR_SF_NEXTENTRY(sfep)             xfs_dir_sf_nextentry(sfep)
-#else
-#define XFS_DIR_SF_NEXTENTRY(sfep)             /* next entry in struct */ \
-       ((xfs_dir_sf_entry_t *) \
-               ((char *)(sfep) + XFS_DIR_SF_ENTSIZE_BYENTRY(sfep)))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR_SF_ALLFIT)
-int xfs_dir_sf_allfit(int count, int totallen);
+static inline xfs_dir_sf_entry_t *xfs_dir_sf_nextentry(xfs_dir_sf_entry_t *sfep)
+{
+       return (xfs_dir_sf_entry_t *) \
+               ((char *)(sfep) + XFS_DIR_SF_ENTSIZE_BYENTRY(sfep));
+}
+
 #define XFS_DIR_SF_ALLFIT(count,totallen)      \
        xfs_dir_sf_allfit(count,totallen)
-#else
-#define XFS_DIR_SF_ALLFIT(count,totallen)      /* will all entries fit? */ \
-       ((uint)sizeof(xfs_dir_sf_hdr_t) + \
-              ((uint)sizeof(xfs_dir_sf_entry_t)-1)*(count) + (totallen))
-#endif
+static inline int xfs_dir_sf_allfit(int count, int totallen)
+{
+       return ((uint)sizeof(xfs_dir_sf_hdr_t) + \
+              ((uint)sizeof(xfs_dir_sf_entry_t)-1)*(count) + (totallen));
+}
 
 #if defined(XFS_DIR_TRACE)
 
index cec54ba800eb641a050309e38a9b4c42c7c65330..1b99c4dfbab3c36ab72a4ebc49c2971193c0958d 100644 (file)
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #include "xfs.h"
-
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
index dcd3fdd5c1f7817697090617136c7622ebc67419..5da2738b45388bccea88daf2a95ec9fd0fc8e9bd 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
 #include "xfs.h"
-
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
 #include "xfs_log.h"
-#include "xfs_sb.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
+#include "xfs_sb.h"
 #include "xfs_dir.h"
 #include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
 #include "xfs_bmap_btree.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
 #include "xfs_inode.h"
 #include "xfs_utils.h"
index 52ee2b90b5edc370f602a2390e21266e18284bc3..66eef1beb0e5bf638af2db9b4cdf279537b80260 100644 (file)
@@ -54,24 +54,10 @@ extern int  xfs_error_trap(int);
 
 struct xfs_mount;
 
-extern void
-xfs_error_report(
-       char            *tag,
-       int             level,
-       struct xfs_mount *mp,
-       char            *fname,
-       int             linenum,
-       inst_t          *ra);
-
-extern void
-xfs_corruption_error(
-       char            *tag,
-       int             level,
-       struct xfs_mount *mp,
-       void            *p,
-       char            *fname,
-       int             linenum,
-       inst_t          *ra);
+extern void xfs_error_report(char *tag, int level, struct xfs_mount *mp,
+                               char *fname, int linenum, inst_t *ra);
+extern void xfs_corruption_error(char *tag, int level, struct xfs_mount *mp,
+                               void *p, char *fname, int linenum, inst_t *ra);
 
 #define        XFS_ERROR_REPORT(e, lvl, mp)    \
        xfs_error_report(e, lvl, mp, __FILE__, __LINE__, __return_address)
@@ -83,6 +69,32 @@ xfs_corruption_error(
 #define XFS_ERRLEVEL_LOW       1
 #define XFS_ERRLEVEL_HIGH      5
 
+/*
+ * Macros to set EFSCORRUPTED & return/branch.
+ */
+#define        XFS_WANT_CORRUPTED_GOTO(x,l)    \
+       { \
+               int fs_is_ok = (x); \
+               ASSERT(fs_is_ok); \
+               if (unlikely(!fs_is_ok)) { \
+                       XFS_ERROR_REPORT("XFS_WANT_CORRUPTED_GOTO", \
+                                        XFS_ERRLEVEL_LOW, NULL); \
+                       error = XFS_ERROR(EFSCORRUPTED); \
+                       goto l; \
+               } \
+       }
+
+#define        XFS_WANT_CORRUPTED_RETURN(x)    \
+       { \
+               int fs_is_ok = (x); \
+               ASSERT(fs_is_ok); \
+               if (unlikely(!fs_is_ok)) { \
+                       XFS_ERROR_REPORT("XFS_WANT_CORRUPTED_RETURN", \
+                                        XFS_ERRLEVEL_LOW, NULL); \
+                       return XFS_ERROR(EFSCORRUPTED); \
+               } \
+       }
+
 /*
  * error injection tags - the labels can be anything you want
  * but each tag should have its own unique number
@@ -139,8 +151,8 @@ xfs_corruption_error(
 #define        XFS_RANDOM_BMAPIFORMAT                          XFS_RANDOM_DEFAULT
 
 #if (defined(DEBUG) || defined(INDUCE_IO_ERROR))
-extern int     xfs_error_test(int, int *, char *, int, char *, unsigned long);
-void xfs_error_test_init(void);
+extern int xfs_error_test(int, int *, char *, int, char *, unsigned long);
+extern void xfs_error_test_init(void);
 
 #define        XFS_NUM_INJECT_ERROR                            10
 
@@ -156,12 +168,10 @@ void xfs_error_test_init(void);
                        (rf)))
 #endif /* __ANSI_CPP__ */
 
-int            xfs_errortag_add(int error_tag, xfs_mount_t *mp);
-int            xfs_errortag_clear(int error_tag, xfs_mount_t *mp);
-
-int            xfs_errortag_clearall(xfs_mount_t *mp);
-int            xfs_errortag_clearall_umount(int64_t fsid, char *fsname,
-                                               int loud);
+extern int xfs_errortag_add(int error_tag, xfs_mount_t *mp);
+extern int xfs_errortag_clear(int error_tag, xfs_mount_t *mp);
+extern int xfs_errortag_clearall(xfs_mount_t *mp);
+extern int xfs_errortag_clearall_umount(int64_t fsid, char *fsname, int loud);
 #else
 #define XFS_TEST_ERROR(expr, mp, tag, rf)      (expr)
 #define xfs_errortag_add(tag, mp)              (ENOSYS)
@@ -185,9 +195,9 @@ int         xfs_errortag_clearall_umount(int64_t fsid, char *fsname,
 
 struct xfs_mount;
 /* PRINTFLIKE4 */
-void           xfs_cmn_err(int panic_tag, int level, struct xfs_mount *mp,
+extern void xfs_cmn_err(int panic_tag, int level, struct xfs_mount *mp,
                            char *fmt, ...);
 /* PRINTFLIKE3 */
-void           xfs_fs_cmn_err(int level, struct xfs_mount *mp, char *fmt, ...);
+extern void xfs_fs_cmn_err(int level, struct xfs_mount *mp, char *fmt, ...);
 
 #endif /* __XFS_ERROR_H__ */
index cc7d1494a45d1a449151451f3a109d4abec8589d..f48cc9a7cd5a919f40d2e8dcf76f6aad61f08085 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
-/*
- * This file contains the implementation of the xfs_efi_log_item
- * and xfs_efd_log_item items.
- */
-
 #include "xfs.h"
-
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_buf_item.h"
 #include "xfs_sb.h"
index 67522f2bcee803c7210c139fe215efecdc82a1ef..411081c0fd7c3e630ee91a772320e39c07343a0d 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
 #include "xfs.h"
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
+#include "xfs_bit.h"
 #include "xfs_inum.h"
 #include "xfs_log.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
+#include "xfs_ag.h"
 #include "xfs_dir.h"
+#include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
-#include "xfs_ag.h"
-#include "xfs_alloc_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_inode_item.h"
 #include "xfs_btree.h"
 #include "xfs_error.h"
 #include "xfs_alloc.h"
 #include "xfs_ialloc.h"
 #include "xfs_fsops.h"
 #include "xfs_itable.h"
-#include "xfs_rw.h"
-#include "xfs_refcache.h"
 #include "xfs_trans_space.h"
 #include "xfs_rtalloc.h"
-#include "xfs_dir2.h"
-#include "xfs_attr_sf.h"
-#include "xfs_dir_sf.h"
-#include "xfs_dir2_sf.h"
-#include "xfs_dinode.h"
-#include "xfs_inode.h"
-#include "xfs_inode_item.h"
+#include "xfs_rw.h"
 
 /*
  * File system operations
index 02989691e4abda2655dafa6cf6a992d7b87a5110..4fc0e73fd18fc0730c85b28a5434100c574c8b1e 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
 #include "xfs.h"
-
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
 #include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
-#include "xfs_alloc_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
-#include "xfs_btree.h"
-#include "xfs_ialloc.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
 #include "xfs_inode.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
 #include "xfs_alloc.h"
-#include "xfs_bit.h"
 #include "xfs_rtalloc.h"
 #include "xfs_error.h"
 #include "xfs_bmap.h"
index db6d0015cecfa91ccd5cd377c6101e351deec9c1..fab660dd6d1b8609f5ef4130d9873dd4349ffc4b 100644 (file)
@@ -40,18 +40,8 @@ struct xfs_trans;
 /*
  * Allocation parameters for inode allocation.
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IALLOC_INODES)
-int xfs_ialloc_inodes(struct xfs_mount *mp);
-#define        XFS_IALLOC_INODES(mp)   xfs_ialloc_inodes(mp)
-#else
-#define        XFS_IALLOC_INODES(mp)   ((mp)->m_ialloc_inos)
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IALLOC_BLOCKS)
-xfs_extlen_t xfs_ialloc_blocks(struct xfs_mount *mp);
-#define        XFS_IALLOC_BLOCKS(mp)   xfs_ialloc_blocks(mp)
-#else
-#define        XFS_IALLOC_BLOCKS(mp)   ((mp)->m_ialloc_blks)
-#endif
+#define        XFS_IALLOC_INODES(mp)   (mp)->m_ialloc_inos
+#define        XFS_IALLOC_BLOCKS(mp)   (mp)->m_ialloc_blks
 
 /*
  * For small block file systems, move inodes in clusters of this size.
@@ -67,31 +57,25 @@ xfs_extlen_t xfs_ialloc_blocks(struct xfs_mount *mp);
 /*
  * Make an inode pointer out of the buffer/offset.
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_MAKE_IPTR)
-struct xfs_dinode *xfs_make_iptr(struct xfs_mount *mp, struct xfs_buf *b, int o);
 #define        XFS_MAKE_IPTR(mp,b,o)           xfs_make_iptr(mp,b,o)
-#else
-#define        XFS_MAKE_IPTR(mp,b,o) \
-       ((xfs_dinode_t *)(xfs_buf_offset(b, (o) << (mp)->m_sb.sb_inodelog)))
-#endif
+static inline struct xfs_dinode *
+xfs_make_iptr(struct xfs_mount *mp, struct xfs_buf *b, int o)
+{
+       return (xfs_dinode_t *)
+               (xfs_buf_offset(b, o << (mp)->m_sb.sb_inodelog));
+}
 
 /*
  * Find a free (set) bit in the inode bitmask.
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IALLOC_FIND_FREE)
-int xfs_ialloc_find_free(xfs_inofree_t *fp);
 #define        XFS_IALLOC_FIND_FREE(fp)        xfs_ialloc_find_free(fp)
-#else
-#define        XFS_IALLOC_FIND_FREE(fp)        xfs_lowbit64(*(fp))
-#endif
+static inline int xfs_ialloc_find_free(xfs_inofree_t *fp)
+{
+       return xfs_lowbit64(*fp);
+}
 
 
 #ifdef __KERNEL__
-
-/*
- * Prototypes for visible xfs_ialloc.c routines.
- */
-
 /*
  * Allocate an inode on disk.
  * Mode is used to tell whether the new inode will need space, and whether
index 2d4daecec9905956b65d9589f64782f4323c864e..a49958d21e87ea6558a251dbb2957c959234aa8e 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
 #include "xfs.h"
-
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
 #include "xfs_dir.h"
+#include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
-#include "xfs_alloc_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
 #include "xfs_btree.h"
 #include "xfs_ialloc.h"
 #include "xfs_alloc.h"
index 44be188674a6a0e405b40559deec84d2aa4dd75c..b8c7e72ed8379eccc4f6388d40f9642cee74bae0 100644 (file)
@@ -51,14 +51,12 @@ typedef     __uint64_t      xfs_inofree_t;
 #define        XFS_INODES_PER_CHUNK_LOG        (XFS_NBBYLOG + 3)
 #define        XFS_INOBT_ALL_FREE      ((xfs_inofree_t)-1)
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INOBT_MASKN)
-xfs_inofree_t xfs_inobt_maskn(int i, int n);
 #define        XFS_INOBT_MASKN(i,n)            xfs_inobt_maskn(i,n)
-#else
-#define        XFS_INOBT_MASKN(i,n)    \
-       ((((n) >= XFS_INODES_PER_CHUNK ? \
-               (xfs_inofree_t)0 : ((xfs_inofree_t)1 << (n))) - 1) << (i))
-#endif
+static inline xfs_inofree_t xfs_inobt_maskn(int i, int n)
+{
+       return (((n) >= XFS_INODES_PER_CHUNK ? \
+               (xfs_inofree_t)0 : ((xfs_inofree_t)1 << (n))) - 1) << (i);
+}
 
 /*
  * Data record structure
@@ -82,237 +80,110 @@ typedef xfs_agblock_t xfs_inobt_ptr_t;    /* btree pointer type */
                                        /* btree block header type */
 typedef        struct xfs_btree_sblock xfs_inobt_block_t;
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BUF_TO_INOBT_BLOCK)
-xfs_inobt_block_t *xfs_buf_to_inobt_block(struct xfs_buf *bp);
-#define        XFS_BUF_TO_INOBT_BLOCK(bp)      xfs_buf_to_inobt_block(bp)
-#else
-#define        XFS_BUF_TO_INOBT_BLOCK(bp) ((xfs_inobt_block_t *)(XFS_BUF_PTR(bp)))
-#endif
+#define        XFS_BUF_TO_INOBT_BLOCK(bp)      ((xfs_inobt_block_t *)XFS_BUF_PTR(bp))
 
 /*
  * Bit manipulations for ir_free.
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INOBT_MASK)
-xfs_inofree_t xfs_inobt_mask(int i);
-#define        XFS_INOBT_MASK(i)               xfs_inobt_mask(i)
-#else
 #define        XFS_INOBT_MASK(i)               ((xfs_inofree_t)1 << (i))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INOBT_IS_FREE)
-int xfs_inobt_is_free(xfs_inobt_rec_t *rp, int i);
-#define        XFS_INOBT_IS_FREE(rp,i)         xfs_inobt_is_free(rp,i)
-#define        XFS_INOBT_IS_FREE_DISK(rp,i)    xfs_inobt_is_free_disk(rp,i)
-#else
-#define        XFS_INOBT_IS_FREE(rp,i) \
-       (((rp)->ir_free & XFS_INOBT_MASK(i)) != 0)
-#define XFS_INOBT_IS_FREE_DISK(rp,i) \
-       ((INT_GET((rp)->ir_free, ARCH_CONVERT) & XFS_INOBT_MASK(i)) != 0)
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INOBT_SET_FREE)
-void xfs_inobt_set_free(xfs_inobt_rec_t *rp, int i);
-#define        XFS_INOBT_SET_FREE(rp,i)        xfs_inobt_set_free(rp,i)
-#else
+#define        XFS_INOBT_IS_FREE(rp,i)         \
+               (((rp)->ir_free & XFS_INOBT_MASK(i)) != 0)
+#define        XFS_INOBT_IS_FREE_DISK(rp,i)    \
+               ((INT_GET((rp)->ir_free,ARCH_CONVERT) & XFS_INOBT_MASK(i)) != 0)
 #define        XFS_INOBT_SET_FREE(rp,i)        ((rp)->ir_free |= XFS_INOBT_MASK(i))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INOBT_CLR_FREE)
-void xfs_inobt_clr_free(xfs_inobt_rec_t *rp, int i);
-#define        XFS_INOBT_CLR_FREE(rp,i)        xfs_inobt_clr_free(rp,i)
-#else
 #define        XFS_INOBT_CLR_FREE(rp,i)        ((rp)->ir_free &= ~XFS_INOBT_MASK(i))
-#endif
 
 /*
  * Real block structures have a size equal to the disk block size.
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INOBT_BLOCK_SIZE)
-int xfs_inobt_block_size(int lev, struct xfs_btree_cur *cur);
-#define        XFS_INOBT_BLOCK_SIZE(lev,cur)   xfs_inobt_block_size(lev,cur)
-#else
 #define        XFS_INOBT_BLOCK_SIZE(lev,cur)   (1 << (cur)->bc_blocklog)
-#endif
-
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INOBT_BLOCK_MAXRECS)
-int xfs_inobt_block_maxrecs(int lev, struct xfs_btree_cur *cur);
-#define        XFS_INOBT_BLOCK_MAXRECS(lev,cur)        xfs_inobt_block_maxrecs(lev,cur)
-#else
-#define        XFS_INOBT_BLOCK_MAXRECS(lev,cur)        \
-       ((cur)->bc_mp->m_inobt_mxr[lev != 0])
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INOBT_BLOCK_MINRECS)
-int xfs_inobt_block_minrecs(int lev, struct xfs_btree_cur *cur);
-#define        XFS_INOBT_BLOCK_MINRECS(lev,cur)        xfs_inobt_block_minrecs(lev,cur)
-#else
-#define        XFS_INOBT_BLOCK_MINRECS(lev,cur)        \
-       ((cur)->bc_mp->m_inobt_mnr[lev != 0])
-#endif
-
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INOBT_IS_LAST_REC)
-int xfs_inobt_is_last_rec(struct xfs_btree_cur *cur);
-#define        XFS_INOBT_IS_LAST_REC(cur)      xfs_inobt_is_last_rec(cur)
-#else
+#define        XFS_INOBT_BLOCK_MAXRECS(lev,cur) ((cur)->bc_mp->m_inobt_mxr[lev != 0])
+#define        XFS_INOBT_BLOCK_MINRECS(lev,cur) ((cur)->bc_mp->m_inobt_mnr[lev != 0])
 #define        XFS_INOBT_IS_LAST_REC(cur)      \
-       ((cur)->bc_ptrs[0] == \
-               INT_GET(XFS_BUF_TO_INOBT_BLOCK((cur)->bc_bufs[0])->bb_numrecs, ARCH_CONVERT))
-#endif
+       ((cur)->bc_ptrs[0] == INT_GET(XFS_BUF_TO_INOBT_BLOCK((cur)->bc_bufs[0])->bb_numrecs, ARCH_CONVERT))
 
 /*
  * Maximum number of inode btree levels.
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IN_MAXLEVELS)
-int xfs_in_maxlevels(struct xfs_mount *mp);
-#define        XFS_IN_MAXLEVELS(mp)            xfs_in_maxlevels(mp)
-#else
 #define        XFS_IN_MAXLEVELS(mp)            ((mp)->m_in_maxlevels)
-#endif
 
 /*
  * block numbers in the AG.
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IBT_BLOCK)
-xfs_agblock_t xfs_ibt_block(struct xfs_mount *mp);
-#define        XFS_IBT_BLOCK(mp)               xfs_ibt_block(mp)
-#else
-#define        XFS_IBT_BLOCK(mp)       ((xfs_agblock_t)(XFS_CNT_BLOCK(mp) + 1))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_PREALLOC_BLOCKS)
-xfs_agblock_t xfs_prealloc_blocks(struct xfs_mount *mp);
-#define        XFS_PREALLOC_BLOCKS(mp)         xfs_prealloc_blocks(mp)
-#else
-#define        XFS_PREALLOC_BLOCKS(mp) ((xfs_agblock_t)(XFS_IBT_BLOCK(mp) + 1))
-#endif
+#define        XFS_IBT_BLOCK(mp)               ((xfs_agblock_t)(XFS_CNT_BLOCK(mp) + 1))
+#define        XFS_PREALLOC_BLOCKS(mp)         ((xfs_agblock_t)(XFS_IBT_BLOCK(mp) + 1))
 
 /*
  * Record, key, and pointer address macros for btree blocks.
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INOBT_REC_ADDR)
-xfs_inobt_rec_t *
-xfs_inobt_rec_addr(xfs_inobt_block_t *bb, int i, struct xfs_btree_cur *cur);
-#define        XFS_INOBT_REC_ADDR(bb,i,cur)    xfs_inobt_rec_addr(bb,i,cur)
-#else
-#define        XFS_INOBT_REC_ADDR(bb,i,cur)    \
-       XFS_BTREE_REC_ADDR(XFS_INOBT_BLOCK_SIZE(0,cur), xfs_inobt, bb, i, \
-               XFS_INOBT_BLOCK_MAXRECS(0, cur))
-#endif
-
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INOBT_KEY_ADDR)
-xfs_inobt_key_t *
-xfs_inobt_key_addr(xfs_inobt_block_t *bb, int i, struct xfs_btree_cur *cur);
-#define        XFS_INOBT_KEY_ADDR(bb,i,cur)    xfs_inobt_key_addr(bb,i,cur)
-#else
-#define        XFS_INOBT_KEY_ADDR(bb,i,cur)    \
-       XFS_BTREE_KEY_ADDR(XFS_INOBT_BLOCK_SIZE(1,cur), xfs_inobt, bb, i, \
-               XFS_INOBT_BLOCK_MAXRECS(1, cur))
-#endif
+#define XFS_INOBT_REC_ADDR(bb,i,cur) \
+       (XFS_BTREE_REC_ADDR(XFS_INOBT_BLOCK_SIZE(0,cur), xfs_inobt, bb, \
+                               i, XFS_INOBT_BLOCK_MAXRECS(0, cur)))
+#define        XFS_INOBT_KEY_ADDR(bb,i,cur) \
+       (XFS_BTREE_KEY_ADDR(XFS_INOBT_BLOCK_SIZE(1,cur), xfs_inobt, bb, \
+                               i, XFS_INOBT_BLOCK_MAXRECS(1, cur)))
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INOBT_PTR_ADDR)
-xfs_inobt_ptr_t *
-xfs_inobt_ptr_addr(xfs_inobt_block_t *bb, int i, struct xfs_btree_cur *cur);
-#define        XFS_INOBT_PTR_ADDR(bb,i,cur)    xfs_inobt_ptr_addr(bb,i,cur)
-#else
-#define        XFS_INOBT_PTR_ADDR(bb,i,cur)    \
-       XFS_BTREE_PTR_ADDR(XFS_INOBT_BLOCK_SIZE(1,cur), xfs_inobt, bb, i, \
-               XFS_INOBT_BLOCK_MAXRECS(1, cur))
-#endif
-
-/*
- * Prototypes for externally visible routines.
- */
+#define        XFS_INOBT_PTR_ADDR(bb,i,cur) \
+       (XFS_BTREE_PTR_ADDR(XFS_INOBT_BLOCK_SIZE(1,cur), xfs_inobt, bb, \
+                               i, XFS_INOBT_BLOCK_MAXRECS(1, cur)))
 
 /*
  * Decrement cursor by one record at the level.
  * For nonzero levels the leaf-ward information is untouched.
  */
-int                                    /* error */
-xfs_inobt_decrement(
-       struct xfs_btree_cur    *cur,   /* btree cursor */
-       int                     level,  /* level in btree, 0 is leaf */
-       int                     *stat); /* success/failure */
+extern int xfs_inobt_decrement(struct xfs_btree_cur *cur, int level, int *stat);
 
 /*
  * Delete the record pointed to by cur.
  * The cursor refers to the place where the record was (could be inserted)
  * when the operation returns.
  */
-int                                    /* error */
-xfs_inobt_delete(
-       struct xfs_btree_cur    *cur,   /* btree cursor */
-       int                     *stat); /* success/failure */
+extern int xfs_inobt_delete(struct xfs_btree_cur *cur, int *stat);
 
 /*
  * Get the data from the pointed-to record.
  */
-int                                    /* error */
-xfs_inobt_get_rec(
-       struct xfs_btree_cur    *cur,   /* btree cursor */
-       xfs_agino_t             *ino,   /* output: starting inode of chunk */
-       __int32_t               *fcnt,  /* output: number of free inodes */
-       xfs_inofree_t           *free,  /* output: free inode mask */
-       int                     *stat); /* output: success/failure */
+extern int xfs_inobt_get_rec(struct xfs_btree_cur *cur, xfs_agino_t *ino,
+                            __int32_t *fcnt, xfs_inofree_t *free, int *stat);
 
 /*
  * Increment cursor by one record at the level.
  * For nonzero levels the leaf-ward information is untouched.
  */
-int                                    /* error */
-xfs_inobt_increment(
-       struct xfs_btree_cur    *cur,   /* btree cursor */
-       int                     level,  /* level in btree, 0 is leaf */
-       int                     *stat); /* success/failure */
+extern int xfs_inobt_increment(struct xfs_btree_cur *cur, int level, int *stat);
 
 /*
  * Insert the current record at the point referenced by cur.
  * The cursor may be inconsistent on return if splits have been done.
  */
-int                                    /* error */
-xfs_inobt_insert(
-       struct xfs_btree_cur    *cur,   /* btree cursor */
-       int                     *stat); /* success/failure */
+extern int xfs_inobt_insert(struct xfs_btree_cur *cur, int *stat);
 
 /*
  * Lookup the record equal to ino in the btree given by cur.
  */
-int                                    /* error */
-xfs_inobt_lookup_eq(
-       struct xfs_btree_cur    *cur,   /* btree cursor */
-       xfs_agino_t             ino,    /* starting inode of chunk */
-       __int32_t               fcnt,   /* free inode count */
-       xfs_inofree_t           free,   /* free inode mask */
-       int                     *stat); /* success/failure */
+extern int xfs_inobt_lookup_eq(struct xfs_btree_cur *cur, xfs_agino_t ino,
+                               __int32_t fcnt, xfs_inofree_t free, int *stat);
 
 /*
  * Lookup the first record greater than or equal to ino
  * in the btree given by cur.
  */
-int                                    /* error */
-xfs_inobt_lookup_ge(
-       struct xfs_btree_cur    *cur,   /* btree cursor */
-       xfs_agino_t             ino,    /* starting inode of chunk */
-       __int32_t               fcnt,   /* free inode count */
-       xfs_inofree_t           free,   /* free inode mask */
-       int                     *stat); /* success/failure */
+extern int xfs_inobt_lookup_ge(struct xfs_btree_cur *cur, xfs_agino_t ino,
+                               __int32_t fcnt, xfs_inofree_t free, int *stat);
 
 /*
  * Lookup the first record less than or equal to ino
  * in the btree given by cur.
  */
-int                                    /* error */
-xfs_inobt_lookup_le(
-       struct xfs_btree_cur    *cur,   /* btree cursor */
-       xfs_agino_t             ino,    /* starting inode of chunk */
-       __int32_t               fcnt,   /* free inode count */
-       xfs_inofree_t           free,   /* free inode mask */
-       int                     *stat); /* success/failure */
+extern int xfs_inobt_lookup_le(struct xfs_btree_cur *cur, xfs_agino_t ino,
+                               __int32_t fcnt, xfs_inofree_t free, int *stat);
 
 /*
  * Update the record referred to by cur, to the value given
  * by [ino, fcnt, free].
  * This either works (return 0) or gets an EFSCORRUPTED error.
  */
-int                                    /* error */
-xfs_inobt_update(
-       struct xfs_btree_cur    *cur,   /* btree cursor */
-       xfs_agino_t             ino,    /* starting inode of chunk */
-       __int32_t               fcnt,   /* free inode count */
-       xfs_inofree_t           free);  /* free inode mask */
+extern int xfs_inobt_update(struct xfs_btree_cur *cur, xfs_agino_t ino,
+                               __int32_t fcnt, xfs_inofree_t free);
 
 #endif /* __XFS_IALLOC_BTREE_H__ */
index 0d9ae8fb41386c956bc43e07d383ffac7697d7fb..f925335e4553ae93fad266e3880abad1863b753c 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
-#include <linux/delay.h>
-
 #include "xfs.h"
-
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
 #include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
-#include "xfs_alloc_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
-#include "xfs_btree.h"
-#include "xfs_ialloc.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
 #include "xfs_inode.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
 #include "xfs_quota.h"
 #include "xfs_utils.h"
-#include "xfs_bit.h"
 
 /*
  * Initialize the inode hash table for the newly mounted file system.
index a648cc8ce96b136cbde9c8c9c10459f2f788d55d..edf50b5409fcae737ee40f24840d8780296ab191 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
 #include "xfs.h"
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
+#include "xfs_imap.h"
 #include "xfs_trans.h"
 #include "xfs_trans_priv.h"
 #include "xfs_sb.h"
 #include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
-#include "xfs_alloc_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
-#include "xfs_btree.h"
-#include "xfs_imap.h"
-#include "xfs_alloc.h"
-#include "xfs_ialloc.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
-#include "xfs_inode_item.h"
 #include "xfs_inode.h"
-#include "xfs_bmap.h"
 #include "xfs_buf_item.h"
+#include "xfs_inode_item.h"
+#include "xfs_btree.h"
+#include "xfs_alloc.h"
+#include "xfs_ialloc.h"
+#include "xfs_bmap.h"
 #include "xfs_rw.h"
 #include "xfs_error.h"
-#include "xfs_bit.h"
 #include "xfs_utils.h"
 #include "xfs_dir2_trace.h"
 #include "xfs_quota.h"
index 6ec8a0dd84a81d97cb45bf030275f7fa58715dc7..11be922698afd77dc17ea92706d55a2241ab437a 100644 (file)
 #ifndef        __XFS_INODE_H__
 #define        __XFS_INODE_H__
 
+/*
+ * Fork identifiers.
+ */
+#define        XFS_DATA_FORK   0
+#define        XFS_ATTR_FORK   1
+
 /*
  * File incore extent information, present for each of data & attr forks.
  */
@@ -311,60 +317,16 @@ typedef struct xfs_inode {
 /*
  * Fork handling.
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_PTR)
-xfs_ifork_t *xfs_ifork_ptr(xfs_inode_t *ip, int w);
-#define        XFS_IFORK_PTR(ip,w)             xfs_ifork_ptr(ip,w)
-#else
-#define        XFS_IFORK_PTR(ip,w)   ((w) == XFS_DATA_FORK ? &(ip)->i_df : (ip)->i_afp)
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_Q)
-int xfs_ifork_q(xfs_inode_t *ip);
-#define        XFS_IFORK_Q(ip)                 xfs_ifork_q(ip)
-#else
+#define        XFS_IFORK_PTR(ip,w)             \
+       ((w) == XFS_DATA_FORK ? &(ip)->i_df : (ip)->i_afp)
 #define        XFS_IFORK_Q(ip)                 XFS_CFORK_Q(&(ip)->i_d)
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_DSIZE)
-int xfs_ifork_dsize(xfs_inode_t *ip);
-#define        XFS_IFORK_DSIZE(ip)             xfs_ifork_dsize(ip)
-#else
 #define        XFS_IFORK_DSIZE(ip)             XFS_CFORK_DSIZE(&ip->i_d, ip->i_mount)
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_ASIZE)
-int xfs_ifork_asize(xfs_inode_t *ip);
-#define        XFS_IFORK_ASIZE(ip)             xfs_ifork_asize(ip)
-#else
 #define        XFS_IFORK_ASIZE(ip)             XFS_CFORK_ASIZE(&ip->i_d, ip->i_mount)
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_SIZE)
-int xfs_ifork_size(xfs_inode_t *ip, int w);
-#define        XFS_IFORK_SIZE(ip,w)            xfs_ifork_size(ip,w)
-#else
 #define        XFS_IFORK_SIZE(ip,w)            XFS_CFORK_SIZE(&ip->i_d, ip->i_mount, w)
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_FORMAT)
-int xfs_ifork_format(xfs_inode_t *ip, int w);
-#define        XFS_IFORK_FORMAT(ip,w)          xfs_ifork_format(ip,w)
-#else
 #define        XFS_IFORK_FORMAT(ip,w)          XFS_CFORK_FORMAT(&ip->i_d, w)
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_FMT_SET)
-void xfs_ifork_fmt_set(xfs_inode_t *ip, int w, int n);
-#define        XFS_IFORK_FMT_SET(ip,w,n)       xfs_ifork_fmt_set(ip,w,n)
-#else
 #define        XFS_IFORK_FMT_SET(ip,w,n)       XFS_CFORK_FMT_SET(&ip->i_d, w, n)
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_NEXTENTS)
-int xfs_ifork_nextents(xfs_inode_t *ip, int w);
-#define        XFS_IFORK_NEXTENTS(ip,w)        xfs_ifork_nextents(ip,w)
-#else
 #define        XFS_IFORK_NEXTENTS(ip,w)        XFS_CFORK_NEXTENTS(&ip->i_d, w)
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_NEXT_SET)
-void xfs_ifork_next_set(xfs_inode_t *ip, int w, int n);
-#define        XFS_IFORK_NEXT_SET(ip,w,n)      xfs_ifork_next_set(ip,w,n)
-#else
 #define        XFS_IFORK_NEXT_SET(ip,w,n)      XFS_CFORK_NEXT_SET(&ip->i_d, w, n)
-#endif
 
 
 #ifdef __KERNEL__
@@ -418,28 +380,11 @@ void xfs_ifork_next_set(xfs_inode_t *ip, int w, int n);
 #define        XFS_ITRUNC_DEFINITE     0x1
 #define        XFS_ITRUNC_MAYBE        0x2
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ITOV)
-struct vnode *xfs_itov(xfs_inode_t *ip);
-#define        XFS_ITOV(ip)            xfs_itov(ip)
-#else
 #define        XFS_ITOV(ip)            BHV_TO_VNODE(XFS_ITOBHV(ip))
-#endif
 #define        XFS_ITOV_NULL(ip)       BHV_TO_VNODE_NULL(XFS_ITOBHV(ip))
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ITOBHV)
-struct bhv_desc *xfs_itobhv(xfs_inode_t *ip);
-#define        XFS_ITOBHV(ip)          xfs_itobhv(ip)
-#else
 #define        XFS_ITOBHV(ip)          ((struct bhv_desc *)(&((ip)->i_bhv_desc)))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BHVTOI)
-xfs_inode_t *xfs_bhvtoi(struct bhv_desc *bhvp);
-#define        XFS_BHVTOI(bhvp)        xfs_bhvtoi(bhvp)
-#else
-#define        XFS_BHVTOI(bhvp)        \
-       ((xfs_inode_t *)((char *)(bhvp) - \
-                        (char *)&(((xfs_inode_t *)0)->i_bhv_desc)))
-#endif
-
+#define        XFS_BHVTOI(bhvp)        ((xfs_inode_t *)((char *)(bhvp) - \
+                               (char *)&(((xfs_inode_t *)0)->i_bhv_desc)))
 #define BHV_IS_XFS(bdp)                (BHV_OPS(bdp) == &xfs_vnodeops)
 
 /*
index 50e2cadf9091a57d5f1b6ca4b70b18cd32c4be9f..cebcc2781bbbd68511b7832c0a84d66fa0612942 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
-/*
- * This file contains the implementation of the xfs_inode_log_item.
- * It contains the item operations used to manipulate the inode log
- * items as well as utility routines used by the inode specific
- * transaction routines.
- */
 #include "xfs.h"
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_buf_item.h"
 #include "xfs_sb.h"
+#include "xfs_ag.h"
 #include "xfs_dir.h"
 #include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
 #include "xfs_trans_priv.h"
-#include "xfs_ag.h"
-#include "xfs_alloc_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
-#include "xfs_btree.h"
-#include "xfs_ialloc.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
-#include "xfs_inode_item.h"
 #include "xfs_inode.h"
+#include "xfs_inode_item.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
 #include "xfs_rw.h"
 
 
index d8775e0d62914ead1a6a7966f1c370635061fdff..61a806ba8fdd18d45e5c6ebe7aa6ffdd4f2b6954 100644 (file)
@@ -159,38 +159,33 @@ typedef struct xfs_inode_log_item {
 } xfs_inode_log_item_t;
 
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ILOG_FDATA)
-int xfs_ilog_fdata(int w);
 #define        XFS_ILOG_FDATA(w)       xfs_ilog_fdata(w)
-#else
-#define        XFS_ILOG_FDATA(w)       \
-       ((w) == XFS_DATA_FORK ? XFS_ILOG_DDATA : XFS_ILOG_ADATA)
-#endif
+static inline int xfs_ilog_fdata(int w)
+{
+       return (w == XFS_DATA_FORK ? XFS_ILOG_DDATA : XFS_ILOG_ADATA);
+}
 
 #endif /* __KERNEL__ */
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ILOG_FBROOT)
-int xfs_ilog_fbroot(int w);
 #define        XFS_ILOG_FBROOT(w)      xfs_ilog_fbroot(w)
-#else
-#define        XFS_ILOG_FBROOT(w)      \
-       ((w) == XFS_DATA_FORK ? XFS_ILOG_DBROOT : XFS_ILOG_ABROOT)
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ILOG_FEXT)
-int xfs_ilog_fext(int w);
+static inline int xfs_ilog_fbroot(int w)
+{
+       return (w == XFS_DATA_FORK ? XFS_ILOG_DBROOT : XFS_ILOG_ABROOT);
+}
+
 #define        XFS_ILOG_FEXT(w)        xfs_ilog_fext(w)
-#else
-#define        XFS_ILOG_FEXT(w)        \
-       ((w) == XFS_DATA_FORK ? XFS_ILOG_DEXT : XFS_ILOG_AEXT)
-#endif
+static inline int xfs_ilog_fext(int w)
+{
+       return (w == XFS_DATA_FORK ? XFS_ILOG_DEXT : XFS_ILOG_AEXT);
+}
 
 #ifdef __KERNEL__
 
-void   xfs_inode_item_init(struct xfs_inode *, struct xfs_mount *);
-void   xfs_inode_item_destroy(struct xfs_inode *);
-void   xfs_iflush_done(struct xfs_buf *, xfs_inode_log_item_t *);
-void   xfs_istale_done(struct xfs_buf *, xfs_inode_log_item_t *);
-void   xfs_iflush_abort(struct xfs_inode *);
+extern void xfs_inode_item_init(struct xfs_inode *, struct xfs_mount *);
+extern void xfs_inode_item_destroy(struct xfs_inode *);
+extern void xfs_iflush_done(struct xfs_buf *, xfs_inode_log_item_t *);
+extern void xfs_istale_done(struct xfs_buf *, xfs_inode_log_item_t *);
+extern void xfs_iflush_abort(struct xfs_inode *);
 
 #endif /* __KERNEL__ */
 
index a3af2d5a6eb7a501e0f66bde2a1f49ece5ef6672..8f70a12d56bc709b235b2b30c2c1d056fe6c1976 100644 (file)
@@ -58,109 +58,31 @@ typedef    __uint32_t      xfs_intino_t;
 
 struct xfs_mount;
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INO_MASK)
-__uint32_t xfs_ino_mask(int k);
-#define        XFS_INO_MASK(k)                 xfs_ino_mask(k)
-#else
-#define        XFS_INO_MASK(k) ((__uint32_t)((1ULL << (k)) - 1))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INO_OFFSET_BITS)
-int xfs_ino_offset_bits(struct xfs_mount *mp);
-#define        XFS_INO_OFFSET_BITS(mp)         xfs_ino_offset_bits(mp)
-#else
-#define        XFS_INO_OFFSET_BITS(mp) ((mp)->m_sb.sb_inopblog)
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INO_AGBNO_BITS)
-int xfs_ino_agbno_bits(struct xfs_mount *mp);
-#define        XFS_INO_AGBNO_BITS(mp)          xfs_ino_agbno_bits(mp)
-#else
-#define        XFS_INO_AGBNO_BITS(mp)  ((mp)->m_sb.sb_agblklog)
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INO_AGINO_BITS)
-int xfs_ino_agino_bits(struct xfs_mount *mp);
-#define        XFS_INO_AGINO_BITS(mp)          xfs_ino_agino_bits(mp)
-#else
-#define        XFS_INO_AGINO_BITS(mp)          ((mp)->m_agino_log)
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INO_AGNO_BITS)
-int xfs_ino_agno_bits(struct xfs_mount *mp);
-#define        XFS_INO_AGNO_BITS(mp)           xfs_ino_agno_bits(mp)
-#else
-#define        XFS_INO_AGNO_BITS(mp)   ((mp)->m_agno_log)
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INO_BITS)
-int xfs_ino_bits(struct xfs_mount *mp);
-#define        XFS_INO_BITS(mp)                xfs_ino_bits(mp)
-#else
-#define        XFS_INO_BITS(mp)        (XFS_INO_AGNO_BITS(mp) + XFS_INO_AGINO_BITS(mp))
-#endif
-
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INO_TO_AGNO)
-xfs_agnumber_t xfs_ino_to_agno(struct xfs_mount *mp, xfs_ino_t i);
-#define        XFS_INO_TO_AGNO(mp,i)           xfs_ino_to_agno(mp,i)
-#else
-#define        XFS_INO_TO_AGNO(mp,i)   \
+#define        XFS_INO_MASK(k)                 (__uint32_t)((1ULL << (k)) - 1)
+#define        XFS_INO_OFFSET_BITS(mp)         (mp)->m_sb.sb_inopblog
+#define        XFS_INO_AGBNO_BITS(mp)          (mp)->m_sb.sb_agblklog
+#define        XFS_INO_AGINO_BITS(mp)          (mp)->m_agino_log
+#define        XFS_INO_AGNO_BITS(mp)           (mp)->m_agno_log
+#define        XFS_INO_BITS(mp)                \
+       XFS_INO_AGNO_BITS(mp) + XFS_INO_AGINO_BITS(mp)
+#define        XFS_INO_TO_AGNO(mp,i)           \
        ((xfs_agnumber_t)((i) >> XFS_INO_AGINO_BITS(mp)))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INO_TO_AGINO)
-xfs_agino_t xfs_ino_to_agino(struct xfs_mount *mp, xfs_ino_t i);
-#define        XFS_INO_TO_AGINO(mp,i)          xfs_ino_to_agino(mp,i)
-#else
-#define        XFS_INO_TO_AGINO(mp,i)  \
+#define        XFS_INO_TO_AGINO(mp,i)          \
        ((xfs_agino_t)(i) & XFS_INO_MASK(XFS_INO_AGINO_BITS(mp)))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INO_TO_AGBNO)
-xfs_agblock_t xfs_ino_to_agbno(struct xfs_mount *mp, xfs_ino_t i);
-#define        XFS_INO_TO_AGBNO(mp,i)          xfs_ino_to_agbno(mp,i)
-#else
-#define        XFS_INO_TO_AGBNO(mp,i)  \
+#define        XFS_INO_TO_AGBNO(mp,i)          \
        (((xfs_agblock_t)(i) >> XFS_INO_OFFSET_BITS(mp)) & \
-        XFS_INO_MASK(XFS_INO_AGBNO_BITS(mp)))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INO_TO_OFFSET)
-int xfs_ino_to_offset(struct xfs_mount *mp, xfs_ino_t i);
-#define        XFS_INO_TO_OFFSET(mp,i)         xfs_ino_to_offset(mp,i)
-#else
-#define        XFS_INO_TO_OFFSET(mp,i) \
+               XFS_INO_MASK(XFS_INO_AGBNO_BITS(mp)))
+#define        XFS_INO_TO_OFFSET(mp,i)         \
        ((int)(i) & XFS_INO_MASK(XFS_INO_OFFSET_BITS(mp)))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INO_TO_FSB)
-xfs_fsblock_t xfs_ino_to_fsb(struct xfs_mount *mp, xfs_ino_t i);
-#define        XFS_INO_TO_FSB(mp,i)            xfs_ino_to_fsb(mp,i)
-#else
-#define        XFS_INO_TO_FSB(mp,i)    \
+#define        XFS_INO_TO_FSB(mp,i)            \
        XFS_AGB_TO_FSB(mp, XFS_INO_TO_AGNO(mp,i), XFS_INO_TO_AGBNO(mp,i))
-#endif
-
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AGINO_TO_INO)
-xfs_ino_t
-xfs_agino_to_ino(struct xfs_mount *mp, xfs_agnumber_t a, xfs_agino_t i);
-#define        XFS_AGINO_TO_INO(mp,a,i)        xfs_agino_to_ino(mp,a,i)
-#else
 #define        XFS_AGINO_TO_INO(mp,a,i)        \
        (((xfs_ino_t)(a) << XFS_INO_AGINO_BITS(mp)) | (i))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AGINO_TO_AGBNO)
-xfs_agblock_t xfs_agino_to_agbno(struct xfs_mount *mp, xfs_agino_t i);
-#define        XFS_AGINO_TO_AGBNO(mp,i)        xfs_agino_to_agbno(mp,i)
-#else
 #define        XFS_AGINO_TO_AGBNO(mp,i)        ((i) >> XFS_INO_OFFSET_BITS(mp))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AGINO_TO_OFFSET)
-int xfs_agino_to_offset(struct xfs_mount *mp, xfs_agino_t i);
-#define        XFS_AGINO_TO_OFFSET(mp,i)       xfs_agino_to_offset(mp,i)
-#else
 #define        XFS_AGINO_TO_OFFSET(mp,i)       \
        ((i) & XFS_INO_MASK(XFS_INO_OFFSET_BITS(mp)))
-#endif
-
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_OFFBNO_TO_AGINO)
-xfs_agino_t xfs_offbno_to_agino(struct xfs_mount *mp, xfs_agblock_t b, int o);
-#define        XFS_OFFBNO_TO_AGINO(mp,b,o)     xfs_offbno_to_agino(mp,b,o)
-#else
 #define        XFS_OFFBNO_TO_AGINO(mp,b,o)     \
        ((xfs_agino_t)(((b) << XFS_INO_OFFSET_BITS(mp)) | (o)))
-#endif
 
 #if XFS_BIG_INUMS
 #define        XFS_MAXINUMBER          ((xfs_ino_t)((1ULL << 56) - 1ULL))
index 414ec496845f1710aae2c0b6d43cdd7a02a50254..6bdd0dcbe39855d9de33e1ab1eb3e757f0863222 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
 #include "xfs.h"
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
 #include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
-#include "xfs_alloc_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
-#include "xfs_itable.h"
-#include "xfs_btree.h"
-#include "xfs_alloc.h"
-#include "xfs_ialloc.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
-#include "xfs_inode_item.h"
 #include "xfs_inode.h"
+#include "xfs_inode_item.h"
+#include "xfs_itable.h"
+#include "xfs_btree.h"
+#include "xfs_alloc.h"
+#include "xfs_ialloc.h"
 #include "xfs_bmap.h"
 #include "xfs_error.h"
-#include "xfs_bit.h"
 #include "xfs_rw.h"
 #include "xfs_quota.h"
 #include "xfs_trans_space.h"
index d0f5be63cddb71b0e0a647d124550c57ac5b3114..1ba0d71349c80268960acff81ac2b918a5aa0eeb 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
 #include "xfs.h"
-
 #include "xfs_fs.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
 #include "xfs_dmapi.h"
 #include "xfs_quota.h"
 #include "xfs_mount.h"
-#include "xfs_alloc_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
-#include "xfs_btree.h"
-#include "xfs_ialloc.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
 #include "xfs_inode.h"
+#include "xfs_ialloc.h"
+#include "xfs_btree.h"
 #include "xfs_bmap.h"
 #include "xfs_bit.h"
 #include "xfs_rtalloc.h"
index 8fbc8d3781885be9db2a51b21650578119c30dbe..abac0399ca4baa5450ea7f32ca17e5e590e145b2 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
 #include "xfs.h"
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
+#include "xfs_ag.h"
 #include "xfs_dir.h"
 #include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
-#include "xfs_ag.h"
-#include "xfs_alloc_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
-#include "xfs_btree.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
 #include "xfs_inode.h"
 #include "xfs_ialloc.h"
 #include "xfs_itable.h"
 #include "xfs_error.h"
+#include "xfs_btree.h"
 
 #ifndef HAVE_USERACC
 #define useracc(ubuffer, size, flags, foo) (0)
index fcde2a2fc457b03b9a82fe0a6a96e3a2d90b49c6..97e2a3b0ca1fd1adc10a841416ee73a8dc26e53a 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
-/*
- * High level interface routines for log manager
- */
-
 #include "xfs.h"
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
-#include "xfs_ag.h"
-#include "xfs_sb.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
 #include "xfs_dir.h"
+#include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
 #include "xfs_error.h"
 #include "xfs_log_priv.h"
 #include "xfs_buf_item.h"
+#include "xfs_bmap_btree.h"
 #include "xfs_alloc_btree.h"
+#include "xfs_ialloc_btree.h"
 #include "xfs_log_recover.h"
-#include "xfs_bit.h"
-#include "xfs_rw.h"
 #include "xfs_trans_priv.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_rw.h"
 
 
 #define xlog_write_adv_cnt(ptr, len, off, bytes) \
index a884cea82fcaf0aa7792b2a0ab41b6bc15aa1ac9..bec421a735f3138a5b43d49184caa7376a04e157 100644 (file)
@@ -35,6 +35,7 @@
 struct xfs_buf;
 struct ktrace;
 struct log;
+struct xlog_ticket;
 struct xfs_buf_cancel;
 struct xfs_mount;
 
@@ -120,77 +121,6 @@ struct xfs_mount;
     ((i) >> 24)
 #endif
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XLOG_GRANT_SUB_SPACE)
-void xlog_grant_sub_space(struct log *log, int bytes, int type);
-#define XLOG_GRANT_SUB_SPACE(log,bytes,type)   \
-       xlog_grant_sub_space(log,bytes,type)
-#else
-#define XLOG_GRANT_SUB_SPACE(log,bytes,type)                           \
-    {                                                                  \
-       if (type == 'w') {                                              \
-               (log)->l_grant_write_bytes -= (bytes);                  \
-               if ((log)->l_grant_write_bytes < 0) {                   \
-                       (log)->l_grant_write_bytes += (log)->l_logsize; \
-                       (log)->l_grant_write_cycle--;                   \
-               }                                                       \
-       } else {                                                        \
-               (log)->l_grant_reserve_bytes -= (bytes);                \
-               if ((log)->l_grant_reserve_bytes < 0) {                 \
-                       (log)->l_grant_reserve_bytes += (log)->l_logsize;\
-                       (log)->l_grant_reserve_cycle--;                 \
-               }                                                       \
-        }                                                              \
-    }
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XLOG_GRANT_ADD_SPACE)
-void xlog_grant_add_space(struct log *log, int bytes, int type);
-#define XLOG_GRANT_ADD_SPACE(log,bytes,type)   \
-       xlog_grant_add_space(log,bytes,type)
-#else
-#define XLOG_GRANT_ADD_SPACE(log,bytes,type)                           \
-    {                                                                  \
-       if (type == 'w') {                                              \
-               (log)->l_grant_write_bytes += (bytes);                  \
-               if ((log)->l_grant_write_bytes > (log)->l_logsize) {    \
-                       (log)->l_grant_write_bytes -= (log)->l_logsize; \
-                       (log)->l_grant_write_cycle++;                   \
-               }                                                       \
-       } else {                                                        \
-               (log)->l_grant_reserve_bytes += (bytes);                \
-               if ((log)->l_grant_reserve_bytes > (log)->l_logsize) {  \
-                       (log)->l_grant_reserve_bytes -= (log)->l_logsize;\
-                       (log)->l_grant_reserve_cycle++;                 \
-               }                                                       \
-        }                                                              \
-    }
-#endif
-#define XLOG_INS_TICKETQ(q,tic)                                \
-    {                                                  \
-       if (q) {                                        \
-               (tic)->t_next       = (q);              \
-               (tic)->t_prev       = (q)->t_prev;      \
-               (q)->t_prev->t_next = (tic);            \
-               (q)->t_prev         = (tic);            \
-       } else {                                        \
-               (tic)->t_prev = (tic)->t_next = (tic);  \
-               (q) = (tic);                            \
-       }                                               \
-       (tic)->t_flags |= XLOG_TIC_IN_Q;                \
-    }
-#define XLOG_DEL_TICKETQ(q,tic)                                \
-    {                                                  \
-       if ((tic) == (tic)->t_next) {                   \
-               (q) = NULL;                             \
-       } else {                                        \
-               (q) = (tic)->t_next;                    \
-               (tic)->t_next->t_prev = (tic)->t_prev;  \
-               (tic)->t_prev->t_next = (tic)->t_next;  \
-       }                                               \
-       (tic)->t_next = (tic)->t_prev = NULL;           \
-       (tic)->t_flags &= ~XLOG_TIC_IN_Q;               \
-    }
-
-
 #define GRANT_LOCK(log)                mutex_spinlock(&(log)->l_grant_lock)
 #define GRANT_UNLOCK(log, s)   mutex_spinunlock(&(log)->l_grant_lock, s)
 #define LOG_LOCK(log)          mutex_spinlock(&(log)->l_icloglock)
@@ -576,6 +506,75 @@ typedef struct log {
                                                 * alignment mask */
 } xlog_t;
 
+#define XLOG_GRANT_SUB_SPACE(log,bytes,type)   \
+       xlog_grant_sub_space(log,bytes,type)
+static inline void xlog_grant_sub_space(struct log *log, int bytes, int type)
+{
+       if (type == 'w') {                                              \
+               (log)->l_grant_write_bytes -= (bytes);                  \
+               if ((log)->l_grant_write_bytes < 0) {                   \
+                       (log)->l_grant_write_bytes += (log)->l_logsize; \
+                       (log)->l_grant_write_cycle--;                   \
+               }                                                       \
+       } else {                                                        \
+               (log)->l_grant_reserve_bytes -= (bytes);                \
+               if ((log)->l_grant_reserve_bytes < 0) {                 \
+                       (log)->l_grant_reserve_bytes += (log)->l_logsize;\
+                       (log)->l_grant_reserve_cycle--;                 \
+               }                                                       \
+        }                                                              \
+}
+
+#define XLOG_GRANT_ADD_SPACE(log,bytes,type)   \
+       xlog_grant_add_space(log,bytes,type)
+static inline void
+xlog_grant_add_space(struct log *log, int bytes, int type)
+{
+       if (type == 'w') {                                              \
+               (log)->l_grant_write_bytes += (bytes);                  \
+               if ((log)->l_grant_write_bytes > (log)->l_logsize) {    \
+                       (log)->l_grant_write_bytes -= (log)->l_logsize; \
+                       (log)->l_grant_write_cycle++;                   \
+               }                                                       \
+       } else {                                                        \
+               (log)->l_grant_reserve_bytes += (bytes);                \
+               if ((log)->l_grant_reserve_bytes > (log)->l_logsize) {  \
+                       (log)->l_grant_reserve_bytes -= (log)->l_logsize;\
+                       (log)->l_grant_reserve_cycle++;                 \
+               }                                                       \
+        }                                                              \
+}
+
+#define XLOG_INS_TICKETQ(q, tic)       xlog_ins_ticketq(q, tic)
+static inline void
+xlog_ins_ticketq(struct xlog_ticket *q, struct xlog_ticket *tic)
+{                                                      \
+       if (q) {                                        \
+               (tic)->t_next       = (q);              \
+               (tic)->t_prev       = (q)->t_prev;      \
+               (q)->t_prev->t_next = (tic);            \
+               (q)->t_prev         = (tic);            \
+       } else {                                        \
+               (tic)->t_prev = (tic)->t_next = (tic);  \
+               (q) = (tic);                            \
+       }                                               \
+       (tic)->t_flags |= XLOG_TIC_IN_Q;                \
+}
+
+#define XLOG_DEL_TICKETQ(q, tic)       xlog_del_ticketq(q, tic)
+static inline void
+xlog_del_ticketq(struct xlog_ticket *q, struct xlog_ticket *tic)
+{                                                      \
+       if ((tic) == (tic)->t_next) {                   \
+               (q) = NULL;                             \
+       } else {                                        \
+               (q) = (tic)->t_next;                    \
+               (tic)->t_next->t_prev = (tic)->t_prev;  \
+               (tic)->t_prev->t_next = (tic)->t_next;  \
+       }                                               \
+       (tic)->t_next = (tic)->t_prev = NULL;           \
+       (tic)->t_flags &= ~XLOG_TIC_IN_Q;               \
+}
 
 /* common routines */
 extern xfs_lsn_t xlog_assign_tail_lsn(struct xfs_mount *mp);
index 212c5411595ee6b78c130e76bc6d2d471e83d1d9..f61dcd1b8e3b3a2b465b2be9bdf628c7b40fdfbd 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
 #include "xfs.h"
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
-#include "xfs_ag.h"
-#include "xfs_sb.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
 #include "xfs_dir.h"
 #include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
 #include "xfs_error.h"
 #include "xfs_bmap_btree.h"
-#include "xfs_alloc.h"
-#include "xfs_attr_sf.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_ialloc_btree.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
-#include "xfs_imap.h"
-#include "xfs_inode_item.h"
 #include "xfs_inode.h"
-#include "xfs_ialloc_btree.h"
+#include "xfs_inode_item.h"
+#include "xfs_imap.h"
+#include "xfs_alloc.h"
 #include "xfs_ialloc.h"
 #include "xfs_log_priv.h"
 #include "xfs_buf_item.h"
-#include "xfs_alloc_btree.h"
 #include "xfs_log_recover.h"
 #include "xfs_extfree_item.h"
 #include "xfs_trans_priv.h"
-#include "xfs_bit.h"
 #include "xfs_quota.h"
 #include "xfs_rw.h"
 
index 4f26172a163e0cab57f5c1f3ccf5148c7a6ac693..52542c5d7a3207423498718aea07f5f575ba25f5 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
 #include "xfs.h"
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
 #include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
-#include "xfs_alloc_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
-#include "xfs_btree.h"
-#include "xfs_ialloc.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
 #include "xfs_inode.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
 #include "xfs_alloc.h"
 #include "xfs_rtalloc.h"
 #include "xfs_bmap.h"
 #include "xfs_error.h"
-#include "xfs_bit.h"
 #include "xfs_rw.h"
 #include "xfs_quota.h"
 #include "xfs_fsops.h"
index 7341f4984c08fcd807b41a0330e4b608dca55b23..0567ee2164fae038d52dc66a06d0a848af044953 100644 (file)
@@ -80,6 +80,9 @@ struct xfs_iocore;
 struct xfs_bmbt_irec;
 struct xfs_bmap_free;
 
+extern struct vfsops xfs_vfsops;
+extern struct vnodeops xfs_vnodeops;
+
 #define        AIL_LOCK_T              lock_t
 #define        AIL_LOCKINIT(x,y)       spinlock_init(x,y)
 #define        AIL_LOCK_DESTROY(x)     spinlock_destroy(x)
@@ -503,57 +506,41 @@ xfs_preferred_iosize(xfs_mount_t *mp)
 /*
  * Macros for getting from mount to vfs and back.
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_MTOVFS)
-struct vfs *xfs_mtovfs(xfs_mount_t *mp);
 #define        XFS_MTOVFS(mp)          xfs_mtovfs(mp)
-#else
-#define        XFS_MTOVFS(mp)          (bhvtovfs(&(mp)->m_bhv))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BHVTOM)
-xfs_mount_t *xfs_bhvtom(bhv_desc_t *bdp);
-#define        XFS_BHVTOM(bdp) xfs_bhvtom(bdp)
-#else
-#define XFS_BHVTOM(bdp)                ((xfs_mount_t *)BHV_PDATA(bdp))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_VFSTOM)
-xfs_mount_t *xfs_vfstom(vfs_t *vfs);
-#define XFS_VFSTOM(vfs) xfs_vfstom(vfs)
-#else
-#define XFS_VFSTOM(vfs)                \
-       (XFS_BHVTOM(bhv_lookup(VFS_BHVHEAD(vfs), &xfs_vfsops)))
-#endif
+static inline struct vfs *xfs_mtovfs(xfs_mount_t *mp)
+{
+       return bhvtovfs(&mp->m_bhv);
+}
 
+#define        XFS_BHVTOM(bdp) xfs_bhvtom(bdp)
+static inline xfs_mount_t *xfs_bhvtom(bhv_desc_t *bdp)
+{
+       return (xfs_mount_t *)BHV_PDATA(bdp);
+}
 
-/*
- * Moved here from xfs_ag.h to avoid reordering header files
- */
+#define XFS_VFSTOM(vfs) xfs_vfstom(vfs)
+static inline xfs_mount_t *xfs_vfstom(vfs_t *vfs)
+{
+       return XFS_BHVTOM(bhv_lookup(VFS_BHVHEAD(vfs), &xfs_vfsops));
+}
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DADDR_TO_AGNO)
-xfs_agnumber_t xfs_daddr_to_agno(struct xfs_mount *mp, xfs_daddr_t d);
 #define XFS_DADDR_TO_AGNO(mp,d)         xfs_daddr_to_agno(mp,d)
-#else
-
-static inline xfs_agnumber_t XFS_DADDR_TO_AGNO(xfs_mount_t *mp, xfs_daddr_t d)
+static inline xfs_agnumber_t
+xfs_daddr_to_agno(struct xfs_mount *mp, xfs_daddr_t d)
 {
-       d = XFS_BB_TO_FSBT(mp, d);
-       do_div(d, mp->m_sb.sb_agblocks);
-       return (xfs_agnumber_t) d;
+       xfs_daddr_t ld = XFS_BB_TO_FSBT(mp, d);
+       do_div(ld, mp->m_sb.sb_agblocks);
+       return (xfs_agnumber_t) ld;
 }
 
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DADDR_TO_AGBNO)
-xfs_agblock_t xfs_daddr_to_agbno(struct xfs_mount *mp, xfs_daddr_t d);
 #define XFS_DADDR_TO_AGBNO(mp,d)        xfs_daddr_to_agbno(mp,d)
-#else
-
-static inline xfs_agblock_t XFS_DADDR_TO_AGBNO(xfs_mount_t *mp, xfs_daddr_t d)
+static inline xfs_agblock_t
+xfs_daddr_to_agbno(struct xfs_mount *mp, xfs_daddr_t d)
 {
-       d = XFS_BB_TO_FSBT(mp, d);
-       return (xfs_agblock_t) do_div(d, mp->m_sb.sb_agblocks);
+       xfs_daddr_t ld = XFS_BB_TO_FSBT(mp, d);
+       return (xfs_agblock_t) do_div(ld, mp->m_sb.sb_agblocks);
 }
 
-#endif
-
 /*
  * This structure is for use by the xfs_mod_incore_sb_batch() routine.
  */
@@ -589,9 +576,6 @@ extern int  xfs_sync_inodes(xfs_mount_t *, int, int, int *);
 extern xfs_agnumber_t  xfs_initialize_perag(xfs_mount_t *, xfs_agnumber_t);
 extern void    xfs_xlatesb(void *, struct xfs_sb *, int, __int64_t);
 
-extern struct vfsops xfs_vfsops;
-extern struct vnodeops xfs_vnodeops;
-
 extern struct xfs_dmops xfs_dmcore_stub;
 extern struct xfs_qmops xfs_qmcore_stub;
 extern struct xfs_ioops xfs_iocore_xfs;
index a6cd6324e946af65d2f1e949606a6e7c25be0f90..ac14d26fa9c4897f3bfe5a90dc7c34326986811c 100644 (file)
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #include "xfs.h"
-
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
index 1c3599df0cc131877dc6361574b247316f39893c..135172414582ed6a491682b2e3c5dc2e5ec0d7a1 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
 #include "xfs.h"
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_dir.h"
 #include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
+#include "xfs_da_btree.h"
 #include "xfs_bmap_btree.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
-#include "xfs_inode_item.h"
 #include "xfs_inode.h"
+#include "xfs_inode_item.h"
 #include "xfs_bmap.h"
 #include "xfs_error.h"
 #include "xfs_quota.h"
 #include "xfs_refcache.h"
 #include "xfs_utils.h"
 #include "xfs_trans_space.h"
-#include "xfs_da_btree.h"
 #include "xfs_dir_leaf.h"
 
 
index 2c37822d1012e60173d396d2fc4cf94097ba8f1b..145f916538a1bd4e27a9fbe1d31a9625412d1a03 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
-/*
- * Free realtime space allocation for XFS.
- */
-
 #include "xfs.h"
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
 #include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
-#include "xfs_alloc_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
-#include "xfs_btree.h"
-#include "xfs_ialloc.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
 #include "xfs_inode.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
 #include "xfs_alloc.h"
 #include "xfs_bmap.h"
-#include "xfs_bit.h"
 #include "xfs_rtalloc.h"
 #include "xfs_fsops.h"
 #include "xfs_error.h"
index 31f68cc637b01a32642f7d1ec56f54df4ef70c51..075850c999f4b5e882d2ffa0c245600005979d2c 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
 #include "xfs.h"
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
 #include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
-#include "xfs_alloc_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_inode_item.h"
 #include "xfs_itable.h"
 #include "xfs_btree.h"
 #include "xfs_alloc.h"
 #include "xfs_ialloc.h"
 #include "xfs_attr.h"
-#include "xfs_attr_sf.h"
-#include "xfs_dir_sf.h"
-#include "xfs_dir2_sf.h"
-#include "xfs_dinode.h"
-#include "xfs_inode_item.h"
-#include "xfs_inode.h"
 #include "xfs_bmap.h"
 #include "xfs_acl.h"
 #include "xfs_mac.h"
index c8b10bf8f5307aea6ca63e07752c95bbde0ca494..90233037fab1285c9cef79c127645f7e98b021a5 100644 (file)
@@ -68,87 +68,44 @@ struct xfs_mount;
  * file is a real time file or not, because the bmap code
  * does.
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_FSB_TO_DB)
-xfs_daddr_t xfs_fsb_to_db(struct xfs_inode *ip, xfs_fsblock_t fsb);
 #define        XFS_FSB_TO_DB(ip,fsb)   xfs_fsb_to_db(ip,fsb)
-#else
-#define        XFS_FSB_TO_DB(ip,fsb) \
-               (((ip)->i_d.di_flags & XFS_DIFLAG_REALTIME) ? \
+static inline xfs_daddr_t
+xfs_fsb_to_db(struct xfs_inode *ip, xfs_fsblock_t fsb)
+{
+       return (((ip)->i_d.di_flags & XFS_DIFLAG_REALTIME) ? \
                 (xfs_daddr_t)XFS_FSB_TO_BB((ip)->i_mount, (fsb)) : \
-                XFS_FSB_TO_DADDR((ip)->i_mount, (fsb)))
-#endif
-
-#define XFS_FSB_TO_DB_IO(io,fsb) \
-               (((io)->io_flags & XFS_IOCORE_RT) ? \
+                XFS_FSB_TO_DADDR((ip)->i_mount, (fsb)));
+}
+#define XFS_FSB_TO_DB_IO(io,fsb) xfs_fsb_to_db_io(io,fsb)
+static inline xfs_daddr_t
+xfs_fsb_to_db_io(struct xfs_iocore *io, xfs_fsblock_t fsb)
+{
+       return (((io)->io_flags & XFS_IOCORE_RT) ? \
                 XFS_FSB_TO_BB((io)->io_mount, (fsb)) : \
-                XFS_FSB_TO_DADDR((io)->io_mount, (fsb)))
+                XFS_FSB_TO_DADDR((io)->io_mount, (fsb)));
+}
 
 /*
  * Prototypes for functions in xfs_rw.c.
  */
-
-int
-xfs_write_clear_setuid(
-       struct xfs_inode        *ip);
-
-int
-xfs_bwrite(
-       struct xfs_mount        *mp,
-       struct xfs_buf          *bp);
-
-int
-xfs_bioerror(
-       struct xfs_buf          *b);
-
-int
-xfs_bioerror_relse(
-       struct xfs_buf          *b);
-
-int
-xfs_read_buf(
-       struct xfs_mount        *mp,
-       xfs_buftarg_t           *target,
-       xfs_daddr_t             blkno,
-       int                     len,
-       uint                    flags,
-       struct xfs_buf          **bpp);
-
-void
-xfs_ioerror_alert(
-       char                    *func,
-       struct xfs_mount        *mp,
-       xfs_buf_t               *bp,
-       xfs_daddr_t             blkno);
-
+extern int xfs_write_clear_setuid(struct xfs_inode *ip);
+extern int xfs_bwrite(struct xfs_mount *mp, struct xfs_buf *bp);
+extern int xfs_bioerror(struct xfs_buf *bp);
+extern int xfs_bioerror_relse(struct xfs_buf *bp);
+extern int xfs_read_buf(struct xfs_mount *mp, xfs_buftarg_t *btp,
+                       xfs_daddr_t blkno, int len, uint flags,
+                       struct xfs_buf **bpp);
+extern void xfs_ioerror_alert(char *func, struct xfs_mount *mp,
+                               xfs_buf_t *bp, xfs_daddr_t blkno);
 
 /*
  * Prototypes for functions in xfs_vnodeops.c.
  */
-
-int
-xfs_rwlock(
-       bhv_desc_t              *bdp,
-       vrwlock_t               write_lock);
-
-void
-xfs_rwunlock(
-       bhv_desc_t              *bdp,
-       vrwlock_t               write_lock);
-
-int
-xfs_change_file_space(
-       bhv_desc_t              *bdp,
-       int                     cmd,
-       xfs_flock64_t           *bf,
-       xfs_off_t               offset,
-       cred_t                  *credp,
-       int                     flags);
-
-int
-xfs_set_dmattrs(
-       bhv_desc_t              *bdp,
-       u_int                   evmask,
-       u_int16_t               state,
-       cred_t                  *credp);
+extern int xfs_rwlock(bhv_desc_t *bdp, vrwlock_t write_lock);
+extern void xfs_rwunlock(bhv_desc_t *bdp, vrwlock_t write_lock);
+extern int xfs_change_file_space(bhv_desc_t *bdp, int cmd, xfs_flock64_t *bf,
+                                xfs_off_t offset, cred_t *credp, int flags);
+extern int xfs_set_dmattrs(bhv_desc_t *bdp, u_int evmask, u_int16_t state,
+                          cred_t *credp);
 
 #endif /* __XFS_RW_H__ */
index 01c5a5ff230e77d9a66fec88a43bed97c82acc36..a7b2542fd7bae23eb6b0702d0c1bf359ec939559 100644 (file)
@@ -241,42 +241,33 @@ typedef enum {
  */
 #define XFS_SB_MAX_SHARED_VN   0
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_NUM)
-int xfs_sb_version_num(xfs_sb_t *sbp);
-#define        XFS_SB_VERSION_NUM(sbp) xfs_sb_version_num(sbp)
-#else
 #define        XFS_SB_VERSION_NUM(sbp) ((sbp)->sb_versionnum & XFS_SB_VERSION_NUMBITS)
-#endif
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_GOOD_VERSION)
-int xfs_sb_good_version(xfs_sb_t *sbp);
 #define        XFS_SB_GOOD_VERSION(sbp)        xfs_sb_good_version(sbp)
-#else
-#define        XFS_SB_GOOD_VERSION_INT(sbp)    \
-       ((((sbp)->sb_versionnum >= XFS_SB_VERSION_1) && \
-         ((sbp)->sb_versionnum <= XFS_SB_VERSION_3)) || \
-          ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
-           !(((sbp)->sb_versionnum & ~XFS_SB_VERSION_OKREALBITS) || \
-             (((sbp)->sb_versionnum & XFS_SB_VERSION_MOREBITSBIT) && \
-              ((sbp)->sb_features2 & ~XFS_SB_VERSION2_OKREALBITS)))
-
 #ifdef __KERNEL__
-#define        XFS_SB_GOOD_VERSION(sbp)        \
-       (XFS_SB_GOOD_VERSION_INT(sbp) && \
-         (sbp)->sb_shared_vn <= XFS_SB_MAX_SHARED_VN) ))
-#else
-/*
- * extra 2 paren's here (( to unconfuse paren-matching editors
- * like vi because XFS_SB_GOOD_VERSION_INT is a partial expression
- * and the two XFS_SB_GOOD_VERSION's each 2 more close paren's to
- * complete the expression.
- */
-#define XFS_SB_GOOD_VERSION(sbp)       \
-       (XFS_SB_GOOD_VERSION_INT(sbp) && \
-         (!((sbp)->sb_versionnum & XFS_SB_VERSION_SHAREDBIT) || \
-          (sbp)->sb_shared_vn <= XFS_SB_MAX_SHARED_VN)) ))
+static inline int xfs_sb_good_version(xfs_sb_t *sbp)
+{
+       return (((sbp->sb_versionnum >= XFS_SB_VERSION_1) && \
+                 (sbp->sb_versionnum <= XFS_SB_VERSION_3)) || \
+                  ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
+                   !((sbp->sb_versionnum & ~XFS_SB_VERSION_OKREALBITS) || \
+                     ((sbp->sb_versionnum & XFS_SB_VERSION_MOREBITSBIT) && \
+                      (sbp->sb_features2 & ~XFS_SB_VERSION2_OKREALBITS))) && \
+                   (sbp->sb_shared_vn <= XFS_SB_MAX_SHARED_VN)));
+}
+#else
+static inline int xfs_sb_good_version(xfs_sb_t *sbp)
+{
+       return (((sbp->sb_versionnum >= XFS_SB_VERSION_1) && \
+                 (sbp->sb_versionnum <= XFS_SB_VERSION_3)) || \
+                  ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
+                   !((sbp->sb_versionnum & ~XFS_SB_VERSION_OKREALBITS) || \
+                     ((sbp->sb_versionnum & XFS_SB_VERSION_MOREBITSBIT) && \
+                      (sbp->sb_features2 & ~XFS_SB_VERSION2_OKREALBITS))) && \
+                 (!(sbp->sb_versionnum & XFS_SB_VERSION_SHAREDBIT) || \
+                  (sbp->sb_shared_vn <= XFS_SB_MAX_SHARED_VN))));
+}
 #endif /* __KERNEL__ */
-#endif
 
 #define        XFS_SB_GOOD_SASH_VERSION(sbp)   \
        ((((sbp)->sb_versionnum >= XFS_SB_VERSION_1) && \
@@ -284,224 +275,178 @@ int xfs_sb_good_version(xfs_sb_t *sbp);
         ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
          !((sbp)->sb_versionnum & ~XFS_SB_VERSION_OKSASHBITS)))
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_TONEW)
-unsigned xfs_sb_version_tonew(unsigned v);
 #define        XFS_SB_VERSION_TONEW(v) xfs_sb_version_tonew(v)
-#else
-#define        XFS_SB_VERSION_TONEW(v) \
-       ((((v) == XFS_SB_VERSION_1) ? \
+static inline unsigned xfs_sb_version_tonew(unsigned v)
+{
+       return ((((v) == XFS_SB_VERSION_1) ? \
                0 : \
                (((v) == XFS_SB_VERSION_2) ? \
                        XFS_SB_VERSION_ATTRBIT : \
                        (XFS_SB_VERSION_ATTRBIT | XFS_SB_VERSION_NLINKBIT))) | \
-        XFS_SB_VERSION_4)
-#endif
+               XFS_SB_VERSION_4);
+}
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_TOOLD)
-unsigned xfs_sb_version_toold(unsigned v);
 #define        XFS_SB_VERSION_TOOLD(v) xfs_sb_version_toold(v)
-#else
-#define        XFS_SB_VERSION_TOOLD(v) \
-       (((v) & (XFS_SB_VERSION_QUOTABIT | XFS_SB_VERSION_ALIGNBIT)) ? \
+static inline unsigned xfs_sb_version_toold(unsigned v)
+{
+       return (((v) & (XFS_SB_VERSION_QUOTABIT | XFS_SB_VERSION_ALIGNBIT)) ? \
                0 : \
                (((v) & XFS_SB_VERSION_NLINKBIT) ? \
                        XFS_SB_VERSION_3 : \
                        (((v) & XFS_SB_VERSION_ATTRBIT) ?  \
                                XFS_SB_VERSION_2 : \
-                               XFS_SB_VERSION_1)))
-#endif
+                               XFS_SB_VERSION_1)));
+}
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_HASATTR)
-int xfs_sb_version_hasattr(xfs_sb_t *sbp);
 #define        XFS_SB_VERSION_HASATTR(sbp)     xfs_sb_version_hasattr(sbp)
-#else
-#define        XFS_SB_VERSION_HASATTR(sbp)     \
-       (((sbp)->sb_versionnum == XFS_SB_VERSION_2) || \
-        ((sbp)->sb_versionnum == XFS_SB_VERSION_3) || \
-        ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
-         ((sbp)->sb_versionnum & XFS_SB_VERSION_ATTRBIT)))
-#endif
+static inline int xfs_sb_version_hasattr(xfs_sb_t *sbp)
+{
+       return ((sbp)->sb_versionnum == XFS_SB_VERSION_2) || \
+                ((sbp)->sb_versionnum == XFS_SB_VERSION_3) || \
+                ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
+                 ((sbp)->sb_versionnum & XFS_SB_VERSION_ATTRBIT));
+}
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_ADDATTR)
-void xfs_sb_version_addattr(xfs_sb_t *sbp);
 #define        XFS_SB_VERSION_ADDATTR(sbp)     xfs_sb_version_addattr(sbp)
-#else
-#define        XFS_SB_VERSION_ADDATTR(sbp)     \
-       ((sbp)->sb_versionnum = \
-        (((sbp)->sb_versionnum == XFS_SB_VERSION_1) ? \
+static inline void xfs_sb_version_addattr(xfs_sb_t *sbp)
+{
+       (sbp)->sb_versionnum = (((sbp)->sb_versionnum == XFS_SB_VERSION_1) ? \
                XFS_SB_VERSION_2 : \
                ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) ? \
                        ((sbp)->sb_versionnum | XFS_SB_VERSION_ATTRBIT) : \
-                       (XFS_SB_VERSION_4 | XFS_SB_VERSION_ATTRBIT))))
-#endif
+                       (XFS_SB_VERSION_4 | XFS_SB_VERSION_ATTRBIT)));
+}
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_HASNLINK)
-int xfs_sb_version_hasnlink(xfs_sb_t *sbp);
 #define        XFS_SB_VERSION_HASNLINK(sbp)    xfs_sb_version_hasnlink(sbp)
-#else
-#define        XFS_SB_VERSION_HASNLINK(sbp)    \
-       (((sbp)->sb_versionnum == XFS_SB_VERSION_3) || \
-        ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
-         ((sbp)->sb_versionnum & XFS_SB_VERSION_NLINKBIT)))
-#endif
+static inline int xfs_sb_version_hasnlink(xfs_sb_t *sbp)
+{
+       return ((sbp)->sb_versionnum == XFS_SB_VERSION_3) || \
+                ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
+                 ((sbp)->sb_versionnum & XFS_SB_VERSION_NLINKBIT));
+}
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_ADDNLINK)
-void xfs_sb_version_addnlink(xfs_sb_t *sbp);
 #define        XFS_SB_VERSION_ADDNLINK(sbp)    xfs_sb_version_addnlink(sbp)
-#else
-#define        XFS_SB_VERSION_ADDNLINK(sbp)    \
-       ((sbp)->sb_versionnum = \
-        ((sbp)->sb_versionnum <= XFS_SB_VERSION_2 ? \
+static inline void xfs_sb_version_addnlink(xfs_sb_t *sbp)
+{
+       (sbp)->sb_versionnum = ((sbp)->sb_versionnum <= XFS_SB_VERSION_2 ? \
                XFS_SB_VERSION_3 : \
-               ((sbp)->sb_versionnum | XFS_SB_VERSION_NLINKBIT)))
-#endif
+               ((sbp)->sb_versionnum | XFS_SB_VERSION_NLINKBIT));
+}
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_HASQUOTA)
-int xfs_sb_version_hasquota(xfs_sb_t *sbp);
 #define        XFS_SB_VERSION_HASQUOTA(sbp)    xfs_sb_version_hasquota(sbp)
-#else
-#define        XFS_SB_VERSION_HASQUOTA(sbp)    \
-       ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
-        ((sbp)->sb_versionnum & XFS_SB_VERSION_QUOTABIT))
-#endif
+static inline int xfs_sb_version_hasquota(xfs_sb_t *sbp)
+{
+       return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
+               ((sbp)->sb_versionnum & XFS_SB_VERSION_QUOTABIT);
+}
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_ADDQUOTA)
-void xfs_sb_version_addquota(xfs_sb_t *sbp);
 #define        XFS_SB_VERSION_ADDQUOTA(sbp)    xfs_sb_version_addquota(sbp)
-#else
-#define        XFS_SB_VERSION_ADDQUOTA(sbp)    \
-       ((sbp)->sb_versionnum = \
-        (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4 ? \
-               ((sbp)->sb_versionnum | XFS_SB_VERSION_QUOTABIT) : \
-               (XFS_SB_VERSION_TONEW((sbp)->sb_versionnum) | \
-                XFS_SB_VERSION_QUOTABIT)))
-#endif
-
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_HASALIGN)
-int xfs_sb_version_hasalign(xfs_sb_t *sbp);
+static inline void xfs_sb_version_addquota(xfs_sb_t *sbp)
+{
+       (sbp)->sb_versionnum = \
+                (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4 ? \
+                       ((sbp)->sb_versionnum | XFS_SB_VERSION_QUOTABIT) : \
+                       (XFS_SB_VERSION_TONEW((sbp)->sb_versionnum) | \
+                        XFS_SB_VERSION_QUOTABIT));
+}
+
 #define        XFS_SB_VERSION_HASALIGN(sbp)    xfs_sb_version_hasalign(sbp)
-#else
-#define        XFS_SB_VERSION_HASALIGN(sbp)    \
-       ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
-        ((sbp)->sb_versionnum & XFS_SB_VERSION_ALIGNBIT))
-#endif
+static inline int xfs_sb_version_hasalign(xfs_sb_t *sbp)
+{
+       return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
+               ((sbp)->sb_versionnum & XFS_SB_VERSION_ALIGNBIT);
+}
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_SUBALIGN)
-void xfs_sb_version_subalign(xfs_sb_t *sbp);
 #define        XFS_SB_VERSION_SUBALIGN(sbp)    xfs_sb_version_subalign(sbp)
-#else
-#define        XFS_SB_VERSION_SUBALIGN(sbp)    \
-       ((sbp)->sb_versionnum = \
-        XFS_SB_VERSION_TOOLD((sbp)->sb_versionnum & ~XFS_SB_VERSION_ALIGNBIT))
-#endif
+static inline void xfs_sb_version_subalign(xfs_sb_t *sbp)
+{
+       (sbp)->sb_versionnum = \
+        XFS_SB_VERSION_TOOLD((sbp)->sb_versionnum & ~XFS_SB_VERSION_ALIGNBIT);
+}
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_HASDALIGN)
-int xfs_sb_version_hasdalign(xfs_sb_t *sbp);
 #define XFS_SB_VERSION_HASDALIGN(sbp)  xfs_sb_version_hasdalign(sbp)
-#else
-#define XFS_SB_VERSION_HASDALIGN(sbp)  \
-       ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
-        ((sbp)->sb_versionnum & XFS_SB_VERSION_DALIGNBIT))
-#endif
+static inline int xfs_sb_version_hasdalign(xfs_sb_t *sbp)
+{
+       return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
+               ((sbp)->sb_versionnum & XFS_SB_VERSION_DALIGNBIT);
+}
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_ADDDALIGN)
-int xfs_sb_version_adddalign(xfs_sb_t *sbp);
 #define XFS_SB_VERSION_ADDDALIGN(sbp)  xfs_sb_version_adddalign(sbp)
-#else
-#define XFS_SB_VERSION_ADDDALIGN(sbp)  \
-       ((sbp)->sb_versionnum = \
-               ((sbp)->sb_versionnum | XFS_SB_VERSION_DALIGNBIT))
-#endif
+static inline int xfs_sb_version_adddalign(xfs_sb_t *sbp)
+{
+       return (sbp)->sb_versionnum = \
+               ((sbp)->sb_versionnum | XFS_SB_VERSION_DALIGNBIT);
+}
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_HASSHARED)
-int xfs_sb_version_hasshared(xfs_sb_t *sbp);
 #define XFS_SB_VERSION_HASSHARED(sbp)  xfs_sb_version_hasshared(sbp)
-#else
-#define XFS_SB_VERSION_HASSHARED(sbp)  \
-       ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
-        ((sbp)->sb_versionnum & XFS_SB_VERSION_SHAREDBIT))
-#endif
+static inline int xfs_sb_version_hasshared(xfs_sb_t *sbp)
+{
+       return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
+               ((sbp)->sb_versionnum & XFS_SB_VERSION_SHAREDBIT);
+}
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_ADDSHARED)
-int xfs_sb_version_addshared(xfs_sb_t *sbp);
 #define XFS_SB_VERSION_ADDSHARED(sbp)  xfs_sb_version_addshared(sbp)
-#else
-#define XFS_SB_VERSION_ADDSHARED(sbp)  \
-       ((sbp)->sb_versionnum = \
-               ((sbp)->sb_versionnum | XFS_SB_VERSION_SHAREDBIT))
-#endif
+static inline int xfs_sb_version_addshared(xfs_sb_t *sbp)
+{
+       return (sbp)->sb_versionnum = \
+               ((sbp)->sb_versionnum | XFS_SB_VERSION_SHAREDBIT);
+}
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_SUBSHARED)
-int xfs_sb_version_subshared(xfs_sb_t *sbp);
 #define XFS_SB_VERSION_SUBSHARED(sbp)  xfs_sb_version_subshared(sbp)
-#else
-#define XFS_SB_VERSION_SUBSHARED(sbp)  \
-       ((sbp)->sb_versionnum = \
-               ((sbp)->sb_versionnum & ~XFS_SB_VERSION_SHAREDBIT))
-#endif
+static inline int xfs_sb_version_subshared(xfs_sb_t *sbp)
+{
+       return (sbp)->sb_versionnum = \
+               ((sbp)->sb_versionnum & ~XFS_SB_VERSION_SHAREDBIT);
+}
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_HASDIRV2)
-int xfs_sb_version_hasdirv2(xfs_sb_t *sbp);
 #define XFS_SB_VERSION_HASDIRV2(sbp)   xfs_sb_version_hasdirv2(sbp)
-#else
-#define XFS_SB_VERSION_HASDIRV2(sbp)   \
-       ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
-        ((sbp)->sb_versionnum & XFS_SB_VERSION_DIRV2BIT))
-#endif
+static inline int xfs_sb_version_hasdirv2(xfs_sb_t *sbp)
+{
+       return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
+               ((sbp)->sb_versionnum & XFS_SB_VERSION_DIRV2BIT);
+}
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_HASLOGV2)
-int xfs_sb_version_haslogv2(xfs_sb_t *sbp);
 #define XFS_SB_VERSION_HASLOGV2(sbp)   xfs_sb_version_haslogv2(sbp)
-#else
-#define XFS_SB_VERSION_HASLOGV2(sbp)   \
-       ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
-       ((sbp)->sb_versionnum & XFS_SB_VERSION_LOGV2BIT))
-#endif
+static inline int xfs_sb_version_haslogv2(xfs_sb_t *sbp)
+{
+       return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
+               ((sbp)->sb_versionnum & XFS_SB_VERSION_LOGV2BIT);
+}
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_HASEXTFLGBIT)
-int xfs_sb_version_hasextflgbit(xfs_sb_t *sbp);
 #define XFS_SB_VERSION_HASEXTFLGBIT(sbp)       xfs_sb_version_hasextflgbit(sbp)
-#else
-#define XFS_SB_VERSION_HASEXTFLGBIT(sbp)       \
-       ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
-        ((sbp)->sb_versionnum & XFS_SB_VERSION_EXTFLGBIT))
-#endif
+static inline int xfs_sb_version_hasextflgbit(xfs_sb_t *sbp)
+{
+       return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
+               ((sbp)->sb_versionnum & XFS_SB_VERSION_EXTFLGBIT);
+}
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_ADDEXTFLGBIT)
-int xfs_sb_version_addextflgbit(xfs_sb_t *sbp);
 #define XFS_SB_VERSION_ADDEXTFLGBIT(sbp)       xfs_sb_version_addextflgbit(sbp)
-#else
-#define XFS_SB_VERSION_ADDEXTFLGBIT(sbp)       \
-       ((sbp)->sb_versionnum = \
-               ((sbp)->sb_versionnum | XFS_SB_VERSION_EXTFLGBIT))
-#endif
+static inline int xfs_sb_version_addextflgbit(xfs_sb_t *sbp)
+{
+       return (sbp)->sb_versionnum = \
+               ((sbp)->sb_versionnum | XFS_SB_VERSION_EXTFLGBIT);
+}
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_SUBEXTFLGBIT)
-int xfs_sb_version_subextflgbit(xfs_sb_t *sbp);
 #define XFS_SB_VERSION_SUBEXTFLGBIT(sbp)       xfs_sb_version_subextflgbit(sbp)
-#else
-#define XFS_SB_VERSION_SUBEXTFLGBIT(sbp)       \
-       ((sbp)->sb_versionnum = \
-               ((sbp)->sb_versionnum & ~XFS_SB_VERSION_EXTFLGBIT))
-#endif
+static inline int xfs_sb_version_subextflgbit(xfs_sb_t *sbp)
+{
+       return (sbp)->sb_versionnum = \
+               ((sbp)->sb_versionnum & ~XFS_SB_VERSION_EXTFLGBIT);
+}
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_HASSECTOR)
-int xfs_sb_version_hassector(xfs_sb_t *sbp);
 #define XFS_SB_VERSION_HASSECTOR(sbp)   xfs_sb_version_hassector(sbp)
-#else
-#define XFS_SB_VERSION_HASSECTOR(sbp)   \
-       ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
-       ((sbp)->sb_versionnum & XFS_SB_VERSION_SECTORBIT))
-#endif
+static inline int xfs_sb_version_hassector(xfs_sb_t *sbp)
+{
+       return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
+               ((sbp)->sb_versionnum & XFS_SB_VERSION_SECTORBIT);
+}
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_HASMOREBITSBIT)
-int xfs_sb_version_hasmorebits(xfs_sb_t *sbp);
 #define XFS_SB_VERSION_HASMOREBITS(sbp)        xfs_sb_version_hasmorebits(sbp)
-#else
-#define XFS_SB_VERSION_HASMOREBITS(sbp)        \
-       ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
-        ((sbp)->sb_versionnum & XFS_SB_VERSION_MOREBITSBIT))
-#endif
+static inline int xfs_sb_version_hasmorebits(xfs_sb_t *sbp)
+{
+       return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
+               ((sbp)->sb_versionnum & XFS_SB_VERSION_MOREBITSBIT);
+}
 
 /*
  * sb_features2 bit version macros.
@@ -512,65 +457,36 @@ int xfs_sb_version_hasmorebits(xfs_sb_t *sbp);
  *     ((XFS_SB_VERSION_HASMOREBITS(sbp) &&
  *      ((sbp)->sb_features2 & XFS_SB_VERSION2_FUNBIT)
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_HASATTR2)
-int xfs_sb_version_hasattr2(xfs_sb_t *sbp);
+
 #define XFS_SB_VERSION_HASATTR2(sbp)   xfs_sb_version_hasattr2(sbp)
-#else
-#define XFS_SB_VERSION_HASATTR2(sbp)   \
-       ((XFS_SB_VERSION_HASMOREBITS(sbp)) &&   \
-        ((sbp)->sb_features2 & XFS_SB_VERSION2_ATTR2BIT))
-#endif
+static inline int xfs_sb_version_hasattr2(xfs_sb_t *sbp)
+{
+       return (XFS_SB_VERSION_HASMOREBITS(sbp)) &&     \
+               ((sbp)->sb_features2 & XFS_SB_VERSION2_ATTR2BIT);
+}
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_ADDATTR2)
-void xfs_sb_version_addattr2(xfs_sb_t *sbp);
 #define XFS_SB_VERSION_ADDATTR2(sbp)   xfs_sb_version_addattr2(sbp)
-#else
-#define XFS_SB_VERSION_ADDATTR2(sbp)   \
+static inline void xfs_sb_version_addattr2(xfs_sb_t *sbp)
+{
        ((sbp)->sb_versionnum = \
                ((sbp)->sb_versionnum | XFS_SB_VERSION_MOREBITSBIT),    \
        ((sbp)->sb_features2 =  \
-               ((sbp)->sb_features2 | XFS_SB_VERSION2_ATTR2BIT)))
-#endif
+               ((sbp)->sb_features2 | XFS_SB_VERSION2_ATTR2BIT)));
+}
+
 /*
  * end of superblock version macros
  */
 
-#define XFS_SB_DADDR   ((xfs_daddr_t)0)        /* daddr in filesystem/ag */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_BLOCK)
-xfs_agblock_t xfs_sb_block(struct xfs_mount *mp);
-#define        XFS_SB_BLOCK(mp)        xfs_sb_block(mp)
-#else
+#define XFS_SB_DADDR           ((xfs_daddr_t)0) /* daddr in filesystem/ag */
 #define        XFS_SB_BLOCK(mp)        XFS_HDR_BLOCK(mp, XFS_SB_DADDR)
-#endif
-
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_HDR_BLOCK)
-xfs_agblock_t xfs_hdr_block(struct xfs_mount *mp, xfs_daddr_t d);
-#define        XFS_HDR_BLOCK(mp,d)     xfs_hdr_block(mp,d)
-#else
-#define        XFS_HDR_BLOCK(mp,d)     ((xfs_agblock_t)(XFS_BB_TO_FSBT(mp,d)))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DADDR_TO_FSB)
-xfs_fsblock_t xfs_daddr_to_fsb(struct xfs_mount *mp, xfs_daddr_t d);
-#define        XFS_DADDR_TO_FSB(mp,d)          xfs_daddr_to_fsb(mp,d)
-#else
-#define        XFS_DADDR_TO_FSB(mp,d) \
-       XFS_AGB_TO_FSB(mp, XFS_DADDR_TO_AGNO(mp,d), XFS_DADDR_TO_AGBNO(mp,d))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_FSB_TO_DADDR)
-xfs_daddr_t xfs_fsb_to_daddr(struct xfs_mount *mp, xfs_fsblock_t fsbno);
-#define        XFS_FSB_TO_DADDR(mp,fsbno)      xfs_fsb_to_daddr(mp,fsbno)
-#else
-#define        XFS_FSB_TO_DADDR(mp,fsbno) \
-       XFS_AGB_TO_DADDR(mp, XFS_FSB_TO_AGNO(mp,fsbno), \
-                        XFS_FSB_TO_AGBNO(mp,fsbno))
-#endif
-
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BUF_TO_SBP)
-xfs_sb_t *xfs_buf_to_sbp(struct xfs_buf *bp);
-#define XFS_BUF_TO_SBP(bp)     xfs_buf_to_sbp(bp)
-#else
 #define XFS_BUF_TO_SBP(bp)     ((xfs_sb_t *)XFS_BUF_PTR(bp))
-#endif
+
+#define        XFS_HDR_BLOCK(mp,d)     ((xfs_agblock_t)XFS_BB_TO_FSBT(mp,d))
+#define        XFS_DADDR_TO_FSB(mp,d)  XFS_AGB_TO_FSB(mp, \
+                       XFS_DADDR_TO_AGNO(mp,d), XFS_DADDR_TO_AGBNO(mp,d))
+#define        XFS_FSB_TO_DADDR(mp,fsbno)      XFS_AGB_TO_DADDR(mp, \
+                       XFS_FSB_TO_AGNO(mp,fsbno), XFS_FSB_TO_AGBNO(mp,fsbno))
 
 /*
  * File system sector to basic block conversions.
index 5e33891b80496c8fbcaf9d4fac0f8a4b341d0271..d14adef65a26ea11b2daf36e891a57a450e3f24c 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
 #include "xfs.h"
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
 #include "xfs_error.h"
-#include "xfs_trans_priv.h"
-#include "xfs_alloc_btree.h"
+#include "xfs_da_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
-#include "xfs_btree.h"
-#include "xfs_ialloc.h"
-#include "xfs_alloc.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
 #include "xfs_inode.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_alloc.h"
 #include "xfs_bmap.h"
-#include "xfs_da_btree.h"
 #include "xfs_quota.h"
+#include "xfs_trans_priv.h"
 #include "xfs_trans_space.h"
 
 
index 0f333fba187ca547be8eec04402a431fb3699978..6381669a34ac44be21a4212219fca4947af7d1e0 100644 (file)
@@ -234,68 +234,67 @@ typedef struct xfs_log_item_chunk {
  * lic_unused to the right value (0 matches all free).  The
  * lic_descs.lid_index values are set up as each desc is allocated.
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LIC_INIT)
-void xfs_lic_init(xfs_log_item_chunk_t *cp);
 #define        XFS_LIC_INIT(cp)        xfs_lic_init(cp)
-#else
-#define        XFS_LIC_INIT(cp)        ((cp)->lic_free = XFS_LIC_FREEMASK)
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LIC_INIT_SLOT)
-void xfs_lic_init_slot(xfs_log_item_chunk_t *cp, int slot);
+static inline void xfs_lic_init(xfs_log_item_chunk_t *cp)
+{
+       cp->lic_free = XFS_LIC_FREEMASK;
+}
+
 #define        XFS_LIC_INIT_SLOT(cp,slot)      xfs_lic_init_slot(cp, slot)
-#else
-#define        XFS_LIC_INIT_SLOT(cp,slot)      \
-       ((cp)->lic_descs[slot].lid_index = (unsigned char)(slot))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LIC_VACANCY)
-int xfs_lic_vacancy(xfs_log_item_chunk_t *cp);
+static inline void xfs_lic_init_slot(xfs_log_item_chunk_t *cp, int slot)
+{
+       cp->lic_descs[slot].lid_index = (unsigned char)(slot);
+}
+
 #define        XFS_LIC_VACANCY(cp)             xfs_lic_vacancy(cp)
-#else
-#define        XFS_LIC_VACANCY(cp)             (((cp)->lic_free) & XFS_LIC_FREEMASK)
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LIC_ALL_FREE)
-void xfs_lic_all_free(xfs_log_item_chunk_t *cp);
+static inline int xfs_lic_vacancy(xfs_log_item_chunk_t *cp)
+{
+       return cp->lic_free & XFS_LIC_FREEMASK;
+}
+
 #define        XFS_LIC_ALL_FREE(cp)            xfs_lic_all_free(cp)
-#else
-#define        XFS_LIC_ALL_FREE(cp)            ((cp)->lic_free = XFS_LIC_FREEMASK)
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LIC_ARE_ALL_FREE)
-int xfs_lic_are_all_free(xfs_log_item_chunk_t *cp);
+static inline void xfs_lic_all_free(xfs_log_item_chunk_t *cp)
+{
+       cp->lic_free = XFS_LIC_FREEMASK;
+}
+
 #define        XFS_LIC_ARE_ALL_FREE(cp)        xfs_lic_are_all_free(cp)
-#else
-#define        XFS_LIC_ARE_ALL_FREE(cp)        (((cp)->lic_free & XFS_LIC_FREEMASK) ==\
-                                       XFS_LIC_FREEMASK)
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LIC_ISFREE)
-int xfs_lic_isfree(xfs_log_item_chunk_t *cp, int slot);
+static inline int xfs_lic_are_all_free(xfs_log_item_chunk_t *cp)
+{
+       return ((cp->lic_free & XFS_LIC_FREEMASK) == XFS_LIC_FREEMASK);
+}
+
 #define        XFS_LIC_ISFREE(cp,slot) xfs_lic_isfree(cp,slot)
-#else
-#define        XFS_LIC_ISFREE(cp,slot) ((cp)->lic_free & (1 << (slot)))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LIC_CLAIM)
-void xfs_lic_claim(xfs_log_item_chunk_t *cp, int slot);
+static inline int xfs_lic_isfree(xfs_log_item_chunk_t *cp, int slot)
+{
+       return (cp->lic_free & (1 << slot));
+}
+
 #define        XFS_LIC_CLAIM(cp,slot)          xfs_lic_claim(cp,slot)
-#else
-#define        XFS_LIC_CLAIM(cp,slot)          ((cp)->lic_free &= ~(1 << (slot)))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LIC_RELSE)
-void xfs_lic_relse(xfs_log_item_chunk_t *cp, int slot);
+static inline void xfs_lic_claim(xfs_log_item_chunk_t *cp, int slot)
+{
+       cp->lic_free &= ~(1 << slot);
+}
+
 #define        XFS_LIC_RELSE(cp,slot)          xfs_lic_relse(cp,slot)
-#else
-#define        XFS_LIC_RELSE(cp,slot)          ((cp)->lic_free |= 1 << (slot))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LIC_SLOT)
-xfs_log_item_desc_t *xfs_lic_slot(xfs_log_item_chunk_t *cp, int slot);
+static inline void xfs_lic_relse(xfs_log_item_chunk_t *cp, int slot)
+{
+       cp->lic_free |= 1 << slot;
+}
+
 #define        XFS_LIC_SLOT(cp,slot)           xfs_lic_slot(cp,slot)
-#else
-#define        XFS_LIC_SLOT(cp,slot)           (&((cp)->lic_descs[slot]))
-#endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LIC_DESC_TO_SLOT)
-int xfs_lic_desc_to_slot(xfs_log_item_desc_t *dp);
+static inline xfs_log_item_desc_t *
+xfs_lic_slot(xfs_log_item_chunk_t *cp, int slot)
+{
+       return &(cp->lic_descs[slot]);
+}
+
 #define        XFS_LIC_DESC_TO_SLOT(dp)        xfs_lic_desc_to_slot(dp)
-#else
-#define        XFS_LIC_DESC_TO_SLOT(dp)        ((uint)((dp)->lid_index))
-#endif
+static inline int xfs_lic_desc_to_slot(xfs_log_item_desc_t *dp)
+{
+       return (uint)dp->lid_index;
+}
+
 /*
  * Calculate the address of a chunk given a descriptor pointer:
  * dp - dp->lid_index give the address of the start of the lic_descs array.
@@ -303,15 +302,14 @@ int xfs_lic_desc_to_slot(xfs_log_item_desc_t *dp);
  * All of this yields the address of the chunk, which is
  * cast to a chunk pointer.
  */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LIC_DESC_TO_CHUNK)
-xfs_log_item_chunk_t *xfs_lic_desc_to_chunk(xfs_log_item_desc_t *dp);
 #define        XFS_LIC_DESC_TO_CHUNK(dp)       xfs_lic_desc_to_chunk(dp)
-#else
-#define        XFS_LIC_DESC_TO_CHUNK(dp)       ((xfs_log_item_chunk_t*) \
-                                       (((xfs_caddr_t)((dp) - (dp)->lid_index)) -\
-                                       (xfs_caddr_t)(((xfs_log_item_chunk_t*) \
-                                       0)->lic_descs)))
-#endif
+static inline xfs_log_item_chunk_t *
+xfs_lic_desc_to_chunk(xfs_log_item_desc_t *dp)
+{
+       return (xfs_log_item_chunk_t*) \
+               (((xfs_caddr_t)((dp) - (dp)->lid_index)) - \
+               (xfs_caddr_t)(((xfs_log_item_chunk_t*)0)->lic_descs));
+}
 
 #ifdef __KERNEL__
 /*
@@ -328,7 +326,7 @@ typedef struct xfs_log_busy_slot {
 #define XFS_LBC_NUM_SLOTS      31
 typedef struct xfs_log_busy_chunk {
        struct xfs_log_busy_chunk       *lbc_next;
-       uint                            lbc_free;       /* bitmask of free slots */
+       uint                            lbc_free;       /* free slots bitmask */
        ushort                          lbc_unused;     /* first unused */
        xfs_log_busy_slot_t             lbc_busy[XFS_LBC_NUM_SLOTS];
 } xfs_log_busy_chunk_t;
index 2a71b4f91bfa1bf9a50909fde4b8a0a682b75eca..f248cb60ff7c65cdc1efbcf225b5c23c430f6d35 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
 #include "xfs.h"
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_dir.h"
index e733293dd7f488f24a8d7bedf5dc7b3cf1428085..24630da76a29608df5a4cb9532b57551df4fcadc 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
 #include "xfs.h"
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
-#include "xfs_buf_item.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
 #include "xfs_dir.h"
+#include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_buf_item.h"
 #include "xfs_trans_priv.h"
 #include "xfs_error.h"
 #include "xfs_rw.h"
index 93259a15f983d7fe0df132f37135106bbe475dff..1f6b17777f2d6c86ea3ff30a1b3c1a853fe1da78 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
 #include "xfs.h"
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_dir.h"
index 7e7631ca49793b6ad8b2cad24d3a0e9ab530f442..060b1a72eef16148dc21024efd0d98b5cd2a219c 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
 #include "xfs.h"
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
 #include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
-#include "xfs_trans_priv.h"
-#include "xfs_alloc_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
-#include "xfs_btree.h"
-#include "xfs_ialloc.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
-#include "xfs_inode_item.h"
 #include "xfs_inode.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_trans_priv.h"
+#include "xfs_inode_item.h"
 
 #ifdef XFS_TRANS_DEBUG
 STATIC void
index 1b8a756d80ed009d93a8fab688eb67c1e2b6a010..8edfb151df105db46f7f528b6f3ba0b7f6f2f3fb 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
 #include "xfs.h"
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 
 STATIC int     xfs_trans_unlock_chunk(xfs_log_item_chunk_t *,
index 11351f08d438e9b5a3302e32a5c181585c90e8c5..c6459514fadbcc9d96f0d29de80d0f1e3d9b9911 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
 #include "xfs.h"
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
+#include "xfs_ag.h"
 #include "xfs_dir.h"
 #include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
 #include "xfs_bmap_btree.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
-#include "xfs_inode_item.h"
 #include "xfs_inode.h"
+#include "xfs_inode_item.h"
 #include "xfs_bmap.h"
 #include "xfs_error.h"
 #include "xfs_quota.h"
index 200e0c50acf29fb45d919e92b0b8f23661369d2b..9ea201762a9c2bc9c1843dcc7407fab22e118674 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * XFS filesystem operations.
- *
  * Copyright (c) 2000-2005 Silicon Graphics, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
 #include "xfs.h"
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
+#include "xfs_ag.h"
 #include "xfs_dir.h"
 #include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
+#include "xfs_da_btree.h"
 #include "xfs_bmap_btree.h"
 #include "xfs_ialloc_btree.h"
 #include "xfs_alloc_btree.h"
-#include "xfs_btree.h"
-#include "xfs_alloc.h"
-#include "xfs_ialloc.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
-#include "xfs_inode_item.h"
 #include "xfs_inode.h"
-#include "xfs_ag.h"
+#include "xfs_inode_item.h"
+#include "xfs_btree.h"
+#include "xfs_alloc.h"
+#include "xfs_ialloc.h"
+#include "xfs_quota.h"
 #include "xfs_error.h"
 #include "xfs_bmap.h"
-#include "xfs_da_btree.h"
 #include "xfs_rw.h"
 #include "xfs_refcache.h"
 #include "xfs_buf_item.h"
-#include "xfs_extfree_item.h"
-#include "xfs_quota.h"
+#include "xfs_log_priv.h"
 #include "xfs_dir2_trace.h"
+#include "xfs_extfree_item.h"
 #include "xfs_acl.h"
 #include "xfs_attr.h"
 #include "xfs_clnt.h"
-#include "xfs_log_priv.h"
 
 STATIC int xfs_sync(bhv_desc_t *, int, cred_t *);
 
index 8221b11a48c0a5b30cfc067451c93c3e43e4adb7..443ec6a0b2b86ed91b8024e55805706cb2c80acd 100644 (file)
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-
 #include "xfs.h"
-#include "xfs_macros.h"
+#include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
+#include "xfs_bit.h"
 #include "xfs_log.h"
+#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
 #include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
-#include "xfs_alloc_btree.h"
+#include "xfs_da_btree.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
-#include "xfs_itable.h"
-#include "xfs_btree.h"
-#include "xfs_ialloc.h"
-#include "xfs_alloc.h"
-#include "xfs_attr_sf.h"
 #include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
+#include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
-#include "xfs_inode_item.h"
 #include "xfs_inode.h"
+#include "xfs_inode_item.h"
+#include "xfs_dir_leaf.h"
+#include "xfs_itable.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_alloc.h"
 #include "xfs_bmap.h"
-#include "xfs_da_btree.h"
 #include "xfs_attr.h"
 #include "xfs_rw.h"
-#include "xfs_refcache.h"
 #include "xfs_error.h"
-#include "xfs_bit.h"
-#include "xfs_rtalloc.h"
 #include "xfs_quota.h"
 #include "xfs_utils.h"
+#include "xfs_rtalloc.h"
+#include "xfs_refcache.h"
 #include "xfs_trans_space.h"
-#include "xfs_dir_leaf.h"
-#include "xfs_mac.h"
 #include "xfs_log_priv.h"
+#include "xfs_mac.h"
 
 
 /*