Skip to contentSkip to conversation

xfs: cleanups to make userspace merges simpler

PATCH New Dave Chinner 1 participant 8 messages Apr 16, 2012 XFS filesystem

lore
Share & tools
lore
#0 lore raw

cover xfs: cleanups to make userspace merges simpler

To make userspace merges easier, we really need to separate code that exists purely in the kernel code from code that is used by both usrespace and kernel code. This reduces the differences between the userspace and kernel code, and makes it easier to maintain. This patch series sits on top of my current patch queue as posted here:

http://oss.sgi.com/archives/xfs/2012-04/msg00768.html

The biggest change in the this series is to separate the busy extent list code from xfs_alloc.c. The busy extent code is not needed in userspace whilst the rest of the allocation code is, so it makes sense to move it to it;s own file in the kernel code.

Similarly, xfs_rw.[ch] do not exist in userspace, but there are includes all over the place for it in .c files that are shared with userspace. We can trivially kill the xfs_rw.[ch] files in the kernel altogether, removing another trivial difference between user and kernel space.

Other header file cleanups are performed - moving xfs_agino_t to xfs_types.h removes a lot of needless dependencies, as does making the static inline function xfs_fsb_to_db a just a normal function in a .c file.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#1 lore raw

PATCH 1/7 xfs: move xfsagino_t to xfs_types.h

From: Dave Chinner <[email protected]>

Untangle the header file includes a bit by moving the definition of xfs_agino_t to xfs_types.h. This removes the dependency that xfs_ag.h has on xfs_inum.h, meaning we don't need to include xfs_inum.h everywhere we include xfs_ag.h.

---
 fs/xfs/xfs_alloc.c         |    1 -
 fs/xfs/xfs_alloc_btree.c   |    1 -
 fs/xfs/xfs_aops.c          |    1 -
 fs/xfs/xfs_attr.c          |    1 -
 fs/xfs/xfs_attr_leaf.c     |    1 -
 fs/xfs/xfs_bmap_btree.c    |    1 -
 fs/xfs/xfs_btree.c         |    1 -
 fs/xfs/xfs_buf.c           |    1 -
 fs/xfs/xfs_buf_item.c      |    1 -
 fs/xfs/xfs_da_btree.c      |    1 -
 fs/xfs/xfs_dfrag.c         |    1 -
 fs/xfs/xfs_dir2_block.c    |    1 -
 fs/xfs/xfs_dir2_data.c     |    1 -
 fs/xfs/xfs_dir2_leaf.c     |    1 -
 fs/xfs/xfs_dir2_node.c     |    1 -
 fs/xfs/xfs_dir2_sf.c       |    1 -
 fs/xfs/xfs_discard.c       |    1 -
 fs/xfs/xfs_dquot.c         |    1 -
 fs/xfs/xfs_dquot_item.c    |    1 -
 fs/xfs/xfs_error.c         |    1 -
 fs/xfs/xfs_export.c        |    1 -
 fs/xfs/xfs_extfree_item.c  |    1 -
 fs/xfs/xfs_file.c          |    1 -
 fs/xfs/xfs_fsops.c         |    1 -
 fs/xfs/xfs_ialloc_btree.c  |    1 -
 fs/xfs/xfs_inode_item.c    |    1 -
 fs/xfs/xfs_inum.h          |    5 -----
 fs/xfs/xfs_ioctl.c         |    1 -
 fs/xfs/xfs_ioctl32.c       |    1 -
 fs/xfs/xfs_iomap.c         |    1 -
 fs/xfs/xfs_iops.c          |    1 -
 fs/xfs/xfs_log.c           |    1 -
 fs/xfs/xfs_log_cil.c       |    1 -
 fs/xfs/xfs_message.c       |    1 -
 fs/xfs/xfs_qm.c            |    1 -
 fs/xfs/xfs_qm_bhv.c        |    1 -
 fs/xfs/xfs_qm_syscalls.c   |    1 -
 fs/xfs/xfs_quotaops.c      |    1 -
 fs/xfs/xfs_rename.c        |    1 -
 fs/xfs/xfs_rtalloc.c       |    1 -
 fs/xfs/xfs_rw.c            |    1 -
 fs/xfs/xfs_trace.c         |    1 -
 fs/xfs/xfs_trans.c         |    1 -
 fs/xfs/xfs_trans_ail.c     |    1 -
 fs/xfs/xfs_trans_buf.c     |    1 -
 fs/xfs/xfs_trans_dquot.c   |    1 -
 fs/xfs/xfs_trans_extfree.c |    1 -
 fs/xfs/xfs_trans_inode.c   |    1 -
 fs/xfs/xfs_types.h         |    5 +++++
 fs/xfs/xfs_utils.c         |    1 -
 fs/xfs/xfs_vnodeops.c      |    1 -
 51 files changed, 5 insertions(+), 54 deletions(-)
fs/xfs/xfs_alloc.c +0 -1
index 0f0df27..95ee705 100644
@@ -20,7 +20,6 @@
 #include "xfs_types.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"
fs/xfs/xfs_alloc_btree.c +0 -1
index ffb3386..e23cc97 100644
@@ -20,7 +20,6 @@
 #include "xfs_types.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"
fs/xfs/xfs_aops.c +0 -1
index acae70a..1194bdc 100644
@@ -18,7 +18,6 @@
 #include "xfs.h"
 #include "xfs_bit.h"
 #include "xfs_log.h"
-#include "xfs_inum.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
 #include "xfs_trans.h"
fs/xfs/xfs_attr.c +0 -1
index 0960bb6..561fd60 100644
@@ -21,7 +21,6 @@
 #include "xfs_types.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"
fs/xfs/xfs_attr_leaf.c +0 -1
index 3cd5dc6..7d89d80 100644
@@ -20,7 +20,6 @@
 #include "xfs_types.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"
fs/xfs/xfs_bmap_btree.c +0 -1
index e2f5d59..862084a 100644
@@ -20,7 +20,6 @@
 #include "xfs_types.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"
fs/xfs/xfs_btree.c +0 -1
index 1f19f03..e53e317 100644
@@ -20,7 +20,6 @@
 #include "xfs_types.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"
fs/xfs/xfs_buf.c +0 -1
index e2e0538..0b3f7a6 100644
@@ -35,7 +35,6 @@
 #include <linux/freezer.h>
 
 #include "xfs_sb.h"
-#include "xfs_inum.h"
 #include "xfs_log.h"
 #include "xfs_ag.h"
 #include "xfs_mount.h"
fs/xfs/xfs_buf_item.c +0 -1
index a25206c..45df2b8 100644
@@ -20,7 +20,6 @@
 #include "xfs_types.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"
fs/xfs/xfs_da_btree.c +0 -1
index b8adc79..015b946 100644
@@ -20,7 +20,6 @@
 #include "xfs_types.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"
fs/xfs/xfs_dfrag.c +0 -1
index 1137bbc..f39205f 100644
@@ -20,7 +20,6 @@
 #include "xfs_types.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"
fs/xfs/xfs_dir2_block.c +0 -1
index d3b63ae..586732f 100644
@@ -19,7 +19,6 @@
 #include "xfs_fs.h"
 #include "xfs_types.h"
 #include "xfs_log.h"
-#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
fs/xfs/xfs_dir2_data.c +0 -1
index 5bbe2a8..2046988 100644
@@ -19,7 +19,6 @@
 #include "xfs_fs.h"
 #include "xfs_types.h"
 #include "xfs_log.h"
-#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
fs/xfs/xfs_dir2_leaf.c +0 -1
index 66e108f..397ffbc 100644
@@ -20,7 +20,6 @@
 #include "xfs_types.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"
fs/xfs/xfs_dir2_node.c +0 -1
index 0179a41..b0f2678 100644
@@ -19,7 +19,6 @@
 #include "xfs_fs.h"
 #include "xfs_types.h"
 #include "xfs_log.h"
-#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
fs/xfs/xfs_dir2_sf.c +0 -1
index 79d05e8..19bf0c5 100644
@@ -19,7 +19,6 @@
 #include "xfs_fs.h"
 #include "xfs_types.h"
 #include "xfs_log.h"
-#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
fs/xfs/xfs_discard.c +0 -1
index 1ad3a4b..bbbabc8 100644
@@ -17,7 +17,6 @@
  */
 #include "xfs.h"
 #include "xfs_sb.h"
-#include "xfs_inum.h"
 #include "xfs_log.h"
 #include "xfs_ag.h"
 #include "xfs_mount.h"
fs/xfs/xfs_dquot.c +0 -1
index 7bf3855..bf27fcc 100644
@@ -19,7 +19,6 @@
 #include "xfs_fs.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"
fs/xfs/xfs_dquot_item.c +0 -1
index aa6a2a6..9610e52 100644
@@ -19,7 +19,6 @@
 #include "xfs_fs.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"
fs/xfs/xfs_error.c +0 -1
index 39f0633..6104560 100644
@@ -19,7 +19,6 @@
 #include "xfs_fs.h"
 #include "xfs_types.h"
 #include "xfs_log.h"
-#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
fs/xfs/xfs_export.c +0 -1
index 558910f..2d25d19 100644
@@ -17,7 +17,6 @@
  */
 #include "xfs.h"
 #include "xfs_types.h"
-#include "xfs_inum.h"
 #include "xfs_log.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
fs/xfs/xfs_extfree_item.c +0 -1
index 1c57eb9..39021cd 100644
@@ -19,7 +19,6 @@
 #include "xfs_fs.h"
 #include "xfs_types.h"
 #include "xfs_log.h"
-#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_buf_item.h"
 #include "xfs_sb.h"
fs/xfs/xfs_file.c +0 -1
index f48c106..762ce4e 100644
@@ -19,7 +19,6 @@
 #include "xfs_fs.h"
 #include "xfs_bit.h"
 #include "xfs_log.h"
-#include "xfs_inum.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
 #include "xfs_trans.h"
fs/xfs/xfs_fsops.c +0 -1
index e9f5bc0..2635e17 100644
@@ -19,7 +19,6 @@
 #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"
fs/xfs/xfs_ialloc_btree.c +0 -1
index c6a7581..2b8b7a3 100644
@@ -20,7 +20,6 @@
 #include "xfs_types.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"
fs/xfs/xfs_inode_item.c +0 -1
index 3f96a94..a8d5fdd 100644
@@ -20,7 +20,6 @@
 #include "xfs_types.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"
fs/xfs/xfs_inum.h +0 -5
index b253c0e..90efdaf 100644
@@ -26,11 +26,6 @@
  * high agno_log-agblklog-inopblog bits - 0
  */
 
-typedef	__uint32_t	xfs_agino_t;	/* within allocation grp inode number */
-
-#define	NULLFSINO	((xfs_ino_t)-1)
-#define	NULLAGINO	((xfs_agino_t)-1)
-
 struct xfs_mount;
 
 #define	XFS_INO_MASK(k)			(__uint32_t)((1ULL << (k)) - 1)
fs/xfs/xfs_ioctl.c +0 -1
index 91f8ff5..706029f 100644
@@ -19,7 +19,6 @@
 #include "xfs_fs.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"
fs/xfs/xfs_ioctl32.c +0 -1
index a849a54..c79fa5f 100644
@@ -24,7 +24,6 @@
 #include "xfs_fs.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"
fs/xfs/xfs_iomap.c +0 -1
index 47e714a..0a6b7ff 100644
@@ -19,7 +19,6 @@
 #include "xfs_fs.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"
fs/xfs/xfs_iops.c +0 -1
index efdc461..e6d6a32 100644
@@ -20,7 +20,6 @@
 #include "xfs_acl.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"
fs/xfs/xfs_log.c +0 -1
index 5e2aa52..dec1458 100644
@@ -20,7 +20,6 @@
 #include "xfs_types.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"
fs/xfs/xfs_log_cil.c +0 -1
index 566a2d5..2a4540c 100644
@@ -20,7 +20,6 @@
 #include "xfs_types.h"
 #include "xfs_bit.h"
 #include "xfs_log.h"
-#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_trans_priv.h"
 #include "xfs_log_priv.h"
fs/xfs/xfs_message.c +0 -1
index bd672de..331cd9f 100644
@@ -19,7 +19,6 @@
 #include "xfs_fs.h"
 #include "xfs_types.h"
 #include "xfs_log.h"
-#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
fs/xfs/xfs_qm.c +0 -1
index 1f26fa8..62ea03f 100644
@@ -19,7 +19,6 @@
 #include "xfs_fs.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"
fs/xfs/xfs_qm_bhv.c +0 -1
index e6986b5..cd70529 100644
@@ -19,7 +19,6 @@
 #include "xfs_fs.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"
fs/xfs/xfs_qm_syscalls.c +0 -1
index c4f396e..858a3b1 100644
@@ -22,7 +22,6 @@
 #include "xfs_fs.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"
fs/xfs/xfs_quotaops.c +0 -1
index 7e76f53..fed504f 100644
@@ -17,7 +17,6 @@
  */
 #include "xfs.h"
 #include "xfs_sb.h"
-#include "xfs_inum.h"
 #include "xfs_log.h"
 #include "xfs_ag.h"
 #include "xfs_mount.h"
fs/xfs/xfs_rename.c +0 -1
index e44ef7e..30ff5f4 100644
@@ -19,7 +19,6 @@
 #include "xfs_fs.h"
 #include "xfs_types.h"
 #include "xfs_log.h"
-#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
fs/xfs/xfs_rtalloc.c +0 -1
index 7434d3f..b6ef74d 100644
@@ -20,7 +20,6 @@
 #include "xfs_types.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"
fs/xfs/xfs_rw.c +0 -1
index 3c2488a..7e3644f 100644
@@ -20,7 +20,6 @@
 #include "xfs_types.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"
fs/xfs/xfs_trace.c +0 -1
index 9010ce8..0115378 100644
@@ -20,7 +20,6 @@
 #include "xfs_types.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"
fs/xfs/xfs_trans.c +0 -1
index 103b00c..d7acb7b 100644
@@ -21,7 +21,6 @@
 #include "xfs_types.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"
fs/xfs/xfs_trans_ail.c +0 -1
index cd2fde7..01264b2 100644
@@ -20,7 +20,6 @@
 #include "xfs_fs.h"
 #include "xfs_types.h"
 #include "xfs_log.h"
-#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
fs/xfs/xfs_trans_buf.c +0 -1
index ccc6da1..7d69213 100644
@@ -20,7 +20,6 @@
 #include "xfs_types.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"
fs/xfs/xfs_trans_dquot.c +0 -1
index 2790997..72236b0 100644
@@ -19,7 +19,6 @@
 #include "xfs_fs.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"
fs/xfs/xfs_trans_extfree.c +0 -1
index f7590f5..8d71b16 100644
@@ -19,7 +19,6 @@
 #include "xfs_fs.h"
 #include "xfs_types.h"
 #include "xfs_log.h"
-#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
fs/xfs/xfs_trans_inode.c +0 -1
index 7a7442c..82fd520 100644
@@ -20,7 +20,6 @@
 #include "xfs_types.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"
fs/xfs/xfs_types.h +5 -0
index 65584b5..398cf68 100644
@@ -57,6 +57,7 @@ typedef __uint64_t __psunsigned_t;
 #endif	/* __KERNEL__ */
 
 typedef __uint32_t	xfs_agblock_t;	/* blockno in alloc. group */
+typedef	__uint32_t	xfs_agino_t;	/* inode # within allocation grp */
 typedef	__uint32_t	xfs_extlen_t;	/* extent length in blocks */
 typedef	__uint32_t	xfs_agnumber_t;	/* allocation group number */
 typedef __int32_t	xfs_extnum_t;	/* # of extents in a file */
@@ -101,6 +102,7 @@ typedef __uint64_t	xfs_fileoff_t;	/* block number in a file */
 typedef __int64_t	xfs_sfiloff_t;	/* signed block number in a file */
 typedef __uint64_t	xfs_filblks_t;	/* number of blocks in a file */
 
+
 /*
  * Null values for the types.
  */
@@ -120,6 +122,9 @@ typedef __uint64_t	xfs_filblks_t;	/* number of blocks in a file */
 
 #define NULLCOMMITLSN	((xfs_lsn_t)-1)
 
+#define	NULLFSINO	((xfs_ino_t)-1)
+#define	NULLAGINO	((xfs_agino_t)-1)
+
 /*
  * Max values for extlen, extnum, aextnum.
  */
fs/xfs/xfs_utils.c +0 -1
index 79c05ac..0732231 100644
@@ -20,7 +20,6 @@
 #include "xfs_types.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"
fs/xfs/xfs_vnodeops.c +0 -1
index 9b6c94e..9e82669 100644
@@ -21,7 +21,6 @@
 #include "xfs_types.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"
Signature · 6 lines
1.7.9.5

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#2 lore raw

PATCH 2/7 xfs: move busy extent handling to it's own file

In reply to Dave Chinner

From: Dave Chinner <[email protected]>

To make it easier to handle userspace code merges, move all the busy extent handling out of the allocation code and into it's own file. The userspace code does not need the busy extent code, so this simplifies the merging of the kernel code into the userspace xfsprogs library.

Because the busy extent code has been almost completely rewritten over the past couple of years, also update the copyright on this new file to include the authors that made all those changes.

---
 fs/xfs/Makefile          |    1 +
 fs/xfs/xfs_ag.h          |   18 --
 fs/xfs/xfs_alloc.c       |  572 +------------------------------------------
 fs/xfs/xfs_alloc.h       |   28 ---
 fs/xfs/xfs_alloc_btree.c |    1 +
 fs/xfs/xfs_discard.c     |    1 +
 fs/xfs/xfs_extent_busy.c |  603 ++++++++++++++++++++++++++++++++++++++++++++++
 fs/xfs/xfs_log_cil.c     |    1 +
 fs/xfs/xfs_trans.c       |    1 +
 9 files changed, 609 insertions(+), 617 deletions(-)
 create mode 100644 fs/xfs/xfs_extent_busy.c
fs/xfs/Makefile +1 -0
index 0a99779..ca9229f 100644
@@ -33,6 +33,7 @@ xfs-y				+= xfs_aops.o \
 				   xfs_discard.o \
 				   xfs_error.o \
 				   xfs_export.o \
+				   xfs_extent_busy.o \
 				   xfs_file.o \
 				   xfs_filestream.o \
 				   xfs_fsops.o \
fs/xfs/xfs_ag.h +0 -18
index 4805f00..44d65c1 100644
@@ -175,24 +175,6 @@ typedef struct xfs_agfl {
 } xfs_agfl_t;
 
 /*
- * Busy block/extent entry.  Indexed by a rbtree in perag to mark blocks that
- * have been freed but whose transactions aren't committed to disk yet.
- *
- * Note that we use the transaction ID to record the transaction, not the
- * transaction structure itself. See xfs_alloc_busy_insert() for details.
- */
-struct xfs_busy_extent {
-	struct rb_node	rb_node;	/* ag by-bno indexed search tree */
-	struct list_head list;		/* transaction busy extent list */
-	xfs_agnumber_t	agno;
-	xfs_agblock_t	bno;
-	xfs_extlen_t	length;
-	unsigned int	flags;
-#define XFS_ALLOC_BUSY_DISCARDED	0x01	/* undergoing a discard op. */
-#define XFS_ALLOC_BUSY_SKIP_DISCARD	0x02	/* do not discard */
-};
-
-/*
  * Per-ag incore structure, copies of information in agf and agi,
  * to improve the performance of allocation group selection.
  */
fs/xfs/xfs_alloc.c +1 -571

581 lines not on this page · raw message

fs/xfs/xfs_alloc.h +0 -28
index 3a7e7d8..93be4a6 100644
@@ -23,7 +23,6 @@ struct xfs_btree_cur;
 struct xfs_mount;
 struct xfs_perag;
 struct xfs_trans;
-struct xfs_busy_extent;
 
 extern struct workqueue_struct *xfs_alloc_wq;
 
@@ -139,33 +138,6 @@ xfs_extlen_t
 xfs_alloc_longest_free_extent(struct xfs_mount *mp,
 		struct xfs_perag *pag);
 
-#ifdef __KERNEL__
-void
-xfs_alloc_busy_insert(struct xfs_trans *tp, xfs_agnumber_t agno,
-	xfs_agblock_t bno, xfs_extlen_t len, unsigned int flags);
-
-void
-xfs_alloc_busy_clear(struct xfs_mount *mp, struct list_head *list,
-	bool do_discard);
-
-int
-xfs_alloc_busy_search(struct xfs_mount *mp, xfs_agnumber_t agno,
-	xfs_agblock_t bno, xfs_extlen_t len);
-
-void
-xfs_alloc_busy_reuse(struct xfs_mount *mp, xfs_agnumber_t agno,
-	xfs_agblock_t fbno, xfs_extlen_t flen, bool userdata);
-
-int
-xfs_busy_extent_ag_cmp(void *priv, struct list_head *a, struct list_head *b);
-
-static inline void xfs_alloc_busy_sort(struct list_head *list)
-{
-	list_sort(NULL, list, xfs_busy_extent_ag_cmp);
-}
-
-#endif	/* __KERNEL__ */
-
 /*
  * Compute and fill in value of m_ag_maxlevels.
  */
fs/xfs/xfs_alloc_btree.c +1 -0
index e23cc97..3f66548 100644
@@ -31,6 +31,7 @@
 #include "xfs_inode.h"
 #include "xfs_btree.h"
 #include "xfs_alloc.h"
+#include "xfs_extent_busy.h"
 #include "xfs_error.h"
 #include "xfs_trace.h"
 
fs/xfs/xfs_discard.c +1 -0
index bbbabc8..e3f1abe 100644
@@ -29,6 +29,7 @@
 #include "xfs_inode.h"
 #include "xfs_alloc.h"
 #include "xfs_error.h"
+#include "xfs_extent_busy.h"
 #include "xfs_discard.h"
 #include "xfs_trace.h"
 
fs/xfs/xfs_extent_busy.c new file +603 -0

603 lines not on this page · raw message

fs/xfs/xfs_log_cil.c +1 -0
index 2a4540c..4442757 100644
@@ -28,6 +28,7 @@
 #include "xfs_mount.h"
 #include "xfs_error.h"
 #include "xfs_alloc.h"
+#include "xfs_extent_busy.h"
 #include "xfs_discard.h"
 
 /*
fs/xfs/xfs_trans.c +1 -0
index d7acb7b..d8bdb61 100644
@@ -35,6 +35,7 @@
 #include "xfs_btree.h"
 #include "xfs_ialloc.h"
 #include "xfs_alloc.h"
+#include "xfs_extent_busy.h"
 #include "xfs_bmap.h"
 #include "xfs_quota.h"
 #include "xfs_trans_priv.h"
Signature · 6 lines
1.7.9.5

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#3 lore raw

PATCH 3/7 xfs: clean up busy extent naming

In reply to Dave Chinner

From: Dave Chinner <[email protected]>

Now that the busy extent tracking has been moved out of the allocation files, clean up the namespace it uses to "xfs_extent_busy" rather than a mix of "xfs_busy" and "xfs_alloc_busy".

---
 fs/xfs/xfs_alloc.c       |   12 ++++----
 fs/xfs/xfs_alloc_btree.c |    6 ++--
 fs/xfs/xfs_discard.c     |    4 +--
 fs/xfs/xfs_extent_busy.c |   76 +++++++++++++++++++++++-----------------------
 fs/xfs/xfs_log_cil.c     |    6 ++--
 fs/xfs/xfs_trace.h       |   16 +++++-----
 fs/xfs/xfs_trans.c       |    4 +--
 7 files changed, 62 insertions(+), 62 deletions(-)
fs/xfs/xfs_alloc.c +6 -6
index ae6df25..588496d 100644
@@ -47,7 +47,7 @@ STATIC int xfs_alloc_ag_vextent_near(xfs_alloc_arg_t *);
 STATIC int xfs_alloc_ag_vextent_size(xfs_alloc_arg_t *);
 STATIC int xfs_alloc_ag_vextent_small(xfs_alloc_arg_t *,
 		xfs_btree_cur_t *, xfs_agblock_t *, xfs_extlen_t *, int *);
-STATIC void xfs_alloc_busy_trim(struct xfs_alloc_arg *,
+STATIC void xfs_extent_busy_trim(struct xfs_alloc_arg *,
 		xfs_agblock_t, xfs_extlen_t, xfs_agblock_t *, xfs_extlen_t *);
 
 /*
@@ -152,7 +152,7 @@ xfs_alloc_compute_aligned(
 	xfs_extlen_t	len;
 
 	/* Trim busy sections out of found extent */
-	xfs_alloc_busy_trim(args, foundbno, foundlen, &bno, &len);
+	xfs_extent_busy_trim(args, foundbno, foundlen, &bno, &len);
 
 	if (args->alignment > 1 && len >= args->minlen) {
 		xfs_agblock_t	aligned_bno = roundup(bno, args->alignment);
@@ -536,7 +536,7 @@ xfs_alloc_ag_vextent(
 		if (error)
 			return error;
 
-		ASSERT(!xfs_alloc_busy_search(args->mp, args->agno,
+		ASSERT(!xfs_extent_busy_search(args->mp, args->agno,
 					      args->agbno, args->len));
 	}
 
@@ -603,7 +603,7 @@ xfs_alloc_ag_vextent_exact(
 	/*
 	 * Check for overlapping busy extents.
 	 */
-	xfs_alloc_busy_trim(args, fbno, flen, &tbno, &tlen);
+	xfs_extent_busy_trim(args, fbno, flen, &tbno, &tlen);
 
 	/*
 	 * Give up if the start of the extent is busy, or the freespace isn't
@@ -1391,7 +1391,7 @@ xfs_alloc_ag_vextent_small(
 		if (error)
 			goto error0;
 		if (fbno != NULLAGBLOCK) {
-			xfs_alloc_busy_reuse(args->mp, args->agno, fbno, 1,
+			xfs_extent_busy_reuse(args->mp, args->agno, fbno, 1,
 					     args->userdata);
 
 			if (args->userdata) {
@@ -2496,7 +2496,7 @@ xfs_free_extent(
 
 	error = xfs_free_ag_extent(tp, args.agbp, args.agno, args.agbno, len, 0);
 	if (!error)
-		xfs_alloc_busy_insert(tp, args.agno, args.agbno, len, 0);
+		xfs_extent_busy_insert(tp, args.agno, args.agbno, len, 0);
 error0:
 	xfs_perag_put(args.pag);
 	return error;
fs/xfs/xfs_alloc_btree.c +3 -3
index 3f66548..68ebabc 100644
@@ -94,7 +94,7 @@ xfs_allocbt_alloc_block(
 		return 0;
 	}
 
-	xfs_alloc_busy_reuse(cur->bc_mp, cur->bc_private.a.agno, bno, 1, false);
+	xfs_extent_busy_reuse(cur->bc_mp, cur->bc_private.a.agno, bno, 1, false);
 
 	xfs_trans_agbtree_delta(cur->bc_tp, 1);
 	new->s = cpu_to_be32(bno);
@@ -119,8 +119,8 @@ xfs_allocbt_free_block(
 	if (error)
 		return error;
 
-	xfs_alloc_busy_insert(cur->bc_tp, be32_to_cpu(agf->agf_seqno), bno, 1,
-			      XFS_ALLOC_BUSY_SKIP_DISCARD);
+	xfs_extent_busy_insert(cur->bc_tp, be32_to_cpu(agf->agf_seqno), bno, 1,
+			      XFS_EXTENT_BUSY_SKIP_DISCARD);
 	xfs_trans_agbtree_delta(cur->bc_tp, -1);
 	return 0;
 }
fs/xfs/xfs_discard.c +2 -2
index e3f1abe..f9c3fe3 100644
@@ -118,7 +118,7 @@ xfs_trim_extents(
 		 * If any blocks in the range are still busy, skip the
 		 * discard and try again the next time.
 		 */
-		if (xfs_alloc_busy_search(mp, agno, fbno, flen)) {
+		if (xfs_extent_busy_search(mp, agno, fbno, flen)) {
 			trace_xfs_discard_busy(mp, agno, fbno, flen);
 			goto next_extent;
 		}
@@ -212,7 +212,7 @@ xfs_discard_extents(
 	struct xfs_mount	*mp,
 	struct list_head	*list)
 {
-	struct xfs_busy_extent	*busyp;
+	struct xfs_extent_busy	*busyp;
 	int			error = 0;
 
 	list_for_each_entry(busyp, list, list) {
fs/xfs/xfs_extent_busy.c +38 -38

241 lines not on this page · raw message

fs/xfs/xfs_log_cil.c +3 -3
index 4442757..0d42422 100644
@@ -338,8 +338,8 @@ xlog_cil_committed(
 	xfs_trans_committed_bulk(ctx->cil->xc_log->l_ailp, ctx->lv_chain,
 					ctx->start_lsn, abort);
 
-	xfs_alloc_busy_sort(&ctx->busy_extents);
-	xfs_alloc_busy_clear(mp, &ctx->busy_extents,
+	xfs_extent_busy_sort(&ctx->busy_extents);
+	xfs_extent_busy_clear(mp, &ctx->busy_extents,
 			     (mp->m_flags & XFS_MOUNT_DISCARD) && !abort);
 
 	spin_lock(&ctx->cil->xc_cil_lock);
@@ -352,7 +352,7 @@ xlog_cil_committed(
 		ASSERT(mp->m_flags & XFS_MOUNT_DISCARD);
 
 		xfs_discard_extents(mp, &ctx->busy_extents);
-		xfs_alloc_busy_clear(mp, &ctx->busy_extents, false);
+		xfs_extent_busy_clear(mp, &ctx->busy_extents, false);
 	}
 
 	kmem_free(ctx);
fs/xfs/xfs_trace.h +8 -8
index 900764c..febff43 100644
@@ -1142,7 +1142,7 @@ TRACE_EVENT(xfs_bunmap,
 
 );
 
-DECLARE_EVENT_CLASS(xfs_busy_class,
+DECLARE_EVENT_CLASS(xfs_extent_busy_class,
 	TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
 		 xfs_agblock_t agbno, xfs_extlen_t len),
 	TP_ARGS(mp, agno, agbno, len),
@@ -1165,17 +1165,17 @@ DECLARE_EVENT_CLASS(xfs_busy_class,
 		  __entry->len)
 );
 #define DEFINE_BUSY_EVENT(name) \
-DEFINE_EVENT(xfs_busy_class, name, \
+DEFINE_EVENT(xfs_extent_busy_class, name, \
 	TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
 		 xfs_agblock_t agbno, xfs_extlen_t len), \
 	TP_ARGS(mp, agno, agbno, len))
-DEFINE_BUSY_EVENT(xfs_alloc_busy);
-DEFINE_BUSY_EVENT(xfs_alloc_busy_enomem);
-DEFINE_BUSY_EVENT(xfs_alloc_busy_force);
-DEFINE_BUSY_EVENT(xfs_alloc_busy_reuse);
-DEFINE_BUSY_EVENT(xfs_alloc_busy_clear);
+DEFINE_BUSY_EVENT(xfs_extent_busy);
+DEFINE_BUSY_EVENT(xfs_extent_busy_enomem);
+DEFINE_BUSY_EVENT(xfs_extent_busy_force);
+DEFINE_BUSY_EVENT(xfs_extent_busy_reuse);
+DEFINE_BUSY_EVENT(xfs_extent_busy_clear);
 
-TRACE_EVENT(xfs_alloc_busy_trim,
+TRACE_EVENT(xfs_extent_busy_trim,
 	TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
 		 xfs_agblock_t agbno, xfs_extlen_t len,
 		 xfs_agblock_t tbno, xfs_extlen_t tlen),
fs/xfs/xfs_trans.c +2 -2
index d8bdb61..f674855 100644
@@ -608,8 +608,8 @@ STATIC void
 xfs_trans_free(
 	struct xfs_trans	*tp)
 {
-	xfs_alloc_busy_sort(&tp->t_busy);
-	xfs_alloc_busy_clear(tp->t_mountp, &tp->t_busy, false);
+	xfs_extent_busy_sort(&tp->t_busy);
+	xfs_extent_busy_clear(tp->t_mountp, &tp->t_busy, false);
 
 	atomic_dec(&tp->t_mountp->m_active_trans);
 	xfs_trans_free_dqinfo(tp);
Signature · 6 lines
1.7.9.5

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#4 lore raw

PATCH 4/7 xfs: move xfs_fsb_to_db to xfs_bmap.h

In reply to Dave Chinner

From: Dave Chinner <[email protected]>

This is the only remaining useful function in xfs_rw.h, so move it to a header file responsible for block mapping functions that the callers already include. Soon we can get rid of xfs_rw.h.

---
 fs/xfs/xfs_bmap.c |   13 +++++++++++++
 fs/xfs/xfs_bmap.h |    3 +++
 fs/xfs/xfs_rw.h   |   14 --------------
 3 files changed, 16 insertions(+), 14 deletions(-)
fs/xfs/xfs_bmap.c +13 -0
index 85e7e32..1e58bc3 100644
@@ -6157,3 +6157,16 @@ next_block:
 
 	return error;
 }
+
+/*
+ * Convert the given file system block to a disk block.  We have to treat it
+ * differently based on whether the file is a real time file or not, because the
+ * bmap code does.
+ */
+xfs_daddr_t
+xfs_fsb_to_db(struct xfs_inode *ip, xfs_fsblock_t fsb)
+{
+	return (XFS_IS_REALTIME_INODE(ip) ? \
+		 (xfs_daddr_t)XFS_FSB_TO_BB((ip)->i_mount, (fsb)) : \
+		 XFS_FSB_TO_DADDR((ip)->i_mount, (fsb)));
+}
fs/xfs/xfs_bmap.h +3 -0
index 89ee672..803b56d 100644
@@ -211,6 +211,9 @@ int	xfs_bmap_count_blocks(struct xfs_trans *tp, struct xfs_inode *ip,
 		int whichfork, int *count);
 int	xfs_bmap_punch_delalloc_range(struct xfs_inode *ip,
 		xfs_fileoff_t start_fsb, xfs_fileoff_t length);
+
+xfs_daddr_t xfs_fsb_to_db(struct xfs_inode *ip, xfs_fsblock_t fsb);
+
 #endif	/* __KERNEL__ */
 
 #endif	/* __XFS_BMAP_H__ */
fs/xfs/xfs_rw.h +0 -14
index 967b3a4..13f6317 100644
@@ -23,20 +23,6 @@ struct xfs_inode;
 struct xfs_mount;
 
 /*
- * Convert the given file system block to a disk block.
- * We have to treat it differently based on whether the
- * file is a real time file or not, because the bmap code
- * does.
- */
-static inline xfs_daddr_t
-xfs_fsb_to_db(struct xfs_inode *ip, xfs_fsblock_t fsb)
-{
-	return (XFS_IS_REALTIME_INODE(ip) ? \
-		 (xfs_daddr_t)XFS_FSB_TO_BB((ip)->i_mount, (fsb)) : \
-		 XFS_FSB_TO_DADDR((ip)->i_mount, (fsb)));
-}
-
-/*
  * Prototypes for functions in xfs_rw.c.
  */
 extern xfs_extlen_t xfs_get_extsz_hint(struct xfs_inode *ip);
Signature · 6 lines
1.7.9.5

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#5 lore raw

PATCH 5/7 xfs: move xfs_get_extsz_hint() and kill xfs_rw.h

In reply to Dave Chinner

From: Dave Chinner <[email protected]>

The only thing left in xfs_rw.h is a function prototype for an inode function. Move that to xfs_inode.h, and kill xfs_rw.h.

Also move the function implementing the prototype from xfs_rw.c to xfs_inode.c so we only have one function left in xfs_rw.c

---
 fs/xfs/xfs_aops.c        |    1 -
 fs/xfs/xfs_attr.c        |    1 -
 fs/xfs/xfs_bmap.c        |    1 -
 fs/xfs/xfs_fsops.c       |    1 -
 fs/xfs/xfs_inode.c       |   14 ++++++++++++++
 fs/xfs/xfs_inode.h       |    2 ++
 fs/xfs/xfs_iomap.c       |    1 -
 fs/xfs/xfs_iops.c        |    1 -
 fs/xfs/xfs_log.c         |    1 -
 fs/xfs/xfs_log_recover.c |    1 -
 fs/xfs/xfs_mount.c       |    1 -
 fs/xfs/xfs_rtalloc.c     |    1 -
 fs/xfs/xfs_rw.c          |   15 ---------------
 fs/xfs/xfs_rw.h          |   30 ------------------------------
 fs/xfs/xfs_trans_buf.c   |    1 -
 15 files changed, 16 insertions(+), 56 deletions(-)
 delete mode 100644 fs/xfs/xfs_rw.h
fs/xfs/xfs_aops.c +0 -1
index 1194bdc..5584c5c 100644
@@ -28,7 +28,6 @@
 #include "xfs_inode_item.h"
 #include "xfs_alloc.h"
 #include "xfs_error.h"
-#include "xfs_rw.h"
 #include "xfs_iomap.h"
 #include "xfs_vnodeops.h"
 #include "xfs_trace.h"
fs/xfs/xfs_attr.c +0 -1
index 561fd60..a17ff01 100644
@@ -38,7 +38,6 @@
 #include "xfs_error.h"
 #include "xfs_quota.h"
 #include "xfs_trans_space.h"
-#include "xfs_rw.h"
 #include "xfs_vnodeops.h"
 #include "xfs_trace.h"
 
fs/xfs/xfs_bmap.c +0 -1
index 1e58bc3..26ab256 100644
@@ -41,7 +41,6 @@
 #include "xfs_rtalloc.h"
 #include "xfs_error.h"
 #include "xfs_attr_leaf.h"
-#include "xfs_rw.h"
 #include "xfs_quota.h"
 #include "xfs_trans_space.h"
 #include "xfs_buf_item.h"
fs/xfs/xfs_fsops.c +0 -1
index 2635e17..f6c7698 100644
@@ -38,7 +38,6 @@
 #include "xfs_itable.h"
 #include "xfs_trans_space.h"
 #include "xfs_rtalloc.h"
-#include "xfs_rw.h"
 #include "xfs_filestream.h"
 #include "xfs_trace.h"
 
fs/xfs/xfs_inode.c +14 -0
index f64b482..c6fb5f0 100644
@@ -61,6 +61,20 @@ STATIC int xfs_iformat_local(xfs_inode_t *, xfs_dinode_t *, int, int);
 STATIC int xfs_iformat_extents(xfs_inode_t *, xfs_dinode_t *, int);
 STATIC int xfs_iformat_btree(xfs_inode_t *, xfs_dinode_t *, int);
 
+/*
+ * helper function to extract extent size hint from inode
+ */
+xfs_extlen_t
+xfs_get_extsz_hint(
+	struct xfs_inode	*ip)
+{
+	if ((ip->i_d.di_flags & XFS_DIFLAG_EXTSIZE) && ip->i_d.di_extsize)
+		return ip->i_d.di_extsize;
+	if (XFS_IS_REALTIME_INODE(ip))
+		return ip->i_mount->m_sb.sb_rextsize;
+	return 0;
+}
+
 #ifdef DEBUG
 /*
  * Make sure that the extents in the given memory buffer
fs/xfs/xfs_inode.h +2 -0
index f0e252f..1efff36 100644
@@ -533,6 +533,8 @@ int		xfs_iflush(struct xfs_inode *, struct xfs_buf **);
 void		xfs_lock_inodes(xfs_inode_t **, int, uint);
 void		xfs_lock_two_inodes(xfs_inode_t *, xfs_inode_t *, uint);
 
+xfs_extlen_t	xfs_get_extsz_hint(struct xfs_inode *ip);
+
 #define IHOLD(ip) \
 do { \
 	ASSERT(atomic_read(&VFS_I(ip)->i_count) > 0) ; \
fs/xfs/xfs_iomap.c +0 -1
index 0a6b7ff..845cea0 100644
@@ -36,7 +36,6 @@
 #include "xfs_rtalloc.h"
 #include "xfs_error.h"
 #include "xfs_itable.h"
-#include "xfs_rw.h"
 #include "xfs_attr.h"
 #include "xfs_buf_item.h"
 #include "xfs_trans_space.h"
fs/xfs/xfs_iops.c +0 -1
index e6d6a32..e7a6660 100644
@@ -33,7 +33,6 @@
 #include "xfs_rtalloc.h"
 #include "xfs_error.h"
 #include "xfs_itable.h"
-#include "xfs_rw.h"
 #include "xfs_attr.h"
 #include "xfs_buf_item.h"
 #include "xfs_utils.h"
fs/xfs/xfs_log.c +0 -1
index dec1458..97e489b 100644
@@ -34,7 +34,6 @@
 #include "xfs_trans_priv.h"
 #include "xfs_dinode.h"
 #include "xfs_inode.h"
-#include "xfs_rw.h"
 #include "xfs_trace.h"
 
 kmem_zone_t	*xfs_log_ticket_zone;
fs/xfs/xfs_log_recover.c +0 -1
index b700ced..574e2e9 100644
@@ -40,7 +40,6 @@
 #include "xfs_extfree_item.h"
 #include "xfs_trans_priv.h"
 #include "xfs_quota.h"
-#include "xfs_rw.h"
 #include "xfs_utils.h"
 #include "xfs_trace.h"
 
fs/xfs/xfs_mount.c +0 -1
index 89be5ff..f511d22 100644
@@ -38,7 +38,6 @@
 #include "xfs_rtalloc.h"
 #include "xfs_bmap.h"
 #include "xfs_error.h"
-#include "xfs_rw.h"
 #include "xfs_quota.h"
 #include "xfs_fsops.h"
 #include "xfs_utils.h"
fs/xfs/xfs_rtalloc.c +0 -1
index b6ef74d..92d4331 100644
@@ -33,7 +33,6 @@
 #include "xfs_rtalloc.h"
 #include "xfs_fsops.h"
 #include "xfs_error.h"
-#include "xfs_rw.h"
 #include "xfs_inode_item.h"
 #include "xfs_trans_space.h"
 #include "xfs_utils.h"
fs/xfs/xfs_rw.c +0 -15
index 7e3644f..c406cb6 100644
@@ -28,7 +28,6 @@
 #include "xfs_dinode.h"
 #include "xfs_inode.h"
 #include "xfs_error.h"
-#include "xfs_rw.h"
 
 /*
  * Force a shutdown of the filesystem instantly while keeping
@@ -89,17 +88,3 @@ xfs_do_force_shutdown(
 	"Please umount the filesystem and rectify the problem(s)");
 	}
 }
-
-/*
- * helper function to extract extent size hint from inode
- */
-xfs_extlen_t
-xfs_get_extsz_hint(
-	struct xfs_inode	*ip)
-{
-	if ((ip->i_d.di_flags & XFS_DIFLAG_EXTSIZE) && ip->i_d.di_extsize)
-		return ip->i_d.di_extsize;
-	if (XFS_IS_REALTIME_INODE(ip))
-		return ip->i_mount->m_sb.sb_rextsize;
-	return 0;
-}
fs/xfs/xfs_rw.h deleted +0 -30
deleted file mode 100644
index 13f6317..0000000
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2000-2006 Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write the Free Software Foundation,
- * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-#ifndef	__XFS_RW_H__
-#define	__XFS_RW_H__
-
-struct xfs_buf;
-struct xfs_inode;
-struct xfs_mount;
-
-/*
- * Prototypes for functions in xfs_rw.c.
- */
-extern xfs_extlen_t xfs_get_extsz_hint(struct xfs_inode *ip);
-
-#endif /* __XFS_RW_H__ */
fs/xfs/xfs_trans_buf.c +0 -1
index 7d69213..743d7a5 100644
@@ -32,7 +32,6 @@
 #include "xfs_buf_item.h"
 #include "xfs_trans_priv.h"
 #include "xfs_error.h"
-#include "xfs_rw.h"
 #include "xfs_trace.h"
 
 /*
Signature · 6 lines
1.7.9.5

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#6 lore raw

PATCH 6/7 xfs: move xfs_do_force_shutdown() and kill xfs_rw.c

In reply to Dave Chinner

From: Dave Chinner <[email protected]>

xfs-do-force_shutdown now is the only thing in xfs_rw.c. There is no need to keep it in it's own file anymore, so move it to xfs_fsops.c next to xfs_fs_goingdown() and kill xfs_rw.c.

---
 fs/xfs/Makefile    |    1 -
 fs/xfs/xfs_fsops.c |   60 +++++++++++++++++++++++++++++++++++
 fs/xfs/xfs_rw.c    |   90 ----------------------------------------------------
 3 files changed, 60 insertions(+), 91 deletions(-)
 delete mode 100644 fs/xfs/xfs_rw.c
fs/xfs/Makefile +0 -1
index ca9229f..d2bf974 100644
@@ -50,7 +50,6 @@ xfs-y				+= xfs_aops.o \
 				   xfs_sync.o \
 				   xfs_xattr.o \
 				   xfs_rename.o \
-				   xfs_rw.o \
 				   xfs_utils.o \
 				   xfs_vnodeops.o \
 				   kmem.o \
fs/xfs/xfs_fsops.c +60 -0

63 lines not on this page · raw message

fs/xfs/xfs_rw.c deleted +0 -90

90 lines not on this page · raw message

Signature · 6 lines
1.7.9.5

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#7 lore raw

PATCH 7/7 xfs: clean up xfs_bit.h includes

In reply to Dave Chinner

From: Dave Chinner <[email protected]>

With the removal of xfs_rw.h and other changes over time, xfs_bit.h is being included in many files that don't actually need it. Clean up the includes as necessary.

Also move the only-used-once xfs_ialloc_find_free() static inline function out of a header file that is widely included to reduce the number of needless dependencies on xfs_bit.h.

---
 fs/xfs/xfs_alloc_btree.c |    1 -
 fs/xfs/xfs_aops.c        |    1 -
 fs/xfs/xfs_dfrag.c       |    1 -
 fs/xfs/xfs_dir2.c        |    1 -
 fs/xfs/xfs_dquot_item.c  |    1 -
 fs/xfs/xfs_file.c        |    1 -
 fs/xfs/xfs_fsops.c       |    1 -
 fs/xfs/xfs_ialloc.c      |    7 +++++++
 fs/xfs/xfs_ialloc.h      |    9 ---------
 fs/xfs/xfs_iget.c        |    1 -
 fs/xfs/xfs_inode.c       |    1 -
 fs/xfs/xfs_inode_item.c  |    1 -
 fs/xfs/xfs_ioctl.c       |    1 -
 fs/xfs/xfs_ioctl32.c     |    1 -
 fs/xfs/xfs_iomap.c       |    1 -
 fs/xfs/xfs_iops.c        |    1 -
 fs/xfs/xfs_itable.c      |    1 -
 fs/xfs/xfs_log.c         |    1 -
 fs/xfs/xfs_log_cil.c     |    1 -
 fs/xfs/xfs_qm_bhv.c      |    1 -
 fs/xfs/xfs_super.c       |    1 -
 fs/xfs/xfs_sync.c        |    1 -
 fs/xfs/xfs_trace.c       |    1 -
 fs/xfs/xfs_trans.c       |    1 -
 fs/xfs/xfs_trans_buf.c   |    1 -
 fs/xfs/xfs_trans_dquot.c |    1 -
 fs/xfs/xfs_trans_inode.c |    1 -
 fs/xfs/xfs_utils.c       |    1 -
 28 files changed, 7 insertions(+), 35 deletions(-)
fs/xfs/xfs_alloc_btree.c +0 -1
index 68ebabc..f1647ca 100644
@@ -18,7 +18,6 @@
 #include "xfs.h"
 #include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_bit.h"
 #include "xfs_log.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
fs/xfs/xfs_aops.c +0 -1
index 5584c5c..91e3ed8 100644
@@ -16,7 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 #include "xfs.h"
-#include "xfs_bit.h"
 #include "xfs_log.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
fs/xfs/xfs_dfrag.c +0 -1
index f39205f..e00de08 100644
@@ -18,7 +18,6 @@
 #include "xfs.h"
 #include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_bit.h"
 #include "xfs_log.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
fs/xfs/xfs_dir2.c +0 -1
index a2e2701..67a250c 100644
@@ -18,7 +18,6 @@
 #include "xfs.h"
 #include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_bit.h"
 #include "xfs_log.h"
 #include "xfs_inum.h"
 #include "xfs_trans.h"
fs/xfs/xfs_dquot_item.c +0 -1
index 9610e52..57aa4b0 100644
@@ -17,7 +17,6 @@
  */
 #include "xfs.h"
 #include "xfs_fs.h"
-#include "xfs_bit.h"
 #include "xfs_log.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
fs/xfs/xfs_file.c +0 -1
index 762ce4e..42b522f 100644
@@ -17,7 +17,6 @@
  */
 #include "xfs.h"
 #include "xfs_fs.h"
-#include "xfs_bit.h"
 #include "xfs_log.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
fs/xfs/xfs_fsops.c +0 -1
index 537c2ae..75593d9 100644
@@ -18,7 +18,6 @@
 #include "xfs.h"
 #include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_bit.h"
 #include "xfs_log.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
fs/xfs/xfs_ialloc.c +7 -0
index d094a23..177a21a 100644
@@ -609,6 +609,13 @@ xfs_ialloc_get_rec(
 /*
  * Visible inode allocation functions.
  */
+/*
+ * Find a free (set) bit in the inode bitmask.
+ */
+static inline int xfs_ialloc_find_free(xfs_inofree_t *fp)
+{
+	return xfs_lowbit64(*fp);
+}
 
 /*
  * Allocate an inode on disk.
fs/xfs/xfs_ialloc.h +0 -9
index 666a037..65ac57c 100644
@@ -47,15 +47,6 @@ xfs_make_iptr(struct xfs_mount *mp, struct xfs_buf *b, int o)
 }
 
 /*
- * Find a free (set) bit in the inode bitmask.
- */
-static inline int xfs_ialloc_find_free(xfs_inofree_t *fp)
-{
-	return xfs_lowbit64(*fp);
-}
-
-
-/*
  * Allocate an inode on disk.
  * Mode is used to tell whether the new inode will need space, and whether
  * it is a directory.
fs/xfs/xfs_iget.c +0 -1
index ab89ca7..7f81397 100644
@@ -19,7 +19,6 @@
 #include "xfs_fs.h"
 #include "xfs_types.h"
 #include "xfs_acl.h"
-#include "xfs_bit.h"
 #include "xfs_log.h"
 #include "xfs_inum.h"
 #include "xfs_trans.h"
fs/xfs/xfs_inode.c +0 -1
index c6fb5f0..72ec1a4 100644
@@ -20,7 +20,6 @@
 #include "xfs.h"
 #include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_bit.h"
 #include "xfs_log.h"
 #include "xfs_inum.h"
 #include "xfs_trans.h"
fs/xfs/xfs_inode_item.c +0 -1
index a8d5fdd..6cdbf90 100644
@@ -18,7 +18,6 @@
 #include "xfs.h"
 #include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_bit.h"
 #include "xfs_log.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
fs/xfs/xfs_ioctl.c +0 -1
index 706029f..3a05a41 100644
@@ -17,7 +17,6 @@
  */
 #include "xfs.h"
 #include "xfs_fs.h"
-#include "xfs_bit.h"
 #include "xfs_log.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
fs/xfs/xfs_ioctl32.c +0 -1
index c79fa5f..c4f2da0 100644
@@ -22,7 +22,6 @@
 #include <asm/uaccess.h>
 #include "xfs.h"
 #include "xfs_fs.h"
-#include "xfs_bit.h"
 #include "xfs_log.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
fs/xfs/xfs_iomap.c +0 -1
index 845cea0..361f279 100644
@@ -17,7 +17,6 @@
  */
 #include "xfs.h"
 #include "xfs_fs.h"
-#include "xfs_bit.h"
 #include "xfs_log.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
fs/xfs/xfs_iops.c +0 -1
index e7a6660..1a25fd8 100644
@@ -18,7 +18,6 @@
 #include "xfs.h"
 #include "xfs_fs.h"
 #include "xfs_acl.h"
-#include "xfs_bit.h"
 #include "xfs_log.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
fs/xfs/xfs_itable.c +0 -1
index acc2bf2..eff577a 100644
@@ -18,7 +18,6 @@
 #include "xfs.h"
 #include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_bit.h"
 #include "xfs_log.h"
 #include "xfs_inum.h"
 #include "xfs_trans.h"
fs/xfs/xfs_log.c +0 -1
index 97e489b..9b10a15 100644
@@ -18,7 +18,6 @@
 #include "xfs.h"
 #include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_bit.h"
 #include "xfs_log.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
fs/xfs/xfs_log_cil.c +0 -1
index 0d42422..a07943b 100644
@@ -18,7 +18,6 @@
 #include "xfs.h"
 #include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_bit.h"
 #include "xfs_log.h"
 #include "xfs_trans.h"
 #include "xfs_trans_priv.h"
fs/xfs/xfs_qm_bhv.c +0 -1
index cd70529..6b39115 100644
@@ -17,7 +17,6 @@
  */
 #include "xfs.h"
 #include "xfs_fs.h"
-#include "xfs_bit.h"
 #include "xfs_log.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
fs/xfs/xfs_super.c +0 -1
index 9ec7626b..6df97d2 100644
@@ -17,7 +17,6 @@
  */
 
 #include "xfs.h"
-#include "xfs_bit.h"
 #include "xfs_log.h"
 #include "xfs_inum.h"
 #include "xfs_trans.h"
fs/xfs/xfs_sync.c +0 -1
index f7f019f..67434e1 100644
@@ -18,7 +18,6 @@
 #include "xfs.h"
 #include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_bit.h"
 #include "xfs_log.h"
 #include "xfs_inum.h"
 #include "xfs_trans.h"
fs/xfs/xfs_trace.c +0 -1
index 0115378..624bedd 100644
@@ -18,7 +18,6 @@
 #include "xfs.h"
 #include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_bit.h"
 #include "xfs_log.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
fs/xfs/xfs_trans.c +0 -1
index f674855..cdf896f 100644
@@ -19,7 +19,6 @@
 #include "xfs.h"
 #include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_bit.h"
 #include "xfs_log.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
fs/xfs/xfs_trans_buf.c +0 -1
index 743d7a5..d250afa 100644
@@ -18,7 +18,6 @@
 #include "xfs.h"
 #include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_bit.h"
 #include "xfs_log.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
fs/xfs/xfs_trans_dquot.c +0 -1
index 72236b0..bcb6054 100644
@@ -17,7 +17,6 @@
  */
 #include "xfs.h"
 #include "xfs_fs.h"
-#include "xfs_bit.h"
 #include "xfs_log.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
fs/xfs/xfs_trans_inode.c +0 -1
index 82fd520..d2eee20 100644
@@ -18,7 +18,6 @@
 #include "xfs.h"
 #include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_bit.h"
 #include "xfs_log.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
fs/xfs/xfs_utils.c +0 -1
index 0732231..4e5b9ad 100644
@@ -18,7 +18,6 @@
 #include "xfs.h"
 #include "xfs_fs.h"
 #include "xfs_types.h"
-#include "xfs_bit.h"
 #include "xfs_log.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
Signature · 6 lines
1.7.9.5

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs