aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/xfs_bmap.c4
-rw-r--r--fs/xfs/xfs_bmap_btree.c88
-rw-r--r--fs/xfs/xfs_bmap_btree.h4
-rw-r--r--fs/xfs/xfs_btree.c4
-rw-r--r--fs/xfs/xfs_btree.h6
5 files changed, 10 insertions, 96 deletions
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index 74761ca2c63d..5cceb8d3c162 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -3563,8 +3563,8 @@ xfs_bmap_extents_to_btree(
3563 * Do all this logging at the end so that 3563 * Do all this logging at the end so that
3564 * the root is at the right level. 3564 * the root is at the right level.
3565 */ 3565 */
3566 xfs_bmbt_log_block(cur, abp, XFS_BB_ALL_BITS); 3566 xfs_btree_log_block(cur, abp, XFS_BB_ALL_BITS);
3567 xfs_bmbt_log_recs(cur, abp, 1, be16_to_cpu(ablock->bb_numrecs)); 3567 xfs_btree_log_recs(cur, abp, 1, be16_to_cpu(ablock->bb_numrecs));
3568 ASSERT(*curp == NULL); 3568 ASSERT(*curp == NULL);
3569 *curp = cur; 3569 *curp = cur;
3570 *logflagsp = XFS_ILOG_CORE | XFS_ILOG_FBROOT(whichfork); 3570 *logflagsp = XFS_ILOG_CORE | XFS_ILOG_FBROOT(whichfork);
diff --git a/fs/xfs/xfs_bmap_btree.c b/fs/xfs/xfs_bmap_btree.c
index 5b8030561d78..7a02d391afec 100644
--- a/fs/xfs/xfs_bmap_btree.c
+++ b/fs/xfs/xfs_bmap_btree.c
@@ -44,33 +44,6 @@
44#include "xfs_error.h" 44#include "xfs_error.h"
45#include "xfs_quota.h" 45#include "xfs_quota.h"
46 46
47#undef EXIT
48
49#define ENTRY XBT_ENTRY
50#define ERROR XBT_ERROR
51#define EXIT XBT_EXIT
52
53/*
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 47
75/* 48/*
76 * Determine the extent state. 49 * Determine the extent state.
@@ -259,67 +232,6 @@ xfs_bmbt_disk_get_startoff(
259 XFS_MASK64LO(64 - BMBT_EXNTFLAG_BITLEN)) >> 9; 232 XFS_MASK64LO(64 - BMBT_EXNTFLAG_BITLEN)) >> 9;
260} 233}
261 234
262/*
263 * Log fields from the btree block header.
264 */
265void
266xfs_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 */
299void
300xfs_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 * Set all the fields in a bmap extent record from the arguments. 237 * Set all the fields in a bmap extent record from the arguments.
diff --git a/fs/xfs/xfs_bmap_btree.h b/fs/xfs/xfs_bmap_btree.h
index 952ab395f79c..6f38e2505701 100644
--- a/fs/xfs/xfs_bmap_btree.h
+++ b/fs/xfs/xfs_bmap_btree.h
@@ -247,10 +247,6 @@ extern void xfs_bmbt_disk_get_all(xfs_bmbt_rec_t *r, xfs_bmbt_irec_t *s);
247extern xfs_filblks_t xfs_bmbt_disk_get_blockcount(xfs_bmbt_rec_t *r); 247extern xfs_filblks_t xfs_bmbt_disk_get_blockcount(xfs_bmbt_rec_t *r);
248extern xfs_fileoff_t xfs_bmbt_disk_get_startoff(xfs_bmbt_rec_t *r); 248extern xfs_fileoff_t xfs_bmbt_disk_get_startoff(xfs_bmbt_rec_t *r);
249 249
250extern void xfs_bmbt_log_block(struct xfs_btree_cur *, struct xfs_buf *, int);
251extern void xfs_bmbt_log_recs(struct xfs_btree_cur *, struct xfs_buf *, int,
252 int);
253
254extern void xfs_bmbt_set_all(xfs_bmbt_rec_host_t *r, xfs_bmbt_irec_t *s); 250extern void xfs_bmbt_set_all(xfs_bmbt_rec_host_t *r, xfs_bmbt_irec_t *s);
255extern void xfs_bmbt_set_allf(xfs_bmbt_rec_host_t *r, xfs_fileoff_t o, 251extern void xfs_bmbt_set_allf(xfs_bmbt_rec_host_t *r, xfs_fileoff_t o,
256 xfs_fsblock_t b, xfs_filblks_t c, xfs_exntst_t v); 252 xfs_fsblock_t b, xfs_filblks_t c, xfs_exntst_t v);
diff --git a/fs/xfs/xfs_btree.c b/fs/xfs/xfs_btree.c
index 8503ed5d10a0..88eb00bdeb96 100644
--- a/fs/xfs/xfs_btree.c
+++ b/fs/xfs/xfs_btree.c
@@ -1309,7 +1309,7 @@ xfs_btree_log_keys(
1309/* 1309/*
1310 * Log record values from the btree block. 1310 * Log record values from the btree block.
1311 */ 1311 */
1312STATIC void 1312void
1313xfs_btree_log_recs( 1313xfs_btree_log_recs(
1314 struct xfs_btree_cur *cur, 1314 struct xfs_btree_cur *cur,
1315 struct xfs_buf *bp, 1315 struct xfs_buf *bp,
@@ -1357,7 +1357,7 @@ xfs_btree_log_ptrs(
1357/* 1357/*
1358 * Log fields from a btree block header. 1358 * Log fields from a btree block header.
1359 */ 1359 */
1360STATIC void 1360void
1361xfs_btree_log_block( 1361xfs_btree_log_block(
1362 struct xfs_btree_cur *cur, /* btree cursor */ 1362 struct xfs_btree_cur *cur, /* btree cursor */
1363 struct xfs_buf *bp, /* buffer containing btree block */ 1363 struct xfs_buf *bp, /* buffer containing btree block */
diff --git a/fs/xfs/xfs_btree.h b/fs/xfs/xfs_btree.h
index cee3684d871e..d6cc71e31de5 100644
--- a/fs/xfs/xfs_btree.h
+++ b/fs/xfs/xfs_btree.h
@@ -570,6 +570,12 @@ int xfs_btree_delete(struct xfs_btree_cur *, int *);
570int xfs_btree_get_rec(struct xfs_btree_cur *, union xfs_btree_rec **, int *); 570int 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 */
575void xfs_btree_log_block(struct xfs_btree_cur *, struct xfs_buf *, int);
576void xfs_btree_log_recs(struct xfs_btree_cur *, struct xfs_buf *, int, int);
577
578/*
573 * Helpers. 579 * Helpers.
574 */ 580 */
575static inline int xfs_btree_get_numrecs(struct xfs_btree_block *block) 581static inline int xfs_btree_get_numrecs(struct xfs_btree_block *block)