Commit fd6bcc5b63051392ba709a8fd33173b263669e0a

Authored by Christoph Hellwig
Committed by Lachlan McIlroy
1 parent 8cc938fe42

[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: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Signed-off-by: Bill O'Donnell <billodo@sgi.com>
Signed-off-by: David Chinner <david@fromorbit.com>

Showing 5 changed files with 10 additions and 96 deletions Side-by-side Diff

... ... @@ -3563,8 +3563,8 @@
3563 3563 * Do all this logging at the end so that
3564 3564 * the root is at the right level.
3565 3565 */
3566   - xfs_bmbt_log_block(cur, abp, XFS_BB_ALL_BITS);
3567   - xfs_bmbt_log_recs(cur, abp, 1, be16_to_cpu(ablock->bb_numrecs));
  3566 + xfs_btree_log_block(cur, abp, XFS_BB_ALL_BITS);
  3567 + xfs_btree_log_recs(cur, abp, 1, be16_to_cpu(ablock->bb_numrecs));
3568 3568 ASSERT(*curp == NULL);
3569 3569 *curp = cur;
3570 3570 *logflagsp = XFS_ILOG_CORE | XFS_ILOG_FBROOT(whichfork);
fs/xfs/xfs_bmap_btree.c
... ... @@ -44,35 +44,8 @@
44 44 #include "xfs_error.h"
45 45 #include "xfs_quota.h"
46 46  
47   -#undef EXIT
48 47  
49   -#define ENTRY XBT_ENTRY
50   -#define ERROR XBT_ERROR
51   -#define EXIT XBT_EXIT
52   -
53 48 /*
54   - * Keep the XFS_BMBT_TRACE_ names around for now until all code using them
55   - * is converted to be generic and thus switches to the XFS_BTREE_TRACE_ names.
56   - */
57   -#define XFS_BMBT_TRACE_ARGBI(c,b,i) \
58   - XFS_BTREE_TRACE_ARGBI(c,b,i)
59   -#define XFS_BMBT_TRACE_ARGBII(c,b,i,j) \
60   - XFS_BTREE_TRACE_ARGBII(c,b,i,j)
61   -#define XFS_BMBT_TRACE_ARGFFFI(c,o,b,i,j) \
62   - XFS_BTREE_TRACE_ARGFFFI(c,o,b,i,j)
63   -#define XFS_BMBT_TRACE_ARGI(c,i) \
64   - XFS_BTREE_TRACE_ARGI(c,i)
65   -#define XFS_BMBT_TRACE_ARGIFK(c,i,f,s) \
66   - XFS_BTREE_TRACE_ARGIPK(c,i,(union xfs_btree_ptr)f,s)
67   -#define XFS_BMBT_TRACE_ARGIFR(c,i,f,r) \
68   - XFS_BTREE_TRACE_ARGIPR(c,i, \
69   - (union xfs_btree_ptr)f, (union xfs_btree_rec *)r)
70   -#define XFS_BMBT_TRACE_ARGIK(c,i,k) \
71   - XFS_BTREE_TRACE_ARGIK(c,i,(union xfs_btree_key *)k)
72   -#define XFS_BMBT_TRACE_CURSOR(c,s) \
73   - XFS_BTREE_TRACE_CURSOR(c,s)
74   -
75   -/*
76 49 * Determine the extent state.
77 50 */
78 51 /* ARGSUSED */
... ... @@ -259,67 +232,6 @@
259 232 XFS_MASK64LO(64 - BMBT_EXNTFLAG_BITLEN)) >> 9;
260 233 }
261 234  
262   -/*
263   - * Log fields from the btree block header.
264   - */
265   -void
266   -xfs_bmbt_log_block(
267   - xfs_btree_cur_t *cur,
268   - xfs_buf_t *bp,
269   - int fields)
270   -{
271   - int first;
272   - int last;
273   - xfs_trans_t *tp;
274   - static const short offsets[] = {
275   - offsetof(xfs_bmbt_block_t, bb_magic),
276   - offsetof(xfs_bmbt_block_t, bb_level),
277   - offsetof(xfs_bmbt_block_t, bb_numrecs),
278   - offsetof(xfs_bmbt_block_t, bb_leftsib),
279   - offsetof(xfs_bmbt_block_t, bb_rightsib),
280   - sizeof(xfs_bmbt_block_t)
281   - };
282   -
283   - XFS_BMBT_TRACE_CURSOR(cur, ENTRY);
284   - XFS_BMBT_TRACE_ARGBI(cur, bp, fields);
285   - tp = cur->bc_tp;
286   - if (bp) {
287   - xfs_btree_offsets(fields, offsets, XFS_BB_NUM_BITS, &first,
288   - &last);
289   - xfs_trans_log_buf(tp, bp, first, last);
290   - } else
291   - xfs_trans_log_inode(tp, cur->bc_private.b.ip,
292   - XFS_ILOG_FBROOT(cur->bc_private.b.whichfork));
293   - XFS_BMBT_TRACE_CURSOR(cur, EXIT);
294   -}
295   -
296   -/*
297   - * Log record values from the btree block.
298   - */
299   -void
300   -xfs_bmbt_log_recs(
301   - xfs_btree_cur_t *cur,
302   - xfs_buf_t *bp,
303   - int rfirst,
304   - int rlast)
305   -{
306   - xfs_bmbt_block_t *block;
307   - int first;
308   - int last;
309   - xfs_bmbt_rec_t *rp;
310   - xfs_trans_t *tp;
311   -
312   - XFS_BMBT_TRACE_CURSOR(cur, ENTRY);
313   - XFS_BMBT_TRACE_ARGBII(cur, bp, rfirst, rlast);
314   - ASSERT(bp);
315   - tp = cur->bc_tp;
316   - block = XFS_BUF_TO_BMBT_BLOCK(bp);
317   - rp = XFS_BMAP_REC_DADDR(block, 1, cur);
318   - first = (int)((xfs_caddr_t)&rp[rfirst - 1] - (xfs_caddr_t)block);
319   - last = (int)(((xfs_caddr_t)&rp[rlast] - 1) - (xfs_caddr_t)block);
320   - xfs_trans_log_buf(tp, bp, first, last);
321   - XFS_BMBT_TRACE_CURSOR(cur, EXIT);
322   -}
323 235  
324 236 /*
325 237 * Set all the fields in a bmap extent record from the arguments.
fs/xfs/xfs_bmap_btree.h
... ... @@ -247,10 +247,6 @@
247 247 extern xfs_filblks_t xfs_bmbt_disk_get_blockcount(xfs_bmbt_rec_t *r);
248 248 extern xfs_fileoff_t xfs_bmbt_disk_get_startoff(xfs_bmbt_rec_t *r);
249 249  
250   -extern void xfs_bmbt_log_block(struct xfs_btree_cur *, struct xfs_buf *, int);
251   -extern void xfs_bmbt_log_recs(struct xfs_btree_cur *, struct xfs_buf *, int,
252   - int);
253   -
254 250 extern void xfs_bmbt_set_all(xfs_bmbt_rec_host_t *r, xfs_bmbt_irec_t *s);
255 251 extern void xfs_bmbt_set_allf(xfs_bmbt_rec_host_t *r, xfs_fileoff_t o,
256 252 xfs_fsblock_t b, xfs_filblks_t c, xfs_exntst_t v);
... ... @@ -1309,7 +1309,7 @@
1309 1309 /*
1310 1310 * Log record values from the btree block.
1311 1311 */
1312   -STATIC void
  1312 +void
1313 1313 xfs_btree_log_recs(
1314 1314 struct xfs_btree_cur *cur,
1315 1315 struct xfs_buf *bp,
... ... @@ -1357,7 +1357,7 @@
1357 1357 /*
1358 1358 * Log fields from a btree block header.
1359 1359 */
1360   -STATIC void
  1360 +void
1361 1361 xfs_btree_log_block(
1362 1362 struct xfs_btree_cur *cur, /* btree cursor */
1363 1363 struct xfs_buf *bp, /* buffer containing btree block */
... ... @@ -570,6 +570,12 @@
570 570 int xfs_btree_get_rec(struct xfs_btree_cur *, union xfs_btree_rec **, int *);
571 571  
572 572 /*
  573 + * Internal btree helpers also used by xfs_bmap.c.
  574 + */
  575 +void xfs_btree_log_block(struct xfs_btree_cur *, struct xfs_buf *, int);
  576 +void xfs_btree_log_recs(struct xfs_btree_cur *, struct xfs_buf *, int, int);
  577 +
  578 +/*
573 579 * Helpers.
574 580 */
575 581 static inline int xfs_btree_get_numrecs(struct xfs_btree_block *block)