@@ -69,6 +69,7 @@
#define trace_xfs_btree_bload_level_geometry(a,b,c,d,e,f,g) ((void) 0)
#define trace_xfs_btree_bload_block(a,b,c,d,e,f) ((void) 0)
#define trace_xfs_btree_free_block(...) ((void) 0)
+#define trace_xfs_btree_alloc_block(...) ((void) 0)
#define trace_xfs_free_extent(a,b,c,d,e,f,g) ((void) 0)
#define trace_xfs_agf(a,b,c,d) ((void) 0)
@@ -257,8 +258,6 @@
#define trace_xfs_rmap_find_left_neighbor_result(...) ((void) 0)
#define trace_xfs_rmap_lookup_le_range_result(...) ((void) 0)
-#define trace_xfs_rmapbt_alloc_block(...) ((void) 0)
-
#define trace_xfs_ag_resv_critical(...) ((void) 0)
#define trace_xfs_ag_resv_needed(...) ((void) 0)
#define trace_xfs_ag_resv_free(...) ((void) 0)
@@ -276,7 +275,6 @@
#define trace_xfs_refcount_insert_error(...) ((void) 0)
#define trace_xfs_refcount_delete(...) ((void) 0)
#define trace_xfs_refcount_delete_error(...) ((void) 0)
-#define trace_xfs_refcountbt_alloc_block(...) ((void) 0)
#define trace_xfs_refcount_rec_order_error(...) ((void) 0)
#define trace_xfs_refcount_lookup(...) ((void) 0)
@@ -2690,6 +2690,20 @@ xfs_btree_rshift(
return error;
}
+static inline int
+xfs_btree_alloc_block(
+ struct xfs_btree_cur *cur,
+ const union xfs_btree_ptr *hint_block,
+ union xfs_btree_ptr *new_block,
+ int *stat)
+{
+ int error;
+
+ error = cur->bc_ops->alloc_block(cur, hint_block, new_block, stat);
+ trace_xfs_btree_alloc_block(cur, new_block, *stat, error);
+ return error;
+}
+
/*
* Split cur/level block in half.
* Return new block number and the key to its first
@@ -2733,7 +2747,7 @@ __xfs_btree_split(
xfs_btree_buf_to_ptr(cur, lbp, &lptr);
/* Allocate the new block. If we can't do it, we're toast. Give up. */
- error = cur->bc_ops->alloc_block(cur, &lptr, &rptr, stat);
+ error = xfs_btree_alloc_block(cur, &lptr, &rptr, stat);
if (error)
goto error0;
if (*stat == 0)
@@ -3013,7 +3027,7 @@ xfs_btree_new_iroot(
pp = xfs_btree_ptr_addr(cur, 1, block);
/* Allocate the new block. If we can't do it, we're toast. Give up. */
- error = cur->bc_ops->alloc_block(cur, pp, &nptr, stat);
+ error = xfs_btree_alloc_block(cur, pp, &nptr, stat);
if (error)
goto error0;
if (*stat == 0)
@@ -3113,7 +3127,7 @@ xfs_btree_new_root(
cur->bc_ops->init_ptr_from_cur(cur, &rptr);
/* Allocate the new block. If we can't do it, we're toast. Give up. */
- error = cur->bc_ops->alloc_block(cur, &rptr, &lptr, stat);
+ error = xfs_btree_alloc_block(cur, &rptr, &lptr, stat);
if (error)
goto error0;
if (*stat == 0)
@@ -76,8 +76,6 @@ xfs_refcountbt_alloc_block(
xfs_refc_block(args.mp)));
if (error)
goto out_error;
- trace_xfs_refcountbt_alloc_block(cur->bc_mp, cur->bc_ag.pag->pag_agno,
- args.agbno, 1);
if (args.fsbno == NULLFSBLOCK) {
*stat = 0;
return 0;
@@ -92,8 +92,6 @@ xfs_rmapbt_alloc_block(
&bno, 1);
if (error)
return error;
-
- trace_xfs_rmapbt_alloc_block(cur->bc_mp, pag->pag_agno, bno, 1);
if (bno == NULLAGBLOCK) {
*stat = 0;
return 0;