Commit fd6bcc5b authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Lachlan McIlroy

[XFS] kill xfs_bmbt_log_block and xfs_bmbt_log_recs

These are equivalent to the xfs_btree_* versions, and the only remaining
caller can be switched to the generic one after they are exported. Also
remove some now dead infrastructure in xfs_bmap_btree.c.

SGI-PV: 985583

SGI-Modid: xfs-linux-melb:xfs-kern:32207a
Signed-off-by: default avatarChristoph Hellwig <hch@infradead.org>
Signed-off-by: default avatarLachlan McIlroy <lachlan@sgi.com>
Signed-off-by: default avatarBill O'Donnell <billodo@sgi.com>
Signed-off-by: default avatarDavid Chinner <david@fromorbit.com>
parent 8cc938fe
...@@ -3563,8 +3563,8 @@ xfs_bmap_extents_to_btree( ...@@ -3563,8 +3563,8 @@ xfs_bmap_extents_to_btree(
* Do all this logging at the end so that * Do all this logging at the end so that
* the root is at the right level. * 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)); xfs_btree_log_recs(cur, abp, 1, be16_to_cpu(ablock->bb_numrecs));
ASSERT(*curp == NULL); ASSERT(*curp == NULL);
*curp = cur; *curp = cur;
*logflagsp = XFS_ILOG_CORE | XFS_ILOG_FBROOT(whichfork); *logflagsp = XFS_ILOG_CORE | XFS_ILOG_FBROOT(whichfork);
......
...@@ -44,33 +44,6 @@ ...@@ -44,33 +44,6 @@
#include "xfs_error.h" #include "xfs_error.h"
#include "xfs_quota.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. * Determine the extent state.
...@@ -259,67 +232,6 @@ xfs_bmbt_disk_get_startoff( ...@@ -259,67 +232,6 @@ xfs_bmbt_disk_get_startoff(
XFS_MASK64LO(64 - BMBT_EXNTFLAG_BITLEN)) >> 9; XFS_MASK64LO(64 - BMBT_EXNTFLAG_BITLEN)) >> 9;
} }
/*
* 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);
}
/*
* Log record values from the btree block.
*/
void
xfs_bmbt_log_recs(
xfs_btree_cur_t *cur,
xfs_buf_t *bp,
int rfirst,
int rlast)
{
xfs_bmbt_block_t *block;
int first;
int last;
xfs_bmbt_rec_t *rp;
xfs_trans_t *tp;
XFS_BMBT_TRACE_CURSOR(cur, ENTRY);
XFS_BMBT_TRACE_ARGBII(cur, bp, rfirst, rlast);
ASSERT(bp);
tp = cur->bc_tp;
block = XFS_BUF_TO_BMBT_BLOCK(bp);
rp = XFS_BMAP_REC_DADDR(block, 1, cur);
first = (int)((xfs_caddr_t)&rp[rfirst - 1] - (xfs_caddr_t)block);
last = (int)(((xfs_caddr_t)&rp[rlast] - 1) - (xfs_caddr_t)block);
xfs_trans_log_buf(tp, bp, first, last);
XFS_BMBT_TRACE_CURSOR(cur, EXIT);
}
/* /*
* Set all the fields in a bmap extent record from the arguments. * Set all the fields in a bmap extent record from the arguments.
......
...@@ -247,10 +247,6 @@ extern void xfs_bmbt_disk_get_all(xfs_bmbt_rec_t *r, xfs_bmbt_irec_t *s); ...@@ -247,10 +247,6 @@ extern void xfs_bmbt_disk_get_all(xfs_bmbt_rec_t *r, xfs_bmbt_irec_t *s);
extern xfs_filblks_t xfs_bmbt_disk_get_blockcount(xfs_bmbt_rec_t *r); extern xfs_filblks_t xfs_bmbt_disk_get_blockcount(xfs_bmbt_rec_t *r);
extern xfs_fileoff_t xfs_bmbt_disk_get_startoff(xfs_bmbt_rec_t *r); extern xfs_fileoff_t xfs_bmbt_disk_get_startoff(xfs_bmbt_rec_t *r);
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 void xfs_bmbt_set_all(xfs_bmbt_rec_host_t *r, xfs_bmbt_irec_t *s); extern void xfs_bmbt_set_all(xfs_bmbt_rec_host_t *r, xfs_bmbt_irec_t *s);
extern void xfs_bmbt_set_allf(xfs_bmbt_rec_host_t *r, xfs_fileoff_t o, extern void xfs_bmbt_set_allf(xfs_bmbt_rec_host_t *r, xfs_fileoff_t o,
xfs_fsblock_t b, xfs_filblks_t c, xfs_exntst_t v); xfs_fsblock_t b, xfs_filblks_t c, xfs_exntst_t v);
......
...@@ -1309,7 +1309,7 @@ xfs_btree_log_keys( ...@@ -1309,7 +1309,7 @@ xfs_btree_log_keys(
/* /*
* Log record values from the btree block. * Log record values from the btree block.
*/ */
STATIC void void
xfs_btree_log_recs( xfs_btree_log_recs(
struct xfs_btree_cur *cur, struct xfs_btree_cur *cur,
struct xfs_buf *bp, struct xfs_buf *bp,
...@@ -1357,7 +1357,7 @@ xfs_btree_log_ptrs( ...@@ -1357,7 +1357,7 @@ xfs_btree_log_ptrs(
/* /*
* Log fields from a btree block header. * Log fields from a btree block header.
*/ */
STATIC void void
xfs_btree_log_block( xfs_btree_log_block(
struct xfs_btree_cur *cur, /* btree cursor */ struct xfs_btree_cur *cur, /* btree cursor */
struct xfs_buf *bp, /* buffer containing btree block */ struct xfs_buf *bp, /* buffer containing btree block */
......
...@@ -569,6 +569,12 @@ int xfs_btree_insert(struct xfs_btree_cur *, int *); ...@@ -569,6 +569,12 @@ int xfs_btree_insert(struct xfs_btree_cur *, int *);
int xfs_btree_delete(struct xfs_btree_cur *, int *); int xfs_btree_delete(struct xfs_btree_cur *, int *);
int xfs_btree_get_rec(struct xfs_btree_cur *, union xfs_btree_rec **, int *); int xfs_btree_get_rec(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);
void xfs_btree_log_recs(struct xfs_btree_cur *, struct xfs_buf *, int, int);
/* /*
* Helpers. * Helpers.
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment