public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 25/26] kill xfs_bmbt_log_block
@ 2008-08-04  1:36 Christoph Hellwig
  2008-08-05  1:43 ` Dave Chinner
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig @ 2008-08-04  1:36 UTC (permalink / raw)
  To: xfs

[-- Attachment #1: xfs-kill-xfs_bmbt_log_block --]
[-- Type: text/plain, Size: 4158 bytes --]

Only one caller left, which can just use xfs_btree_log_block if we export it.


Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c
===================================================================
--- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c	2008-08-04 01:20:43.000000000 +0200
+++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c	2008-08-04 01:21:46.000000000 +0200
@@ -44,34 +44,6 @@
 #include "xfs_error.h"
 #include "xfs_quota.h"
 
-#undef EXIT
-
-#define ENTRY	XBT_ENTRY
-#define ERROR	XBT_ERROR
-#define EXIT	XBT_EXIT
-
-/*
- * Keep the XFS_BMBT_TRACE_ names around for now until all code using them
- * is converted to be generic and thus switches to the XFS_BTREE_TRACE_ names.
- */
-#define	XFS_BMBT_TRACE_ARGBI(c,b,i) \
-	XFS_BTREE_TRACE_ARGBI(c,b,i)
-#define	XFS_BMBT_TRACE_ARGBII(c,b,i,j) \
-	XFS_BTREE_TRACE_ARGBII(c,b,i,j)
-#define	XFS_BMBT_TRACE_ARGFFFI(c,o,b,i,j) \
-	XFS_BTREE_TRACE_ARGFFFI(c,o,b,i,j)
-#define	XFS_BMBT_TRACE_ARGI(c,i) \
-	XFS_BTREE_TRACE_ARGI(c,i)
-#define	XFS_BMBT_TRACE_ARGIFK(c,i,f,s) \
-	XFS_BTREE_TRACE_ARGIPK(c,i,(union xfs_btree_ptr)f,s)
-#define	XFS_BMBT_TRACE_ARGIFR(c,i,f,r) \
-	XFS_BTREE_TRACE_ARGIPR(c,i, \
-		(union xfs_btree_ptr)f, (union xfs_btree_rec *)r)
-#define	XFS_BMBT_TRACE_ARGIK(c,i,k) \
-	XFS_BTREE_TRACE_ARGIK(c,i,(union xfs_btree_key *)k)
-#define	XFS_BMBT_TRACE_CURSOR(c,s) \
-	XFS_BTREE_TRACE_CURSOR(c,s)
-
 
 /*
  * Determine the extent state.
@@ -261,40 +233,6 @@ xfs_bmbt_disk_get_startoff(
 }
 
 /*
- * Log fields from the btree block header.
- */
-void
-xfs_bmbt_log_block(
-	xfs_btree_cur_t		*cur,
-	xfs_buf_t		*bp,
-	int			fields)
-{
-	int			first;
-	int			last;
-	xfs_trans_t		*tp;
-	static const short	offsets[] = {
-		offsetof(xfs_bmbt_block_t, bb_magic),
-		offsetof(xfs_bmbt_block_t, bb_level),
-		offsetof(xfs_bmbt_block_t, bb_numrecs),
-		offsetof(xfs_bmbt_block_t, bb_leftsib),
-		offsetof(xfs_bmbt_block_t, bb_rightsib),
-		sizeof(xfs_bmbt_block_t)
-	};
-
-	XFS_BMBT_TRACE_CURSOR(cur, ENTRY);
-	XFS_BMBT_TRACE_ARGBI(cur, bp, fields);
-	tp = cur->bc_tp;
-	if (bp) {
-		xfs_btree_offsets(fields, offsets, XFS_BB_NUM_BITS, &first,
-				  &last);
-		xfs_trans_log_buf(tp, bp, first, last);
-	} else
-		xfs_trans_log_inode(tp, cur->bc_private.b.ip,
-			XFS_ILOG_FBROOT(cur->bc_private.b.whichfork));
-	XFS_BMBT_TRACE_CURSOR(cur, EXIT);
-}
-
-/*
  * Set all the fields in a bmap extent record from the arguments.
  */
 void
Index: linux-2.6-xfs/fs/xfs/xfs_btree.c
===================================================================
--- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c	2008-08-04 01:20:43.000000000 +0200
+++ linux-2.6-xfs/fs/xfs/xfs_btree.c	2008-08-04 01:21:46.000000000 +0200
@@ -1139,7 +1139,7 @@ xfs_btree_log_ptrs(
 /*
  * Log fields from the short from btree block header.
  */
-STATIC void
+void
 xfs_btree_log_block(
 	struct xfs_btree_cur	*cur,	/* btree cursor */
 	struct xfs_buf		*bp,	/* buffer containing btree block */
Index: linux-2.6-xfs/fs/xfs/xfs_bmap.c
===================================================================
--- linux-2.6-xfs.orig/fs/xfs/xfs_bmap.c	2008-08-04 01:20:43.000000000 +0200
+++ linux-2.6-xfs/fs/xfs/xfs_bmap.c	2008-08-04 01:21:46.000000000 +0200
@@ -3563,7 +3563,7 @@ xfs_bmap_extents_to_btree(
 	 * Do all this logging at the end so that
 	 * the root is at the right level.
 	 */
-	xfs_bmbt_log_block(cur, abp, XFS_BB_ALL_BITS);
+	xfs_btree_log_block(cur, abp, XFS_BB_ALL_BITS);
 	xfs_bmbt_log_recs(cur, abp, 1, be16_to_cpu(ablock->bb_numrecs));
 	ASSERT(*curp == NULL);
 	*curp = cur;
Index: linux-2.6-xfs/fs/xfs/xfs_btree.h
===================================================================
--- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h	2008-08-04 01:21:53.000000000 +0200
+++ linux-2.6-xfs/fs/xfs/xfs_btree.h	2008-08-04 01:22:37.000000000 +0200
@@ -605,6 +605,11 @@ int xfs_btree_insert(struct xfs_btree_cu
 int xfs_btree_delete(struct xfs_btree_cur *, int *);
 int xfs_btree_getrec(struct xfs_btree_cur *, union xfs_btree_rec **, int *);
 
+/*
+ * Internal btree helpers also used by xfs_bmap.c.
+ */
+void xfs_btree_log_block(struct xfs_btree_cur *, struct xfs_buf *, int);
+
 
 /*
  * Helpers.

-- 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-08-05  1:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-04  1:36 [PATCH 25/26] kill xfs_bmbt_log_block Christoph Hellwig
2008-08-05  1:43 ` Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox