* [PATCH 0/8] xfs-4.19: fixes & cleanups
@ 2018-07-18 15:50 Darrick J. Wong
2018-07-18 15:50 ` [PATCH 1/8] xfs: check leaf attribute block freemap in verifier Darrick J. Wong
` (7 more replies)
0 siblings, 8 replies; 30+ messages in thread
From: Darrick J. Wong @ 2018-07-18 15:50 UTC (permalink / raw)
To: darrick.wong; +Cc: linux-xfs
Hi all,
Here's a series of bugfixes and cleanups for 4.19.
The first patch enhances the extended attribute leaf block checks to
sanitize the freemap. This is essential to prevent asserts on totally
garbage freemap info from taking the fs down during an xattr update.
The second patch ensures that we always return from xfs_defer_finish
with a clean transaction so that any new work added to the transaction
after that does not overflow the reservation.
The next two patches clean up xfs_btree_del_cursor usage. Callers can
pass negative error numbers into the function to signal a full btree
cursor buffer cleanup so they do not need to use ternary expressions to
select XFS_BTREE_{NO,}ERROR.
The four patches after that shorten name prefixes in the online fsck
code. The xfs_scrub_* functions are shortened to xchk_*; the
xfs_repair_* functions become xrep_*; struct xfs_scrub_context becomes
struct xfs_scrub; and the final patch of the series cleans up all the
whitespace and indenting problems. That last patch I did by hand; the
first three were mechanical changes with simple sed scripts.
Comments and questions are, as always, welcome.
--D
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH 1/8] xfs: check leaf attribute block freemap in verifier
2018-07-18 15:50 [PATCH 0/8] xfs-4.19: fixes & cleanups Darrick J. Wong
@ 2018-07-18 15:50 ` Darrick J. Wong
2018-07-19 12:19 ` Carlos Maiolino
` (2 more replies)
2018-07-18 15:50 ` [PATCH 2/8] xfs: return from _defer_finish with a clean transaction Darrick J. Wong
` (6 subsequent siblings)
7 siblings, 3 replies; 30+ messages in thread
From: Darrick J. Wong @ 2018-07-18 15:50 UTC (permalink / raw)
To: darrick.wong; +Cc: linux-xfs
From: Darrick J. Wong <darrick.wong@oracle.com>
Check the leaf attribute freemap when we we're verifying the block.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
fs/xfs/libxfs/xfs_attr_leaf.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/fs/xfs/libxfs/xfs_attr_leaf.c b/fs/xfs/libxfs/xfs_attr_leaf.c
index 76e90046731c..b3c19339e1b5 100644
--- a/fs/xfs/libxfs/xfs_attr_leaf.c
+++ b/fs/xfs/libxfs/xfs_attr_leaf.c
@@ -244,6 +244,8 @@ xfs_attr3_leaf_verify(
struct xfs_attr_leafblock *leaf = bp->b_addr;
struct xfs_perag *pag = bp->b_pag;
struct xfs_attr_leaf_entry *entries;
+ uint16_t end;
+ int i;
xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &ichdr, leaf);
@@ -289,6 +291,22 @@ xfs_attr3_leaf_verify(
/* XXX: need to range check rest of attr header values */
/* XXX: hash order check? */
+ for (i = 0; i < XFS_ATTR_LEAF_MAPSIZE; i++) {
+ if (ichdr.freemap[i].base > mp->m_attr_geo->blksize)
+ return __this_address;
+ if (ichdr.freemap[i].base & 0x3)
+ return __this_address;
+ if (ichdr.freemap[i].size > mp->m_attr_geo->blksize)
+ return __this_address;
+ if (ichdr.freemap[i].size & 0x3)
+ return __this_address;
+ end = ichdr.freemap[i].base + ichdr.freemap[i].size;
+ if (end < ichdr.freemap[i].base)
+ return __this_address;
+ if (end > mp->m_attr_geo->blksize)
+ return __this_address;
+ }
+
return NULL;
}
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 2/8] xfs: return from _defer_finish with a clean transaction
2018-07-18 15:50 [PATCH 0/8] xfs-4.19: fixes & cleanups Darrick J. Wong
2018-07-18 15:50 ` [PATCH 1/8] xfs: check leaf attribute block freemap in verifier Darrick J. Wong
@ 2018-07-18 15:50 ` Darrick J. Wong
2018-07-19 12:24 ` Brian Foster
2018-07-19 16:41 ` Christoph Hellwig
2018-07-18 15:50 ` [PATCH 3/8] xfs: trivial xfs_btree_del_cursor cleanups Darrick J. Wong
` (5 subsequent siblings)
7 siblings, 2 replies; 30+ messages in thread
From: Darrick J. Wong @ 2018-07-18 15:50 UTC (permalink / raw)
To: darrick.wong; +Cc: linux-xfs, Christoph Hellwig
From: Darrick J. Wong <darrick.wong@oracle.com>
Christoph Hellwig reported seeing the following assertion in
generic/051:
XFS: Assertion failed: tp->t_firstblock == NULLFSBLOCK, file: fs/xfs/libxfs5
------------[ cut here ]------------
kernel BUG at fs/xfs/xfs_message.c:102!
invalid opcode: 0000 [#1] SMP PTI
CPU: 2 PID: 20757 Comm: fsstress Not tainted 4.18.0-rc4+ #3969
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.1-1 04/01/4
RIP: 0010:assfail+0x23/0x30
Code: c3 66 0f 1f 44 00 00 48 89 f1 41 89 d0 48 c7 c6 88 e0 8c 82 48 89 fa
RSP: 0018:ffff88012dc43c08 EFLAGS: 00010202
RAX: 0000000000000000 RBX: ffff88012dc43ca0 RCX: 0000000000000000
RDX: 00000000ffffffc0 RSI: 000000000000000a RDI: ffffffff828480eb
RBP: ffff88012aa92758 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: f000000000000000 R12: 0000000000000000
R13: ffff88012dc43d48 R14: ffff88013092e7e8 R15: 0000000000000014
FS: 00007f8d689b8e80(0000) GS:ffff88013fd00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f8d689c7000 CR3: 000000012ba6a000 CR4: 00000000000006e0
Call Trace:
xfs_defer_init+0xff/0x160
xfs_reflink_remap_extent+0x31b/0xa00
xfs_reflink_remap_blocks+0xec/0x4a0
xfs_reflink_remap_range+0x3a1/0x650
xfs_file_dedupe_range+0x39/0x50
vfs_dedupe_file_range+0x218/0x260
do_vfs_ioctl+0x262/0x6a0
? __se_sys_newfstat+0x3c/0x60
ksys_ioctl+0x35/0x60
__x64_sys_ioctl+0x11/0x20
do_syscall_64+0x4b/0x190
entry_SYSCALL_64_after_hwframe+0x49/0xbe
The root cause of the assertion failure is that xfs_defer_finish doesn't
roll the transaction after processing all the deferred items. Therefore
it returns a dirty transaction to the caller, which leaves the caller at
risk of exceeding the transaction reservation if it logs more items.
Brian Foster's patchset to move the defer_ops firstblock into the
transaction requires t_firstblock == NULLFSBLOCK upon defer_ops
initialization, which is how this was noticed at all.
Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
fs/xfs/libxfs/xfs_defer.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/fs/xfs/libxfs/xfs_defer.c b/fs/xfs/libxfs/xfs_defer.c
index c3e5bffda4f5..3ba8bb308c3c 100644
--- a/fs/xfs/libxfs/xfs_defer.c
+++ b/fs/xfs/libxfs/xfs_defer.c
@@ -424,6 +424,12 @@ xfs_defer_finish(
cleanup_fn(*tp, state, error);
}
+ /*
+ * Roll the transaction once more to avoid returning to the caller
+ * with a dirty transaction.
+ */
+ if ((*tp)->t_flags & XFS_TRANS_DIRTY)
+ error = xfs_defer_trans_roll(tp, dop);
out:
(*tp)->t_agfl_dfops = orig_dop;
if (error)
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 3/8] xfs: trivial xfs_btree_del_cursor cleanups
2018-07-18 15:50 [PATCH 0/8] xfs-4.19: fixes & cleanups Darrick J. Wong
2018-07-18 15:50 ` [PATCH 1/8] xfs: check leaf attribute block freemap in verifier Darrick J. Wong
2018-07-18 15:50 ` [PATCH 2/8] xfs: return from _defer_finish with a clean transaction Darrick J. Wong
@ 2018-07-18 15:50 ` Darrick J. Wong
2018-07-19 12:24 ` Brian Foster
` (2 more replies)
2018-07-18 15:50 ` [PATCH 4/8] xfs: clean up xfs_btree_del_cursor callers Darrick J. Wong
` (4 subsequent siblings)
7 siblings, 3 replies; 30+ messages in thread
From: Darrick J. Wong @ 2018-07-18 15:50 UTC (permalink / raw)
To: darrick.wong; +Cc: linux-xfs
From: Darrick J. Wong <darrick.wong@oracle.com>
The error argument to xfs_btree_del_cursor already understands the
"nonzero for error" semantics, so remove pointless error testing in the
callers and pass it directly.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
fs/xfs/libxfs/xfs_bmap.c | 24 ++++++++----------------
fs/xfs/libxfs/xfs_bmap_btree.c | 2 +-
fs/xfs/libxfs/xfs_ialloc.c | 2 +-
fs/xfs/libxfs/xfs_ialloc_btree.c | 2 +-
fs/xfs/libxfs/xfs_refcount.c | 2 +-
fs/xfs/libxfs/xfs_rmap.c | 18 +++---------------
fs/xfs/scrub/bmap.c | 5 ++---
fs/xfs/scrub/repair.c | 2 +-
fs/xfs/xfs_discard.c | 2 +-
fs/xfs/xfs_fsmap.c | 2 +-
fs/xfs/xfs_itable.c | 6 ++----
fs/xfs/xfs_reflink.c | 2 +-
12 files changed, 23 insertions(+), 46 deletions(-)
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index 7205268b30bc..50119b54a2b5 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -975,8 +975,7 @@ xfs_bmap_add_attrfork_extents(
flags, XFS_DATA_FORK);
if (cur) {
cur->bc_private.b.allocated = 0;
- xfs_btree_del_cursor(cur,
- error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
+ xfs_btree_del_cursor(cur, error);
}
return error;
}
@@ -4500,8 +4499,7 @@ xfs_bmapi_write(
bma.cur->bc_private.b.firstblock));
*firstblock = bma.cur->bc_private.b.firstblock;
}
- xfs_btree_del_cursor(bma.cur,
- error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
+ xfs_btree_del_cursor(bma.cur, error);
}
if (!error)
xfs_bmap_validate_ret(orig_bno, orig_len, orig_flags, orig_mval,
@@ -4599,10 +4597,8 @@ xfs_bmapi_remap(
if (logflags)
xfs_trans_log_inode(tp, ip, logflags);
- if (cur) {
- xfs_btree_del_cursor(cur,
- error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
- }
+ if (cur)
+ xfs_btree_del_cursor(cur, error);
return error;
}
@@ -5505,8 +5501,7 @@ __xfs_bunmapi(
*firstblock = cur->bc_private.b.firstblock;
cur->bc_private.b.allocated = 0;
}
- xfs_btree_del_cursor(cur,
- error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
+ xfs_btree_del_cursor(cur, error);
}
return error;
}
@@ -5773,8 +5768,7 @@ xfs_bmap_collapse_extents(
*next_fsb = got.br_startoff;
del_cursor:
if (cur)
- xfs_btree_del_cursor(cur,
- error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
+ xfs_btree_del_cursor(cur, error);
if (logflags)
xfs_trans_log_inode(tp, ip, logflags);
return error;
@@ -5905,8 +5899,7 @@ xfs_bmap_insert_extents(
*next_fsb = got.br_startoff;
del_cursor:
if (cur)
- xfs_btree_del_cursor(cur,
- error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
+ xfs_btree_del_cursor(cur, error);
if (logflags)
xfs_trans_log_inode(tp, ip, logflags);
return error;
@@ -6026,8 +6019,7 @@ xfs_bmap_split_extent_at(
del_cursor:
if (cur) {
cur->bc_private.b.allocated = 0;
- xfs_btree_del_cursor(cur,
- error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
+ xfs_btree_del_cursor(cur, error);
}
if (logflags)
diff --git a/fs/xfs/libxfs/xfs_bmap_btree.c b/fs/xfs/libxfs/xfs_bmap_btree.c
index e1a2d9ceb615..cd2da4ef614f 100644
--- a/fs/xfs/libxfs/xfs_bmap_btree.c
+++ b/fs/xfs/libxfs/xfs_bmap_btree.c
@@ -645,7 +645,7 @@ xfs_bmbt_change_owner(
cur->bc_private.b.flags |= XFS_BTCUR_BPRV_INVALID_OWNER;
error = xfs_btree_change_owner(cur, new_owner, buffer_list);
- xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
+ xfs_btree_del_cursor(cur, error);
return error;
}
diff --git a/fs/xfs/libxfs/xfs_ialloc.c b/fs/xfs/libxfs/xfs_ialloc.c
index 0d968e8143aa..dd0a0fb0abc8 100644
--- a/fs/xfs/libxfs/xfs_ialloc.c
+++ b/fs/xfs/libxfs/xfs_ialloc.c
@@ -2260,7 +2260,7 @@ xfs_imap_lookup(
}
xfs_trans_brelse(tp, agbp);
- xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
+ xfs_btree_del_cursor(cur, error);
if (error)
return error;
diff --git a/fs/xfs/libxfs/xfs_ialloc_btree.c b/fs/xfs/libxfs/xfs_ialloc_btree.c
index a5237afec5ab..735a33252eb2 100644
--- a/fs/xfs/libxfs/xfs_ialloc_btree.c
+++ b/fs/xfs/libxfs/xfs_ialloc_btree.c
@@ -566,7 +566,7 @@ xfs_inobt_count_blocks(
cur = xfs_inobt_init_cursor(mp, NULL, agbp, agno, btnum);
error = xfs_btree_count_blocks(cur, tree_blocks);
- xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
+ xfs_btree_del_cursor(cur, error);
xfs_buf_relse(agbp);
return error;
diff --git a/fs/xfs/libxfs/xfs_refcount.c b/fs/xfs/libxfs/xfs_refcount.c
index 9dda6fd0bb13..240a32984d13 100644
--- a/fs/xfs/libxfs/xfs_refcount.c
+++ b/fs/xfs/libxfs/xfs_refcount.c
@@ -1067,7 +1067,7 @@ xfs_refcount_finish_one_cleanup(
if (rcur == NULL)
return;
agbp = rcur->bc_private.a.agbp;
- xfs_btree_del_cursor(rcur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
+ xfs_btree_del_cursor(rcur, error);
if (error)
xfs_trans_brelse(tp, agbp);
}
diff --git a/fs/xfs/libxfs/xfs_rmap.c b/fs/xfs/libxfs/xfs_rmap.c
index 8b2a2f81d110..fb266fa2cc45 100644
--- a/fs/xfs/libxfs/xfs_rmap.c
+++ b/fs/xfs/libxfs/xfs_rmap.c
@@ -670,14 +670,8 @@ xfs_rmap_free(
cur = xfs_rmapbt_init_cursor(mp, tp, agbp, agno);
error = xfs_rmap_unmap(cur, bno, len, false, oinfo);
- if (error)
- goto out_error;
- xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR);
- return 0;
-
-out_error:
- xfs_btree_del_cursor(cur, XFS_BTREE_ERROR);
+ xfs_btree_del_cursor(cur, error);
return error;
}
@@ -912,14 +906,8 @@ xfs_rmap_alloc(
cur = xfs_rmapbt_init_cursor(mp, tp, agbp, agno);
error = xfs_rmap_map(cur, bno, len, false, oinfo);
- if (error)
- goto out_error;
- xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR);
- return 0;
-
-out_error:
- xfs_btree_del_cursor(cur, XFS_BTREE_ERROR);
+ xfs_btree_del_cursor(cur, error);
return error;
}
@@ -2156,7 +2144,7 @@ xfs_rmap_finish_one_cleanup(
if (rcur == NULL)
return;
agbp = rcur->bc_private.a.agbp;
- xfs_btree_del_cursor(rcur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
+ xfs_btree_del_cursor(rcur, error);
if (error)
xfs_trans_brelse(tp, agbp);
}
diff --git a/fs/xfs/scrub/bmap.c b/fs/xfs/scrub/bmap.c
index 3d08589f5c60..ebbfab173e97 100644
--- a/fs/xfs/scrub/bmap.c
+++ b/fs/xfs/scrub/bmap.c
@@ -404,8 +404,7 @@ xfs_scrub_bmap_btree(
cur = xfs_bmbt_init_cursor(mp, sc->tp, ip, whichfork);
xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, whichfork);
error = xfs_scrub_btree(sc, cur, xfs_scrub_bmapbt_rec, &oinfo, info);
- xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR :
- XFS_BTREE_NOERROR);
+ xfs_btree_del_cursor(cur, error);
return error;
}
@@ -514,7 +513,7 @@ xfs_scrub_bmap_check_ag_rmaps(
if (error == XFS_BTREE_QUERY_RANGE_ABORT)
error = 0;
- xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
+ xfs_btree_del_cursor(cur, error);
out_agf:
xfs_trans_brelse(sc->tp, agf);
return error;
diff --git a/fs/xfs/scrub/repair.c b/fs/xfs/scrub/repair.c
index 326be4e8b71e..35c589a04fac 100644
--- a/fs/xfs/scrub/repair.c
+++ b/fs/xfs/scrub/repair.c
@@ -1009,7 +1009,7 @@ xfs_repair_find_ag_btree_roots(
cur = xfs_rmapbt_init_cursor(mp, sc->tp, agf_bp, sc->sa.agno);
error = xfs_rmap_query_all(cur, xfs_repair_findroot_rmap, &ri);
- xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
+ xfs_btree_del_cursor(cur, error);
return error;
}
diff --git a/fs/xfs/xfs_discard.c b/fs/xfs/xfs_discard.c
index 678a5fcd7576..93f07edafd81 100644
--- a/fs/xfs/xfs_discard.c
+++ b/fs/xfs/xfs_discard.c
@@ -128,7 +128,7 @@ xfs_trim_extents(
}
out_del_cursor:
- xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
+ xfs_btree_del_cursor(cur, error);
xfs_buf_relse(agbp);
out_put_perag:
xfs_perag_put(pag);
diff --git a/fs/xfs/xfs_fsmap.c b/fs/xfs/xfs_fsmap.c
index c7157bc48bd1..f7e00e42f360 100644
--- a/fs/xfs/xfs_fsmap.c
+++ b/fs/xfs/xfs_fsmap.c
@@ -219,7 +219,7 @@ xfs_getfsmap_is_shared(
error = xfs_refcount_find_shared(cur, rec->rm_startblock,
rec->rm_blockcount, &fbno, &flen, false);
- xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
+ xfs_btree_del_cursor(cur, error);
if (error)
return error;
diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c
index 24f4f1c555b5..65810827a8d0 100644
--- a/fs/xfs/xfs_itable.c
+++ b/fs/xfs/xfs_itable.c
@@ -458,8 +458,7 @@ xfs_bulkstat(
* pending error, then we are done.
*/
del_cursor:
- xfs_btree_del_cursor(cur, error ?
- XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
+ xfs_btree_del_cursor(cur, error);
xfs_buf_relse(agbp);
if (error)
break;
@@ -632,8 +631,7 @@ xfs_inumbers(
kmem_free(buffer);
if (cur)
- xfs_btree_del_cursor(cur, (error ? XFS_BTREE_ERROR :
- XFS_BTREE_NOERROR));
+ xfs_btree_del_cursor(cur, error);
if (agbp)
xfs_buf_relse(agbp);
diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c
index 592fb2071a03..268d51e35812 100644
--- a/fs/xfs/xfs_reflink.c
+++ b/fs/xfs/xfs_reflink.c
@@ -162,7 +162,7 @@ xfs_reflink_find_shared(
error = xfs_refcount_find_shared(cur, agbno, aglen, fbno, flen,
find_end_of_shared);
- xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
+ xfs_btree_del_cursor(cur, error);
xfs_trans_brelse(tp, agbp);
return error;
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 4/8] xfs: clean up xfs_btree_del_cursor callers
2018-07-18 15:50 [PATCH 0/8] xfs-4.19: fixes & cleanups Darrick J. Wong
` (2 preceding siblings ...)
2018-07-18 15:50 ` [PATCH 3/8] xfs: trivial xfs_btree_del_cursor cleanups Darrick J. Wong
@ 2018-07-18 15:50 ` Darrick J. Wong
2018-07-19 12:24 ` Brian Foster
` (2 more replies)
2018-07-18 15:51 ` [PATCH 5/8] xfs: shorten xfs_scrub_ prefix Darrick J. Wong
` (3 subsequent siblings)
7 siblings, 3 replies; 30+ messages in thread
From: Darrick J. Wong @ 2018-07-18 15:50 UTC (permalink / raw)
To: darrick.wong; +Cc: linux-xfs
From: Darrick J. Wong <darrick.wong@oracle.com>
Less trivial cleanups of the error argument to xfs_btree_del_cursor;
these require some minor code refactoring.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
fs/xfs/libxfs/xfs_refcount.c | 11 +++--------
fs/xfs/scrub/repair.c | 7 +++----
2 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/fs/xfs/libxfs/xfs_refcount.c b/fs/xfs/libxfs/xfs_refcount.c
index 240a32984d13..a38e5840a73f 100644
--- a/fs/xfs/libxfs/xfs_refcount.c
+++ b/fs/xfs/libxfs/xfs_refcount.c
@@ -1675,11 +1675,11 @@ xfs_refcount_recover_cow_leftovers(
high.rc.rc_startblock = -1U;
error = xfs_btree_query_range(cur, &low, &high,
xfs_refcount_recover_extent, &debris);
- if (error)
- goto out_cursor;
- xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR);
+ xfs_btree_del_cursor(cur, error);
xfs_trans_brelse(tp, agbp);
xfs_trans_cancel(tp);
+ if (error)
+ goto out_free;
/* Now iterate the list to free the leftovers */
list_for_each_entry_safe(rr, n, &debris, rr_list) {
@@ -1727,11 +1727,6 @@ xfs_refcount_recover_cow_leftovers(
kmem_free(rr);
}
return error;
-
-out_cursor:
- xfs_btree_del_cursor(cur, XFS_BTREE_ERROR);
- xfs_trans_brelse(tp, agbp);
- goto out_trans;
}
/* Is there a record covering a given extent? */
diff --git a/fs/xfs/scrub/repair.c b/fs/xfs/scrub/repair.c
index 35c589a04fac..ea39e2bdc96a 100644
--- a/fs/xfs/scrub/repair.c
+++ b/fs/xfs/scrub/repair.c
@@ -747,9 +747,9 @@ xfs_repair_dispose_btree_block(
/* Can we find any other rmappings? */
error = xfs_rmap_has_other_keys(cur, agbno, 1, oinfo, &has_other_rmap);
+ xfs_btree_del_cursor(cur, error);
if (error)
- goto out_cur;
- xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR);
+ goto out_free;
/*
* If there are other rmappings, this block is cross linked and must
@@ -779,8 +779,7 @@ xfs_repair_dispose_btree_block(
return xfs_trans_roll_inode(&sc->tp, sc->ip);
return xfs_repair_roll_ag_trans(sc);
-out_cur:
- xfs_btree_del_cursor(cur, XFS_BTREE_ERROR);
+out_free:
if (agf_bp != sc->sa.agf_bp)
xfs_trans_brelse(sc->tp, agf_bp);
return error;
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 5/8] xfs: shorten xfs_scrub_ prefix
2018-07-18 15:50 [PATCH 0/8] xfs-4.19: fixes & cleanups Darrick J. Wong
` (3 preceding siblings ...)
2018-07-18 15:50 ` [PATCH 4/8] xfs: clean up xfs_btree_del_cursor callers Darrick J. Wong
@ 2018-07-18 15:51 ` Darrick J. Wong
2018-07-19 12:59 ` Brian Foster
2018-07-18 15:51 ` [PATCH 6/8] xfs: shorten xfs_repair_ prefix to xrep_ Darrick J. Wong
` (2 subsequent siblings)
7 siblings, 1 reply; 30+ messages in thread
From: Darrick J. Wong @ 2018-07-18 15:51 UTC (permalink / raw)
To: darrick.wong; +Cc: linux-xfs
From: Darrick J. Wong <darrick.wong@oracle.com>
Shorten all the metadata checking xfs_scrub_ prefixes to xchk_. After
this, the only xfs_scrub* symbols are the ones that pertain to both
scrub and repair. Whitespace damage will be fixed in a subsequent
patch. There are no functional changes.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
| 318 ++++++++++++++++++++++++-----------------------
fs/xfs/scrub/alloc.c | 56 ++++----
fs/xfs/scrub/attr.c | 106 ++++++++--------
fs/xfs/scrub/bmap.c | 176 +++++++++++++-------------
fs/xfs/scrub/btree.c | 166 ++++++++++++-------------
fs/xfs/scrub/btree.h | 22 ++-
fs/xfs/scrub/common.c | 172 +++++++++++++------------
fs/xfs/scrub/common.h | 102 ++++++++-------
fs/xfs/scrub/dabtree.c | 124 +++++++++---------
fs/xfs/scrub/dabtree.h | 14 +-
fs/xfs/scrub/dir.c | 170 +++++++++++++------------
fs/xfs/scrub/ialloc.c | 138 ++++++++++----------
fs/xfs/scrub/inode.c | 160 ++++++++++++------------
fs/xfs/scrub/parent.c | 62 +++++----
fs/xfs/scrub/quota.c | 64 +++++----
fs/xfs/scrub/refcount.c | 114 ++++++++---------
fs/xfs/scrub/repair.c | 4 -
fs/xfs/scrub/rmap.c | 78 ++++++------
fs/xfs/scrub/rtbitmap.c | 30 ++--
fs/xfs/scrub/scrub.c | 142 +++++++++++----------
fs/xfs/scrub/scrub.h | 82 ++++++------
fs/xfs/scrub/symlink.c | 14 +-
fs/xfs/scrub/trace.c | 2
fs/xfs/scrub/trace.h | 70 +++++-----
24 files changed, 1196 insertions(+), 1190 deletions(-)
--git a/fs/xfs/scrub/agheader.c b/fs/xfs/scrub/agheader.c
index 9bb0745f1ad2..c0625ec16d63 100644
--- a/fs/xfs/scrub/agheader.c
+++ b/fs/xfs/scrub/agheader.c
@@ -28,7 +28,7 @@
/* Cross-reference with the other btrees. */
STATIC void
-xfs_scrub_superblock_xref(
+xchk_superblock_xref(
struct xfs_scrub_context *sc,
struct xfs_buf *bp)
{
@@ -43,15 +43,15 @@ xfs_scrub_superblock_xref(
agbno = XFS_SB_BLOCK(mp);
- error = xfs_scrub_ag_init(sc, agno, &sc->sa);
- if (!xfs_scrub_xref_process_error(sc, agno, agbno, &error))
+ error = xchk_ag_init(sc, agno, &sc->sa);
+ if (!xchk_xref_process_error(sc, agno, agbno, &error))
return;
- xfs_scrub_xref_is_used_space(sc, agbno, 1);
- xfs_scrub_xref_is_not_inode_chunk(sc, agbno, 1);
+ xchk_xref_is_used_space(sc, agbno, 1);
+ xchk_xref_is_not_inode_chunk(sc, agbno, 1);
xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_FS);
- xfs_scrub_xref_is_owned_by(sc, agbno, 1, &oinfo);
- xfs_scrub_xref_is_not_shared(sc, agbno, 1);
+ xchk_xref_is_owned_by(sc, agbno, 1, &oinfo);
+ xchk_xref_is_not_shared(sc, agbno, 1);
/* scrub teardown will take care of sc->sa for us */
}
@@ -65,7 +65,7 @@ xfs_scrub_superblock_xref(
* sb 0 is ok and we can use its information to check everything else.
*/
int
-xfs_scrub_superblock(
+xchk_superblock(
struct xfs_scrub_context *sc)
{
struct xfs_mount *mp = sc->mp;
@@ -98,7 +98,7 @@ xfs_scrub_superblock(
default:
break;
}
- if (!xfs_scrub_process_error(sc, agno, XFS_SB_BLOCK(mp), &error))
+ if (!xchk_process_error(sc, agno, XFS_SB_BLOCK(mp), &error))
return error;
sb = XFS_BUF_TO_SBP(bp);
@@ -110,46 +110,46 @@ xfs_scrub_superblock(
* checked.
*/
if (sb->sb_blocksize != cpu_to_be32(mp->m_sb.sb_blocksize))
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
if (sb->sb_dblocks != cpu_to_be64(mp->m_sb.sb_dblocks))
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
if (sb->sb_rblocks != cpu_to_be64(mp->m_sb.sb_rblocks))
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
if (sb->sb_rextents != cpu_to_be64(mp->m_sb.sb_rextents))
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
if (!uuid_equal(&sb->sb_uuid, &mp->m_sb.sb_uuid))
- xfs_scrub_block_set_preen(sc, bp);
+ xchk_block_set_preen(sc, bp);
if (sb->sb_logstart != cpu_to_be64(mp->m_sb.sb_logstart))
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
if (sb->sb_rootino != cpu_to_be64(mp->m_sb.sb_rootino))
- xfs_scrub_block_set_preen(sc, bp);
+ xchk_block_set_preen(sc, bp);
if (sb->sb_rbmino != cpu_to_be64(mp->m_sb.sb_rbmino))
- xfs_scrub_block_set_preen(sc, bp);
+ xchk_block_set_preen(sc, bp);
if (sb->sb_rsumino != cpu_to_be64(mp->m_sb.sb_rsumino))
- xfs_scrub_block_set_preen(sc, bp);
+ xchk_block_set_preen(sc, bp);
if (sb->sb_rextsize != cpu_to_be32(mp->m_sb.sb_rextsize))
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
if (sb->sb_agblocks != cpu_to_be32(mp->m_sb.sb_agblocks))
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
if (sb->sb_agcount != cpu_to_be32(mp->m_sb.sb_agcount))
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
if (sb->sb_rbmblocks != cpu_to_be32(mp->m_sb.sb_rbmblocks))
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
if (sb->sb_logblocks != cpu_to_be32(mp->m_sb.sb_logblocks))
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
/* Check sb_versionnum bits that are set at mkfs time. */
vernum_mask = cpu_to_be16(~XFS_SB_VERSION_OKBITS |
@@ -163,7 +163,7 @@ xfs_scrub_superblock(
XFS_SB_VERSION_DIRV2BIT);
if ((sb->sb_versionnum & vernum_mask) !=
(cpu_to_be16(mp->m_sb.sb_versionnum) & vernum_mask))
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
/* Check sb_versionnum bits that can be set after mkfs time. */
vernum_mask = cpu_to_be16(XFS_SB_VERSION_ATTRBIT |
@@ -171,40 +171,40 @@ xfs_scrub_superblock(
XFS_SB_VERSION_QUOTABIT);
if ((sb->sb_versionnum & vernum_mask) !=
(cpu_to_be16(mp->m_sb.sb_versionnum) & vernum_mask))
- xfs_scrub_block_set_preen(sc, bp);
+ xchk_block_set_preen(sc, bp);
if (sb->sb_sectsize != cpu_to_be16(mp->m_sb.sb_sectsize))
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
if (sb->sb_inodesize != cpu_to_be16(mp->m_sb.sb_inodesize))
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
if (sb->sb_inopblock != cpu_to_be16(mp->m_sb.sb_inopblock))
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
if (memcmp(sb->sb_fname, mp->m_sb.sb_fname, sizeof(sb->sb_fname)))
- xfs_scrub_block_set_preen(sc, bp);
+ xchk_block_set_preen(sc, bp);
if (sb->sb_blocklog != mp->m_sb.sb_blocklog)
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
if (sb->sb_sectlog != mp->m_sb.sb_sectlog)
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
if (sb->sb_inodelog != mp->m_sb.sb_inodelog)
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
if (sb->sb_inopblog != mp->m_sb.sb_inopblog)
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
if (sb->sb_agblklog != mp->m_sb.sb_agblklog)
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
if (sb->sb_rextslog != mp->m_sb.sb_rextslog)
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
if (sb->sb_imax_pct != mp->m_sb.sb_imax_pct)
- xfs_scrub_block_set_preen(sc, bp);
+ xchk_block_set_preen(sc, bp);
/*
* Skip the summary counters since we track them in memory anyway.
@@ -212,10 +212,10 @@ xfs_scrub_superblock(
*/
if (sb->sb_uquotino != cpu_to_be64(mp->m_sb.sb_uquotino))
- xfs_scrub_block_set_preen(sc, bp);
+ xchk_block_set_preen(sc, bp);
if (sb->sb_gquotino != cpu_to_be64(mp->m_sb.sb_gquotino))
- xfs_scrub_block_set_preen(sc, bp);
+ xchk_block_set_preen(sc, bp);
/*
* Skip the quota flags since repair will force quotacheck.
@@ -223,46 +223,46 @@ xfs_scrub_superblock(
*/
if (sb->sb_flags != mp->m_sb.sb_flags)
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
if (sb->sb_shared_vn != mp->m_sb.sb_shared_vn)
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
if (sb->sb_inoalignmt != cpu_to_be32(mp->m_sb.sb_inoalignmt))
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
if (sb->sb_unit != cpu_to_be32(mp->m_sb.sb_unit))
- xfs_scrub_block_set_preen(sc, bp);
+ xchk_block_set_preen(sc, bp);
if (sb->sb_width != cpu_to_be32(mp->m_sb.sb_width))
- xfs_scrub_block_set_preen(sc, bp);
+ xchk_block_set_preen(sc, bp);
if (sb->sb_dirblklog != mp->m_sb.sb_dirblklog)
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
if (sb->sb_logsectlog != mp->m_sb.sb_logsectlog)
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
if (sb->sb_logsectsize != cpu_to_be16(mp->m_sb.sb_logsectsize))
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
if (sb->sb_logsunit != cpu_to_be32(mp->m_sb.sb_logsunit))
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
/* Do we see any invalid bits in sb_features2? */
if (!xfs_sb_version_hasmorebits(&mp->m_sb)) {
if (sb->sb_features2 != 0)
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
} else {
v2_ok = XFS_SB_VERSION2_OKBITS;
if (XFS_SB_VERSION_NUM(&mp->m_sb) >= XFS_SB_VERSION_5)
v2_ok |= XFS_SB_VERSION2_CRCBIT;
if (!!(sb->sb_features2 & cpu_to_be32(~v2_ok)))
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
if (sb->sb_features2 != sb->sb_bad_features2)
- xfs_scrub_block_set_preen(sc, bp);
+ xchk_block_set_preen(sc, bp);
}
/* Check sb_features2 flags that are set at mkfs time. */
@@ -272,26 +272,26 @@ xfs_scrub_superblock(
XFS_SB_VERSION2_FTYPE);
if ((sb->sb_features2 & features_mask) !=
(cpu_to_be32(mp->m_sb.sb_features2) & features_mask))
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
/* Check sb_features2 flags that can be set after mkfs time. */
features_mask = cpu_to_be32(XFS_SB_VERSION2_ATTR2BIT);
if ((sb->sb_features2 & features_mask) !=
(cpu_to_be32(mp->m_sb.sb_features2) & features_mask))
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
if (!xfs_sb_version_hascrc(&mp->m_sb)) {
/* all v5 fields must be zero */
if (memchr_inv(&sb->sb_features_compat, 0,
sizeof(struct xfs_dsb) -
offsetof(struct xfs_dsb, sb_features_compat)))
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
} else {
/* Check compat flags; all are set at mkfs time. */
features_mask = cpu_to_be32(XFS_SB_FEAT_COMPAT_UNKNOWN);
if ((sb->sb_features_compat & features_mask) !=
(cpu_to_be32(mp->m_sb.sb_features_compat) & features_mask))
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
/* Check ro compat flags; all are set at mkfs time. */
features_mask = cpu_to_be32(XFS_SB_FEAT_RO_COMPAT_UNKNOWN |
@@ -301,7 +301,7 @@ xfs_scrub_superblock(
if ((sb->sb_features_ro_compat & features_mask) !=
(cpu_to_be32(mp->m_sb.sb_features_ro_compat) &
features_mask))
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
/* Check incompat flags; all are set at mkfs time. */
features_mask = cpu_to_be32(XFS_SB_FEAT_INCOMPAT_UNKNOWN |
@@ -311,22 +311,22 @@ xfs_scrub_superblock(
if ((sb->sb_features_incompat & features_mask) !=
(cpu_to_be32(mp->m_sb.sb_features_incompat) &
features_mask))
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
/* Check log incompat flags; all are set at mkfs time. */
features_mask = cpu_to_be32(XFS_SB_FEAT_INCOMPAT_LOG_UNKNOWN);
if ((sb->sb_features_log_incompat & features_mask) !=
(cpu_to_be32(mp->m_sb.sb_features_log_incompat) &
features_mask))
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
/* Don't care about sb_crc */
if (sb->sb_spino_align != cpu_to_be32(mp->m_sb.sb_spino_align))
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
if (sb->sb_pquotino != cpu_to_be64(mp->m_sb.sb_pquotino))
- xfs_scrub_block_set_preen(sc, bp);
+ xchk_block_set_preen(sc, bp);
/* Don't care about sb_lsn */
}
@@ -334,15 +334,15 @@ xfs_scrub_superblock(
if (xfs_sb_version_hasmetauuid(&mp->m_sb)) {
/* The metadata UUID must be the same for all supers */
if (!uuid_equal(&sb->sb_meta_uuid, &mp->m_sb.sb_meta_uuid))
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
}
/* Everything else must be zero. */
if (memchr_inv(sb + 1, 0,
BBTOB(bp->b_length) - sizeof(struct xfs_dsb)))
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
- xfs_scrub_superblock_xref(sc, bp);
+ xchk_superblock_xref(sc, bp);
return error;
}
@@ -351,7 +351,7 @@ xfs_scrub_superblock(
/* Tally freespace record lengths. */
STATIC int
-xfs_scrub_agf_record_bno_lengths(
+xchk_agf_record_bno_lengths(
struct xfs_btree_cur *cur,
struct xfs_alloc_rec_incore *rec,
void *priv)
@@ -364,7 +364,7 @@ xfs_scrub_agf_record_bno_lengths(
/* Check agf_freeblks */
static inline void
-xfs_scrub_agf_xref_freeblks(
+xchk_agf_xref_freeblks(
struct xfs_scrub_context *sc)
{
struct xfs_agf *agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
@@ -375,16 +375,16 @@ xfs_scrub_agf_xref_freeblks(
return;
error = xfs_alloc_query_all(sc->sa.bno_cur,
- xfs_scrub_agf_record_bno_lengths, &blocks);
- if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.bno_cur))
+ xchk_agf_record_bno_lengths, &blocks);
+ if (!xchk_should_check_xref(sc, &error, &sc->sa.bno_cur))
return;
if (blocks != be32_to_cpu(agf->agf_freeblks))
- xfs_scrub_block_xref_set_corrupt(sc, sc->sa.agf_bp);
+ xchk_block_xref_set_corrupt(sc, sc->sa.agf_bp);
}
/* Cross reference the AGF with the cntbt (freespace by length btree) */
static inline void
-xfs_scrub_agf_xref_cntbt(
+xchk_agf_xref_cntbt(
struct xfs_scrub_context *sc)
{
struct xfs_agf *agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
@@ -398,25 +398,25 @@ xfs_scrub_agf_xref_cntbt(
/* Any freespace at all? */
error = xfs_alloc_lookup_le(sc->sa.cnt_cur, 0, -1U, &have);
- if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.cnt_cur))
+ if (!xchk_should_check_xref(sc, &error, &sc->sa.cnt_cur))
return;
if (!have) {
if (agf->agf_freeblks != be32_to_cpu(0))
- xfs_scrub_block_xref_set_corrupt(sc, sc->sa.agf_bp);
+ xchk_block_xref_set_corrupt(sc, sc->sa.agf_bp);
return;
}
/* Check agf_longest */
error = xfs_alloc_get_rec(sc->sa.cnt_cur, &agbno, &blocks, &have);
- if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.cnt_cur))
+ if (!xchk_should_check_xref(sc, &error, &sc->sa.cnt_cur))
return;
if (!have || blocks != be32_to_cpu(agf->agf_longest))
- xfs_scrub_block_xref_set_corrupt(sc, sc->sa.agf_bp);
+ xchk_block_xref_set_corrupt(sc, sc->sa.agf_bp);
}
/* Check the btree block counts in the AGF against the btrees. */
STATIC void
-xfs_scrub_agf_xref_btreeblks(
+xchk_agf_xref_btreeblks(
struct xfs_scrub_context *sc)
{
struct xfs_agf *agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
@@ -428,11 +428,11 @@ xfs_scrub_agf_xref_btreeblks(
/* Check agf_rmap_blocks; set up for agf_btreeblks check */
if (sc->sa.rmap_cur) {
error = xfs_btree_count_blocks(sc->sa.rmap_cur, &blocks);
- if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.rmap_cur))
+ if (!xchk_should_check_xref(sc, &error, &sc->sa.rmap_cur))
return;
btreeblks = blocks - 1;
if (blocks != be32_to_cpu(agf->agf_rmap_blocks))
- xfs_scrub_block_xref_set_corrupt(sc, sc->sa.agf_bp);
+ xchk_block_xref_set_corrupt(sc, sc->sa.agf_bp);
} else {
btreeblks = 0;
}
@@ -447,22 +447,22 @@ xfs_scrub_agf_xref_btreeblks(
/* Check agf_btreeblks */
error = xfs_btree_count_blocks(sc->sa.bno_cur, &blocks);
- if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.bno_cur))
+ if (!xchk_should_check_xref(sc, &error, &sc->sa.bno_cur))
return;
btreeblks += blocks - 1;
error = xfs_btree_count_blocks(sc->sa.cnt_cur, &blocks);
- if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.cnt_cur))
+ if (!xchk_should_check_xref(sc, &error, &sc->sa.cnt_cur))
return;
btreeblks += blocks - 1;
if (btreeblks != be32_to_cpu(agf->agf_btreeblks))
- xfs_scrub_block_xref_set_corrupt(sc, sc->sa.agf_bp);
+ xchk_block_xref_set_corrupt(sc, sc->sa.agf_bp);
}
/* Check agf_refcount_blocks against tree size */
static inline void
-xfs_scrub_agf_xref_refcblks(
+xchk_agf_xref_refcblks(
struct xfs_scrub_context *sc)
{
struct xfs_agf *agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
@@ -473,15 +473,15 @@ xfs_scrub_agf_xref_refcblks(
return;
error = xfs_btree_count_blocks(sc->sa.refc_cur, &blocks);
- if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.refc_cur))
+ if (!xchk_should_check_xref(sc, &error, &sc->sa.refc_cur))
return;
if (blocks != be32_to_cpu(agf->agf_refcount_blocks))
- xfs_scrub_block_xref_set_corrupt(sc, sc->sa.agf_bp);
+ xchk_block_xref_set_corrupt(sc, sc->sa.agf_bp);
}
/* Cross-reference with the other btrees. */
STATIC void
-xfs_scrub_agf_xref(
+xchk_agf_xref(
struct xfs_scrub_context *sc)
{
struct xfs_owner_info oinfo;
@@ -494,26 +494,26 @@ xfs_scrub_agf_xref(
agbno = XFS_AGF_BLOCK(mp);
- error = xfs_scrub_ag_btcur_init(sc, &sc->sa);
+ error = xchk_ag_btcur_init(sc, &sc->sa);
if (error)
return;
- xfs_scrub_xref_is_used_space(sc, agbno, 1);
- xfs_scrub_agf_xref_freeblks(sc);
- xfs_scrub_agf_xref_cntbt(sc);
- xfs_scrub_xref_is_not_inode_chunk(sc, agbno, 1);
+ xchk_xref_is_used_space(sc, agbno, 1);
+ xchk_agf_xref_freeblks(sc);
+ xchk_agf_xref_cntbt(sc);
+ xchk_xref_is_not_inode_chunk(sc, agbno, 1);
xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_FS);
- xfs_scrub_xref_is_owned_by(sc, agbno, 1, &oinfo);
- xfs_scrub_agf_xref_btreeblks(sc);
- xfs_scrub_xref_is_not_shared(sc, agbno, 1);
- xfs_scrub_agf_xref_refcblks(sc);
+ xchk_xref_is_owned_by(sc, agbno, 1, &oinfo);
+ xchk_agf_xref_btreeblks(sc);
+ xchk_xref_is_not_shared(sc, agbno, 1);
+ xchk_agf_xref_refcblks(sc);
/* scrub teardown will take care of sc->sa for us */
}
/* Scrub the AGF. */
int
-xfs_scrub_agf(
+xchk_agf(
struct xfs_scrub_context *sc)
{
struct xfs_mount *mp = sc->mp;
@@ -529,54 +529,54 @@ xfs_scrub_agf(
int error = 0;
agno = sc->sa.agno = sc->sm->sm_agno;
- error = xfs_scrub_ag_read_headers(sc, agno, &sc->sa.agi_bp,
+ error = xchk_ag_read_headers(sc, agno, &sc->sa.agi_bp,
&sc->sa.agf_bp, &sc->sa.agfl_bp);
- if (!xfs_scrub_process_error(sc, agno, XFS_AGF_BLOCK(sc->mp), &error))
+ if (!xchk_process_error(sc, agno, XFS_AGF_BLOCK(sc->mp), &error))
goto out;
- xfs_scrub_buffer_recheck(sc, sc->sa.agf_bp);
+ xchk_buffer_recheck(sc, sc->sa.agf_bp);
agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
/* Check the AG length */
eoag = be32_to_cpu(agf->agf_length);
if (eoag != xfs_ag_block_count(mp, agno))
- xfs_scrub_block_set_corrupt(sc, sc->sa.agf_bp);
+ xchk_block_set_corrupt(sc, sc->sa.agf_bp);
/* Check the AGF btree roots and levels */
agbno = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]);
if (!xfs_verify_agbno(mp, agno, agbno))
- xfs_scrub_block_set_corrupt(sc, sc->sa.agf_bp);
+ xchk_block_set_corrupt(sc, sc->sa.agf_bp);
agbno = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]);
if (!xfs_verify_agbno(mp, agno, agbno))
- xfs_scrub_block_set_corrupt(sc, sc->sa.agf_bp);
+ xchk_block_set_corrupt(sc, sc->sa.agf_bp);
level = be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]);
if (level <= 0 || level > XFS_BTREE_MAXLEVELS)
- xfs_scrub_block_set_corrupt(sc, sc->sa.agf_bp);
+ xchk_block_set_corrupt(sc, sc->sa.agf_bp);
level = be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]);
if (level <= 0 || level > XFS_BTREE_MAXLEVELS)
- xfs_scrub_block_set_corrupt(sc, sc->sa.agf_bp);
+ xchk_block_set_corrupt(sc, sc->sa.agf_bp);
if (xfs_sb_version_hasrmapbt(&mp->m_sb)) {
agbno = be32_to_cpu(agf->agf_roots[XFS_BTNUM_RMAP]);
if (!xfs_verify_agbno(mp, agno, agbno))
- xfs_scrub_block_set_corrupt(sc, sc->sa.agf_bp);
+ xchk_block_set_corrupt(sc, sc->sa.agf_bp);
level = be32_to_cpu(agf->agf_levels[XFS_BTNUM_RMAP]);
if (level <= 0 || level > XFS_BTREE_MAXLEVELS)
- xfs_scrub_block_set_corrupt(sc, sc->sa.agf_bp);
+ xchk_block_set_corrupt(sc, sc->sa.agf_bp);
}
if (xfs_sb_version_hasreflink(&mp->m_sb)) {
agbno = be32_to_cpu(agf->agf_refcount_root);
if (!xfs_verify_agbno(mp, agno, agbno))
- xfs_scrub_block_set_corrupt(sc, sc->sa.agf_bp);
+ xchk_block_set_corrupt(sc, sc->sa.agf_bp);
level = be32_to_cpu(agf->agf_refcount_level);
if (level <= 0 || level > XFS_BTREE_MAXLEVELS)
- xfs_scrub_block_set_corrupt(sc, sc->sa.agf_bp);
+ xchk_block_set_corrupt(sc, sc->sa.agf_bp);
}
/* Check the AGFL counters */
@@ -588,16 +588,16 @@ xfs_scrub_agf(
else
fl_count = xfs_agfl_size(mp) - agfl_first + agfl_last + 1;
if (agfl_count != 0 && fl_count != agfl_count)
- xfs_scrub_block_set_corrupt(sc, sc->sa.agf_bp);
+ xchk_block_set_corrupt(sc, sc->sa.agf_bp);
- xfs_scrub_agf_xref(sc);
+ xchk_agf_xref(sc);
out:
return error;
}
/* AGFL */
-struct xfs_scrub_agfl_info {
+struct xchk_agfl_info {
struct xfs_owner_info oinfo;
unsigned int sz_entries;
unsigned int nr_entries;
@@ -607,7 +607,7 @@ struct xfs_scrub_agfl_info {
/* Cross-reference with the other btrees. */
STATIC void
-xfs_scrub_agfl_block_xref(
+xchk_agfl_block_xref(
struct xfs_scrub_context *sc,
xfs_agblock_t agbno,
struct xfs_owner_info *oinfo)
@@ -615,20 +615,20 @@ xfs_scrub_agfl_block_xref(
if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
return;
- xfs_scrub_xref_is_used_space(sc, agbno, 1);
- xfs_scrub_xref_is_not_inode_chunk(sc, agbno, 1);
- xfs_scrub_xref_is_owned_by(sc, agbno, 1, oinfo);
- xfs_scrub_xref_is_not_shared(sc, agbno, 1);
+ xchk_xref_is_used_space(sc, agbno, 1);
+ xchk_xref_is_not_inode_chunk(sc, agbno, 1);
+ xchk_xref_is_owned_by(sc, agbno, 1, oinfo);
+ xchk_xref_is_not_shared(sc, agbno, 1);
}
/* Scrub an AGFL block. */
STATIC int
-xfs_scrub_agfl_block(
+xchk_agfl_block(
struct xfs_mount *mp,
xfs_agblock_t agbno,
void *priv)
{
- struct xfs_scrub_agfl_info *sai = priv;
+ struct xchk_agfl_info *sai = priv;
struct xfs_scrub_context *sc = sai->sc;
xfs_agnumber_t agno = sc->sa.agno;
@@ -636,9 +636,9 @@ xfs_scrub_agfl_block(
sai->nr_entries < sai->sz_entries)
sai->entries[sai->nr_entries++] = agbno;
else
- xfs_scrub_block_set_corrupt(sc, sc->sa.agfl_bp);
+ xchk_block_set_corrupt(sc, sc->sa.agfl_bp);
- xfs_scrub_agfl_block_xref(sc, agbno, priv);
+ xchk_agfl_block_xref(sc, agbno, priv);
if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
return XFS_BTREE_QUERY_RANGE_ABORT;
@@ -647,7 +647,7 @@ xfs_scrub_agfl_block(
}
static int
-xfs_scrub_agblock_cmp(
+xchk_agblock_cmp(
const void *pa,
const void *pb)
{
@@ -659,7 +659,7 @@ xfs_scrub_agblock_cmp(
/* Cross-reference with the other btrees. */
STATIC void
-xfs_scrub_agfl_xref(
+xchk_agfl_xref(
struct xfs_scrub_context *sc)
{
struct xfs_owner_info oinfo;
@@ -672,15 +672,15 @@ xfs_scrub_agfl_xref(
agbno = XFS_AGFL_BLOCK(mp);
- error = xfs_scrub_ag_btcur_init(sc, &sc->sa);
+ error = xchk_ag_btcur_init(sc, &sc->sa);
if (error)
return;
- xfs_scrub_xref_is_used_space(sc, agbno, 1);
- xfs_scrub_xref_is_not_inode_chunk(sc, agbno, 1);
+ xchk_xref_is_used_space(sc, agbno, 1);
+ xchk_xref_is_not_inode_chunk(sc, agbno, 1);
xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_FS);
- xfs_scrub_xref_is_owned_by(sc, agbno, 1, &oinfo);
- xfs_scrub_xref_is_not_shared(sc, agbno, 1);
+ xchk_xref_is_owned_by(sc, agbno, 1, &oinfo);
+ xchk_xref_is_not_shared(sc, agbno, 1);
/*
* Scrub teardown will take care of sc->sa for us. Leave sc->sa
@@ -690,10 +690,10 @@ xfs_scrub_agfl_xref(
/* Scrub the AGFL. */
int
-xfs_scrub_agfl(
+xchk_agfl(
struct xfs_scrub_context *sc)
{
- struct xfs_scrub_agfl_info sai;
+ struct xchk_agfl_info sai;
struct xfs_agf *agf;
xfs_agnumber_t agno;
unsigned int agflcount;
@@ -701,15 +701,15 @@ xfs_scrub_agfl(
int error;
agno = sc->sa.agno = sc->sm->sm_agno;
- error = xfs_scrub_ag_read_headers(sc, agno, &sc->sa.agi_bp,
+ error = xchk_ag_read_headers(sc, agno, &sc->sa.agi_bp,
&sc->sa.agf_bp, &sc->sa.agfl_bp);
- if (!xfs_scrub_process_error(sc, agno, XFS_AGFL_BLOCK(sc->mp), &error))
+ if (!xchk_process_error(sc, agno, XFS_AGFL_BLOCK(sc->mp), &error))
goto out;
if (!sc->sa.agf_bp)
return -EFSCORRUPTED;
- xfs_scrub_buffer_recheck(sc, sc->sa.agfl_bp);
+ xchk_buffer_recheck(sc, sc->sa.agfl_bp);
- xfs_scrub_agfl_xref(sc);
+ xchk_agfl_xref(sc);
if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
goto out;
@@ -718,7 +718,7 @@ xfs_scrub_agfl(
agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
agflcount = be32_to_cpu(agf->agf_flcount);
if (agflcount > xfs_agfl_size(sc->mp)) {
- xfs_scrub_block_set_corrupt(sc, sc->sa.agf_bp);
+ xchk_block_set_corrupt(sc, sc->sa.agf_bp);
goto out;
}
memset(&sai, 0, sizeof(sai));
@@ -734,7 +734,7 @@ xfs_scrub_agfl(
/* Check the blocks in the AGFL. */
xfs_rmap_ag_owner(&sai.oinfo, XFS_RMAP_OWN_AG);
error = xfs_agfl_walk(sc->mp, XFS_BUF_TO_AGF(sc->sa.agf_bp),
- sc->sa.agfl_bp, xfs_scrub_agfl_block, &sai);
+ sc->sa.agfl_bp, xchk_agfl_block, &sai);
if (error == XFS_BTREE_QUERY_RANGE_ABORT) {
error = 0;
goto out_free;
@@ -743,16 +743,16 @@ xfs_scrub_agfl(
goto out_free;
if (agflcount != sai.nr_entries) {
- xfs_scrub_block_set_corrupt(sc, sc->sa.agf_bp);
+ xchk_block_set_corrupt(sc, sc->sa.agf_bp);
goto out_free;
}
/* Sort entries, check for duplicates. */
sort(sai.entries, sai.nr_entries, sizeof(sai.entries[0]),
- xfs_scrub_agblock_cmp, NULL);
+ xchk_agblock_cmp, NULL);
for (i = 1; i < sai.nr_entries; i++) {
if (sai.entries[i] == sai.entries[i - 1]) {
- xfs_scrub_block_set_corrupt(sc, sc->sa.agf_bp);
+ xchk_block_set_corrupt(sc, sc->sa.agf_bp);
break;
}
}
@@ -767,7 +767,7 @@ xfs_scrub_agfl(
/* Check agi_count/agi_freecount */
static inline void
-xfs_scrub_agi_xref_icounts(
+xchk_agi_xref_icounts(
struct xfs_scrub_context *sc)
{
struct xfs_agi *agi = XFS_BUF_TO_AGI(sc->sa.agi_bp);
@@ -779,16 +779,16 @@ xfs_scrub_agi_xref_icounts(
return;
error = xfs_ialloc_count_inodes(sc->sa.ino_cur, &icount, &freecount);
- if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.ino_cur))
+ if (!xchk_should_check_xref(sc, &error, &sc->sa.ino_cur))
return;
if (be32_to_cpu(agi->agi_count) != icount ||
be32_to_cpu(agi->agi_freecount) != freecount)
- xfs_scrub_block_xref_set_corrupt(sc, sc->sa.agi_bp);
+ xchk_block_xref_set_corrupt(sc, sc->sa.agi_bp);
}
/* Cross-reference with the other btrees. */
STATIC void
-xfs_scrub_agi_xref(
+xchk_agi_xref(
struct xfs_scrub_context *sc)
{
struct xfs_owner_info oinfo;
@@ -801,23 +801,23 @@ xfs_scrub_agi_xref(
agbno = XFS_AGI_BLOCK(mp);
- error = xfs_scrub_ag_btcur_init(sc, &sc->sa);
+ error = xchk_ag_btcur_init(sc, &sc->sa);
if (error)
return;
- xfs_scrub_xref_is_used_space(sc, agbno, 1);
- xfs_scrub_xref_is_not_inode_chunk(sc, agbno, 1);
- xfs_scrub_agi_xref_icounts(sc);
+ xchk_xref_is_used_space(sc, agbno, 1);
+ xchk_xref_is_not_inode_chunk(sc, agbno, 1);
+ xchk_agi_xref_icounts(sc);
xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_FS);
- xfs_scrub_xref_is_owned_by(sc, agbno, 1, &oinfo);
- xfs_scrub_xref_is_not_shared(sc, agbno, 1);
+ xchk_xref_is_owned_by(sc, agbno, 1, &oinfo);
+ xchk_xref_is_not_shared(sc, agbno, 1);
/* scrub teardown will take care of sc->sa for us */
}
/* Scrub the AGI. */
int
-xfs_scrub_agi(
+xchk_agi(
struct xfs_scrub_context *sc)
{
struct xfs_mount *mp = sc->mp;
@@ -834,36 +834,36 @@ xfs_scrub_agi(
int error = 0;
agno = sc->sa.agno = sc->sm->sm_agno;
- error = xfs_scrub_ag_read_headers(sc, agno, &sc->sa.agi_bp,
+ error = xchk_ag_read_headers(sc, agno, &sc->sa.agi_bp,
&sc->sa.agf_bp, &sc->sa.agfl_bp);
- if (!xfs_scrub_process_error(sc, agno, XFS_AGI_BLOCK(sc->mp), &error))
+ if (!xchk_process_error(sc, agno, XFS_AGI_BLOCK(sc->mp), &error))
goto out;
- xfs_scrub_buffer_recheck(sc, sc->sa.agi_bp);
+ xchk_buffer_recheck(sc, sc->sa.agi_bp);
agi = XFS_BUF_TO_AGI(sc->sa.agi_bp);
/* Check the AG length */
eoag = be32_to_cpu(agi->agi_length);
if (eoag != xfs_ag_block_count(mp, agno))
- xfs_scrub_block_set_corrupt(sc, sc->sa.agi_bp);
+ xchk_block_set_corrupt(sc, sc->sa.agi_bp);
/* Check btree roots and levels */
agbno = be32_to_cpu(agi->agi_root);
if (!xfs_verify_agbno(mp, agno, agbno))
- xfs_scrub_block_set_corrupt(sc, sc->sa.agi_bp);
+ xchk_block_set_corrupt(sc, sc->sa.agi_bp);
level = be32_to_cpu(agi->agi_level);
if (level <= 0 || level > XFS_BTREE_MAXLEVELS)
- xfs_scrub_block_set_corrupt(sc, sc->sa.agi_bp);
+ xchk_block_set_corrupt(sc, sc->sa.agi_bp);
if (xfs_sb_version_hasfinobt(&mp->m_sb)) {
agbno = be32_to_cpu(agi->agi_free_root);
if (!xfs_verify_agbno(mp, agno, agbno))
- xfs_scrub_block_set_corrupt(sc, sc->sa.agi_bp);
+ xchk_block_set_corrupt(sc, sc->sa.agi_bp);
level = be32_to_cpu(agi->agi_free_level);
if (level <= 0 || level > XFS_BTREE_MAXLEVELS)
- xfs_scrub_block_set_corrupt(sc, sc->sa.agi_bp);
+ xchk_block_set_corrupt(sc, sc->sa.agi_bp);
}
/* Check inode counters */
@@ -871,16 +871,16 @@ xfs_scrub_agi(
icount = be32_to_cpu(agi->agi_count);
if (icount > last_agino - first_agino + 1 ||
icount < be32_to_cpu(agi->agi_freecount))
- xfs_scrub_block_set_corrupt(sc, sc->sa.agi_bp);
+ xchk_block_set_corrupt(sc, sc->sa.agi_bp);
/* Check inode pointers */
agino = be32_to_cpu(agi->agi_newino);
if (agino != NULLAGINO && !xfs_verify_agino(mp, agno, agino))
- xfs_scrub_block_set_corrupt(sc, sc->sa.agi_bp);
+ xchk_block_set_corrupt(sc, sc->sa.agi_bp);
agino = be32_to_cpu(agi->agi_dirino);
if (agino != NULLAGINO && !xfs_verify_agino(mp, agno, agino))
- xfs_scrub_block_set_corrupt(sc, sc->sa.agi_bp);
+ xchk_block_set_corrupt(sc, sc->sa.agi_bp);
/* Check unlinked inode buckets */
for (i = 0; i < XFS_AGI_UNLINKED_BUCKETS; i++) {
@@ -888,13 +888,13 @@ xfs_scrub_agi(
if (agino == NULLAGINO)
continue;
if (!xfs_verify_agino(mp, agno, agino))
- xfs_scrub_block_set_corrupt(sc, sc->sa.agi_bp);
+ xchk_block_set_corrupt(sc, sc->sa.agi_bp);
}
if (agi->agi_pad32 != cpu_to_be32(0))
- xfs_scrub_block_set_corrupt(sc, sc->sa.agi_bp);
+ xchk_block_set_corrupt(sc, sc->sa.agi_bp);
- xfs_scrub_agi_xref(sc);
+ xchk_agi_xref(sc);
out:
return error;
}
diff --git a/fs/xfs/scrub/alloc.c b/fs/xfs/scrub/alloc.c
index 50e4f7fa06f0..1f6e3a6a1fdd 100644
--- a/fs/xfs/scrub/alloc.c
+++ b/fs/xfs/scrub/alloc.c
@@ -28,11 +28,11 @@
* Set us up to scrub free space btrees.
*/
int
-xfs_scrub_setup_ag_allocbt(
+xchk_setup_ag_allocbt(
struct xfs_scrub_context *sc,
struct xfs_inode *ip)
{
- return xfs_scrub_setup_ag_btree(sc, ip, false);
+ return xchk_setup_ag_btree(sc, ip, false);
}
/* Free space btree scrubber. */
@@ -41,7 +41,7 @@ xfs_scrub_setup_ag_allocbt(
* bnobt/cntbt record, respectively.
*/
STATIC void
-xfs_scrub_allocbt_xref_other(
+xchk_allocbt_xref_other(
struct xfs_scrub_context *sc,
xfs_agblock_t agbno,
xfs_extlen_t len)
@@ -56,32 +56,32 @@ xfs_scrub_allocbt_xref_other(
pcur = &sc->sa.cnt_cur;
else
pcur = &sc->sa.bno_cur;
- if (!*pcur || xfs_scrub_skip_xref(sc->sm))
+ if (!*pcur || xchk_skip_xref(sc->sm))
return;
error = xfs_alloc_lookup_le(*pcur, agbno, len, &has_otherrec);
- if (!xfs_scrub_should_check_xref(sc, &error, pcur))
+ if (!xchk_should_check_xref(sc, &error, pcur))
return;
if (!has_otherrec) {
- xfs_scrub_btree_xref_set_corrupt(sc, *pcur, 0);
+ xchk_btree_xref_set_corrupt(sc, *pcur, 0);
return;
}
error = xfs_alloc_get_rec(*pcur, &fbno, &flen, &has_otherrec);
- if (!xfs_scrub_should_check_xref(sc, &error, pcur))
+ if (!xchk_should_check_xref(sc, &error, pcur))
return;
if (!has_otherrec) {
- xfs_scrub_btree_xref_set_corrupt(sc, *pcur, 0);
+ xchk_btree_xref_set_corrupt(sc, *pcur, 0);
return;
}
if (fbno != agbno || flen != len)
- xfs_scrub_btree_xref_set_corrupt(sc, *pcur, 0);
+ xchk_btree_xref_set_corrupt(sc, *pcur, 0);
}
/* Cross-reference with the other btrees. */
STATIC void
-xfs_scrub_allocbt_xref(
+xchk_allocbt_xref(
struct xfs_scrub_context *sc,
xfs_agblock_t agbno,
xfs_extlen_t len)
@@ -89,16 +89,16 @@ xfs_scrub_allocbt_xref(
if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
return;
- xfs_scrub_allocbt_xref_other(sc, agbno, len);
- xfs_scrub_xref_is_not_inode_chunk(sc, agbno, len);
- xfs_scrub_xref_has_no_owner(sc, agbno, len);
- xfs_scrub_xref_is_not_shared(sc, agbno, len);
+ xchk_allocbt_xref_other(sc, agbno, len);
+ xchk_xref_is_not_inode_chunk(sc, agbno, len);
+ xchk_xref_has_no_owner(sc, agbno, len);
+ xchk_xref_is_not_shared(sc, agbno, len);
}
/* Scrub a bnobt/cntbt record. */
STATIC int
-xfs_scrub_allocbt_rec(
- struct xfs_scrub_btree *bs,
+xchk_allocbt_rec(
+ struct xchk_btree *bs,
union xfs_btree_rec *rec)
{
struct xfs_mount *mp = bs->cur->bc_mp;
@@ -113,16 +113,16 @@ xfs_scrub_allocbt_rec(
if (bno + len <= bno ||
!xfs_verify_agbno(mp, agno, bno) ||
!xfs_verify_agbno(mp, agno, bno + len - 1))
- xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
+ xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
- xfs_scrub_allocbt_xref(bs->sc, bno, len);
+ xchk_allocbt_xref(bs->sc, bno, len);
return error;
}
/* Scrub the freespace btrees for some AG. */
STATIC int
-xfs_scrub_allocbt(
+xchk_allocbt(
struct xfs_scrub_context *sc,
xfs_btnum_t which)
{
@@ -131,26 +131,26 @@ xfs_scrub_allocbt(
xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_AG);
cur = which == XFS_BTNUM_BNO ? sc->sa.bno_cur : sc->sa.cnt_cur;
- return xfs_scrub_btree(sc, cur, xfs_scrub_allocbt_rec, &oinfo, NULL);
+ return xchk_btree(sc, cur, xchk_allocbt_rec, &oinfo, NULL);
}
int
-xfs_scrub_bnobt(
+xchk_bnobt(
struct xfs_scrub_context *sc)
{
- return xfs_scrub_allocbt(sc, XFS_BTNUM_BNO);
+ return xchk_allocbt(sc, XFS_BTNUM_BNO);
}
int
-xfs_scrub_cntbt(
+xchk_cntbt(
struct xfs_scrub_context *sc)
{
- return xfs_scrub_allocbt(sc, XFS_BTNUM_CNT);
+ return xchk_allocbt(sc, XFS_BTNUM_CNT);
}
/* xref check that the extent is not free */
void
-xfs_scrub_xref_is_used_space(
+xchk_xref_is_used_space(
struct xfs_scrub_context *sc,
xfs_agblock_t agbno,
xfs_extlen_t len)
@@ -158,12 +158,12 @@ xfs_scrub_xref_is_used_space(
bool is_freesp;
int error;
- if (!sc->sa.bno_cur || xfs_scrub_skip_xref(sc->sm))
+ if (!sc->sa.bno_cur || xchk_skip_xref(sc->sm))
return;
error = xfs_alloc_has_record(sc->sa.bno_cur, agbno, len, &is_freesp);
- if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.bno_cur))
+ if (!xchk_should_check_xref(sc, &error, &sc->sa.bno_cur))
return;
if (is_freesp)
- xfs_scrub_btree_xref_set_corrupt(sc, sc->sa.bno_cur, 0);
+ xchk_btree_xref_set_corrupt(sc, sc->sa.bno_cur, 0);
}
diff --git a/fs/xfs/scrub/attr.c b/fs/xfs/scrub/attr.c
index de51cf8a8516..0068bebddf3e 100644
--- a/fs/xfs/scrub/attr.c
+++ b/fs/xfs/scrub/attr.c
@@ -32,7 +32,7 @@
/* Set us up to scrub an inode's extended attributes. */
int
-xfs_scrub_setup_xattr(
+xchk_setup_xattr(
struct xfs_scrub_context *sc,
struct xfs_inode *ip)
{
@@ -50,12 +50,12 @@ xfs_scrub_setup_xattr(
if (!sc->buf)
return -ENOMEM;
- return xfs_scrub_setup_inode_contents(sc, ip, 0);
+ return xchk_setup_inode_contents(sc, ip, 0);
}
/* Extended Attributes */
-struct xfs_scrub_xattr {
+struct xchk_xattr {
struct xfs_attr_list_context context;
struct xfs_scrub_context *sc;
};
@@ -69,22 +69,22 @@ struct xfs_scrub_xattr {
* or if we get more or less data than we expected.
*/
static void
-xfs_scrub_xattr_listent(
+xchk_xattr_listent(
struct xfs_attr_list_context *context,
int flags,
unsigned char *name,
int namelen,
int valuelen)
{
- struct xfs_scrub_xattr *sx;
+ struct xchk_xattr *sx;
struct xfs_da_args args = { NULL };
int error = 0;
- sx = container_of(context, struct xfs_scrub_xattr, context);
+ sx = container_of(context, struct xchk_xattr, context);
if (flags & XFS_ATTR_INCOMPLETE) {
/* Incomplete attr key, just mark the inode for preening. */
- xfs_scrub_ino_set_preen(sx->sc, context->dp->i_ino);
+ xchk_ino_set_preen(sx->sc, context->dp->i_ino);
return;
}
@@ -106,11 +106,11 @@ xfs_scrub_xattr_listent(
error = xfs_attr_get_ilocked(context->dp, &args);
if (error == -EEXIST)
error = 0;
- if (!xfs_scrub_fblock_process_error(sx->sc, XFS_ATTR_FORK, args.blkno,
+ if (!xchk_fblock_process_error(sx->sc, XFS_ATTR_FORK, args.blkno,
&error))
goto fail_xref;
if (args.valuelen != valuelen)
- xfs_scrub_fblock_set_corrupt(sx->sc, XFS_ATTR_FORK,
+ xchk_fblock_set_corrupt(sx->sc, XFS_ATTR_FORK,
args.blkno);
fail_xref:
if (sx->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
@@ -126,7 +126,7 @@ xfs_scrub_xattr_listent(
* the smallest address
*/
STATIC bool
-xfs_scrub_xattr_set_map(
+xchk_xattr_set_map(
struct xfs_scrub_context *sc,
unsigned long *map,
unsigned int start,
@@ -154,7 +154,7 @@ xfs_scrub_xattr_set_map(
* attr freemap has problems or points to used space.
*/
STATIC bool
-xfs_scrub_xattr_check_freemap(
+xchk_xattr_check_freemap(
struct xfs_scrub_context *sc,
unsigned long *map,
struct xfs_attr3_icleaf_hdr *leafhdr)
@@ -168,7 +168,7 @@ xfs_scrub_xattr_check_freemap(
freemap = (unsigned long *)sc->buf + BITS_TO_LONGS(mapsize);
bitmap_zero(freemap, mapsize);
for (i = 0; i < XFS_ATTR_LEAF_MAPSIZE; i++) {
- if (!xfs_scrub_xattr_set_map(sc, freemap,
+ if (!xchk_xattr_set_map(sc, freemap,
leafhdr->freemap[i].base,
leafhdr->freemap[i].size))
return false;
@@ -184,8 +184,8 @@ xfs_scrub_xattr_check_freemap(
* Returns the number of bytes used for the name/value data.
*/
STATIC void
-xfs_scrub_xattr_entry(
- struct xfs_scrub_da_btree *ds,
+xchk_xattr_entry(
+ struct xchk_da_btree *ds,
int level,
char *buf_end,
struct xfs_attr_leafblock *leaf,
@@ -204,17 +204,17 @@ xfs_scrub_xattr_entry(
unsigned int namesize;
if (ent->pad2 != 0)
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
/* Hash values in order? */
if (be32_to_cpu(ent->hashval) < *last_hashval)
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
*last_hashval = be32_to_cpu(ent->hashval);
nameidx = be16_to_cpu(ent->nameidx);
if (nameidx < leafhdr->firstused ||
nameidx >= mp->m_attr_geo->blksize) {
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
return;
}
@@ -225,27 +225,27 @@ xfs_scrub_xattr_entry(
be16_to_cpu(lentry->valuelen));
name_end = (char *)lentry + namesize;
if (lentry->namelen == 0)
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
} else {
rentry = xfs_attr3_leaf_name_remote(leaf, idx);
namesize = xfs_attr_leaf_entsize_remote(rentry->namelen);
name_end = (char *)rentry + namesize;
if (rentry->namelen == 0 || rentry->valueblk == 0)
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
}
if (name_end > buf_end)
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
- if (!xfs_scrub_xattr_set_map(ds->sc, usedmap, nameidx, namesize))
- xfs_scrub_da_set_corrupt(ds, level);
+ if (!xchk_xattr_set_map(ds->sc, usedmap, nameidx, namesize))
+ xchk_da_set_corrupt(ds, level);
if (!(ds->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT))
*usedbytes += namesize;
}
/* Scrub an attribute leaf. */
STATIC int
-xfs_scrub_xattr_block(
- struct xfs_scrub_da_btree *ds,
+xchk_xattr_block(
+ struct xchk_da_btree *ds,
int level)
{
struct xfs_attr3_icleaf_hdr leafhdr;
@@ -275,10 +275,10 @@ xfs_scrub_xattr_block(
if (leaf->hdr.pad1 != 0 || leaf->hdr.pad2 != 0 ||
leaf->hdr.info.hdr.pad != 0)
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
} else {
if (leaf->hdr.pad1 != 0 || leaf->hdr.info.pad != 0)
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
}
/* Check the leaf header */
@@ -286,44 +286,44 @@ xfs_scrub_xattr_block(
hdrsize = xfs_attr3_leaf_hdr_size(leaf);
if (leafhdr.usedbytes > mp->m_attr_geo->blksize)
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
if (leafhdr.firstused > mp->m_attr_geo->blksize)
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
if (leafhdr.firstused < hdrsize)
- xfs_scrub_da_set_corrupt(ds, level);
- if (!xfs_scrub_xattr_set_map(ds->sc, usedmap, 0, hdrsize))
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
+ if (!xchk_xattr_set_map(ds->sc, usedmap, 0, hdrsize))
+ xchk_da_set_corrupt(ds, level);
if (ds->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
goto out;
entries = xfs_attr3_leaf_entryp(leaf);
if ((char *)&entries[leafhdr.count] > (char *)leaf + leafhdr.firstused)
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
buf_end = (char *)bp->b_addr + mp->m_attr_geo->blksize;
for (i = 0, ent = entries; i < leafhdr.count; ent++, i++) {
/* Mark the leaf entry itself. */
off = (char *)ent - (char *)leaf;
- if (!xfs_scrub_xattr_set_map(ds->sc, usedmap, off,
+ if (!xchk_xattr_set_map(ds->sc, usedmap, off,
sizeof(xfs_attr_leaf_entry_t))) {
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
goto out;
}
/* Check the entry and nameval. */
- xfs_scrub_xattr_entry(ds, level, buf_end, leaf, &leafhdr,
+ xchk_xattr_entry(ds, level, buf_end, leaf, &leafhdr,
usedmap, ent, i, &usedbytes, &last_hashval);
if (ds->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
goto out;
}
- if (!xfs_scrub_xattr_check_freemap(ds->sc, usedmap, &leafhdr))
- xfs_scrub_da_set_corrupt(ds, level);
+ if (!xchk_xattr_check_freemap(ds->sc, usedmap, &leafhdr))
+ xchk_da_set_corrupt(ds, level);
if (leafhdr.usedbytes != usedbytes)
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
out:
return 0;
@@ -331,8 +331,8 @@ xfs_scrub_xattr_block(
/* Scrub a attribute btree record. */
STATIC int
-xfs_scrub_xattr_rec(
- struct xfs_scrub_da_btree *ds,
+xchk_xattr_rec(
+ struct xchk_da_btree *ds,
int level,
void *rec)
{
@@ -352,14 +352,14 @@ xfs_scrub_xattr_rec(
blk = &ds->state->path.blk[level];
/* Check the whole block, if necessary. */
- error = xfs_scrub_xattr_block(ds, level);
+ error = xchk_xattr_block(ds, level);
if (error)
goto out;
if (ds->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
goto out;
/* Check the hash of the entry. */
- error = xfs_scrub_da_btree_hash(ds, level, &ent->hashval);
+ error = xchk_da_btree_hash(ds, level, &ent->hashval);
if (error)
goto out;
@@ -368,7 +368,7 @@ xfs_scrub_xattr_rec(
hdrsize = xfs_attr3_leaf_hdr_size(bp->b_addr);
nameidx = be16_to_cpu(ent->nameidx);
if (nameidx < hdrsize || nameidx >= mp->m_attr_geo->blksize) {
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
goto out;
}
@@ -377,12 +377,12 @@ xfs_scrub_xattr_rec(
badflags = ~(XFS_ATTR_LOCAL | XFS_ATTR_ROOT | XFS_ATTR_SECURE |
XFS_ATTR_INCOMPLETE);
if ((ent->flags & badflags) != 0)
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
if (ent->flags & XFS_ATTR_LOCAL) {
lentry = (struct xfs_attr_leaf_name_local *)
(((char *)bp->b_addr) + nameidx);
if (lentry->namelen <= 0) {
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
goto out;
}
calc_hash = xfs_da_hashname(lentry->nameval, lentry->namelen);
@@ -390,13 +390,13 @@ xfs_scrub_xattr_rec(
rentry = (struct xfs_attr_leaf_name_remote *)
(((char *)bp->b_addr) + nameidx);
if (rentry->namelen <= 0) {
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
goto out;
}
calc_hash = xfs_da_hashname(rentry->name, rentry->namelen);
}
if (calc_hash != hash)
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
out:
return error;
@@ -404,10 +404,10 @@ xfs_scrub_xattr_rec(
/* Scrub the extended attribute metadata. */
int
-xfs_scrub_xattr(
+xchk_xattr(
struct xfs_scrub_context *sc)
{
- struct xfs_scrub_xattr sx;
+ struct xchk_xattr sx;
struct attrlist_cursor_kern cursor = { 0 };
xfs_dablk_t last_checked = -1U;
int error = 0;
@@ -417,7 +417,7 @@ xfs_scrub_xattr(
memset(&sx, 0, sizeof(sx));
/* Check attribute tree structure */
- error = xfs_scrub_da_btree(sc, XFS_ATTR_FORK, xfs_scrub_xattr_rec,
+ error = xchk_da_btree(sc, XFS_ATTR_FORK, xchk_xattr_rec,
&last_checked);
if (error)
goto out;
@@ -429,7 +429,7 @@ xfs_scrub_xattr(
sx.context.dp = sc->ip;
sx.context.cursor = &cursor;
sx.context.resynch = 1;
- sx.context.put_listent = xfs_scrub_xattr_listent;
+ sx.context.put_listent = xchk_xattr_listent;
sx.context.tp = sc->tp;
sx.context.flags = ATTR_INCOMPLETE;
sx.sc = sc;
@@ -438,7 +438,7 @@ xfs_scrub_xattr(
* Look up every xattr in this file by name.
*
* Use the backend implementation of xfs_attr_list to call
- * xfs_scrub_xattr_listent on every attribute key in this inode.
+ * xchk_xattr_listent on every attribute key in this inode.
* In other words, we use the same iterator/callback mechanism
* that listattr uses to scrub extended attributes, though in our
* _listent function, we check the value of the attribute.
@@ -451,7 +451,7 @@ xfs_scrub_xattr(
* locking order.
*/
error = xfs_attr_list_int_ilocked(&sx.context);
- if (!xfs_scrub_fblock_process_error(sc, XFS_ATTR_FORK, 0, &error))
+ if (!xchk_fblock_process_error(sc, XFS_ATTR_FORK, 0, &error))
goto out;
out:
return error;
diff --git a/fs/xfs/scrub/bmap.c b/fs/xfs/scrub/bmap.c
index ebbfab173e97..19cfbd3910a2 100644
--- a/fs/xfs/scrub/bmap.c
+++ b/fs/xfs/scrub/bmap.c
@@ -33,13 +33,13 @@
/* Set us up with an inode's bmap. */
int
-xfs_scrub_setup_inode_bmap(
+xchk_setup_inode_bmap(
struct xfs_scrub_context *sc,
struct xfs_inode *ip)
{
int error;
- error = xfs_scrub_get_inode(sc, ip);
+ error = xchk_get_inode(sc, ip);
if (error)
goto out;
@@ -60,7 +60,7 @@ xfs_scrub_setup_inode_bmap(
}
/* Got the inode, lock it and we're ready to go. */
- error = xfs_scrub_trans_alloc(sc, 0);
+ error = xchk_trans_alloc(sc, 0);
if (error)
goto out;
sc->ilock_flags |= XFS_ILOCK_EXCL;
@@ -78,7 +78,7 @@ xfs_scrub_setup_inode_bmap(
* is in btree format.
*/
-struct xfs_scrub_bmap_info {
+struct xchk_bmap_info {
struct xfs_scrub_context *sc;
xfs_fileoff_t lastoff;
bool is_rt;
@@ -88,8 +88,8 @@ struct xfs_scrub_bmap_info {
/* Look for a corresponding rmap for this irec. */
static inline bool
-xfs_scrub_bmap_get_rmap(
- struct xfs_scrub_bmap_info *info,
+xchk_bmap_get_rmap(
+ struct xchk_bmap_info *info,
struct xfs_bmbt_irec *irec,
xfs_agblock_t agbno,
uint64_t owner,
@@ -120,7 +120,7 @@ xfs_scrub_bmap_get_rmap(
if (info->is_shared) {
error = xfs_rmap_lookup_le_range(info->sc->sa.rmap_cur, agbno,
owner, offset, rflags, rmap, &has_rmap);
- if (!xfs_scrub_should_check_xref(info->sc, &error,
+ if (!xchk_should_check_xref(info->sc, &error,
&info->sc->sa.rmap_cur))
return false;
goto out;
@@ -131,28 +131,28 @@ xfs_scrub_bmap_get_rmap(
*/
error = xfs_rmap_lookup_le(info->sc->sa.rmap_cur, agbno, 0, owner,
offset, rflags, &has_rmap);
- if (!xfs_scrub_should_check_xref(info->sc, &error,
+ if (!xchk_should_check_xref(info->sc, &error,
&info->sc->sa.rmap_cur))
return false;
if (!has_rmap)
goto out;
error = xfs_rmap_get_rec(info->sc->sa.rmap_cur, rmap, &has_rmap);
- if (!xfs_scrub_should_check_xref(info->sc, &error,
+ if (!xchk_should_check_xref(info->sc, &error,
&info->sc->sa.rmap_cur))
return false;
out:
if (!has_rmap)
- xfs_scrub_fblock_xref_set_corrupt(info->sc, info->whichfork,
+ xchk_fblock_xref_set_corrupt(info->sc, info->whichfork,
irec->br_startoff);
return has_rmap;
}
/* Make sure that we have rmapbt records for this extent. */
STATIC void
-xfs_scrub_bmap_xref_rmap(
- struct xfs_scrub_bmap_info *info,
+xchk_bmap_xref_rmap(
+ struct xchk_bmap_info *info,
struct xfs_bmbt_irec *irec,
xfs_agblock_t agbno)
{
@@ -160,7 +160,7 @@ xfs_scrub_bmap_xref_rmap(
unsigned long long rmap_end;
uint64_t owner;
- if (!info->sc->sa.rmap_cur || xfs_scrub_skip_xref(info->sc->sm))
+ if (!info->sc->sa.rmap_cur || xchk_skip_xref(info->sc->sm))
return;
if (info->whichfork == XFS_COW_FORK)
@@ -169,14 +169,14 @@ xfs_scrub_bmap_xref_rmap(
owner = info->sc->ip->i_ino;
/* Find the rmap record for this irec. */
- if (!xfs_scrub_bmap_get_rmap(info, irec, agbno, owner, &rmap))
+ if (!xchk_bmap_get_rmap(info, irec, agbno, owner, &rmap))
return;
/* Check the rmap. */
rmap_end = (unsigned long long)rmap.rm_startblock + rmap.rm_blockcount;
if (rmap.rm_startblock > agbno ||
agbno + irec->br_blockcount > rmap_end)
- xfs_scrub_fblock_xref_set_corrupt(info->sc, info->whichfork,
+ xchk_fblock_xref_set_corrupt(info->sc, info->whichfork,
irec->br_startoff);
/*
@@ -189,12 +189,12 @@ xfs_scrub_bmap_xref_rmap(
rmap.rm_blockcount;
if (rmap.rm_offset > irec->br_startoff ||
irec->br_startoff + irec->br_blockcount > rmap_end)
- xfs_scrub_fblock_xref_set_corrupt(info->sc,
+ xchk_fblock_xref_set_corrupt(info->sc,
info->whichfork, irec->br_startoff);
}
if (rmap.rm_owner != owner)
- xfs_scrub_fblock_xref_set_corrupt(info->sc, info->whichfork,
+ xchk_fblock_xref_set_corrupt(info->sc, info->whichfork,
irec->br_startoff);
/*
@@ -207,22 +207,22 @@ xfs_scrub_bmap_xref_rmap(
if (owner != XFS_RMAP_OWN_COW &&
irec->br_state == XFS_EXT_UNWRITTEN &&
!(rmap.rm_flags & XFS_RMAP_UNWRITTEN))
- xfs_scrub_fblock_xref_set_corrupt(info->sc, info->whichfork,
+ xchk_fblock_xref_set_corrupt(info->sc, info->whichfork,
irec->br_startoff);
if (info->whichfork == XFS_ATTR_FORK &&
!(rmap.rm_flags & XFS_RMAP_ATTR_FORK))
- xfs_scrub_fblock_xref_set_corrupt(info->sc, info->whichfork,
+ xchk_fblock_xref_set_corrupt(info->sc, info->whichfork,
irec->br_startoff);
if (rmap.rm_flags & XFS_RMAP_BMBT_BLOCK)
- xfs_scrub_fblock_xref_set_corrupt(info->sc, info->whichfork,
+ xchk_fblock_xref_set_corrupt(info->sc, info->whichfork,
irec->br_startoff);
}
/* Cross-reference a single rtdev extent record. */
STATIC void
-xfs_scrub_bmap_rt_extent_xref(
- struct xfs_scrub_bmap_info *info,
+xchk_bmap_rt_extent_xref(
+ struct xchk_bmap_info *info,
struct xfs_inode *ip,
struct xfs_btree_cur *cur,
struct xfs_bmbt_irec *irec)
@@ -230,14 +230,14 @@ xfs_scrub_bmap_rt_extent_xref(
if (info->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
return;
- xfs_scrub_xref_is_used_rt_space(info->sc, irec->br_startblock,
+ xchk_xref_is_used_rt_space(info->sc, irec->br_startblock,
irec->br_blockcount);
}
/* Cross-reference a single datadev extent record. */
STATIC void
-xfs_scrub_bmap_extent_xref(
- struct xfs_scrub_bmap_info *info,
+xchk_bmap_extent_xref(
+ struct xchk_bmap_info *info,
struct xfs_inode *ip,
struct xfs_btree_cur *cur,
struct xfs_bmbt_irec *irec)
@@ -255,38 +255,38 @@ xfs_scrub_bmap_extent_xref(
agbno = XFS_FSB_TO_AGBNO(mp, irec->br_startblock);
len = irec->br_blockcount;
- error = xfs_scrub_ag_init(info->sc, agno, &info->sc->sa);
- if (!xfs_scrub_fblock_process_error(info->sc, info->whichfork,
+ error = xchk_ag_init(info->sc, agno, &info->sc->sa);
+ if (!xchk_fblock_process_error(info->sc, info->whichfork,
irec->br_startoff, &error))
return;
- xfs_scrub_xref_is_used_space(info->sc, agbno, len);
- xfs_scrub_xref_is_not_inode_chunk(info->sc, agbno, len);
- xfs_scrub_bmap_xref_rmap(info, irec, agbno);
+ xchk_xref_is_used_space(info->sc, agbno, len);
+ xchk_xref_is_not_inode_chunk(info->sc, agbno, len);
+ xchk_bmap_xref_rmap(info, irec, agbno);
switch (info->whichfork) {
case XFS_DATA_FORK:
if (xfs_is_reflink_inode(info->sc->ip))
break;
/* fall through */
case XFS_ATTR_FORK:
- xfs_scrub_xref_is_not_shared(info->sc, agbno,
+ xchk_xref_is_not_shared(info->sc, agbno,
irec->br_blockcount);
break;
case XFS_COW_FORK:
- xfs_scrub_xref_is_cow_staging(info->sc, agbno,
+ xchk_xref_is_cow_staging(info->sc, agbno,
irec->br_blockcount);
break;
}
- xfs_scrub_ag_free(info->sc, &info->sc->sa);
+ xchk_ag_free(info->sc, &info->sc->sa);
}
/* Scrub a single extent record. */
STATIC int
-xfs_scrub_bmap_extent(
+xchk_bmap_extent(
struct xfs_inode *ip,
struct xfs_btree_cur *cur,
- struct xfs_scrub_bmap_info *info,
+ struct xchk_bmap_info *info,
struct xfs_bmbt_irec *irec)
{
struct xfs_mount *mp = info->sc->mp;
@@ -302,12 +302,12 @@ xfs_scrub_bmap_extent(
* from the incore list, for which there is no ordering check.
*/
if (irec->br_startoff < info->lastoff)
- xfs_scrub_fblock_set_corrupt(info->sc, info->whichfork,
+ xchk_fblock_set_corrupt(info->sc, info->whichfork,
irec->br_startoff);
/* There should never be a "hole" extent in either extent list. */
if (irec->br_startblock == HOLESTARTBLOCK)
- xfs_scrub_fblock_set_corrupt(info->sc, info->whichfork,
+ xchk_fblock_set_corrupt(info->sc, info->whichfork,
irec->br_startoff);
/*
@@ -315,40 +315,40 @@ xfs_scrub_bmap_extent(
* in-core extent scan, and we should never see these in the bmbt.
*/
if (isnullstartblock(irec->br_startblock))
- xfs_scrub_fblock_set_corrupt(info->sc, info->whichfork,
+ xchk_fblock_set_corrupt(info->sc, info->whichfork,
irec->br_startoff);
/* Make sure the extent points to a valid place. */
if (irec->br_blockcount > MAXEXTLEN)
- xfs_scrub_fblock_set_corrupt(info->sc, info->whichfork,
+ xchk_fblock_set_corrupt(info->sc, info->whichfork,
irec->br_startoff);
if (irec->br_startblock + irec->br_blockcount <= irec->br_startblock)
- xfs_scrub_fblock_set_corrupt(info->sc, info->whichfork,
+ xchk_fblock_set_corrupt(info->sc, info->whichfork,
irec->br_startoff);
end = irec->br_startblock + irec->br_blockcount - 1;
if (info->is_rt &&
(!xfs_verify_rtbno(mp, irec->br_startblock) ||
!xfs_verify_rtbno(mp, end)))
- xfs_scrub_fblock_set_corrupt(info->sc, info->whichfork,
+ xchk_fblock_set_corrupt(info->sc, info->whichfork,
irec->br_startoff);
if (!info->is_rt &&
(!xfs_verify_fsbno(mp, irec->br_startblock) ||
!xfs_verify_fsbno(mp, end) ||
XFS_FSB_TO_AGNO(mp, irec->br_startblock) !=
XFS_FSB_TO_AGNO(mp, end)))
- xfs_scrub_fblock_set_corrupt(info->sc, info->whichfork,
+ xchk_fblock_set_corrupt(info->sc, info->whichfork,
irec->br_startoff);
/* We don't allow unwritten extents on attr forks. */
if (irec->br_state == XFS_EXT_UNWRITTEN &&
info->whichfork == XFS_ATTR_FORK)
- xfs_scrub_fblock_set_corrupt(info->sc, info->whichfork,
+ xchk_fblock_set_corrupt(info->sc, info->whichfork,
irec->br_startoff);
if (info->is_rt)
- xfs_scrub_bmap_rt_extent_xref(info, ip, cur, irec);
+ xchk_bmap_rt_extent_xref(info, ip, cur, irec);
else
- xfs_scrub_bmap_extent_xref(info, ip, cur, irec);
+ xchk_bmap_extent_xref(info, ip, cur, irec);
info->lastoff = irec->br_startoff + irec->br_blockcount;
return error;
@@ -356,12 +356,12 @@ xfs_scrub_bmap_extent(
/* Scrub a bmbt record. */
STATIC int
-xfs_scrub_bmapbt_rec(
- struct xfs_scrub_btree *bs,
+xchk_bmapbt_rec(
+ struct xchk_btree *bs,
union xfs_btree_rec *rec)
{
struct xfs_bmbt_irec irec;
- struct xfs_scrub_bmap_info *info = bs->private;
+ struct xchk_bmap_info *info = bs->private;
struct xfs_inode *ip = bs->cur->bc_private.b.ip;
struct xfs_buf *bp = NULL;
struct xfs_btree_block *block;
@@ -378,22 +378,22 @@ xfs_scrub_bmapbt_rec(
block = xfs_btree_get_block(bs->cur, i, &bp);
owner = be64_to_cpu(block->bb_u.l.bb_owner);
if (owner != ip->i_ino)
- xfs_scrub_fblock_set_corrupt(bs->sc,
+ xchk_fblock_set_corrupt(bs->sc,
info->whichfork, 0);
}
}
/* Set up the in-core record and scrub it. */
xfs_bmbt_disk_get_all(&rec->bmbt, &irec);
- return xfs_scrub_bmap_extent(ip, bs->cur, info, &irec);
+ return xchk_bmap_extent(ip, bs->cur, info, &irec);
}
/* Scan the btree records. */
STATIC int
-xfs_scrub_bmap_btree(
+xchk_bmap_btree(
struct xfs_scrub_context *sc,
int whichfork,
- struct xfs_scrub_bmap_info *info)
+ struct xchk_bmap_info *info)
{
struct xfs_owner_info oinfo;
struct xfs_mount *mp = sc->mp;
@@ -403,12 +403,12 @@ xfs_scrub_bmap_btree(
cur = xfs_bmbt_init_cursor(mp, sc->tp, ip, whichfork);
xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, whichfork);
- error = xfs_scrub_btree(sc, cur, xfs_scrub_bmapbt_rec, &oinfo, info);
+ error = xchk_btree(sc, cur, xchk_bmapbt_rec, &oinfo, info);
xfs_btree_del_cursor(cur, error);
return error;
}
-struct xfs_scrub_bmap_check_rmap_info {
+struct xchk_bmap_check_rmap_info {
struct xfs_scrub_context *sc;
int whichfork;
struct xfs_iext_cursor icur;
@@ -416,13 +416,13 @@ struct xfs_scrub_bmap_check_rmap_info {
/* Can we find bmaps that fit this rmap? */
STATIC int
-xfs_scrub_bmap_check_rmap(
+xchk_bmap_check_rmap(
struct xfs_btree_cur *cur,
struct xfs_rmap_irec *rec,
void *priv)
{
struct xfs_bmbt_irec irec;
- struct xfs_scrub_bmap_check_rmap_info *sbcri = priv;
+ struct xchk_bmap_check_rmap_info *sbcri = priv;
struct xfs_ifork *ifp;
struct xfs_scrub_context *sc = sbcri->sc;
bool have_map;
@@ -439,14 +439,14 @@ xfs_scrub_bmap_check_rmap(
/* Now look up the bmbt record. */
ifp = XFS_IFORK_PTR(sc->ip, sbcri->whichfork);
if (!ifp) {
- xfs_scrub_fblock_set_corrupt(sc, sbcri->whichfork,
+ xchk_fblock_set_corrupt(sc, sbcri->whichfork,
rec->rm_offset);
goto out;
}
have_map = xfs_iext_lookup_extent(sc->ip, ifp, rec->rm_offset,
&sbcri->icur, &irec);
if (!have_map)
- xfs_scrub_fblock_set_corrupt(sc, sbcri->whichfork,
+ xchk_fblock_set_corrupt(sc, sbcri->whichfork,
rec->rm_offset);
/*
* bmap extent record lengths are constrained to 2^21 blocks in length
@@ -457,14 +457,14 @@ xfs_scrub_bmap_check_rmap(
*/
while (have_map) {
if (irec.br_startoff != rec->rm_offset)
- xfs_scrub_fblock_set_corrupt(sc, sbcri->whichfork,
+ xchk_fblock_set_corrupt(sc, sbcri->whichfork,
rec->rm_offset);
if (irec.br_startblock != XFS_AGB_TO_FSB(sc->mp,
cur->bc_private.a.agno, rec->rm_startblock))
- xfs_scrub_fblock_set_corrupt(sc, sbcri->whichfork,
+ xchk_fblock_set_corrupt(sc, sbcri->whichfork,
rec->rm_offset);
if (irec.br_blockcount > rec->rm_blockcount)
- xfs_scrub_fblock_set_corrupt(sc, sbcri->whichfork,
+ xchk_fblock_set_corrupt(sc, sbcri->whichfork,
rec->rm_offset);
if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
break;
@@ -475,7 +475,7 @@ xfs_scrub_bmap_check_rmap(
break;
have_map = xfs_iext_next_extent(ifp, &sbcri->icur, &irec);
if (!have_map)
- xfs_scrub_fblock_set_corrupt(sc, sbcri->whichfork,
+ xchk_fblock_set_corrupt(sc, sbcri->whichfork,
rec->rm_offset);
}
@@ -487,12 +487,12 @@ xfs_scrub_bmap_check_rmap(
/* Make sure each rmap has a corresponding bmbt entry. */
STATIC int
-xfs_scrub_bmap_check_ag_rmaps(
+xchk_bmap_check_ag_rmaps(
struct xfs_scrub_context *sc,
int whichfork,
xfs_agnumber_t agno)
{
- struct xfs_scrub_bmap_check_rmap_info sbcri;
+ struct xchk_bmap_check_rmap_info sbcri;
struct xfs_btree_cur *cur;
struct xfs_buf *agf;
int error;
@@ -509,7 +509,7 @@ xfs_scrub_bmap_check_ag_rmaps(
sbcri.sc = sc;
sbcri.whichfork = whichfork;
- error = xfs_rmap_query_all(cur, xfs_scrub_bmap_check_rmap, &sbcri);
+ error = xfs_rmap_query_all(cur, xchk_bmap_check_rmap, &sbcri);
if (error == XFS_BTREE_QUERY_RANGE_ABORT)
error = 0;
@@ -521,7 +521,7 @@ xfs_scrub_bmap_check_ag_rmaps(
/* Make sure each rmap has a corresponding bmbt entry. */
STATIC int
-xfs_scrub_bmap_check_rmaps(
+xchk_bmap_check_rmaps(
struct xfs_scrub_context *sc,
int whichfork)
{
@@ -561,7 +561,7 @@ xfs_scrub_bmap_check_rmaps(
return 0;
for (agno = 0; agno < sc->mp->m_sb.sb_agcount; agno++) {
- error = xfs_scrub_bmap_check_ag_rmaps(sc, whichfork, agno);
+ error = xchk_bmap_check_ag_rmaps(sc, whichfork, agno);
if (error)
return error;
if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
@@ -578,12 +578,12 @@ xfs_scrub_bmap_check_rmaps(
* Then we unconditionally scan the incore extent cache.
*/
STATIC int
-xfs_scrub_bmap(
+xchk_bmap(
struct xfs_scrub_context *sc,
int whichfork)
{
struct xfs_bmbt_irec irec;
- struct xfs_scrub_bmap_info info = { NULL };
+ struct xchk_bmap_info info = { NULL };
struct xfs_mount *mp = sc->mp;
struct xfs_inode *ip = sc->ip;
struct xfs_ifork *ifp;
@@ -605,7 +605,7 @@ xfs_scrub_bmap(
goto out;
/* No CoW forks on non-reflink inodes/filesystems. */
if (!xfs_is_reflink_inode(ip)) {
- xfs_scrub_ino_set_corrupt(sc, sc->ip->i_ino);
+ xchk_ino_set_corrupt(sc, sc->ip->i_ino);
goto out;
}
break;
@@ -614,7 +614,7 @@ xfs_scrub_bmap(
goto out_check_rmap;
if (!xfs_sb_version_hasattr(&mp->m_sb) &&
!xfs_sb_version_hasattr2(&mp->m_sb))
- xfs_scrub_ino_set_corrupt(sc, sc->ip->i_ino);
+ xchk_ino_set_corrupt(sc, sc->ip->i_ino);
break;
default:
ASSERT(whichfork == XFS_DATA_FORK);
@@ -630,22 +630,22 @@ xfs_scrub_bmap(
goto out;
case XFS_DINODE_FMT_EXTENTS:
if (!(ifp->if_flags & XFS_IFEXTENTS)) {
- xfs_scrub_fblock_set_corrupt(sc, whichfork, 0);
+ xchk_fblock_set_corrupt(sc, whichfork, 0);
goto out;
}
break;
case XFS_DINODE_FMT_BTREE:
if (whichfork == XFS_COW_FORK) {
- xfs_scrub_fblock_set_corrupt(sc, whichfork, 0);
+ xchk_fblock_set_corrupt(sc, whichfork, 0);
goto out;
}
- error = xfs_scrub_bmap_btree(sc, whichfork, &info);
+ error = xchk_bmap_btree(sc, whichfork, &info);
if (error)
goto out;
break;
default:
- xfs_scrub_fblock_set_corrupt(sc, whichfork, 0);
+ xchk_fblock_set_corrupt(sc, whichfork, 0);
goto out;
}
@@ -655,37 +655,37 @@ xfs_scrub_bmap(
/* Now try to scrub the in-memory extent list. */
if (!(ifp->if_flags & XFS_IFEXTENTS)) {
error = xfs_iread_extents(sc->tp, ip, whichfork);
- if (!xfs_scrub_fblock_process_error(sc, whichfork, 0, &error))
+ if (!xchk_fblock_process_error(sc, whichfork, 0, &error))
goto out;
}
/* Find the offset of the last extent in the mapping. */
error = xfs_bmap_last_offset(ip, &endoff, whichfork);
- if (!xfs_scrub_fblock_process_error(sc, whichfork, 0, &error))
+ if (!xchk_fblock_process_error(sc, whichfork, 0, &error))
goto out;
/* Scrub extent records. */
info.lastoff = 0;
ifp = XFS_IFORK_PTR(ip, whichfork);
for_each_xfs_iext(ifp, &icur, &irec) {
- if (xfs_scrub_should_terminate(sc, &error) ||
+ if (xchk_should_terminate(sc, &error) ||
(sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT))
break;
if (isnullstartblock(irec.br_startblock))
continue;
if (irec.br_startoff >= endoff) {
- xfs_scrub_fblock_set_corrupt(sc, whichfork,
+ xchk_fblock_set_corrupt(sc, whichfork,
irec.br_startoff);
goto out;
}
- error = xfs_scrub_bmap_extent(ip, NULL, &info, &irec);
+ error = xchk_bmap_extent(ip, NULL, &info, &irec);
if (error)
goto out;
}
out_check_rmap:
- error = xfs_scrub_bmap_check_rmaps(sc, whichfork);
- if (!xfs_scrub_fblock_xref_process_error(sc, whichfork, 0, &error))
+ error = xchk_bmap_check_rmaps(sc, whichfork);
+ if (!xchk_fblock_xref_process_error(sc, whichfork, 0, &error))
goto out;
out:
return error;
@@ -693,27 +693,27 @@ xfs_scrub_bmap(
/* Scrub an inode's data fork. */
int
-xfs_scrub_bmap_data(
+xchk_bmap_data(
struct xfs_scrub_context *sc)
{
- return xfs_scrub_bmap(sc, XFS_DATA_FORK);
+ return xchk_bmap(sc, XFS_DATA_FORK);
}
/* Scrub an inode's attr fork. */
int
-xfs_scrub_bmap_attr(
+xchk_bmap_attr(
struct xfs_scrub_context *sc)
{
- return xfs_scrub_bmap(sc, XFS_ATTR_FORK);
+ return xchk_bmap(sc, XFS_ATTR_FORK);
}
/* Scrub an inode's CoW fork. */
int
-xfs_scrub_bmap_cow(
+xchk_bmap_cow(
struct xfs_scrub_context *sc)
{
if (!xfs_is_reflink_inode(sc->ip))
return -ENOENT;
- return xfs_scrub_bmap(sc, XFS_COW_FORK);
+ return xchk_bmap(sc, XFS_COW_FORK);
}
diff --git a/fs/xfs/scrub/btree.c b/fs/xfs/scrub/btree.c
index 5b472045f036..30fe9a147959 100644
--- a/fs/xfs/scrub/btree.c
+++ b/fs/xfs/scrub/btree.c
@@ -29,7 +29,7 @@
* operational errors in common.c.
*/
static bool
-__xfs_scrub_btree_process_error(
+__xchk_btree_process_error(
struct xfs_scrub_context *sc,
struct xfs_btree_cur *cur,
int level,
@@ -43,7 +43,7 @@ __xfs_scrub_btree_process_error(
switch (*error) {
case -EDEADLOCK:
/* Used to restart an op with deadlock avoidance. */
- trace_xfs_scrub_deadlock_retry(sc->ip, sc->sm, *error);
+ trace_xchk_deadlock_retry(sc->ip, sc->sm, *error);
break;
case -EFSBADCRC:
case -EFSCORRUPTED:
@@ -53,10 +53,10 @@ __xfs_scrub_btree_process_error(
/* fall through */
default:
if (cur->bc_flags & XFS_BTREE_ROOT_IN_INODE)
- trace_xfs_scrub_ifork_btree_op_error(sc, cur, level,
+ trace_xchk_ifork_btree_op_error(sc, cur, level,
*error, ret_ip);
else
- trace_xfs_scrub_btree_op_error(sc, cur, level,
+ trace_xchk_btree_op_error(sc, cur, level,
*error, ret_ip);
break;
}
@@ -64,30 +64,30 @@ __xfs_scrub_btree_process_error(
}
bool
-xfs_scrub_btree_process_error(
+xchk_btree_process_error(
struct xfs_scrub_context *sc,
struct xfs_btree_cur *cur,
int level,
int *error)
{
- return __xfs_scrub_btree_process_error(sc, cur, level, error,
+ return __xchk_btree_process_error(sc, cur, level, error,
XFS_SCRUB_OFLAG_CORRUPT, __return_address);
}
bool
-xfs_scrub_btree_xref_process_error(
+xchk_btree_xref_process_error(
struct xfs_scrub_context *sc,
struct xfs_btree_cur *cur,
int level,
int *error)
{
- return __xfs_scrub_btree_process_error(sc, cur, level, error,
+ return __xchk_btree_process_error(sc, cur, level, error,
XFS_SCRUB_OFLAG_XFAIL, __return_address);
}
/* Record btree block corruption. */
static void
-__xfs_scrub_btree_set_corrupt(
+__xchk_btree_set_corrupt(
struct xfs_scrub_context *sc,
struct xfs_btree_cur *cur,
int level,
@@ -97,30 +97,30 @@ __xfs_scrub_btree_set_corrupt(
sc->sm->sm_flags |= errflag;
if (cur->bc_flags & XFS_BTREE_ROOT_IN_INODE)
- trace_xfs_scrub_ifork_btree_error(sc, cur, level,
+ trace_xchk_ifork_btree_error(sc, cur, level,
ret_ip);
else
- trace_xfs_scrub_btree_error(sc, cur, level,
+ trace_xchk_btree_error(sc, cur, level,
ret_ip);
}
void
-xfs_scrub_btree_set_corrupt(
+xchk_btree_set_corrupt(
struct xfs_scrub_context *sc,
struct xfs_btree_cur *cur,
int level)
{
- __xfs_scrub_btree_set_corrupt(sc, cur, level, XFS_SCRUB_OFLAG_CORRUPT,
+ __xchk_btree_set_corrupt(sc, cur, level, XFS_SCRUB_OFLAG_CORRUPT,
__return_address);
}
void
-xfs_scrub_btree_xref_set_corrupt(
+xchk_btree_xref_set_corrupt(
struct xfs_scrub_context *sc,
struct xfs_btree_cur *cur,
int level)
{
- __xfs_scrub_btree_set_corrupt(sc, cur, level, XFS_SCRUB_OFLAG_XCORRUPT,
+ __xchk_btree_set_corrupt(sc, cur, level, XFS_SCRUB_OFLAG_XCORRUPT,
__return_address);
}
@@ -129,8 +129,8 @@ xfs_scrub_btree_xref_set_corrupt(
* keys.
*/
STATIC void
-xfs_scrub_btree_rec(
- struct xfs_scrub_btree *bs)
+xchk_btree_rec(
+ struct xchk_btree *bs)
{
struct xfs_btree_cur *cur = bs->cur;
union xfs_btree_rec *rec;
@@ -144,11 +144,11 @@ xfs_scrub_btree_rec(
block = xfs_btree_get_block(cur, 0, &bp);
rec = xfs_btree_rec_addr(cur, cur->bc_ptrs[0], block);
- trace_xfs_scrub_btree_rec(bs->sc, cur, 0);
+ trace_xchk_btree_rec(bs->sc, cur, 0);
/* If this isn't the first record, are they in order? */
if (!bs->firstrec && !cur->bc_ops->recs_inorder(cur, &bs->lastrec, rec))
- xfs_scrub_btree_set_corrupt(bs->sc, cur, 0);
+ xchk_btree_set_corrupt(bs->sc, cur, 0);
bs->firstrec = false;
memcpy(&bs->lastrec, rec, cur->bc_ops->rec_len);
@@ -160,7 +160,7 @@ xfs_scrub_btree_rec(
keyblock = xfs_btree_get_block(cur, 1, &bp);
keyp = xfs_btree_key_addr(cur, cur->bc_ptrs[1], keyblock);
if (cur->bc_ops->diff_two_keys(cur, &key, keyp) < 0)
- xfs_scrub_btree_set_corrupt(bs->sc, cur, 1);
+ xchk_btree_set_corrupt(bs->sc, cur, 1);
if (!(cur->bc_flags & XFS_BTREE_OVERLAPPING))
return;
@@ -169,7 +169,7 @@ xfs_scrub_btree_rec(
cur->bc_ops->init_high_key_from_rec(&hkey, rec);
keyp = xfs_btree_high_key_addr(cur, cur->bc_ptrs[1], keyblock);
if (cur->bc_ops->diff_two_keys(cur, keyp, &hkey) < 0)
- xfs_scrub_btree_set_corrupt(bs->sc, cur, 1);
+ xchk_btree_set_corrupt(bs->sc, cur, 1);
}
/*
@@ -177,8 +177,8 @@ xfs_scrub_btree_rec(
* keys.
*/
STATIC void
-xfs_scrub_btree_key(
- struct xfs_scrub_btree *bs,
+xchk_btree_key(
+ struct xchk_btree *bs,
int level)
{
struct xfs_btree_cur *cur = bs->cur;
@@ -191,12 +191,12 @@ xfs_scrub_btree_key(
block = xfs_btree_get_block(cur, level, &bp);
key = xfs_btree_key_addr(cur, cur->bc_ptrs[level], block);
- trace_xfs_scrub_btree_key(bs->sc, cur, level);
+ trace_xchk_btree_key(bs->sc, cur, level);
/* If this isn't the first key, are they in order? */
if (!bs->firstkey[level] &&
!cur->bc_ops->keys_inorder(cur, &bs->lastkey[level], key))
- xfs_scrub_btree_set_corrupt(bs->sc, cur, level);
+ xchk_btree_set_corrupt(bs->sc, cur, level);
bs->firstkey[level] = false;
memcpy(&bs->lastkey[level], key, cur->bc_ops->key_len);
@@ -207,7 +207,7 @@ xfs_scrub_btree_key(
keyblock = xfs_btree_get_block(cur, level + 1, &bp);
keyp = xfs_btree_key_addr(cur, cur->bc_ptrs[level + 1], keyblock);
if (cur->bc_ops->diff_two_keys(cur, key, keyp) < 0)
- xfs_scrub_btree_set_corrupt(bs->sc, cur, level);
+ xchk_btree_set_corrupt(bs->sc, cur, level);
if (!(cur->bc_flags & XFS_BTREE_OVERLAPPING))
return;
@@ -216,7 +216,7 @@ xfs_scrub_btree_key(
key = xfs_btree_high_key_addr(cur, cur->bc_ptrs[level], block);
keyp = xfs_btree_high_key_addr(cur, cur->bc_ptrs[level + 1], keyblock);
if (cur->bc_ops->diff_two_keys(cur, keyp, key) < 0)
- xfs_scrub_btree_set_corrupt(bs->sc, cur, level);
+ xchk_btree_set_corrupt(bs->sc, cur, level);
}
/*
@@ -224,8 +224,8 @@ xfs_scrub_btree_key(
* Callers do not need to set the corrupt flag.
*/
static bool
-xfs_scrub_btree_ptr_ok(
- struct xfs_scrub_btree *bs,
+xchk_btree_ptr_ok(
+ struct xchk_btree *bs,
int level,
union xfs_btree_ptr *ptr)
{
@@ -242,15 +242,15 @@ xfs_scrub_btree_ptr_ok(
else
res = xfs_btree_check_sptr(bs->cur, be32_to_cpu(ptr->s), level);
if (!res)
- xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, level);
+ xchk_btree_set_corrupt(bs->sc, bs->cur, level);
return res;
}
/* Check that a btree block's sibling matches what we expect it. */
STATIC int
-xfs_scrub_btree_block_check_sibling(
- struct xfs_scrub_btree *bs,
+xchk_btree_block_check_sibling(
+ struct xchk_btree *bs,
int level,
int direction,
union xfs_btree_ptr *sibling)
@@ -264,7 +264,7 @@ xfs_scrub_btree_block_check_sibling(
int error;
error = xfs_btree_dup_cursor(cur, &ncur);
- if (!xfs_scrub_btree_process_error(bs->sc, cur, level + 1, &error) ||
+ if (!xchk_btree_process_error(bs->sc, cur, level + 1, &error) ||
!ncur)
return error;
@@ -278,7 +278,7 @@ xfs_scrub_btree_block_check_sibling(
else
error = xfs_btree_decrement(ncur, level + 1, &success);
if (error == 0 && success)
- xfs_scrub_btree_set_corrupt(bs->sc, cur, level);
+ xchk_btree_set_corrupt(bs->sc, cur, level);
error = 0;
goto out;
}
@@ -288,23 +288,23 @@ xfs_scrub_btree_block_check_sibling(
error = xfs_btree_increment(ncur, level + 1, &success);
else
error = xfs_btree_decrement(ncur, level + 1, &success);
- if (!xfs_scrub_btree_process_error(bs->sc, cur, level + 1, &error))
+ if (!xchk_btree_process_error(bs->sc, cur, level + 1, &error))
goto out;
if (!success) {
- xfs_scrub_btree_set_corrupt(bs->sc, cur, level + 1);
+ xchk_btree_set_corrupt(bs->sc, cur, level + 1);
goto out;
}
/* Compare upper level pointer to sibling pointer. */
pblock = xfs_btree_get_block(ncur, level + 1, &pbp);
pp = xfs_btree_ptr_addr(ncur, ncur->bc_ptrs[level + 1], pblock);
- if (!xfs_scrub_btree_ptr_ok(bs, level + 1, pp))
+ if (!xchk_btree_ptr_ok(bs, level + 1, pp))
goto out;
if (pbp)
- xfs_scrub_buffer_recheck(bs->sc, pbp);
+ xchk_buffer_recheck(bs->sc, pbp);
if (xfs_btree_diff_two_ptrs(cur, pp, sibling))
- xfs_scrub_btree_set_corrupt(bs->sc, cur, level);
+ xchk_btree_set_corrupt(bs->sc, cur, level);
out:
xfs_btree_del_cursor(ncur, XFS_BTREE_ERROR);
return error;
@@ -312,8 +312,8 @@ xfs_scrub_btree_block_check_sibling(
/* Check the siblings of a btree block. */
STATIC int
-xfs_scrub_btree_block_check_siblings(
- struct xfs_scrub_btree *bs,
+xchk_btree_block_check_siblings(
+ struct xchk_btree *bs,
struct xfs_btree_block *block)
{
struct xfs_btree_cur *cur = bs->cur;
@@ -330,7 +330,7 @@ xfs_scrub_btree_block_check_siblings(
if (level == cur->bc_nlevels - 1) {
if (!xfs_btree_ptr_is_null(cur, &leftsib) ||
!xfs_btree_ptr_is_null(cur, &rightsib))
- xfs_scrub_btree_set_corrupt(bs->sc, cur, level);
+ xchk_btree_set_corrupt(bs->sc, cur, level);
goto out;
}
@@ -339,10 +339,10 @@ xfs_scrub_btree_block_check_siblings(
* parent level pointers?
* (These function absorbs error codes for us.)
*/
- error = xfs_scrub_btree_block_check_sibling(bs, level, -1, &leftsib);
+ error = xchk_btree_block_check_sibling(bs, level, -1, &leftsib);
if (error)
return error;
- error = xfs_scrub_btree_block_check_sibling(bs, level, 1, &rightsib);
+ error = xchk_btree_block_check_sibling(bs, level, 1, &rightsib);
if (error)
return error;
out:
@@ -360,8 +360,8 @@ struct check_owner {
* an rmap record for it.
*/
STATIC int
-xfs_scrub_btree_check_block_owner(
- struct xfs_scrub_btree *bs,
+xchk_btree_check_block_owner(
+ struct xchk_btree *bs,
int level,
xfs_daddr_t daddr)
{
@@ -380,13 +380,13 @@ xfs_scrub_btree_check_block_owner(
init_sa = bs->cur->bc_flags & XFS_BTREE_LONG_PTRS;
if (init_sa) {
- error = xfs_scrub_ag_init(bs->sc, agno, &bs->sc->sa);
- if (!xfs_scrub_btree_xref_process_error(bs->sc, bs->cur,
+ error = xchk_ag_init(bs->sc, agno, &bs->sc->sa);
+ if (!xchk_btree_xref_process_error(bs->sc, bs->cur,
level, &error))
return error;
}
- xfs_scrub_xref_is_used_space(bs->sc, agbno, 1);
+ xchk_xref_is_used_space(bs->sc, agbno, 1);
/*
* The bnobt scrubber aliases bs->cur to bs->sc->sa.bno_cur, so we
* have to nullify it (to shut down further block owner checks) if
@@ -395,20 +395,20 @@ xfs_scrub_btree_check_block_owner(
if (!bs->sc->sa.bno_cur && btnum == XFS_BTNUM_BNO)
bs->cur = NULL;
- xfs_scrub_xref_is_owned_by(bs->sc, agbno, 1, bs->oinfo);
+ xchk_xref_is_owned_by(bs->sc, agbno, 1, bs->oinfo);
if (!bs->sc->sa.rmap_cur && btnum == XFS_BTNUM_RMAP)
bs->cur = NULL;
if (init_sa)
- xfs_scrub_ag_free(bs->sc, &bs->sc->sa);
+ xchk_ag_free(bs->sc, &bs->sc->sa);
return error;
}
/* Check the owner of a btree block. */
STATIC int
-xfs_scrub_btree_check_owner(
- struct xfs_scrub_btree *bs,
+xchk_btree_check_owner(
+ struct xchk_btree *bs,
int level,
struct xfs_buf *bp)
{
@@ -437,7 +437,7 @@ xfs_scrub_btree_check_owner(
return 0;
}
- return xfs_scrub_btree_check_block_owner(bs, level, XFS_BUF_ADDR(bp));
+ return xchk_btree_check_block_owner(bs, level, XFS_BUF_ADDR(bp));
}
/*
@@ -445,8 +445,8 @@ xfs_scrub_btree_check_owner(
* special blocks that don't require that.
*/
STATIC void
-xfs_scrub_btree_check_minrecs(
- struct xfs_scrub_btree *bs,
+xchk_btree_check_minrecs(
+ struct xchk_btree *bs,
int level,
struct xfs_btree_block *block)
{
@@ -475,7 +475,7 @@ xfs_scrub_btree_check_minrecs(
if (level >= ok_level)
return;
- xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, level);
+ xchk_btree_set_corrupt(bs->sc, bs->cur, level);
}
/*
@@ -483,8 +483,8 @@ xfs_scrub_btree_check_minrecs(
* and buffer pointers (if applicable) if they're ok to use.
*/
STATIC int
-xfs_scrub_btree_get_block(
- struct xfs_scrub_btree *bs,
+xchk_btree_get_block(
+ struct xchk_btree *bs,
int level,
union xfs_btree_ptr *pp,
struct xfs_btree_block **pblock,
@@ -497,7 +497,7 @@ xfs_scrub_btree_get_block(
*pbp = NULL;
error = xfs_btree_lookup_get_block(bs->cur, level, pp, pblock);
- if (!xfs_scrub_btree_process_error(bs->sc, bs->cur, level, &error) ||
+ if (!xchk_btree_process_error(bs->sc, bs->cur, level, &error) ||
!*pblock)
return error;
@@ -509,19 +509,19 @@ xfs_scrub_btree_get_block(
failed_at = __xfs_btree_check_sblock(bs->cur, *pblock,
level, *pbp);
if (failed_at) {
- xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, level);
+ xchk_btree_set_corrupt(bs->sc, bs->cur, level);
return 0;
}
if (*pbp)
- xfs_scrub_buffer_recheck(bs->sc, *pbp);
+ xchk_buffer_recheck(bs->sc, *pbp);
- xfs_scrub_btree_check_minrecs(bs, level, *pblock);
+ xchk_btree_check_minrecs(bs, level, *pblock);
/*
* Check the block's owner; this function absorbs error codes
* for us.
*/
- error = xfs_scrub_btree_check_owner(bs, level, *pbp);
+ error = xchk_btree_check_owner(bs, level, *pbp);
if (error)
return error;
@@ -529,7 +529,7 @@ xfs_scrub_btree_get_block(
* Check the block's siblings; this function absorbs error codes
* for us.
*/
- return xfs_scrub_btree_block_check_siblings(bs, *pblock);
+ return xchk_btree_block_check_siblings(bs, *pblock);
}
/*
@@ -537,8 +537,8 @@ xfs_scrub_btree_get_block(
* in the parent block.
*/
STATIC void
-xfs_scrub_btree_block_keys(
- struct xfs_scrub_btree *bs,
+xchk_btree_block_keys(
+ struct xchk_btree *bs,
int level,
struct xfs_btree_block *block)
{
@@ -562,7 +562,7 @@ xfs_scrub_btree_block_keys(
parent_block);
if (cur->bc_ops->diff_two_keys(cur, &block_keys, parent_keys) != 0)
- xfs_scrub_btree_set_corrupt(bs->sc, cur, 1);
+ xchk_btree_set_corrupt(bs->sc, cur, 1);
if (!(cur->bc_flags & XFS_BTREE_OVERLAPPING))
return;
@@ -573,7 +573,7 @@ xfs_scrub_btree_block_keys(
parent_block);
if (cur->bc_ops->diff_two_keys(cur, high_bk, high_pk) != 0)
- xfs_scrub_btree_set_corrupt(bs->sc, cur, 1);
+ xchk_btree_set_corrupt(bs->sc, cur, 1);
}
/*
@@ -582,14 +582,14 @@ xfs_scrub_btree_block_keys(
* so that the caller can verify individual records.
*/
int
-xfs_scrub_btree(
+xchk_btree(
struct xfs_scrub_context *sc,
struct xfs_btree_cur *cur,
- xfs_scrub_btree_rec_fn scrub_fn,
+ xchk_btree_rec_fn scrub_fn,
struct xfs_owner_info *oinfo,
void *private)
{
- struct xfs_scrub_btree bs = { NULL };
+ struct xchk_btree bs = { NULL };
union xfs_btree_ptr ptr;
union xfs_btree_ptr *pp;
union xfs_btree_rec *recp;
@@ -614,7 +614,7 @@ xfs_scrub_btree(
/* Don't try to check a tree with a height we can't handle. */
if (cur->bc_nlevels > XFS_BTREE_MAXLEVELS) {
- xfs_scrub_btree_set_corrupt(sc, cur, 0);
+ xchk_btree_set_corrupt(sc, cur, 0);
goto out;
}
@@ -624,9 +624,9 @@ xfs_scrub_btree(
*/
level = cur->bc_nlevels - 1;
cur->bc_ops->init_ptr_from_cur(cur, &ptr);
- if (!xfs_scrub_btree_ptr_ok(&bs, cur->bc_nlevels, &ptr))
+ if (!xchk_btree_ptr_ok(&bs, cur->bc_nlevels, &ptr))
goto out;
- error = xfs_scrub_btree_get_block(&bs, level, &ptr, &block, &bp);
+ error = xchk_btree_get_block(&bs, level, &ptr, &block, &bp);
if (error || !block)
goto out;
@@ -639,7 +639,7 @@ xfs_scrub_btree(
/* End of leaf, pop back towards the root. */
if (cur->bc_ptrs[level] >
be16_to_cpu(block->bb_numrecs)) {
- xfs_scrub_btree_block_keys(&bs, level, block);
+ xchk_btree_block_keys(&bs, level, block);
if (level < cur->bc_nlevels - 1)
cur->bc_ptrs[level + 1]++;
level++;
@@ -647,14 +647,14 @@ xfs_scrub_btree(
}
/* Records in order for scrub? */
- xfs_scrub_btree_rec(&bs);
+ xchk_btree_rec(&bs);
/* Call out to the record checker. */
recp = xfs_btree_rec_addr(cur, cur->bc_ptrs[0], block);
error = bs.scrub_rec(&bs, recp);
if (error)
break;
- if (xfs_scrub_should_terminate(sc, &error) ||
+ if (xchk_should_terminate(sc, &error) ||
(sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT))
break;
@@ -664,7 +664,7 @@ xfs_scrub_btree(
/* End of node, pop back towards the root. */
if (cur->bc_ptrs[level] > be16_to_cpu(block->bb_numrecs)) {
- xfs_scrub_btree_block_keys(&bs, level, block);
+ xchk_btree_block_keys(&bs, level, block);
if (level < cur->bc_nlevels - 1)
cur->bc_ptrs[level + 1]++;
level++;
@@ -672,16 +672,16 @@ xfs_scrub_btree(
}
/* Keys in order for scrub? */
- xfs_scrub_btree_key(&bs, level);
+ xchk_btree_key(&bs, level);
/* Drill another level deeper. */
pp = xfs_btree_ptr_addr(cur, cur->bc_ptrs[level], block);
- if (!xfs_scrub_btree_ptr_ok(&bs, level, pp)) {
+ if (!xchk_btree_ptr_ok(&bs, level, pp)) {
cur->bc_ptrs[level]++;
continue;
}
level--;
- error = xfs_scrub_btree_get_block(&bs, level, pp, &block, &bp);
+ error = xchk_btree_get_block(&bs, level, pp, &block, &bp);
if (error || !block)
goto out;
@@ -692,7 +692,7 @@ xfs_scrub_btree(
/* Process deferred owner checks on btree blocks. */
list_for_each_entry_safe(co, n, &bs.to_check, list) {
if (!error && bs.cur)
- error = xfs_scrub_btree_check_block_owner(&bs,
+ error = xchk_btree_check_block_owner(&bs,
co->level, co->daddr);
list_del(&co->list);
kmem_free(co);
diff --git a/fs/xfs/scrub/btree.h b/fs/xfs/scrub/btree.h
index 956627500f2c..598ac04a6c3e 100644
--- a/fs/xfs/scrub/btree.h
+++ b/fs/xfs/scrub/btree.h
@@ -9,32 +9,32 @@
/* btree scrub */
/* Check for btree operation errors. */
-bool xfs_scrub_btree_process_error(struct xfs_scrub_context *sc,
+bool xchk_btree_process_error(struct xfs_scrub_context *sc,
struct xfs_btree_cur *cur, int level, int *error);
/* Check for btree xref operation errors. */
-bool xfs_scrub_btree_xref_process_error(struct xfs_scrub_context *sc,
+bool xchk_btree_xref_process_error(struct xfs_scrub_context *sc,
struct xfs_btree_cur *cur, int level,
int *error);
/* Check for btree corruption. */
-void xfs_scrub_btree_set_corrupt(struct xfs_scrub_context *sc,
+void xchk_btree_set_corrupt(struct xfs_scrub_context *sc,
struct xfs_btree_cur *cur, int level);
/* Check for btree xref discrepancies. */
-void xfs_scrub_btree_xref_set_corrupt(struct xfs_scrub_context *sc,
+void xchk_btree_xref_set_corrupt(struct xfs_scrub_context *sc,
struct xfs_btree_cur *cur, int level);
-struct xfs_scrub_btree;
-typedef int (*xfs_scrub_btree_rec_fn)(
- struct xfs_scrub_btree *bs,
+struct xchk_btree;
+typedef int (*xchk_btree_rec_fn)(
+ struct xchk_btree *bs,
union xfs_btree_rec *rec);
-struct xfs_scrub_btree {
+struct xchk_btree {
/* caller-provided scrub state */
struct xfs_scrub_context *sc;
struct xfs_btree_cur *cur;
- xfs_scrub_btree_rec_fn scrub_rec;
+ xchk_btree_rec_fn scrub_rec;
struct xfs_owner_info *oinfo;
void *private;
@@ -45,8 +45,8 @@ struct xfs_scrub_btree {
bool firstkey[XFS_BTREE_MAXLEVELS];
struct list_head to_check;
};
-int xfs_scrub_btree(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur,
- xfs_scrub_btree_rec_fn scrub_fn,
+int xchk_btree(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur,
+ xchk_btree_rec_fn scrub_fn,
struct xfs_owner_info *oinfo, void *private);
#endif /* __XFS_SCRUB_BTREE_H__ */
diff --git a/fs/xfs/scrub/common.c b/fs/xfs/scrub/common.c
index 70e70c69f83f..a4004a06f482 100644
--- a/fs/xfs/scrub/common.c
+++ b/fs/xfs/scrub/common.c
@@ -68,7 +68,7 @@
/* Check for operational errors. */
static bool
-__xfs_scrub_process_error(
+__xchk_process_error(
struct xfs_scrub_context *sc,
xfs_agnumber_t agno,
xfs_agblock_t bno,
@@ -81,7 +81,7 @@ __xfs_scrub_process_error(
return true;
case -EDEADLOCK:
/* Used to restart an op with deadlock avoidance. */
- trace_xfs_scrub_deadlock_retry(sc->ip, sc->sm, *error);
+ trace_xchk_deadlock_retry(sc->ip, sc->sm, *error);
break;
case -EFSBADCRC:
case -EFSCORRUPTED:
@@ -90,7 +90,7 @@ __xfs_scrub_process_error(
*error = 0;
/* fall through */
default:
- trace_xfs_scrub_op_error(sc, agno, bno, *error,
+ trace_xchk_op_error(sc, agno, bno, *error,
ret_ip);
break;
}
@@ -98,30 +98,30 @@ __xfs_scrub_process_error(
}
bool
-xfs_scrub_process_error(
+xchk_process_error(
struct xfs_scrub_context *sc,
xfs_agnumber_t agno,
xfs_agblock_t bno,
int *error)
{
- return __xfs_scrub_process_error(sc, agno, bno, error,
+ return __xchk_process_error(sc, agno, bno, error,
XFS_SCRUB_OFLAG_CORRUPT, __return_address);
}
bool
-xfs_scrub_xref_process_error(
+xchk_xref_process_error(
struct xfs_scrub_context *sc,
xfs_agnumber_t agno,
xfs_agblock_t bno,
int *error)
{
- return __xfs_scrub_process_error(sc, agno, bno, error,
+ return __xchk_process_error(sc, agno, bno, error,
XFS_SCRUB_OFLAG_XFAIL, __return_address);
}
/* Check for operational errors for a file offset. */
static bool
-__xfs_scrub_fblock_process_error(
+__xchk_fblock_process_error(
struct xfs_scrub_context *sc,
int whichfork,
xfs_fileoff_t offset,
@@ -134,7 +134,7 @@ __xfs_scrub_fblock_process_error(
return true;
case -EDEADLOCK:
/* Used to restart an op with deadlock avoidance. */
- trace_xfs_scrub_deadlock_retry(sc->ip, sc->sm, *error);
+ trace_xchk_deadlock_retry(sc->ip, sc->sm, *error);
break;
case -EFSBADCRC:
case -EFSCORRUPTED:
@@ -143,7 +143,7 @@ __xfs_scrub_fblock_process_error(
*error = 0;
/* fall through */
default:
- trace_xfs_scrub_file_op_error(sc, whichfork, offset, *error,
+ trace_xchk_file_op_error(sc, whichfork, offset, *error,
ret_ip);
break;
}
@@ -151,24 +151,24 @@ __xfs_scrub_fblock_process_error(
}
bool
-xfs_scrub_fblock_process_error(
+xchk_fblock_process_error(
struct xfs_scrub_context *sc,
int whichfork,
xfs_fileoff_t offset,
int *error)
{
- return __xfs_scrub_fblock_process_error(sc, whichfork, offset, error,
+ return __xchk_fblock_process_error(sc, whichfork, offset, error,
XFS_SCRUB_OFLAG_CORRUPT, __return_address);
}
bool
-xfs_scrub_fblock_xref_process_error(
+xchk_fblock_xref_process_error(
struct xfs_scrub_context *sc,
int whichfork,
xfs_fileoff_t offset,
int *error)
{
- return __xfs_scrub_fblock_process_error(sc, whichfork, offset, error,
+ return __xchk_fblock_process_error(sc, whichfork, offset, error,
XFS_SCRUB_OFLAG_XFAIL, __return_address);
}
@@ -186,12 +186,12 @@ xfs_scrub_fblock_xref_process_error(
/* Record a block which could be optimized. */
void
-xfs_scrub_block_set_preen(
+xchk_block_set_preen(
struct xfs_scrub_context *sc,
struct xfs_buf *bp)
{
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_PREEN;
- trace_xfs_scrub_block_preen(sc, bp->b_bn, __return_address);
+ trace_xchk_block_preen(sc, bp->b_bn, __return_address);
}
/*
@@ -200,32 +200,32 @@ xfs_scrub_block_set_preen(
* the block location of the inode record itself.
*/
void
-xfs_scrub_ino_set_preen(
+xchk_ino_set_preen(
struct xfs_scrub_context *sc,
xfs_ino_t ino)
{
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_PREEN;
- trace_xfs_scrub_ino_preen(sc, ino, __return_address);
+ trace_xchk_ino_preen(sc, ino, __return_address);
}
/* Record a corrupt block. */
void
-xfs_scrub_block_set_corrupt(
+xchk_block_set_corrupt(
struct xfs_scrub_context *sc,
struct xfs_buf *bp)
{
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT;
- trace_xfs_scrub_block_error(sc, bp->b_bn, __return_address);
+ trace_xchk_block_error(sc, bp->b_bn, __return_address);
}
/* Record a corruption while cross-referencing. */
void
-xfs_scrub_block_xref_set_corrupt(
+xchk_block_xref_set_corrupt(
struct xfs_scrub_context *sc,
struct xfs_buf *bp)
{
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_XCORRUPT;
- trace_xfs_scrub_block_error(sc, bp->b_bn, __return_address);
+ trace_xchk_block_error(sc, bp->b_bn, __return_address);
}
/*
@@ -234,44 +234,44 @@ xfs_scrub_block_xref_set_corrupt(
* inode record itself.
*/
void
-xfs_scrub_ino_set_corrupt(
+xchk_ino_set_corrupt(
struct xfs_scrub_context *sc,
xfs_ino_t ino)
{
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT;
- trace_xfs_scrub_ino_error(sc, ino, __return_address);
+ trace_xchk_ino_error(sc, ino, __return_address);
}
/* Record a corruption while cross-referencing with an inode. */
void
-xfs_scrub_ino_xref_set_corrupt(
+xchk_ino_xref_set_corrupt(
struct xfs_scrub_context *sc,
xfs_ino_t ino)
{
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_XCORRUPT;
- trace_xfs_scrub_ino_error(sc, ino, __return_address);
+ trace_xchk_ino_error(sc, ino, __return_address);
}
/* Record corruption in a block indexed by a file fork. */
void
-xfs_scrub_fblock_set_corrupt(
+xchk_fblock_set_corrupt(
struct xfs_scrub_context *sc,
int whichfork,
xfs_fileoff_t offset)
{
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT;
- trace_xfs_scrub_fblock_error(sc, whichfork, offset, __return_address);
+ trace_xchk_fblock_error(sc, whichfork, offset, __return_address);
}
/* Record a corruption while cross-referencing a fork block. */
void
-xfs_scrub_fblock_xref_set_corrupt(
+xchk_fblock_xref_set_corrupt(
struct xfs_scrub_context *sc,
int whichfork,
xfs_fileoff_t offset)
{
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_XCORRUPT;
- trace_xfs_scrub_fblock_error(sc, whichfork, offset, __return_address);
+ trace_xchk_fblock_error(sc, whichfork, offset, __return_address);
}
/*
@@ -279,32 +279,32 @@ xfs_scrub_fblock_xref_set_corrupt(
* incorrect.
*/
void
-xfs_scrub_ino_set_warning(
+xchk_ino_set_warning(
struct xfs_scrub_context *sc,
xfs_ino_t ino)
{
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_WARNING;
- trace_xfs_scrub_ino_warning(sc, ino, __return_address);
+ trace_xchk_ino_warning(sc, ino, __return_address);
}
/* Warn about a block indexed by a file fork that needs review. */
void
-xfs_scrub_fblock_set_warning(
+xchk_fblock_set_warning(
struct xfs_scrub_context *sc,
int whichfork,
xfs_fileoff_t offset)
{
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_WARNING;
- trace_xfs_scrub_fblock_warning(sc, whichfork, offset, __return_address);
+ trace_xchk_fblock_warning(sc, whichfork, offset, __return_address);
}
/* Signal an incomplete scrub. */
void
-xfs_scrub_set_incomplete(
+xchk_set_incomplete(
struct xfs_scrub_context *sc)
{
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_INCOMPLETE;
- trace_xfs_scrub_incomplete(sc, __return_address);
+ trace_xchk_incomplete(sc, __return_address);
}
/*
@@ -312,18 +312,18 @@ xfs_scrub_set_incomplete(
* at least according to the reverse mapping data.
*/
-struct xfs_scrub_rmap_ownedby_info {
+struct xchk_rmap_ownedby_info {
struct xfs_owner_info *oinfo;
xfs_filblks_t *blocks;
};
STATIC int
-xfs_scrub_count_rmap_ownedby_irec(
+xchk_count_rmap_ownedby_irec(
struct xfs_btree_cur *cur,
struct xfs_rmap_irec *rec,
void *priv)
{
- struct xfs_scrub_rmap_ownedby_info *sroi = priv;
+ struct xchk_rmap_ownedby_info *sroi = priv;
bool irec_attr;
bool oinfo_attr;
@@ -344,19 +344,19 @@ xfs_scrub_count_rmap_ownedby_irec(
* The caller should pass us an rmapbt cursor.
*/
int
-xfs_scrub_count_rmap_ownedby_ag(
+xchk_count_rmap_ownedby_ag(
struct xfs_scrub_context *sc,
struct xfs_btree_cur *cur,
struct xfs_owner_info *oinfo,
xfs_filblks_t *blocks)
{
- struct xfs_scrub_rmap_ownedby_info sroi;
+ struct xchk_rmap_ownedby_info sroi;
sroi.oinfo = oinfo;
*blocks = 0;
sroi.blocks = blocks;
- return xfs_rmap_query_all(cur, xfs_scrub_count_rmap_ownedby_irec,
+ return xfs_rmap_query_all(cur, xchk_count_rmap_ownedby_irec,
&sroi);
}
@@ -392,12 +392,12 @@ want_ag_read_header_failure(
/*
* Grab all the headers for an AG.
*
- * The headers should be released by xfs_scrub_ag_free, but as a fail
+ * The headers should be released by xchk_ag_free, but as a fail
* safe we attach all the buffers we grab to the scrub transaction so
* they'll all be freed when we cancel it.
*/
int
-xfs_scrub_ag_read_headers(
+xchk_ag_read_headers(
struct xfs_scrub_context *sc,
xfs_agnumber_t agno,
struct xfs_buf **agi,
@@ -425,8 +425,8 @@ xfs_scrub_ag_read_headers(
/* Release all the AG btree cursors. */
void
-xfs_scrub_ag_btcur_free(
- struct xfs_scrub_ag *sa)
+xchk_ag_btcur_free(
+ struct xchk_ag *sa)
{
if (sa->refc_cur)
xfs_btree_del_cursor(sa->refc_cur, XFS_BTREE_ERROR);
@@ -451,9 +451,9 @@ xfs_scrub_ag_btcur_free(
/* Initialize all the btree cursors for an AG. */
int
-xfs_scrub_ag_btcur_init(
+xchk_ag_btcur_init(
struct xfs_scrub_context *sc,
- struct xfs_scrub_ag *sa)
+ struct xchk_ag *sa)
{
struct xfs_mount *mp = sc->mp;
xfs_agnumber_t agno = sa->agno;
@@ -511,11 +511,11 @@ xfs_scrub_ag_btcur_init(
/* Release the AG header context and btree cursors. */
void
-xfs_scrub_ag_free(
+xchk_ag_free(
struct xfs_scrub_context *sc,
- struct xfs_scrub_ag *sa)
+ struct xchk_ag *sa)
{
- xfs_scrub_ag_btcur_free(sa);
+ xchk_ag_btcur_free(sa);
if (sa->agfl_bp) {
xfs_trans_brelse(sc->tp, sa->agfl_bp);
sa->agfl_bp = NULL;
@@ -543,30 +543,30 @@ xfs_scrub_ag_free(
* transaction ourselves.
*/
int
-xfs_scrub_ag_init(
+xchk_ag_init(
struct xfs_scrub_context *sc,
xfs_agnumber_t agno,
- struct xfs_scrub_ag *sa)
+ struct xchk_ag *sa)
{
int error;
sa->agno = agno;
- error = xfs_scrub_ag_read_headers(sc, agno, &sa->agi_bp,
+ error = xchk_ag_read_headers(sc, agno, &sa->agi_bp,
&sa->agf_bp, &sa->agfl_bp);
if (error)
return error;
- return xfs_scrub_ag_btcur_init(sc, sa);
+ return xchk_ag_btcur_init(sc, sa);
}
/*
* Grab the per-ag structure if we haven't already gotten it. Teardown of the
- * xfs_scrub_ag will release it for us.
+ * xchk_ag will release it for us.
*/
void
-xfs_scrub_perag_get(
+xchk_perag_get(
struct xfs_mount *mp,
- struct xfs_scrub_ag *sa)
+ struct xchk_ag *sa)
{
if (!sa->pag)
sa->pag = xfs_perag_get(mp, sa->agno);
@@ -585,7 +585,7 @@ xfs_scrub_perag_get(
* the metadata object.
*/
int
-xfs_scrub_trans_alloc(
+xchk_trans_alloc(
struct xfs_scrub_context *sc,
uint resblks)
{
@@ -598,19 +598,19 @@ xfs_scrub_trans_alloc(
/* Set us up with a transaction and an empty context. */
int
-xfs_scrub_setup_fs(
+xchk_setup_fs(
struct xfs_scrub_context *sc,
struct xfs_inode *ip)
{
uint resblks;
resblks = xfs_repair_calc_ag_resblks(sc);
- return xfs_scrub_trans_alloc(sc, resblks);
+ return xchk_trans_alloc(sc, resblks);
}
/* Set us up with AG headers and btree cursors. */
int
-xfs_scrub_setup_ag_btree(
+xchk_setup_ag_btree(
struct xfs_scrub_context *sc,
struct xfs_inode *ip,
bool force_log)
@@ -625,21 +625,21 @@ xfs_scrub_setup_ag_btree(
* document why they need to do so.
*/
if (force_log) {
- error = xfs_scrub_checkpoint_log(mp);
+ error = xchk_checkpoint_log(mp);
if (error)
return error;
}
- error = xfs_scrub_setup_fs(sc, ip);
+ error = xchk_setup_fs(sc, ip);
if (error)
return error;
- return xfs_scrub_ag_init(sc, sc->sm->sm_agno, &sc->sa);
+ return xchk_ag_init(sc, sc->sm->sm_agno, &sc->sa);
}
/* Push everything out of the log onto disk. */
int
-xfs_scrub_checkpoint_log(
+xchk_checkpoint_log(
struct xfs_mount *mp)
{
int error;
@@ -657,7 +657,7 @@ xfs_scrub_checkpoint_log(
* The inode is not locked.
*/
int
-xfs_scrub_get_inode(
+xchk_get_inode(
struct xfs_scrub_context *sc,
struct xfs_inode *ip_in)
{
@@ -704,7 +704,7 @@ xfs_scrub_get_inode(
error = -EFSCORRUPTED;
/* fall through */
default:
- trace_xfs_scrub_op_error(sc,
+ trace_xchk_op_error(sc,
XFS_INO_TO_AGNO(mp, sc->sm->sm_ino),
XFS_INO_TO_AGBNO(mp, sc->sm->sm_ino),
error, __return_address);
@@ -721,21 +721,21 @@ xfs_scrub_get_inode(
/* Set us up to scrub a file's contents. */
int
-xfs_scrub_setup_inode_contents(
+xchk_setup_inode_contents(
struct xfs_scrub_context *sc,
struct xfs_inode *ip,
unsigned int resblks)
{
int error;
- error = xfs_scrub_get_inode(sc, ip);
+ error = xchk_get_inode(sc, ip);
if (error)
return error;
/* Got the inode, lock it and we're ready to go. */
sc->ilock_flags = XFS_IOLOCK_EXCL | XFS_MMAPLOCK_EXCL;
xfs_ilock(sc->ip, sc->ilock_flags);
- error = xfs_scrub_trans_alloc(sc, resblks);
+ error = xchk_trans_alloc(sc, resblks);
if (error)
goto out;
sc->ilock_flags |= XFS_ILOCK_EXCL;
@@ -752,13 +752,13 @@ xfs_scrub_setup_inode_contents(
* the cursor and skip the check.
*/
bool
-xfs_scrub_should_check_xref(
+xchk_should_check_xref(
struct xfs_scrub_context *sc,
int *error,
struct xfs_btree_cur **curpp)
{
/* No point in xref if we already know we're corrupt. */
- if (xfs_scrub_skip_xref(sc->sm))
+ if (xchk_skip_xref(sc->sm))
return false;
if (*error == 0)
@@ -775,7 +775,7 @@ xfs_scrub_should_check_xref(
}
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_XFAIL;
- trace_xfs_scrub_xref_error(sc, *error, __return_address);
+ trace_xchk_xref_error(sc, *error, __return_address);
/*
* Errors encountered during cross-referencing with another
@@ -787,25 +787,25 @@ xfs_scrub_should_check_xref(
/* Run the structure verifiers on in-memory buffers to detect bad memory. */
void
-xfs_scrub_buffer_recheck(
+xchk_buffer_recheck(
struct xfs_scrub_context *sc,
struct xfs_buf *bp)
{
xfs_failaddr_t fa;
if (bp->b_ops == NULL) {
- xfs_scrub_block_set_corrupt(sc, bp);
+ xchk_block_set_corrupt(sc, bp);
return;
}
if (bp->b_ops->verify_struct == NULL) {
- xfs_scrub_set_incomplete(sc);
+ xchk_set_incomplete(sc);
return;
}
fa = bp->b_ops->verify_struct(bp);
if (!fa)
return;
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT;
- trace_xfs_scrub_block_error(sc, bp->b_bn, fa);
+ trace_xchk_block_error(sc, bp->b_bn, fa);
}
/*
@@ -813,7 +813,7 @@ xfs_scrub_buffer_recheck(
* pointed to by sc->ip and the ILOCK must be held.
*/
int
-xfs_scrub_metadata_inode_forks(
+xchk_metadata_inode_forks(
struct xfs_scrub_context *sc)
{
__u32 smtype;
@@ -825,26 +825,26 @@ xfs_scrub_metadata_inode_forks(
/* Metadata inodes don't live on the rt device. */
if (sc->ip->i_d.di_flags & XFS_DIFLAG_REALTIME) {
- xfs_scrub_ino_set_corrupt(sc, sc->ip->i_ino);
+ xchk_ino_set_corrupt(sc, sc->ip->i_ino);
return 0;
}
/* They should never participate in reflink. */
if (xfs_is_reflink_inode(sc->ip)) {
- xfs_scrub_ino_set_corrupt(sc, sc->ip->i_ino);
+ xchk_ino_set_corrupt(sc, sc->ip->i_ino);
return 0;
}
/* They also should never have extended attributes. */
if (xfs_inode_hasattr(sc->ip)) {
- xfs_scrub_ino_set_corrupt(sc, sc->ip->i_ino);
+ xchk_ino_set_corrupt(sc, sc->ip->i_ino);
return 0;
}
/* Invoke the data fork scrubber. */
smtype = sc->sm->sm_type;
sc->sm->sm_type = XFS_SCRUB_TYPE_BMBTD;
- error = xfs_scrub_bmap_data(sc);
+ error = xchk_bmap_data(sc);
sc->sm->sm_type = smtype;
if (error || (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT))
return error;
@@ -853,11 +853,11 @@ xfs_scrub_metadata_inode_forks(
if (xfs_sb_version_hasreflink(&sc->mp->m_sb)) {
error = xfs_reflink_inode_has_shared_extents(sc->tp, sc->ip,
&shared);
- if (!xfs_scrub_fblock_process_error(sc, XFS_DATA_FORK, 0,
+ if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, 0,
&error))
return error;
if (shared)
- xfs_scrub_ino_set_corrupt(sc, sc->ip->i_ino);
+ xchk_ino_set_corrupt(sc, sc->ip->i_ino);
}
return error;
@@ -871,7 +871,7 @@ xfs_scrub_metadata_inode_forks(
* we can't.
*/
int
-xfs_scrub_ilock_inverted(
+xchk_ilock_inverted(
struct xfs_inode *ip,
uint lock_mode)
{
diff --git a/fs/xfs/scrub/common.h b/fs/xfs/scrub/common.h
index 2172bd5361e2..5881cb2ecc26 100644
--- a/fs/xfs/scrub/common.h
+++ b/fs/xfs/scrub/common.h
@@ -12,7 +12,7 @@
* Note that we're careful not to make any judgements about *error.
*/
static inline bool
-xfs_scrub_should_terminate(
+xchk_should_terminate(
struct xfs_scrub_context *sc,
int *error)
{
@@ -24,121 +24,121 @@ xfs_scrub_should_terminate(
return false;
}
-int xfs_scrub_trans_alloc(struct xfs_scrub_context *sc, uint resblks);
-bool xfs_scrub_process_error(struct xfs_scrub_context *sc, xfs_agnumber_t agno,
+int xchk_trans_alloc(struct xfs_scrub_context *sc, uint resblks);
+bool xchk_process_error(struct xfs_scrub_context *sc, xfs_agnumber_t agno,
xfs_agblock_t bno, int *error);
-bool xfs_scrub_fblock_process_error(struct xfs_scrub_context *sc, int whichfork,
+bool xchk_fblock_process_error(struct xfs_scrub_context *sc, int whichfork,
xfs_fileoff_t offset, int *error);
-bool xfs_scrub_xref_process_error(struct xfs_scrub_context *sc,
+bool xchk_xref_process_error(struct xfs_scrub_context *sc,
xfs_agnumber_t agno, xfs_agblock_t bno, int *error);
-bool xfs_scrub_fblock_xref_process_error(struct xfs_scrub_context *sc,
+bool xchk_fblock_xref_process_error(struct xfs_scrub_context *sc,
int whichfork, xfs_fileoff_t offset, int *error);
-void xfs_scrub_block_set_preen(struct xfs_scrub_context *sc,
+void xchk_block_set_preen(struct xfs_scrub_context *sc,
struct xfs_buf *bp);
-void xfs_scrub_ino_set_preen(struct xfs_scrub_context *sc, xfs_ino_t ino);
+void xchk_ino_set_preen(struct xfs_scrub_context *sc, xfs_ino_t ino);
-void xfs_scrub_block_set_corrupt(struct xfs_scrub_context *sc,
+void xchk_block_set_corrupt(struct xfs_scrub_context *sc,
struct xfs_buf *bp);
-void xfs_scrub_ino_set_corrupt(struct xfs_scrub_context *sc, xfs_ino_t ino);
-void xfs_scrub_fblock_set_corrupt(struct xfs_scrub_context *sc, int whichfork,
+void xchk_ino_set_corrupt(struct xfs_scrub_context *sc, xfs_ino_t ino);
+void xchk_fblock_set_corrupt(struct xfs_scrub_context *sc, int whichfork,
xfs_fileoff_t offset);
-void xfs_scrub_block_xref_set_corrupt(struct xfs_scrub_context *sc,
+void xchk_block_xref_set_corrupt(struct xfs_scrub_context *sc,
struct xfs_buf *bp);
-void xfs_scrub_ino_xref_set_corrupt(struct xfs_scrub_context *sc,
+void xchk_ino_xref_set_corrupt(struct xfs_scrub_context *sc,
xfs_ino_t ino);
-void xfs_scrub_fblock_xref_set_corrupt(struct xfs_scrub_context *sc,
+void xchk_fblock_xref_set_corrupt(struct xfs_scrub_context *sc,
int whichfork, xfs_fileoff_t offset);
-void xfs_scrub_ino_set_warning(struct xfs_scrub_context *sc, xfs_ino_t ino);
-void xfs_scrub_fblock_set_warning(struct xfs_scrub_context *sc, int whichfork,
+void xchk_ino_set_warning(struct xfs_scrub_context *sc, xfs_ino_t ino);
+void xchk_fblock_set_warning(struct xfs_scrub_context *sc, int whichfork,
xfs_fileoff_t offset);
-void xfs_scrub_set_incomplete(struct xfs_scrub_context *sc);
-int xfs_scrub_checkpoint_log(struct xfs_mount *mp);
+void xchk_set_incomplete(struct xfs_scrub_context *sc);
+int xchk_checkpoint_log(struct xfs_mount *mp);
/* Are we set up for a cross-referencing check? */
-bool xfs_scrub_should_check_xref(struct xfs_scrub_context *sc, int *error,
+bool xchk_should_check_xref(struct xfs_scrub_context *sc, int *error,
struct xfs_btree_cur **curpp);
/* Setup functions */
-int xfs_scrub_setup_fs(struct xfs_scrub_context *sc, struct xfs_inode *ip);
-int xfs_scrub_setup_ag_allocbt(struct xfs_scrub_context *sc,
+int xchk_setup_fs(struct xfs_scrub_context *sc, struct xfs_inode *ip);
+int xchk_setup_ag_allocbt(struct xfs_scrub_context *sc,
struct xfs_inode *ip);
-int xfs_scrub_setup_ag_iallocbt(struct xfs_scrub_context *sc,
+int xchk_setup_ag_iallocbt(struct xfs_scrub_context *sc,
struct xfs_inode *ip);
-int xfs_scrub_setup_ag_rmapbt(struct xfs_scrub_context *sc,
+int xchk_setup_ag_rmapbt(struct xfs_scrub_context *sc,
struct xfs_inode *ip);
-int xfs_scrub_setup_ag_refcountbt(struct xfs_scrub_context *sc,
+int xchk_setup_ag_refcountbt(struct xfs_scrub_context *sc,
struct xfs_inode *ip);
-int xfs_scrub_setup_inode(struct xfs_scrub_context *sc,
+int xchk_setup_inode(struct xfs_scrub_context *sc,
struct xfs_inode *ip);
-int xfs_scrub_setup_inode_bmap(struct xfs_scrub_context *sc,
+int xchk_setup_inode_bmap(struct xfs_scrub_context *sc,
struct xfs_inode *ip);
-int xfs_scrub_setup_inode_bmap_data(struct xfs_scrub_context *sc,
+int xchk_setup_inode_bmap_data(struct xfs_scrub_context *sc,
struct xfs_inode *ip);
-int xfs_scrub_setup_directory(struct xfs_scrub_context *sc,
+int xchk_setup_directory(struct xfs_scrub_context *sc,
struct xfs_inode *ip);
-int xfs_scrub_setup_xattr(struct xfs_scrub_context *sc,
+int xchk_setup_xattr(struct xfs_scrub_context *sc,
struct xfs_inode *ip);
-int xfs_scrub_setup_symlink(struct xfs_scrub_context *sc,
+int xchk_setup_symlink(struct xfs_scrub_context *sc,
struct xfs_inode *ip);
-int xfs_scrub_setup_parent(struct xfs_scrub_context *sc,
+int xchk_setup_parent(struct xfs_scrub_context *sc,
struct xfs_inode *ip);
#ifdef CONFIG_XFS_RT
-int xfs_scrub_setup_rt(struct xfs_scrub_context *sc, struct xfs_inode *ip);
+int xchk_setup_rt(struct xfs_scrub_context *sc, struct xfs_inode *ip);
#else
static inline int
-xfs_scrub_setup_rt(struct xfs_scrub_context *sc, struct xfs_inode *ip)
+xchk_setup_rt(struct xfs_scrub_context *sc, struct xfs_inode *ip)
{
return -ENOENT;
}
#endif
#ifdef CONFIG_XFS_QUOTA
-int xfs_scrub_setup_quota(struct xfs_scrub_context *sc, struct xfs_inode *ip);
+int xchk_setup_quota(struct xfs_scrub_context *sc, struct xfs_inode *ip);
#else
static inline int
-xfs_scrub_setup_quota(struct xfs_scrub_context *sc, struct xfs_inode *ip)
+xchk_setup_quota(struct xfs_scrub_context *sc, struct xfs_inode *ip)
{
return -ENOENT;
}
#endif
-void xfs_scrub_ag_free(struct xfs_scrub_context *sc, struct xfs_scrub_ag *sa);
-int xfs_scrub_ag_init(struct xfs_scrub_context *sc, xfs_agnumber_t agno,
- struct xfs_scrub_ag *sa);
-void xfs_scrub_perag_get(struct xfs_mount *mp, struct xfs_scrub_ag *sa);
-int xfs_scrub_ag_read_headers(struct xfs_scrub_context *sc, xfs_agnumber_t agno,
+void xchk_ag_free(struct xfs_scrub_context *sc, struct xchk_ag *sa);
+int xchk_ag_init(struct xfs_scrub_context *sc, xfs_agnumber_t agno,
+ struct xchk_ag *sa);
+void xchk_perag_get(struct xfs_mount *mp, struct xchk_ag *sa);
+int xchk_ag_read_headers(struct xfs_scrub_context *sc, xfs_agnumber_t agno,
struct xfs_buf **agi, struct xfs_buf **agf,
struct xfs_buf **agfl);
-void xfs_scrub_ag_btcur_free(struct xfs_scrub_ag *sa);
-int xfs_scrub_ag_btcur_init(struct xfs_scrub_context *sc,
- struct xfs_scrub_ag *sa);
-int xfs_scrub_count_rmap_ownedby_ag(struct xfs_scrub_context *sc,
+void xchk_ag_btcur_free(struct xchk_ag *sa);
+int xchk_ag_btcur_init(struct xfs_scrub_context *sc,
+ struct xchk_ag *sa);
+int xchk_count_rmap_ownedby_ag(struct xfs_scrub_context *sc,
struct xfs_btree_cur *cur,
struct xfs_owner_info *oinfo,
xfs_filblks_t *blocks);
-int xfs_scrub_setup_ag_btree(struct xfs_scrub_context *sc,
+int xchk_setup_ag_btree(struct xfs_scrub_context *sc,
struct xfs_inode *ip, bool force_log);
-int xfs_scrub_get_inode(struct xfs_scrub_context *sc, struct xfs_inode *ip_in);
-int xfs_scrub_setup_inode_contents(struct xfs_scrub_context *sc,
+int xchk_get_inode(struct xfs_scrub_context *sc, struct xfs_inode *ip_in);
+int xchk_setup_inode_contents(struct xfs_scrub_context *sc,
struct xfs_inode *ip, unsigned int resblks);
-void xfs_scrub_buffer_recheck(struct xfs_scrub_context *sc, struct xfs_buf *bp);
+void xchk_buffer_recheck(struct xfs_scrub_context *sc, struct xfs_buf *bp);
/*
* Don't bother cross-referencing if we already found corruption or cross
* referencing discrepancies.
*/
-static inline bool xfs_scrub_skip_xref(struct xfs_scrub_metadata *sm)
+static inline bool xchk_skip_xref(struct xfs_scrub_metadata *sm)
{
return sm->sm_flags & (XFS_SCRUB_OFLAG_CORRUPT |
XFS_SCRUB_OFLAG_XCORRUPT);
}
-int xfs_scrub_metadata_inode_forks(struct xfs_scrub_context *sc);
-int xfs_scrub_ilock_inverted(struct xfs_inode *ip, uint lock_mode);
+int xchk_metadata_inode_forks(struct xfs_scrub_context *sc);
+int xchk_ilock_inverted(struct xfs_inode *ip, uint lock_mode);
#endif /* __XFS_SCRUB_COMMON_H__ */
diff --git a/fs/xfs/scrub/dabtree.c b/fs/xfs/scrub/dabtree.c
index d700c4d4d4ef..fee80f6ddfd7 100644
--- a/fs/xfs/scrub/dabtree.c
+++ b/fs/xfs/scrub/dabtree.c
@@ -35,8 +35,8 @@
* operational errors in common.c.
*/
bool
-xfs_scrub_da_process_error(
- struct xfs_scrub_da_btree *ds,
+xchk_da_process_error(
+ struct xchk_da_btree *ds,
int level,
int *error)
{
@@ -48,7 +48,7 @@ xfs_scrub_da_process_error(
switch (*error) {
case -EDEADLOCK:
/* Used to restart an op with deadlock avoidance. */
- trace_xfs_scrub_deadlock_retry(sc->ip, sc->sm, *error);
+ trace_xchk_deadlock_retry(sc->ip, sc->sm, *error);
break;
case -EFSBADCRC:
case -EFSCORRUPTED:
@@ -57,7 +57,7 @@ xfs_scrub_da_process_error(
*error = 0;
/* fall through */
default:
- trace_xfs_scrub_file_op_error(sc, ds->dargs.whichfork,
+ trace_xchk_file_op_error(sc, ds->dargs.whichfork,
xfs_dir2_da_to_db(ds->dargs.geo,
ds->state->path.blk[level].blkno),
*error, __return_address);
@@ -71,15 +71,15 @@ xfs_scrub_da_process_error(
* operational errors in common.c.
*/
void
-xfs_scrub_da_set_corrupt(
- struct xfs_scrub_da_btree *ds,
+xchk_da_set_corrupt(
+ struct xchk_da_btree *ds,
int level)
{
struct xfs_scrub_context *sc = ds->sc;
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT;
- trace_xfs_scrub_fblock_error(sc, ds->dargs.whichfork,
+ trace_xchk_fblock_error(sc, ds->dargs.whichfork,
xfs_dir2_da_to_db(ds->dargs.geo,
ds->state->path.blk[level].blkno),
__return_address);
@@ -87,8 +87,8 @@ xfs_scrub_da_set_corrupt(
/* Find an entry at a certain level in a da btree. */
STATIC void *
-xfs_scrub_da_btree_entry(
- struct xfs_scrub_da_btree *ds,
+xchk_da_btree_entry(
+ struct xchk_da_btree *ds,
int level,
int rec)
{
@@ -123,8 +123,8 @@ xfs_scrub_da_btree_entry(
/* Scrub a da btree hash (key). */
int
-xfs_scrub_da_btree_hash(
- struct xfs_scrub_da_btree *ds,
+xchk_da_btree_hash(
+ struct xchk_da_btree *ds,
int level,
__be32 *hashp)
{
@@ -136,7 +136,7 @@ xfs_scrub_da_btree_hash(
/* Is this hash in order? */
hash = be32_to_cpu(*hashp);
if (hash < ds->hashes[level])
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
ds->hashes[level] = hash;
if (level == 0)
@@ -144,10 +144,10 @@ xfs_scrub_da_btree_hash(
/* Is this hash no larger than the parent hash? */
blks = ds->state->path.blk;
- entry = xfs_scrub_da_btree_entry(ds, level - 1, blks[level - 1].index);
+ entry = xchk_da_btree_entry(ds, level - 1, blks[level - 1].index);
parent_hash = be32_to_cpu(entry->hashval);
if (parent_hash < hash)
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
return 0;
}
@@ -157,13 +157,13 @@ xfs_scrub_da_btree_hash(
* pointer.
*/
STATIC bool
-xfs_scrub_da_btree_ptr_ok(
- struct xfs_scrub_da_btree *ds,
+xchk_da_btree_ptr_ok(
+ struct xchk_da_btree *ds,
int level,
xfs_dablk_t blkno)
{
if (blkno < ds->lowest || (ds->highest != 0 && blkno >= ds->highest)) {
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
return false;
}
@@ -176,7 +176,7 @@ xfs_scrub_da_btree_ptr_ok(
* leaf1, we must multiplex the verifiers.
*/
static void
-xfs_scrub_da_btree_read_verify(
+xchk_da_btree_read_verify(
struct xfs_buf *bp)
{
struct xfs_da_blkinfo *info = bp->b_addr;
@@ -198,7 +198,7 @@ xfs_scrub_da_btree_read_verify(
}
}
static void
-xfs_scrub_da_btree_write_verify(
+xchk_da_btree_write_verify(
struct xfs_buf *bp)
{
struct xfs_da_blkinfo *info = bp->b_addr;
@@ -220,7 +220,7 @@ xfs_scrub_da_btree_write_verify(
}
}
static void *
-xfs_scrub_da_btree_verify(
+xchk_da_btree_verify(
struct xfs_buf *bp)
{
struct xfs_da_blkinfo *info = bp->b_addr;
@@ -236,17 +236,17 @@ xfs_scrub_da_btree_verify(
}
}
-static const struct xfs_buf_ops xfs_scrub_da_btree_buf_ops = {
- .name = "xfs_scrub_da_btree",
- .verify_read = xfs_scrub_da_btree_read_verify,
- .verify_write = xfs_scrub_da_btree_write_verify,
- .verify_struct = xfs_scrub_da_btree_verify,
+static const struct xfs_buf_ops xchk_da_btree_buf_ops = {
+ .name = "xchk_da_btree",
+ .verify_read = xchk_da_btree_read_verify,
+ .verify_write = xchk_da_btree_write_verify,
+ .verify_struct = xchk_da_btree_verify,
};
/* Check a block's sibling. */
STATIC int
-xfs_scrub_da_btree_block_check_sibling(
- struct xfs_scrub_da_btree *ds,
+xchk_da_btree_block_check_sibling(
+ struct xchk_da_btree *ds,
int level,
int direction,
xfs_dablk_t sibling)
@@ -265,7 +265,7 @@ xfs_scrub_da_btree_block_check_sibling(
error = xfs_da3_path_shift(ds->state, &ds->state->altpath,
direction, false, &retval);
if (error == 0 && retval == 0)
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
error = 0;
goto out;
}
@@ -273,19 +273,19 @@ xfs_scrub_da_btree_block_check_sibling(
/* Move the alternate cursor one block in the direction given. */
error = xfs_da3_path_shift(ds->state, &ds->state->altpath,
direction, false, &retval);
- if (!xfs_scrub_da_process_error(ds, level, &error))
+ if (!xchk_da_process_error(ds, level, &error))
return error;
if (retval) {
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
return error;
}
if (ds->state->altpath.blk[level].bp)
- xfs_scrub_buffer_recheck(ds->sc,
+ xchk_buffer_recheck(ds->sc,
ds->state->altpath.blk[level].bp);
/* Compare upper level pointer to sibling pointer. */
if (ds->state->altpath.blk[level].blkno != sibling)
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
xfs_trans_brelse(ds->dargs.trans, ds->state->altpath.blk[level].bp);
out:
return error;
@@ -293,8 +293,8 @@ xfs_scrub_da_btree_block_check_sibling(
/* Check a block's sibling pointers. */
STATIC int
-xfs_scrub_da_btree_block_check_siblings(
- struct xfs_scrub_da_btree *ds,
+xchk_da_btree_block_check_siblings(
+ struct xchk_da_btree *ds,
int level,
struct xfs_da_blkinfo *hdr)
{
@@ -308,7 +308,7 @@ xfs_scrub_da_btree_block_check_siblings(
/* Top level blocks should not have sibling pointers. */
if (level == 0) {
if (forw != 0 || back != 0)
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
return 0;
}
@@ -316,10 +316,10 @@ xfs_scrub_da_btree_block_check_siblings(
* Check back (left) and forw (right) pointers. These functions
* absorb error codes for us.
*/
- error = xfs_scrub_da_btree_block_check_sibling(ds, level, 0, back);
+ error = xchk_da_btree_block_check_sibling(ds, level, 0, back);
if (error)
goto out;
- error = xfs_scrub_da_btree_block_check_sibling(ds, level, 1, forw);
+ error = xchk_da_btree_block_check_sibling(ds, level, 1, forw);
out:
memset(&ds->state->altpath, 0, sizeof(ds->state->altpath));
@@ -328,8 +328,8 @@ xfs_scrub_da_btree_block_check_siblings(
/* Load a dir/attribute block from a btree. */
STATIC int
-xfs_scrub_da_btree_block(
- struct xfs_scrub_da_btree *ds,
+xchk_da_btree_block(
+ struct xchk_da_btree *ds,
int level,
xfs_dablk_t blkno)
{
@@ -355,17 +355,17 @@ xfs_scrub_da_btree_block(
/* Check the pointer. */
blk->blkno = blkno;
- if (!xfs_scrub_da_btree_ptr_ok(ds, level, blkno))
+ if (!xchk_da_btree_ptr_ok(ds, level, blkno))
goto out_nobuf;
/* Read the buffer. */
error = xfs_da_read_buf(dargs->trans, dargs->dp, blk->blkno, -2,
&blk->bp, dargs->whichfork,
- &xfs_scrub_da_btree_buf_ops);
- if (!xfs_scrub_da_process_error(ds, level, &error))
+ &xchk_da_btree_buf_ops);
+ if (!xchk_da_process_error(ds, level, &error))
goto out_nobuf;
if (blk->bp)
- xfs_scrub_buffer_recheck(ds->sc, blk->bp);
+ xchk_buffer_recheck(ds->sc, blk->bp);
/*
* We didn't find a dir btree root block, which means that
@@ -378,7 +378,7 @@ xfs_scrub_da_btree_block(
/* It's /not/ ok for attr trees not to have a da btree. */
if (blk->bp == NULL) {
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
goto out_nobuf;
}
@@ -388,17 +388,17 @@ xfs_scrub_da_btree_block(
/* We only started zeroing the header on v5 filesystems. */
if (xfs_sb_version_hascrc(&ds->sc->mp->m_sb) && hdr3->hdr.pad)
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
/* Check the owner. */
if (xfs_sb_version_hascrc(&ip->i_mount->m_sb)) {
owner = be64_to_cpu(hdr3->owner);
if (owner != ip->i_ino)
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
}
/* Check the siblings. */
- error = xfs_scrub_da_btree_block_check_siblings(ds, level, &hdr3->hdr);
+ error = xchk_da_btree_block_check_siblings(ds, level, &hdr3->hdr);
if (error)
goto out;
@@ -411,7 +411,7 @@ xfs_scrub_da_btree_block(
blk->magic = XFS_ATTR_LEAF_MAGIC;
blk->hashval = xfs_attr_leaf_lasthash(blk->bp, pmaxrecs);
if (ds->tree_level != 0)
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
break;
case XFS_DIR2_LEAFN_MAGIC:
case XFS_DIR3_LEAFN_MAGIC:
@@ -420,7 +420,7 @@ xfs_scrub_da_btree_block(
blk->magic = XFS_DIR2_LEAFN_MAGIC;
blk->hashval = xfs_dir2_leaf_lasthash(ip, blk->bp, pmaxrecs);
if (ds->tree_level != 0)
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
break;
case XFS_DIR2_LEAF1_MAGIC:
case XFS_DIR3_LEAF1_MAGIC:
@@ -429,7 +429,7 @@ xfs_scrub_da_btree_block(
blk->magic = XFS_DIR2_LEAF1_MAGIC;
blk->hashval = xfs_dir2_leaf_lasthash(ip, blk->bp, pmaxrecs);
if (ds->tree_level != 0)
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
break;
case XFS_DA_NODE_MAGIC:
case XFS_DA3_NODE_MAGIC:
@@ -443,13 +443,13 @@ xfs_scrub_da_btree_block(
blk->hashval = be32_to_cpu(btree[*pmaxrecs - 1].hashval);
if (level == 0) {
if (nodehdr.level >= XFS_DA_NODE_MAXDEPTH) {
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
goto out_freebp;
}
ds->tree_level = nodehdr.level;
} else {
if (ds->tree_level != nodehdr.level) {
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
goto out_freebp;
}
}
@@ -457,7 +457,7 @@ xfs_scrub_da_btree_block(
/* XXX: Check hdr3.pad32 once we know how to fix it. */
break;
default:
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
goto out_freebp;
}
@@ -473,13 +473,13 @@ xfs_scrub_da_btree_block(
/* Visit all nodes and leaves of a da btree. */
int
-xfs_scrub_da_btree(
+xchk_da_btree(
struct xfs_scrub_context *sc,
int whichfork,
- xfs_scrub_da_btree_rec_fn scrub_fn,
+ xchk_da_btree_rec_fn scrub_fn,
void *private)
{
- struct xfs_scrub_da_btree ds = {};
+ struct xchk_da_btree ds = {};
struct xfs_mount *mp = sc->mp;
struct xfs_da_state_blk *blks;
struct xfs_da_node_entry *key;
@@ -517,7 +517,7 @@ xfs_scrub_da_btree(
/* Find the root of the da tree, if present. */
blks = ds.state->path.blk;
- error = xfs_scrub_da_btree_block(&ds, level, blkno);
+ error = xchk_da_btree_block(&ds, level, blkno);
if (error)
goto out_state;
/*
@@ -542,12 +542,12 @@ xfs_scrub_da_btree(
}
/* Dispatch record scrubbing. */
- rec = xfs_scrub_da_btree_entry(&ds, level,
+ rec = xchk_da_btree_entry(&ds, level,
blks[level].index);
error = scrub_fn(&ds, level, rec);
if (error)
break;
- if (xfs_scrub_should_terminate(sc, &error) ||
+ if (xchk_should_terminate(sc, &error) ||
(sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT))
break;
@@ -566,8 +566,8 @@ xfs_scrub_da_btree(
}
/* Hashes in order for scrub? */
- key = xfs_scrub_da_btree_entry(&ds, level, blks[level].index);
- error = xfs_scrub_da_btree_hash(&ds, level, &key->hashval);
+ key = xchk_da_btree_entry(&ds, level, blks[level].index);
+ error = xchk_da_btree_hash(&ds, level, &key->hashval);
if (error)
goto out;
@@ -575,7 +575,7 @@ xfs_scrub_da_btree(
blkno = be32_to_cpu(key->before);
level++;
ds.tree_level--;
- error = xfs_scrub_da_btree_block(&ds, level, blkno);
+ error = xchk_da_btree_block(&ds, level, blkno);
if (error)
goto out;
if (blks[level].bp == NULL)
diff --git a/fs/xfs/scrub/dabtree.h b/fs/xfs/scrub/dabtree.h
index 365f9f0019e6..80e4af0e2589 100644
--- a/fs/xfs/scrub/dabtree.h
+++ b/fs/xfs/scrub/dabtree.h
@@ -8,7 +8,7 @@
/* dir/attr btree */
-struct xfs_scrub_da_btree {
+struct xchk_da_btree {
struct xfs_da_args dargs;
xfs_dahash_t hashes[XFS_DA_NODE_MAXDEPTH];
int maxrecs[XFS_DA_NODE_MAXDEPTH];
@@ -28,18 +28,18 @@ struct xfs_scrub_da_btree {
int tree_level;
};
-typedef int (*xfs_scrub_da_btree_rec_fn)(struct xfs_scrub_da_btree *ds,
+typedef int (*xchk_da_btree_rec_fn)(struct xchk_da_btree *ds,
int level, void *rec);
/* Check for da btree operation errors. */
-bool xfs_scrub_da_process_error(struct xfs_scrub_da_btree *ds, int level, int *error);
+bool xchk_da_process_error(struct xchk_da_btree *ds, int level, int *error);
/* Check for da btree corruption. */
-void xfs_scrub_da_set_corrupt(struct xfs_scrub_da_btree *ds, int level);
+void xchk_da_set_corrupt(struct xchk_da_btree *ds, int level);
-int xfs_scrub_da_btree_hash(struct xfs_scrub_da_btree *ds, int level,
+int xchk_da_btree_hash(struct xchk_da_btree *ds, int level,
__be32 *hashp);
-int xfs_scrub_da_btree(struct xfs_scrub_context *sc, int whichfork,
- xfs_scrub_da_btree_rec_fn scrub_fn, void *private);
+int xchk_da_btree(struct xfs_scrub_context *sc, int whichfork,
+ xchk_da_btree_rec_fn scrub_fn, void *private);
#endif /* __XFS_SCRUB_DABTREE_H__ */
diff --git a/fs/xfs/scrub/dir.c b/fs/xfs/scrub/dir.c
index 86324775fc9b..2ac07bb73478 100644
--- a/fs/xfs/scrub/dir.c
+++ b/fs/xfs/scrub/dir.c
@@ -31,18 +31,18 @@
/* Set us up to scrub directories. */
int
-xfs_scrub_setup_directory(
+xchk_setup_directory(
struct xfs_scrub_context *sc,
struct xfs_inode *ip)
{
- return xfs_scrub_setup_inode_contents(sc, ip, 0);
+ return xchk_setup_inode_contents(sc, ip, 0);
}
/* Directories */
/* Scrub a directory entry. */
-struct xfs_scrub_dir_ctx {
+struct xchk_dir_ctx {
/* VFS fill-directory iterator */
struct dir_context dir_iter;
@@ -51,8 +51,8 @@ struct xfs_scrub_dir_ctx {
/* Check that an inode's mode matches a given DT_ type. */
STATIC int
-xfs_scrub_dir_check_ftype(
- struct xfs_scrub_dir_ctx *sdc,
+xchk_dir_check_ftype(
+ struct xchk_dir_ctx *sdc,
xfs_fileoff_t offset,
xfs_ino_t inum,
int dtype)
@@ -64,7 +64,7 @@ xfs_scrub_dir_check_ftype(
if (!xfs_sb_version_hasftype(&mp->m_sb)) {
if (dtype != DT_UNKNOWN && dtype != DT_DIR)
- xfs_scrub_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK,
+ xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK,
offset);
goto out;
}
@@ -78,7 +78,7 @@ xfs_scrub_dir_check_ftype(
* inodes can trigger immediate inactive cleanup of the inode.
*/
error = xfs_iget(mp, sdc->sc->tp, inum, 0, 0, &ip);
- if (!xfs_scrub_fblock_xref_process_error(sdc->sc, XFS_DATA_FORK, offset,
+ if (!xchk_fblock_xref_process_error(sdc->sc, XFS_DATA_FORK, offset,
&error))
goto out;
@@ -86,7 +86,7 @@ xfs_scrub_dir_check_ftype(
ino_dtype = xfs_dir3_get_dtype(mp,
xfs_mode_to_ftype(VFS_I(ip)->i_mode));
if (ino_dtype != dtype)
- xfs_scrub_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK, offset);
+ xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK, offset);
iput(VFS_I(ip));
out:
return error;
@@ -101,7 +101,7 @@ xfs_scrub_dir_check_ftype(
* we can look up this filename. Finally, we check the ftype.
*/
STATIC int
-xfs_scrub_dir_actor(
+xchk_dir_actor(
struct dir_context *dir_iter,
const char *name,
int namelen,
@@ -111,13 +111,13 @@ xfs_scrub_dir_actor(
{
struct xfs_mount *mp;
struct xfs_inode *ip;
- struct xfs_scrub_dir_ctx *sdc;
+ struct xchk_dir_ctx *sdc;
struct xfs_name xname;
xfs_ino_t lookup_ino;
xfs_dablk_t offset;
int error = 0;
- sdc = container_of(dir_iter, struct xfs_scrub_dir_ctx, dir_iter);
+ sdc = container_of(dir_iter, struct xchk_dir_ctx, dir_iter);
ip = sdc->sc->ip;
mp = ip->i_mount;
offset = xfs_dir2_db_to_da(mp->m_dir_geo,
@@ -125,17 +125,17 @@ xfs_scrub_dir_actor(
/* Does this inode number make sense? */
if (!xfs_verify_dir_ino(mp, ino)) {
- xfs_scrub_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK, offset);
+ xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK, offset);
goto out;
}
if (!strncmp(".", name, namelen)) {
/* If this is "." then check that the inum matches the dir. */
if (xfs_sb_version_hasftype(&mp->m_sb) && type != DT_DIR)
- xfs_scrub_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK,
+ xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK,
offset);
if (ino != ip->i_ino)
- xfs_scrub_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK,
+ xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK,
offset);
} else if (!strncmp("..", name, namelen)) {
/*
@@ -143,10 +143,10 @@ xfs_scrub_dir_actor(
* matches this dir.
*/
if (xfs_sb_version_hasftype(&mp->m_sb) && type != DT_DIR)
- xfs_scrub_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK,
+ xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK,
offset);
if (ip->i_ino == mp->m_sb.sb_rootino && ino != ip->i_ino)
- xfs_scrub_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK,
+ xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK,
offset);
}
@@ -156,23 +156,23 @@ xfs_scrub_dir_actor(
xname.type = XFS_DIR3_FT_UNKNOWN;
error = xfs_dir_lookup(sdc->sc->tp, ip, &xname, &lookup_ino, NULL);
- if (!xfs_scrub_fblock_process_error(sdc->sc, XFS_DATA_FORK, offset,
+ if (!xchk_fblock_process_error(sdc->sc, XFS_DATA_FORK, offset,
&error))
goto out;
if (lookup_ino != ino) {
- xfs_scrub_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK, offset);
+ xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK, offset);
goto out;
}
/* Verify the file type. This function absorbs error codes. */
- error = xfs_scrub_dir_check_ftype(sdc, offset, lookup_ino, type);
+ error = xchk_dir_check_ftype(sdc, offset, lookup_ino, type);
if (error)
goto out;
out:
/*
* A negative error code returned here is supposed to cause the
* dir_emit caller (xfs_readdir) to abort the directory iteration
- * and return zero to xfs_scrub_directory.
+ * and return zero to xchk_directory.
*/
if (error == 0 && sdc->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
return -EFSCORRUPTED;
@@ -181,8 +181,8 @@ xfs_scrub_dir_actor(
/* Scrub a directory btree record. */
STATIC int
-xfs_scrub_dir_rec(
- struct xfs_scrub_da_btree *ds,
+xchk_dir_rec(
+ struct xchk_da_btree *ds,
int level,
void *rec)
{
@@ -203,7 +203,7 @@ xfs_scrub_dir_rec(
int error;
/* Check the hash of the entry. */
- error = xfs_scrub_da_btree_hash(ds, level, &ent->hashval);
+ error = xchk_da_btree_hash(ds, level, &ent->hashval);
if (error)
goto out;
@@ -218,18 +218,18 @@ xfs_scrub_dir_rec(
rec_bno = xfs_dir2_db_to_da(mp->m_dir_geo, db);
if (rec_bno >= mp->m_dir_geo->leafblk) {
- xfs_scrub_da_set_corrupt(ds, level);
+ xchk_da_set_corrupt(ds, level);
goto out;
}
error = xfs_dir3_data_read(ds->dargs.trans, dp, rec_bno, -2, &bp);
- if (!xfs_scrub_fblock_process_error(ds->sc, XFS_DATA_FORK, rec_bno,
+ if (!xchk_fblock_process_error(ds->sc, XFS_DATA_FORK, rec_bno,
&error))
goto out;
if (!bp) {
- xfs_scrub_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno);
+ xchk_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno);
goto out;
}
- xfs_scrub_buffer_recheck(ds->sc, bp);
+ xchk_buffer_recheck(ds->sc, bp);
if (ds->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
goto out_relse;
@@ -240,7 +240,7 @@ xfs_scrub_dir_rec(
p = (char *)mp->m_dir_inode_ops->data_entry_p(bp->b_addr);
endp = xfs_dir3_data_endp(mp->m_dir_geo, bp->b_addr);
if (!endp) {
- xfs_scrub_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno);
+ xchk_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno);
goto out_relse;
}
while (p < endp) {
@@ -258,7 +258,7 @@ xfs_scrub_dir_rec(
p += mp->m_dir_inode_ops->data_entsize(dep->namelen);
}
if (p >= endp) {
- xfs_scrub_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno);
+ xchk_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno);
goto out_relse;
}
@@ -267,14 +267,14 @@ xfs_scrub_dir_rec(
hash = be32_to_cpu(ent->hashval);
tag = be16_to_cpup(dp->d_ops->data_entry_tag_p(dent));
if (!xfs_verify_dir_ino(mp, ino) || tag != off)
- xfs_scrub_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno);
+ xchk_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno);
if (dent->namelen == 0) {
- xfs_scrub_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno);
+ xchk_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno);
goto out_relse;
}
calc_hash = xfs_da_hashname(dent->name, dent->namelen);
if (calc_hash != hash)
- xfs_scrub_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno);
+ xchk_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno);
out_relse:
xfs_trans_brelse(ds->dargs.trans, bp);
@@ -288,7 +288,7 @@ xfs_scrub_dir_rec(
* shortest, and that there aren't any bogus entries.
*/
STATIC void
-xfs_scrub_directory_check_free_entry(
+xchk_directory_check_free_entry(
struct xfs_scrub_context *sc,
xfs_dablk_t lblk,
struct xfs_dir2_data_free *bf,
@@ -308,12 +308,12 @@ xfs_scrub_directory_check_free_entry(
return;
/* Unused entry should be in the bestfrees but wasn't found. */
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
}
/* Check free space info in a directory data block. */
STATIC int
-xfs_scrub_directory_data_bestfree(
+xchk_directory_data_bestfree(
struct xfs_scrub_context *sc,
xfs_dablk_t lblk,
bool is_block)
@@ -339,15 +339,15 @@ xfs_scrub_directory_data_bestfree(
if (is_block) {
/* dir block format */
if (lblk != XFS_B_TO_FSBT(mp, XFS_DIR2_DATA_OFFSET))
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
error = xfs_dir3_block_read(sc->tp, sc->ip, &bp);
} else {
/* dir data format */
error = xfs_dir3_data_read(sc->tp, sc->ip, lblk, -1, &bp);
}
- if (!xfs_scrub_fblock_process_error(sc, XFS_DATA_FORK, lblk, &error))
+ if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, lblk, &error))
goto out;
- xfs_scrub_buffer_recheck(sc, bp);
+ xchk_buffer_recheck(sc, bp);
/* XXX: Check xfs_dir3_data_hdr.pad is zero once we start setting it. */
@@ -362,7 +362,7 @@ xfs_scrub_directory_data_bestfree(
if (offset == 0)
continue;
if (offset >= mp->m_dir_geo->blksize) {
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
goto out_buf;
}
dup = (struct xfs_dir2_data_unused *)(bp->b_addr + offset);
@@ -372,13 +372,13 @@ xfs_scrub_directory_data_bestfree(
if (dup->freetag != cpu_to_be16(XFS_DIR2_DATA_FREE_TAG) ||
be16_to_cpu(dup->length) != be16_to_cpu(dfp->length) ||
tag != ((char *)dup - (char *)bp->b_addr)) {
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
goto out_buf;
}
/* bestfree records should be ordered largest to smallest */
if (smallest_bestfree < be16_to_cpu(dfp->length)) {
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
goto out_buf;
}
@@ -400,7 +400,7 @@ xfs_scrub_directory_data_bestfree(
dep = (struct xfs_dir2_data_entry *)ptr;
newlen = d_ops->data_entsize(dep->namelen);
if (newlen <= 0) {
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK,
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK,
lblk);
goto out_buf;
}
@@ -411,7 +411,7 @@ xfs_scrub_directory_data_bestfree(
/* Spot check this free entry */
tag = be16_to_cpu(*xfs_dir2_data_unused_tag_p(dup));
if (tag != ((char *)dup - (char *)bp->b_addr)) {
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
goto out_buf;
}
@@ -419,14 +419,14 @@ xfs_scrub_directory_data_bestfree(
* Either this entry is a bestfree or it's smaller than
* any of the bestfrees.
*/
- xfs_scrub_directory_check_free_entry(sc, lblk, bf, dup);
+ xchk_directory_check_free_entry(sc, lblk, bf, dup);
if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
goto out_buf;
/* Move on. */
newlen = be16_to_cpu(dup->length);
if (newlen <= 0) {
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
goto out_buf;
}
ptr += newlen;
@@ -436,11 +436,11 @@ xfs_scrub_directory_data_bestfree(
/* We're required to fill all the space. */
if (ptr != endptr)
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
/* Did we see at least as many free slots as there are bestfrees? */
if (nr_frees < nr_bestfrees)
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
out_buf:
xfs_trans_brelse(sc->tp, bp);
out:
@@ -454,7 +454,7 @@ xfs_scrub_directory_data_bestfree(
* array is in order.
*/
STATIC void
-xfs_scrub_directory_check_freesp(
+xchk_directory_check_freesp(
struct xfs_scrub_context *sc,
xfs_dablk_t lblk,
struct xfs_buf *dbp,
@@ -465,15 +465,15 @@ xfs_scrub_directory_check_freesp(
dfp = sc->ip->d_ops->data_bestfree_p(dbp->b_addr);
if (len != be16_to_cpu(dfp->length))
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
if (len > 0 && be16_to_cpu(dfp->offset) == 0)
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
}
/* Check free space info in a directory leaf1 block. */
STATIC int
-xfs_scrub_directory_leaf1_bestfree(
+xchk_directory_leaf1_bestfree(
struct xfs_scrub_context *sc,
struct xfs_da_args *args,
xfs_dablk_t lblk)
@@ -497,9 +497,9 @@ xfs_scrub_directory_leaf1_bestfree(
/* Read the free space block. */
error = xfs_dir3_leaf_read(sc->tp, sc->ip, lblk, -1, &bp);
- if (!xfs_scrub_fblock_process_error(sc, XFS_DATA_FORK, lblk, &error))
+ if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, lblk, &error))
goto out;
- xfs_scrub_buffer_recheck(sc, bp);
+ xchk_buffer_recheck(sc, bp);
leaf = bp->b_addr;
d_ops->leaf_hdr_from_disk(&leafhdr, leaf);
@@ -512,7 +512,7 @@ xfs_scrub_directory_leaf1_bestfree(
struct xfs_dir3_leaf_hdr *hdr3 = bp->b_addr;
if (hdr3->pad != cpu_to_be32(0))
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
}
/*
@@ -520,19 +520,19 @@ xfs_scrub_directory_leaf1_bestfree(
* blocks that can fit under i_size.
*/
if (bestcount != xfs_dir2_byte_to_db(geo, sc->ip->i_d.di_size)) {
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
goto out;
}
/* Is the leaf count even remotely sane? */
if (leafhdr.count > d_ops->leaf_max_ents(geo)) {
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
goto out;
}
/* Leaves and bests don't overlap in leaf format. */
if ((char *)&ents[leafhdr.count] > (char *)bestp) {
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
goto out;
}
@@ -540,13 +540,13 @@ xfs_scrub_directory_leaf1_bestfree(
for (i = 0; i < leafhdr.count; i++) {
hash = be32_to_cpu(ents[i].hashval);
if (i > 0 && lasthash > hash)
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
lasthash = hash;
if (ents[i].address == cpu_to_be32(XFS_DIR2_NULL_DATAPTR))
stale++;
}
if (leafhdr.stale != stale)
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
goto out;
@@ -557,10 +557,10 @@ xfs_scrub_directory_leaf1_bestfree(
continue;
error = xfs_dir3_data_read(sc->tp, sc->ip,
i * args->geo->fsbcount, -1, &dbp);
- if (!xfs_scrub_fblock_process_error(sc, XFS_DATA_FORK, lblk,
+ if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, lblk,
&error))
break;
- xfs_scrub_directory_check_freesp(sc, lblk, dbp, best);
+ xchk_directory_check_freesp(sc, lblk, dbp, best);
xfs_trans_brelse(sc->tp, dbp);
if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
goto out;
@@ -571,7 +571,7 @@ xfs_scrub_directory_leaf1_bestfree(
/* Check free space info in a directory freespace block. */
STATIC int
-xfs_scrub_directory_free_bestfree(
+xchk_directory_free_bestfree(
struct xfs_scrub_context *sc,
struct xfs_da_args *args,
xfs_dablk_t lblk)
@@ -587,15 +587,15 @@ xfs_scrub_directory_free_bestfree(
/* Read the free space block */
error = xfs_dir2_free_read(sc->tp, sc->ip, lblk, &bp);
- if (!xfs_scrub_fblock_process_error(sc, XFS_DATA_FORK, lblk, &error))
+ if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, lblk, &error))
goto out;
- xfs_scrub_buffer_recheck(sc, bp);
+ xchk_buffer_recheck(sc, bp);
if (xfs_sb_version_hascrc(&sc->mp->m_sb)) {
struct xfs_dir3_free_hdr *hdr3 = bp->b_addr;
if (hdr3->pad != cpu_to_be32(0))
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
}
/* Check all the entries. */
@@ -610,22 +610,22 @@ xfs_scrub_directory_free_bestfree(
error = xfs_dir3_data_read(sc->tp, sc->ip,
(freehdr.firstdb + i) * args->geo->fsbcount,
-1, &dbp);
- if (!xfs_scrub_fblock_process_error(sc, XFS_DATA_FORK, lblk,
+ if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, lblk,
&error))
break;
- xfs_scrub_directory_check_freesp(sc, lblk, dbp, best);
+ xchk_directory_check_freesp(sc, lblk, dbp, best);
xfs_trans_brelse(sc->tp, dbp);
}
if (freehdr.nused + stale != freehdr.nvalid)
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
out:
return error;
}
/* Check free space information in directories. */
STATIC int
-xfs_scrub_directory_blocks(
+xchk_directory_blocks(
struct xfs_scrub_context *sc)
{
struct xfs_bmbt_irec got;
@@ -656,7 +656,7 @@ xfs_scrub_directory_blocks(
args.geo = mp->m_dir_geo;
args.trans = sc->tp;
error = xfs_dir2_isblock(&args, &is_block);
- if (!xfs_scrub_fblock_process_error(sc, XFS_DATA_FORK, lblk, &error))
+ if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, lblk, &error))
goto out;
/* Iterate all the data extents in the directory... */
@@ -666,7 +666,7 @@ xfs_scrub_directory_blocks(
if (is_block &&
(got.br_startoff > 0 ||
got.br_blockcount != args.geo->fsbcount)) {
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK,
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK,
got.br_startoff);
break;
}
@@ -690,7 +690,7 @@ xfs_scrub_directory_blocks(
args.geo->fsbcount);
lblk < got.br_startoff + got.br_blockcount;
lblk += args.geo->fsbcount) {
- error = xfs_scrub_directory_data_bestfree(sc, lblk,
+ error = xchk_directory_data_bestfree(sc, lblk,
is_block);
if (error)
goto out;
@@ -709,10 +709,10 @@ xfs_scrub_directory_blocks(
got.br_blockcount == args.geo->fsbcount &&
!xfs_iext_next_extent(ifp, &icur, &got)) {
if (is_block) {
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
goto out;
}
- error = xfs_scrub_directory_leaf1_bestfree(sc, &args,
+ error = xchk_directory_leaf1_bestfree(sc, &args,
leaf_lblk);
if (error)
goto out;
@@ -731,11 +731,11 @@ xfs_scrub_directory_blocks(
*/
lblk = got.br_startoff;
if (lblk & ~0xFFFFFFFFULL) {
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
goto out;
}
if (is_block) {
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
goto out;
}
@@ -754,7 +754,7 @@ xfs_scrub_directory_blocks(
args.geo->fsbcount);
lblk < got.br_startoff + got.br_blockcount;
lblk += args.geo->fsbcount) {
- error = xfs_scrub_directory_free_bestfree(sc, &args,
+ error = xchk_directory_free_bestfree(sc, &args,
lblk);
if (error)
goto out;
@@ -769,11 +769,11 @@ xfs_scrub_directory_blocks(
/* Scrub a whole directory. */
int
-xfs_scrub_directory(
+xchk_directory(
struct xfs_scrub_context *sc)
{
- struct xfs_scrub_dir_ctx sdc = {
- .dir_iter.actor = xfs_scrub_dir_actor,
+ struct xchk_dir_ctx sdc = {
+ .dir_iter.actor = xchk_dir_actor,
.dir_iter.pos = 0,
.sc = sc,
};
@@ -786,12 +786,12 @@ xfs_scrub_directory(
/* Plausible size? */
if (sc->ip->i_d.di_size < xfs_dir2_sf_hdr_size(0)) {
- xfs_scrub_ino_set_corrupt(sc, sc->ip->i_ino);
+ xchk_ino_set_corrupt(sc, sc->ip->i_ino);
goto out;
}
/* Check directory tree structure */
- error = xfs_scrub_da_btree(sc, XFS_DATA_FORK, xfs_scrub_dir_rec, NULL);
+ error = xchk_da_btree(sc, XFS_DATA_FORK, xchk_dir_rec, NULL);
if (error)
return error;
@@ -799,7 +799,7 @@ xfs_scrub_directory(
return error;
/* Check the freespace. */
- error = xfs_scrub_directory_blocks(sc);
+ error = xchk_directory_blocks(sc);
if (error)
return error;
@@ -816,7 +816,7 @@ xfs_scrub_directory(
/*
* Look up every name in this directory by hash.
*
- * Use the xfs_readdir function to call xfs_scrub_dir_actor on
+ * Use the xfs_readdir function to call xchk_dir_actor on
* every directory entry in this directory. In _actor, we check
* the name, inode number, and ftype (if applicable) of the
* entry. xfs_readdir uses the VFS filldir functions to provide
@@ -834,7 +834,7 @@ xfs_scrub_directory(
xfs_iunlock(sc->ip, XFS_ILOCK_EXCL);
while (true) {
error = xfs_readdir(sc->tp, sc->ip, &sdc.dir_iter, bufsize);
- if (!xfs_scrub_fblock_process_error(sc, XFS_DATA_FORK, 0,
+ if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, 0,
&error))
goto out;
if (oldpos == sdc.dir_iter.pos)
diff --git a/fs/xfs/scrub/ialloc.c b/fs/xfs/scrub/ialloc.c
index 13d43d108574..69d652b7299c 100644
--- a/fs/xfs/scrub/ialloc.c
+++ b/fs/xfs/scrub/ialloc.c
@@ -35,11 +35,11 @@
* try again after forcing logged inode cores out to disk.
*/
int
-xfs_scrub_setup_ag_iallocbt(
+xchk_setup_ag_iallocbt(
struct xfs_scrub_context *sc,
struct xfs_inode *ip)
{
- return xfs_scrub_setup_ag_btree(sc, ip, sc->try_harder);
+ return xchk_setup_ag_btree(sc, ip, sc->try_harder);
}
/* Inode btree scrubber. */
@@ -50,7 +50,7 @@ xfs_scrub_setup_ag_iallocbt(
* we have a record or not depending on freecount.
*/
static inline void
-xfs_scrub_iallocbt_chunk_xref_other(
+xchk_iallocbt_chunk_xref_other(
struct xfs_scrub_context *sc,
struct xfs_inobt_rec_incore *irec,
xfs_agino_t agino)
@@ -66,16 +66,16 @@ xfs_scrub_iallocbt_chunk_xref_other(
if (!(*pcur))
return;
error = xfs_ialloc_has_inode_record(*pcur, agino, agino, &has_irec);
- if (!xfs_scrub_should_check_xref(sc, &error, pcur))
+ if (!xchk_should_check_xref(sc, &error, pcur))
return;
if (((irec->ir_freecount > 0 && !has_irec) ||
(irec->ir_freecount == 0 && has_irec)))
- xfs_scrub_btree_xref_set_corrupt(sc, *pcur, 0);
+ xchk_btree_xref_set_corrupt(sc, *pcur, 0);
}
/* Cross-reference with the other btrees. */
STATIC void
-xfs_scrub_iallocbt_chunk_xref(
+xchk_iallocbt_chunk_xref(
struct xfs_scrub_context *sc,
struct xfs_inobt_rec_incore *irec,
xfs_agino_t agino,
@@ -87,17 +87,17 @@ xfs_scrub_iallocbt_chunk_xref(
if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
return;
- xfs_scrub_xref_is_used_space(sc, agbno, len);
- xfs_scrub_iallocbt_chunk_xref_other(sc, irec, agino);
+ xchk_xref_is_used_space(sc, agbno, len);
+ xchk_iallocbt_chunk_xref_other(sc, irec, agino);
xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_INODES);
- xfs_scrub_xref_is_owned_by(sc, agbno, len, &oinfo);
- xfs_scrub_xref_is_not_shared(sc, agbno, len);
+ xchk_xref_is_owned_by(sc, agbno, len, &oinfo);
+ xchk_xref_is_not_shared(sc, agbno, len);
}
/* Is this chunk worth checking? */
STATIC bool
-xfs_scrub_iallocbt_chunk(
- struct xfs_scrub_btree *bs,
+xchk_iallocbt_chunk(
+ struct xchk_btree *bs,
struct xfs_inobt_rec_incore *irec,
xfs_agino_t agino,
xfs_extlen_t len)
@@ -110,16 +110,16 @@ xfs_scrub_iallocbt_chunk(
if (bno + len <= bno ||
!xfs_verify_agbno(mp, agno, bno) ||
!xfs_verify_agbno(mp, agno, bno + len - 1))
- xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
+ xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
- xfs_scrub_iallocbt_chunk_xref(bs->sc, irec, agino, bno, len);
+ xchk_iallocbt_chunk_xref(bs->sc, irec, agino, bno, len);
return true;
}
/* Count the number of free inodes. */
static unsigned int
-xfs_scrub_iallocbt_freecount(
+xchk_iallocbt_freecount(
xfs_inofree_t freemask)
{
BUILD_BUG_ON(sizeof(freemask) != sizeof(__u64));
@@ -128,8 +128,8 @@ xfs_scrub_iallocbt_freecount(
/* Check a particular inode with ir_free. */
STATIC int
-xfs_scrub_iallocbt_check_cluster_freemask(
- struct xfs_scrub_btree *bs,
+xchk_iallocbt_check_cluster_freemask(
+ struct xchk_btree *bs,
xfs_ino_t fsino,
xfs_agino_t chunkino,
xfs_agino_t clusterino,
@@ -143,14 +143,14 @@ xfs_scrub_iallocbt_check_cluster_freemask(
bool inuse;
int error = 0;
- if (xfs_scrub_should_terminate(bs->sc, &error))
+ if (xchk_should_terminate(bs->sc, &error))
return error;
dip = xfs_buf_offset(bp, clusterino * mp->m_sb.sb_inodesize);
if (be16_to_cpu(dip->di_magic) != XFS_DINODE_MAGIC ||
(dip->di_version >= 3 &&
be64_to_cpu(dip->di_ino) != fsino + clusterino)) {
- xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
+ xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
goto out;
}
@@ -175,15 +175,15 @@ xfs_scrub_iallocbt_check_cluster_freemask(
freemask_ok = inode_is_free ^ inuse;
}
if (!freemask_ok)
- xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
+ xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
out:
return 0;
}
/* Make sure the free mask is consistent with what the inodes think. */
STATIC int
-xfs_scrub_iallocbt_check_freemask(
- struct xfs_scrub_btree *bs,
+xchk_iallocbt_check_freemask(
+ struct xchk_btree *bs,
struct xfs_inobt_rec_incore *irec)
{
struct xfs_owner_info oinfo;
@@ -223,18 +223,18 @@ xfs_scrub_iallocbt_check_freemask(
/* The whole cluster must be a hole or not a hole. */
ir_holemask = (irec->ir_holemask & holemask);
if (ir_holemask != holemask && ir_holemask != 0) {
- xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
+ xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
continue;
}
/* If any part of this is a hole, skip it. */
if (ir_holemask) {
- xfs_scrub_xref_is_not_owned_by(bs->sc, agbno,
+ xchk_xref_is_not_owned_by(bs->sc, agbno,
blks_per_cluster, &oinfo);
continue;
}
- xfs_scrub_xref_is_owned_by(bs->sc, agbno, blks_per_cluster,
+ xchk_xref_is_owned_by(bs->sc, agbno, blks_per_cluster,
&oinfo);
/* Grab the inode cluster buffer. */
@@ -245,13 +245,13 @@ xfs_scrub_iallocbt_check_freemask(
error = xfs_imap_to_bp(mp, bs->cur->bc_tp, &imap,
&dip, &bp, 0, 0);
- if (!xfs_scrub_btree_xref_process_error(bs->sc, bs->cur, 0,
+ if (!xchk_btree_xref_process_error(bs->sc, bs->cur, 0,
&error))
continue;
/* Which inodes are free? */
for (clusterino = 0; clusterino < nr_inodes; clusterino++) {
- error = xfs_scrub_iallocbt_check_cluster_freemask(bs,
+ error = xchk_iallocbt_check_cluster_freemask(bs,
fsino, chunkino, clusterino, irec, bp);
if (error) {
xfs_trans_brelse(bs->cur->bc_tp, bp);
@@ -267,8 +267,8 @@ xfs_scrub_iallocbt_check_freemask(
/* Scrub an inobt/finobt record. */
STATIC int
-xfs_scrub_iallocbt_rec(
- struct xfs_scrub_btree *bs,
+xchk_iallocbt_rec(
+ struct xchk_btree *bs,
union xfs_btree_rec *rec)
{
struct xfs_mount *mp = bs->cur->bc_mp;
@@ -289,18 +289,18 @@ xfs_scrub_iallocbt_rec(
if (irec.ir_count > XFS_INODES_PER_CHUNK ||
irec.ir_freecount > XFS_INODES_PER_CHUNK)
- xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
+ xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
real_freecount = irec.ir_freecount +
(XFS_INODES_PER_CHUNK - irec.ir_count);
- if (real_freecount != xfs_scrub_iallocbt_freecount(irec.ir_free))
- xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
+ if (real_freecount != xchk_iallocbt_freecount(irec.ir_free))
+ xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
agino = irec.ir_startino;
/* Record has to be properly aligned within the AG. */
if (!xfs_verify_agino(mp, agno, agino) ||
!xfs_verify_agino(mp, agno, agino + XFS_INODES_PER_CHUNK - 1)) {
- xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
+ xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
goto out;
}
@@ -308,7 +308,7 @@ xfs_scrub_iallocbt_rec(
agbno = XFS_AGINO_TO_AGBNO(mp, irec.ir_startino);
if ((agbno & (xfs_ialloc_cluster_alignment(mp) - 1)) ||
(agbno & (xfs_icluster_size_fsb(mp) - 1)))
- xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
+ xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
*inode_blocks += XFS_B_TO_FSB(mp,
irec.ir_count * mp->m_sb.sb_inodesize);
@@ -318,9 +318,9 @@ xfs_scrub_iallocbt_rec(
len = XFS_B_TO_FSB(mp,
XFS_INODES_PER_CHUNK * mp->m_sb.sb_inodesize);
if (irec.ir_count != XFS_INODES_PER_CHUNK)
- xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
+ xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
- if (!xfs_scrub_iallocbt_chunk(bs, &irec, agino, len))
+ if (!xchk_iallocbt_chunk(bs, &irec, agino, len))
goto out;
goto check_freemask;
}
@@ -333,12 +333,12 @@ xfs_scrub_iallocbt_rec(
holes = ~xfs_inobt_irec_to_allocmask(&irec);
if ((holes & irec.ir_free) != holes ||
irec.ir_freecount > irec.ir_count)
- xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
+ xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
for (i = 0; i < XFS_INOBT_HOLEMASK_BITS; i++) {
if (holemask & 1)
holecount += XFS_INODES_PER_HOLEMASK_BIT;
- else if (!xfs_scrub_iallocbt_chunk(bs, &irec, agino, len))
+ else if (!xchk_iallocbt_chunk(bs, &irec, agino, len))
break;
holemask >>= 1;
agino += XFS_INODES_PER_HOLEMASK_BIT;
@@ -346,10 +346,10 @@ xfs_scrub_iallocbt_rec(
if (holecount > XFS_INODES_PER_CHUNK ||
holecount + irec.ir_count != XFS_INODES_PER_CHUNK)
- xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
+ xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
check_freemask:
- error = xfs_scrub_iallocbt_check_freemask(bs, &irec);
+ error = xchk_iallocbt_check_freemask(bs, &irec);
if (error)
goto out;
@@ -362,7 +362,7 @@ xfs_scrub_iallocbt_rec(
* Don't bother if we're missing btree cursors, as we're already corrupt.
*/
STATIC void
-xfs_scrub_iallocbt_xref_rmap_btreeblks(
+xchk_iallocbt_xref_rmap_btreeblks(
struct xfs_scrub_context *sc,
int which)
{
@@ -374,27 +374,27 @@ xfs_scrub_iallocbt_xref_rmap_btreeblks(
if (!sc->sa.ino_cur || !sc->sa.rmap_cur ||
(xfs_sb_version_hasfinobt(&sc->mp->m_sb) && !sc->sa.fino_cur) ||
- xfs_scrub_skip_xref(sc->sm))
+ xchk_skip_xref(sc->sm))
return;
/* Check that we saw as many inobt blocks as the rmap says. */
error = xfs_btree_count_blocks(sc->sa.ino_cur, &inobt_blocks);
- if (!xfs_scrub_process_error(sc, 0, 0, &error))
+ if (!xchk_process_error(sc, 0, 0, &error))
return;
if (sc->sa.fino_cur) {
error = xfs_btree_count_blocks(sc->sa.fino_cur, &finobt_blocks);
- if (!xfs_scrub_process_error(sc, 0, 0, &error))
+ if (!xchk_process_error(sc, 0, 0, &error))
return;
}
xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_INOBT);
- error = xfs_scrub_count_rmap_ownedby_ag(sc, sc->sa.rmap_cur, &oinfo,
+ error = xchk_count_rmap_ownedby_ag(sc, sc->sa.rmap_cur, &oinfo,
&blocks);
- if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.rmap_cur))
+ if (!xchk_should_check_xref(sc, &error, &sc->sa.rmap_cur))
return;
if (blocks != inobt_blocks + finobt_blocks)
- xfs_scrub_btree_set_corrupt(sc, sc->sa.ino_cur, 0);
+ xchk_btree_set_corrupt(sc, sc->sa.ino_cur, 0);
}
/*
@@ -402,7 +402,7 @@ xfs_scrub_iallocbt_xref_rmap_btreeblks(
* the rmap says are owned by inodes.
*/
STATIC void
-xfs_scrub_iallocbt_xref_rmap_inodes(
+xchk_iallocbt_xref_rmap_inodes(
struct xfs_scrub_context *sc,
int which,
xfs_filblks_t inode_blocks)
@@ -411,22 +411,22 @@ xfs_scrub_iallocbt_xref_rmap_inodes(
xfs_filblks_t blocks;
int error;
- if (!sc->sa.rmap_cur || xfs_scrub_skip_xref(sc->sm))
+ if (!sc->sa.rmap_cur || xchk_skip_xref(sc->sm))
return;
/* Check that we saw as many inode blocks as the rmap knows about. */
xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_INODES);
- error = xfs_scrub_count_rmap_ownedby_ag(sc, sc->sa.rmap_cur, &oinfo,
+ error = xchk_count_rmap_ownedby_ag(sc, sc->sa.rmap_cur, &oinfo,
&blocks);
- if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.rmap_cur))
+ if (!xchk_should_check_xref(sc, &error, &sc->sa.rmap_cur))
return;
if (blocks != inode_blocks)
- xfs_scrub_btree_xref_set_corrupt(sc, sc->sa.rmap_cur, 0);
+ xchk_btree_xref_set_corrupt(sc, sc->sa.rmap_cur, 0);
}
/* Scrub the inode btrees for some AG. */
STATIC int
-xfs_scrub_iallocbt(
+xchk_iallocbt(
struct xfs_scrub_context *sc,
xfs_btnum_t which)
{
@@ -437,12 +437,12 @@ xfs_scrub_iallocbt(
xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_INOBT);
cur = which == XFS_BTNUM_INO ? sc->sa.ino_cur : sc->sa.fino_cur;
- error = xfs_scrub_btree(sc, cur, xfs_scrub_iallocbt_rec, &oinfo,
+ error = xchk_btree(sc, cur, xchk_iallocbt_rec, &oinfo,
&inode_blocks);
if (error)
return error;
- xfs_scrub_iallocbt_xref_rmap_btreeblks(sc, which);
+ xchk_iallocbt_xref_rmap_btreeblks(sc, which);
/*
* If we're scrubbing the inode btree, inode_blocks is the number of
@@ -452,28 +452,28 @@ xfs_scrub_iallocbt(
* to inode chunks with free inodes.
*/
if (which == XFS_BTNUM_INO)
- xfs_scrub_iallocbt_xref_rmap_inodes(sc, which, inode_blocks);
+ xchk_iallocbt_xref_rmap_inodes(sc, which, inode_blocks);
return error;
}
int
-xfs_scrub_inobt(
+xchk_inobt(
struct xfs_scrub_context *sc)
{
- return xfs_scrub_iallocbt(sc, XFS_BTNUM_INO);
+ return xchk_iallocbt(sc, XFS_BTNUM_INO);
}
int
-xfs_scrub_finobt(
+xchk_finobt(
struct xfs_scrub_context *sc)
{
- return xfs_scrub_iallocbt(sc, XFS_BTNUM_FINO);
+ return xchk_iallocbt(sc, XFS_BTNUM_FINO);
}
/* See if an inode btree has (or doesn't have) an inode chunk record. */
static inline void
-xfs_scrub_xref_inode_check(
+xchk_xref_inode_check(
struct xfs_scrub_context *sc,
xfs_agblock_t agbno,
xfs_extlen_t len,
@@ -483,33 +483,33 @@ xfs_scrub_xref_inode_check(
bool has_inodes;
int error;
- if (!(*icur) || xfs_scrub_skip_xref(sc->sm))
+ if (!(*icur) || xchk_skip_xref(sc->sm))
return;
error = xfs_ialloc_has_inodes_at_extent(*icur, agbno, len, &has_inodes);
- if (!xfs_scrub_should_check_xref(sc, &error, icur))
+ if (!xchk_should_check_xref(sc, &error, icur))
return;
if (has_inodes != should_have_inodes)
- xfs_scrub_btree_xref_set_corrupt(sc, *icur, 0);
+ xchk_btree_xref_set_corrupt(sc, *icur, 0);
}
/* xref check that the extent is not covered by inodes */
void
-xfs_scrub_xref_is_not_inode_chunk(
+xchk_xref_is_not_inode_chunk(
struct xfs_scrub_context *sc,
xfs_agblock_t agbno,
xfs_extlen_t len)
{
- xfs_scrub_xref_inode_check(sc, agbno, len, &sc->sa.ino_cur, false);
- xfs_scrub_xref_inode_check(sc, agbno, len, &sc->sa.fino_cur, false);
+ xchk_xref_inode_check(sc, agbno, len, &sc->sa.ino_cur, false);
+ xchk_xref_inode_check(sc, agbno, len, &sc->sa.fino_cur, false);
}
/* xref check that the extent is covered by inodes */
void
-xfs_scrub_xref_is_inode_chunk(
+xchk_xref_is_inode_chunk(
struct xfs_scrub_context *sc,
xfs_agblock_t agbno,
xfs_extlen_t len)
{
- xfs_scrub_xref_inode_check(sc, agbno, len, &sc->sa.ino_cur, true);
+ xchk_xref_inode_check(sc, agbno, len, &sc->sa.ino_cur, true);
}
diff --git a/fs/xfs/scrub/inode.c b/fs/xfs/scrub/inode.c
index 7a6208505980..d85fbec39e52 100644
--- a/fs/xfs/scrub/inode.c
+++ b/fs/xfs/scrub/inode.c
@@ -37,7 +37,7 @@
* the goal.
*/
int
-xfs_scrub_setup_inode(
+xchk_setup_inode(
struct xfs_scrub_context *sc,
struct xfs_inode *ip)
{
@@ -47,13 +47,13 @@ xfs_scrub_setup_inode(
* Try to get the inode. If the verifiers fail, we try again
* in raw mode.
*/
- error = xfs_scrub_get_inode(sc, ip);
+ error = xchk_get_inode(sc, ip);
switch (error) {
case 0:
break;
case -EFSCORRUPTED:
case -EFSBADCRC:
- return xfs_scrub_trans_alloc(sc, 0);
+ return xchk_trans_alloc(sc, 0);
default:
return error;
}
@@ -61,7 +61,7 @@ xfs_scrub_setup_inode(
/* Got the inode, lock it and we're ready to go. */
sc->ilock_flags = XFS_IOLOCK_EXCL | XFS_MMAPLOCK_EXCL;
xfs_ilock(sc->ip, sc->ilock_flags);
- error = xfs_scrub_trans_alloc(sc, 0);
+ error = xchk_trans_alloc(sc, 0);
if (error)
goto out;
sc->ilock_flags |= XFS_ILOCK_EXCL;
@@ -76,7 +76,7 @@ xfs_scrub_setup_inode(
/* Validate di_extsize hint. */
STATIC void
-xfs_scrub_inode_extsize(
+xchk_inode_extsize(
struct xfs_scrub_context *sc,
struct xfs_dinode *dip,
xfs_ino_t ino,
@@ -88,7 +88,7 @@ xfs_scrub_inode_extsize(
fa = xfs_inode_validate_extsize(sc->mp, be32_to_cpu(dip->di_extsize),
mode, flags);
if (fa)
- xfs_scrub_ino_set_corrupt(sc, ino);
+ xchk_ino_set_corrupt(sc, ino);
}
/*
@@ -98,7 +98,7 @@ xfs_scrub_inode_extsize(
* These functions must be kept in sync with each other.
*/
STATIC void
-xfs_scrub_inode_cowextsize(
+xchk_inode_cowextsize(
struct xfs_scrub_context *sc,
struct xfs_dinode *dip,
xfs_ino_t ino,
@@ -112,12 +112,12 @@ xfs_scrub_inode_cowextsize(
be32_to_cpu(dip->di_cowextsize), mode, flags,
flags2);
if (fa)
- xfs_scrub_ino_set_corrupt(sc, ino);
+ xchk_ino_set_corrupt(sc, ino);
}
/* Make sure the di_flags make sense for the inode. */
STATIC void
-xfs_scrub_inode_flags(
+xchk_inode_flags(
struct xfs_scrub_context *sc,
struct xfs_dinode *dip,
xfs_ino_t ino,
@@ -157,12 +157,12 @@ xfs_scrub_inode_flags(
return;
bad:
- xfs_scrub_ino_set_corrupt(sc, ino);
+ xchk_ino_set_corrupt(sc, ino);
}
/* Make sure the di_flags2 make sense for the inode. */
STATIC void
-xfs_scrub_inode_flags2(
+xchk_inode_flags2(
struct xfs_scrub_context *sc,
struct xfs_dinode *dip,
xfs_ino_t ino,
@@ -200,12 +200,12 @@ xfs_scrub_inode_flags2(
return;
bad:
- xfs_scrub_ino_set_corrupt(sc, ino);
+ xchk_ino_set_corrupt(sc, ino);
}
/* Scrub all the ondisk inode fields. */
STATIC void
-xfs_scrub_dinode(
+xchk_dinode(
struct xfs_scrub_context *sc,
struct xfs_dinode *dip,
xfs_ino_t ino)
@@ -237,7 +237,7 @@ xfs_scrub_dinode(
/* mode is recognized */
break;
default:
- xfs_scrub_ino_set_corrupt(sc, ino);
+ xchk_ino_set_corrupt(sc, ino);
break;
}
@@ -248,22 +248,22 @@ xfs_scrub_dinode(
* We autoconvert v1 inodes into v2 inodes on writeout,
* so just mark this inode for preening.
*/
- xfs_scrub_ino_set_preen(sc, ino);
+ xchk_ino_set_preen(sc, ino);
break;
case 2:
case 3:
if (dip->di_onlink != 0)
- xfs_scrub_ino_set_corrupt(sc, ino);
+ xchk_ino_set_corrupt(sc, ino);
if (dip->di_mode == 0 && sc->ip)
- xfs_scrub_ino_set_corrupt(sc, ino);
+ xchk_ino_set_corrupt(sc, ino);
if (dip->di_projid_hi != 0 &&
!xfs_sb_version_hasprojid32bit(&mp->m_sb))
- xfs_scrub_ino_set_corrupt(sc, ino);
+ xchk_ino_set_corrupt(sc, ino);
break;
default:
- xfs_scrub_ino_set_corrupt(sc, ino);
+ xchk_ino_set_corrupt(sc, ino);
return;
}
@@ -273,40 +273,40 @@ xfs_scrub_dinode(
*/
if (dip->di_uid == cpu_to_be32(-1U) ||
dip->di_gid == cpu_to_be32(-1U))
- xfs_scrub_ino_set_warning(sc, ino);
+ xchk_ino_set_warning(sc, ino);
/* di_format */
switch (dip->di_format) {
case XFS_DINODE_FMT_DEV:
if (!S_ISCHR(mode) && !S_ISBLK(mode) &&
!S_ISFIFO(mode) && !S_ISSOCK(mode))
- xfs_scrub_ino_set_corrupt(sc, ino);
+ xchk_ino_set_corrupt(sc, ino);
break;
case XFS_DINODE_FMT_LOCAL:
if (!S_ISDIR(mode) && !S_ISLNK(mode))
- xfs_scrub_ino_set_corrupt(sc, ino);
+ xchk_ino_set_corrupt(sc, ino);
break;
case XFS_DINODE_FMT_EXTENTS:
if (!S_ISREG(mode) && !S_ISDIR(mode) && !S_ISLNK(mode))
- xfs_scrub_ino_set_corrupt(sc, ino);
+ xchk_ino_set_corrupt(sc, ino);
break;
case XFS_DINODE_FMT_BTREE:
if (!S_ISREG(mode) && !S_ISDIR(mode))
- xfs_scrub_ino_set_corrupt(sc, ino);
+ xchk_ino_set_corrupt(sc, ino);
break;
case XFS_DINODE_FMT_UUID:
default:
- xfs_scrub_ino_set_corrupt(sc, ino);
+ xchk_ino_set_corrupt(sc, ino);
break;
}
/* di_[amc]time.nsec */
if (be32_to_cpu(dip->di_atime.t_nsec) >= NSEC_PER_SEC)
- xfs_scrub_ino_set_corrupt(sc, ino);
+ xchk_ino_set_corrupt(sc, ino);
if (be32_to_cpu(dip->di_mtime.t_nsec) >= NSEC_PER_SEC)
- xfs_scrub_ino_set_corrupt(sc, ino);
+ xchk_ino_set_corrupt(sc, ino);
if (be32_to_cpu(dip->di_ctime.t_nsec) >= NSEC_PER_SEC)
- xfs_scrub_ino_set_corrupt(sc, ino);
+ xchk_ino_set_corrupt(sc, ino);
/*
* di_size. xfs_dinode_verify checks for things that screw up
@@ -315,19 +315,19 @@ xfs_scrub_dinode(
*/
isize = be64_to_cpu(dip->di_size);
if (isize & (1ULL << 63))
- xfs_scrub_ino_set_corrupt(sc, ino);
+ xchk_ino_set_corrupt(sc, ino);
/* Devices, fifos, and sockets must have zero size */
if (!S_ISDIR(mode) && !S_ISREG(mode) && !S_ISLNK(mode) && isize != 0)
- xfs_scrub_ino_set_corrupt(sc, ino);
+ xchk_ino_set_corrupt(sc, ino);
/* Directories can't be larger than the data section size (32G) */
if (S_ISDIR(mode) && (isize == 0 || isize >= XFS_DIR2_SPACE_SIZE))
- xfs_scrub_ino_set_corrupt(sc, ino);
+ xchk_ino_set_corrupt(sc, ino);
/* Symlinks can't be larger than SYMLINK_MAXLEN */
if (S_ISLNK(mode) && (isize == 0 || isize >= XFS_SYMLINK_MAXLEN))
- xfs_scrub_ino_set_corrupt(sc, ino);
+ xchk_ino_set_corrupt(sc, ino);
/*
* Warn if the running kernel can't handle the kinds of offsets
@@ -336,7 +336,7 @@ xfs_scrub_dinode(
* overly large offsets, flag the inode for admin review.
*/
if (isize >= mp->m_super->s_maxbytes)
- xfs_scrub_ino_set_warning(sc, ino);
+ xchk_ino_set_warning(sc, ino);
/* di_nblocks */
if (flags2 & XFS_DIFLAG2_REFLINK) {
@@ -351,15 +351,15 @@ xfs_scrub_dinode(
*/
if (be64_to_cpu(dip->di_nblocks) >=
mp->m_sb.sb_dblocks + mp->m_sb.sb_rblocks)
- xfs_scrub_ino_set_corrupt(sc, ino);
+ xchk_ino_set_corrupt(sc, ino);
} else {
if (be64_to_cpu(dip->di_nblocks) >= mp->m_sb.sb_dblocks)
- xfs_scrub_ino_set_corrupt(sc, ino);
+ xchk_ino_set_corrupt(sc, ino);
}
- xfs_scrub_inode_flags(sc, dip, ino, mode, flags);
+ xchk_inode_flags(sc, dip, ino, mode, flags);
- xfs_scrub_inode_extsize(sc, dip, ino, mode, flags);
+ xchk_inode_extsize(sc, dip, ino, mode, flags);
/* di_nextents */
nextents = be32_to_cpu(dip->di_nextents);
@@ -367,31 +367,31 @@ xfs_scrub_dinode(
switch (dip->di_format) {
case XFS_DINODE_FMT_EXTENTS:
if (nextents > fork_recs)
- xfs_scrub_ino_set_corrupt(sc, ino);
+ xchk_ino_set_corrupt(sc, ino);
break;
case XFS_DINODE_FMT_BTREE:
if (nextents <= fork_recs)
- xfs_scrub_ino_set_corrupt(sc, ino);
+ xchk_ino_set_corrupt(sc, ino);
break;
default:
if (nextents != 0)
- xfs_scrub_ino_set_corrupt(sc, ino);
+ xchk_ino_set_corrupt(sc, ino);
break;
}
/* di_forkoff */
if (XFS_DFORK_APTR(dip) >= (char *)dip + mp->m_sb.sb_inodesize)
- xfs_scrub_ino_set_corrupt(sc, ino);
+ xchk_ino_set_corrupt(sc, ino);
if (dip->di_anextents != 0 && dip->di_forkoff == 0)
- xfs_scrub_ino_set_corrupt(sc, ino);
+ xchk_ino_set_corrupt(sc, ino);
if (dip->di_forkoff == 0 && dip->di_aformat != XFS_DINODE_FMT_EXTENTS)
- xfs_scrub_ino_set_corrupt(sc, ino);
+ xchk_ino_set_corrupt(sc, ino);
/* di_aformat */
if (dip->di_aformat != XFS_DINODE_FMT_LOCAL &&
dip->di_aformat != XFS_DINODE_FMT_EXTENTS &&
dip->di_aformat != XFS_DINODE_FMT_BTREE)
- xfs_scrub_ino_set_corrupt(sc, ino);
+ xchk_ino_set_corrupt(sc, ino);
/* di_anextents */
nextents = be16_to_cpu(dip->di_anextents);
@@ -399,22 +399,22 @@ xfs_scrub_dinode(
switch (dip->di_aformat) {
case XFS_DINODE_FMT_EXTENTS:
if (nextents > fork_recs)
- xfs_scrub_ino_set_corrupt(sc, ino);
+ xchk_ino_set_corrupt(sc, ino);
break;
case XFS_DINODE_FMT_BTREE:
if (nextents <= fork_recs)
- xfs_scrub_ino_set_corrupt(sc, ino);
+ xchk_ino_set_corrupt(sc, ino);
break;
default:
if (nextents != 0)
- xfs_scrub_ino_set_corrupt(sc, ino);
+ xchk_ino_set_corrupt(sc, ino);
}
if (dip->di_version >= 3) {
if (be32_to_cpu(dip->di_crtime.t_nsec) >= NSEC_PER_SEC)
- xfs_scrub_ino_set_corrupt(sc, ino);
- xfs_scrub_inode_flags2(sc, dip, ino, mode, flags, flags2);
- xfs_scrub_inode_cowextsize(sc, dip, ino, mode, flags,
+ xchk_ino_set_corrupt(sc, ino);
+ xchk_inode_flags2(sc, dip, ino, mode, flags, flags2);
+ xchk_inode_cowextsize(sc, dip, ino, mode, flags,
flags2);
}
}
@@ -425,7 +425,7 @@ xfs_scrub_dinode(
* IGET_UNTRUSTED, which checks the inobt for us.
*/
static void
-xfs_scrub_inode_xref_finobt(
+xchk_inode_xref_finobt(
struct xfs_scrub_context *sc,
xfs_ino_t ino)
{
@@ -434,7 +434,7 @@ xfs_scrub_inode_xref_finobt(
int has_record;
int error;
- if (!sc->sa.fino_cur || xfs_scrub_skip_xref(sc->sm))
+ if (!sc->sa.fino_cur || xchk_skip_xref(sc->sm))
return;
agino = XFS_INO_TO_AGINO(sc->mp, ino);
@@ -445,12 +445,12 @@ xfs_scrub_inode_xref_finobt(
*/
error = xfs_inobt_lookup(sc->sa.fino_cur, agino, XFS_LOOKUP_LE,
&has_record);
- if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.fino_cur) ||
+ if (!xchk_should_check_xref(sc, &error, &sc->sa.fino_cur) ||
!has_record)
return;
error = xfs_inobt_get_rec(sc->sa.fino_cur, &rec, &has_record);
- if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.fino_cur) ||
+ if (!xchk_should_check_xref(sc, &error, &sc->sa.fino_cur) ||
!has_record)
return;
@@ -463,12 +463,12 @@ xfs_scrub_inode_xref_finobt(
return;
if (rec.ir_free & XFS_INOBT_MASK(agino - rec.ir_startino))
- xfs_scrub_btree_xref_set_corrupt(sc, sc->sa.fino_cur, 0);
+ xchk_btree_xref_set_corrupt(sc, sc->sa.fino_cur, 0);
}
/* Cross reference the inode fields with the forks. */
STATIC void
-xfs_scrub_inode_xref_bmap(
+xchk_inode_xref_bmap(
struct xfs_scrub_context *sc,
struct xfs_dinode *dip)
{
@@ -477,32 +477,32 @@ xfs_scrub_inode_xref_bmap(
xfs_filblks_t acount;
int error;
- if (xfs_scrub_skip_xref(sc->sm))
+ if (xchk_skip_xref(sc->sm))
return;
/* Walk all the extents to check nextents/naextents/nblocks. */
error = xfs_bmap_count_blocks(sc->tp, sc->ip, XFS_DATA_FORK,
&nextents, &count);
- if (!xfs_scrub_should_check_xref(sc, &error, NULL))
+ if (!xchk_should_check_xref(sc, &error, NULL))
return;
if (nextents < be32_to_cpu(dip->di_nextents))
- xfs_scrub_ino_xref_set_corrupt(sc, sc->ip->i_ino);
+ xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino);
error = xfs_bmap_count_blocks(sc->tp, sc->ip, XFS_ATTR_FORK,
&nextents, &acount);
- if (!xfs_scrub_should_check_xref(sc, &error, NULL))
+ if (!xchk_should_check_xref(sc, &error, NULL))
return;
if (nextents != be16_to_cpu(dip->di_anextents))
- xfs_scrub_ino_xref_set_corrupt(sc, sc->ip->i_ino);
+ xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino);
/* Check nblocks against the inode. */
if (count + acount != be64_to_cpu(dip->di_nblocks))
- xfs_scrub_ino_xref_set_corrupt(sc, sc->ip->i_ino);
+ xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino);
}
/* Cross-reference with the other btrees. */
STATIC void
-xfs_scrub_inode_xref(
+xchk_inode_xref(
struct xfs_scrub_context *sc,
xfs_ino_t ino,
struct xfs_dinode *dip)
@@ -518,18 +518,18 @@ xfs_scrub_inode_xref(
agno = XFS_INO_TO_AGNO(sc->mp, ino);
agbno = XFS_INO_TO_AGBNO(sc->mp, ino);
- error = xfs_scrub_ag_init(sc, agno, &sc->sa);
- if (!xfs_scrub_xref_process_error(sc, agno, agbno, &error))
+ error = xchk_ag_init(sc, agno, &sc->sa);
+ if (!xchk_xref_process_error(sc, agno, agbno, &error))
return;
- xfs_scrub_xref_is_used_space(sc, agbno, 1);
- xfs_scrub_inode_xref_finobt(sc, ino);
+ xchk_xref_is_used_space(sc, agbno, 1);
+ xchk_inode_xref_finobt(sc, ino);
xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_INODES);
- xfs_scrub_xref_is_owned_by(sc, agbno, 1, &oinfo);
- xfs_scrub_xref_is_not_shared(sc, agbno, 1);
- xfs_scrub_inode_xref_bmap(sc, dip);
+ xchk_xref_is_owned_by(sc, agbno, 1, &oinfo);
+ xchk_xref_is_not_shared(sc, agbno, 1);
+ xchk_inode_xref_bmap(sc, dip);
- xfs_scrub_ag_free(sc, &sc->sa);
+ xchk_ag_free(sc, &sc->sa);
}
/*
@@ -539,7 +539,7 @@ xfs_scrub_inode_xref(
* reflink filesystem.
*/
static void
-xfs_scrub_inode_check_reflink_iflag(
+xchk_inode_check_reflink_iflag(
struct xfs_scrub_context *sc,
xfs_ino_t ino)
{
@@ -552,18 +552,18 @@ xfs_scrub_inode_check_reflink_iflag(
error = xfs_reflink_inode_has_shared_extents(sc->tp, sc->ip,
&has_shared);
- if (!xfs_scrub_xref_process_error(sc, XFS_INO_TO_AGNO(mp, ino),
+ if (!xchk_xref_process_error(sc, XFS_INO_TO_AGNO(mp, ino),
XFS_INO_TO_AGBNO(mp, ino), &error))
return;
if (xfs_is_reflink_inode(sc->ip) && !has_shared)
- xfs_scrub_ino_set_preen(sc, ino);
+ xchk_ino_set_preen(sc, ino);
else if (!xfs_is_reflink_inode(sc->ip) && has_shared)
- xfs_scrub_ino_set_corrupt(sc, ino);
+ xchk_ino_set_corrupt(sc, ino);
}
/* Scrub an inode. */
int
-xfs_scrub_inode(
+xchk_inode(
struct xfs_scrub_context *sc)
{
struct xfs_dinode di;
@@ -575,13 +575,13 @@ xfs_scrub_inode(
* and a NULL inode, so flag the corruption error and return.
*/
if (!sc->ip) {
- xfs_scrub_ino_set_corrupt(sc, sc->sm->sm_ino);
+ xchk_ino_set_corrupt(sc, sc->sm->sm_ino);
return 0;
}
/* Scrub the inode core. */
xfs_inode_to_disk(sc->ip, &di, 0);
- xfs_scrub_dinode(sc, &di, sc->ip->i_ino);
+ xchk_dinode(sc, &di, sc->ip->i_ino);
if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
goto out;
@@ -591,9 +591,9 @@ xfs_scrub_inode(
* we scrubbed the dinode.
*/
if (S_ISREG(VFS_I(sc->ip)->i_mode))
- xfs_scrub_inode_check_reflink_iflag(sc, sc->ip->i_ino);
+ xchk_inode_check_reflink_iflag(sc, sc->ip->i_ino);
- xfs_scrub_inode_xref(sc, sc->ip->i_ino, &di);
+ xchk_inode_xref(sc, sc->ip->i_ino, &di);
out:
return error;
}
diff --git a/fs/xfs/scrub/parent.c b/fs/xfs/scrub/parent.c
index e2bda58c32f0..0a78d8411f23 100644
--- a/fs/xfs/scrub/parent.c
+++ b/fs/xfs/scrub/parent.c
@@ -27,18 +27,18 @@
/* Set us up to scrub parents. */
int
-xfs_scrub_setup_parent(
+xchk_setup_parent(
struct xfs_scrub_context *sc,
struct xfs_inode *ip)
{
- return xfs_scrub_setup_inode_contents(sc, ip, 0);
+ return xchk_setup_inode_contents(sc, ip, 0);
}
/* Parent pointers */
/* Look for an entry in a parent pointing to this inode. */
-struct xfs_scrub_parent_ctx {
+struct xchk_parent_ctx {
struct dir_context dc;
xfs_ino_t ino;
xfs_nlink_t nlink;
@@ -46,7 +46,7 @@ struct xfs_scrub_parent_ctx {
/* Look for a single entry in a directory pointing to an inode. */
STATIC int
-xfs_scrub_parent_actor(
+xchk_parent_actor(
struct dir_context *dc,
const char *name,
int namelen,
@@ -54,9 +54,9 @@ xfs_scrub_parent_actor(
u64 ino,
unsigned type)
{
- struct xfs_scrub_parent_ctx *spc;
+ struct xchk_parent_ctx *spc;
- spc = container_of(dc, struct xfs_scrub_parent_ctx, dc);
+ spc = container_of(dc, struct xchk_parent_ctx, dc);
if (spc->ino == ino)
spc->nlink++;
return 0;
@@ -64,13 +64,13 @@ xfs_scrub_parent_actor(
/* Count the number of dentries in the parent dir that point to this inode. */
STATIC int
-xfs_scrub_parent_count_parent_dentries(
+xchk_parent_count_parent_dentries(
struct xfs_scrub_context *sc,
struct xfs_inode *parent,
xfs_nlink_t *nlink)
{
- struct xfs_scrub_parent_ctx spc = {
- .dc.actor = xfs_scrub_parent_actor,
+ struct xchk_parent_ctx spc = {
+ .dc.actor = xchk_parent_actor,
.dc.pos = 0,
.ino = sc->ip->i_ino,
.nlink = 0,
@@ -120,7 +120,7 @@ xfs_scrub_parent_count_parent_dentries(
* entry pointing back to the inode being scrubbed.
*/
STATIC int
-xfs_scrub_parent_validate(
+xchk_parent_validate(
struct xfs_scrub_context *sc,
xfs_ino_t dnum,
bool *try_again)
@@ -138,7 +138,7 @@ xfs_scrub_parent_validate(
/* '..' must not point to ourselves. */
if (sc->ip->i_ino == dnum) {
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
goto out;
}
@@ -165,13 +165,13 @@ xfs_scrub_parent_validate(
error = xfs_iget(mp, sc->tp, dnum, XFS_IGET_UNTRUSTED, 0, &dp);
if (error == -EINVAL) {
error = -EFSCORRUPTED;
- xfs_scrub_fblock_process_error(sc, XFS_DATA_FORK, 0, &error);
+ xchk_fblock_process_error(sc, XFS_DATA_FORK, 0, &error);
goto out;
}
- if (!xfs_scrub_fblock_xref_process_error(sc, XFS_DATA_FORK, 0, &error))
+ if (!xchk_fblock_xref_process_error(sc, XFS_DATA_FORK, 0, &error))
goto out;
if (dp == sc->ip || !S_ISDIR(VFS_I(dp)->i_mode)) {
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
goto out_rele;
}
@@ -183,12 +183,12 @@ xfs_scrub_parent_validate(
* the child inodes.
*/
if (xfs_ilock_nowait(dp, XFS_IOLOCK_SHARED)) {
- error = xfs_scrub_parent_count_parent_dentries(sc, dp, &nlink);
- if (!xfs_scrub_fblock_xref_process_error(sc, XFS_DATA_FORK, 0,
+ error = xchk_parent_count_parent_dentries(sc, dp, &nlink);
+ if (!xchk_fblock_xref_process_error(sc, XFS_DATA_FORK, 0,
&error))
goto out_unlock;
if (nlink != expected_nlink)
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
goto out_unlock;
}
@@ -200,18 +200,18 @@ xfs_scrub_parent_validate(
*/
xfs_iunlock(sc->ip, sc->ilock_flags);
sc->ilock_flags = 0;
- error = xfs_scrub_ilock_inverted(dp, XFS_IOLOCK_SHARED);
+ error = xchk_ilock_inverted(dp, XFS_IOLOCK_SHARED);
if (error)
goto out_rele;
/* Go looking for our dentry. */
- error = xfs_scrub_parent_count_parent_dentries(sc, dp, &nlink);
- if (!xfs_scrub_fblock_xref_process_error(sc, XFS_DATA_FORK, 0, &error))
+ error = xchk_parent_count_parent_dentries(sc, dp, &nlink);
+ if (!xchk_fblock_xref_process_error(sc, XFS_DATA_FORK, 0, &error))
goto out_unlock;
/* Drop the parent lock, relock this inode. */
xfs_iunlock(dp, XFS_IOLOCK_SHARED);
- error = xfs_scrub_ilock_inverted(sc->ip, XFS_IOLOCK_EXCL);
+ error = xchk_ilock_inverted(sc->ip, XFS_IOLOCK_EXCL);
if (error)
goto out_rele;
sc->ilock_flags = XFS_IOLOCK_EXCL;
@@ -225,7 +225,7 @@ xfs_scrub_parent_validate(
/* Look up '..' to see if the inode changed. */
error = xfs_dir_lookup(sc->tp, sc->ip, &xfs_name_dotdot, &dnum, NULL);
- if (!xfs_scrub_fblock_process_error(sc, XFS_DATA_FORK, 0, &error))
+ if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, 0, &error))
goto out_rele;
/* Drat, parent changed. Try again! */
@@ -241,7 +241,7 @@ xfs_scrub_parent_validate(
* for us in the parent.
*/
if (nlink != expected_nlink)
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
return error;
out_unlock:
@@ -254,7 +254,7 @@ xfs_scrub_parent_validate(
/* Scrub a parent pointer. */
int
-xfs_scrub_parent(
+xchk_parent(
struct xfs_scrub_context *sc)
{
struct xfs_mount *mp = sc->mp;
@@ -272,7 +272,7 @@ xfs_scrub_parent(
/* We're not a special inode, are we? */
if (!xfs_verify_dir_ino(mp, sc->ip->i_ino)) {
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
goto out;
}
@@ -288,10 +288,10 @@ xfs_scrub_parent(
/* Look up '..' */
error = xfs_dir_lookup(sc->tp, sc->ip, &xfs_name_dotdot, &dnum, NULL);
- if (!xfs_scrub_fblock_process_error(sc, XFS_DATA_FORK, 0, &error))
+ if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, 0, &error))
goto out;
if (!xfs_verify_dir_ino(mp, dnum)) {
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
goto out;
}
@@ -299,12 +299,12 @@ xfs_scrub_parent(
if (sc->ip == mp->m_rootip) {
if (sc->ip->i_ino != mp->m_sb.sb_rootino ||
sc->ip->i_ino != dnum)
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
goto out;
}
do {
- error = xfs_scrub_parent_validate(sc, dnum, &try_again);
+ error = xchk_parent_validate(sc, dnum, &try_again);
if (error)
goto out;
} while (try_again && ++tries < 20);
@@ -314,7 +314,7 @@ xfs_scrub_parent(
* incomplete. Userspace can decide if it wants to try again.
*/
if (try_again && tries == 20)
- xfs_scrub_set_incomplete(sc);
+ xchk_set_incomplete(sc);
out:
/*
* If we failed to lock the parent inode even after a retry, just mark
@@ -322,7 +322,7 @@ xfs_scrub_parent(
*/
if (sc->try_harder && error == -EDEADLOCK) {
error = 0;
- xfs_scrub_set_incomplete(sc);
+ xchk_set_incomplete(sc);
}
return error;
}
diff --git a/fs/xfs/scrub/quota.c b/fs/xfs/scrub/quota.c
index 6ff906aa0a3b..d1b52dd7efcd 100644
--- a/fs/xfs/scrub/quota.c
+++ b/fs/xfs/scrub/quota.c
@@ -30,7 +30,7 @@
/* Convert a scrub type code to a DQ flag, or return 0 if error. */
static inline uint
-xfs_scrub_quota_to_dqtype(
+xchk_quota_to_dqtype(
struct xfs_scrub_context *sc)
{
switch (sc->sm->sm_type) {
@@ -47,7 +47,7 @@ xfs_scrub_quota_to_dqtype(
/* Set us up to scrub a quota. */
int
-xfs_scrub_setup_quota(
+xchk_setup_quota(
struct xfs_scrub_context *sc,
struct xfs_inode *ip)
{
@@ -57,14 +57,14 @@ xfs_scrub_setup_quota(
if (!XFS_IS_QUOTA_RUNNING(sc->mp) || !XFS_IS_QUOTA_ON(sc->mp))
return -ENOENT;
- dqtype = xfs_scrub_quota_to_dqtype(sc);
+ dqtype = xchk_quota_to_dqtype(sc);
if (dqtype == 0)
return -EINVAL;
sc->has_quotaofflock = true;
mutex_lock(&sc->mp->m_quotainfo->qi_quotaofflock);
if (!xfs_this_quota_on(sc->mp, dqtype))
return -ENOENT;
- error = xfs_scrub_setup_fs(sc, ip);
+ error = xchk_setup_fs(sc, ip);
if (error)
return error;
sc->ip = xfs_quota_inode(sc->mp, dqtype);
@@ -75,19 +75,19 @@ xfs_scrub_setup_quota(
/* Quotas. */
-struct xfs_scrub_quota_info {
+struct xchk_quota_info {
struct xfs_scrub_context *sc;
xfs_dqid_t last_id;
};
/* Scrub the fields in an individual quota item. */
STATIC int
-xfs_scrub_quota_item(
+xchk_quota_item(
struct xfs_dquot *dq,
uint dqtype,
void *priv)
{
- struct xfs_scrub_quota_info *sqi = priv;
+ struct xchk_quota_info *sqi = priv;
struct xfs_scrub_context *sc = sqi->sc;
struct xfs_mount *mp = sc->mp;
struct xfs_disk_dquot *d = &dq->q_core;
@@ -111,16 +111,16 @@ xfs_scrub_quota_item(
*/
offset = id / qi->qi_dqperchunk;
if (id && id <= sqi->last_id)
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
sqi->last_id = id;
/* Did we get the dquot type we wanted? */
if (dqtype != (d->d_flags & XFS_DQ_ALLTYPES))
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
if (d->d_pad0 != cpu_to_be32(0) || d->d_pad != cpu_to_be16(0))
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
/* Check the limits. */
bhard = be64_to_cpu(d->d_blk_hardlimit);
@@ -140,19 +140,19 @@ xfs_scrub_quota_item(
* the hard limit.
*/
if (bhard > mp->m_sb.sb_dblocks)
- xfs_scrub_fblock_set_warning(sc, XFS_DATA_FORK, offset);
+ xchk_fblock_set_warning(sc, XFS_DATA_FORK, offset);
if (bsoft > bhard)
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
if (ihard > mp->m_maxicount)
- xfs_scrub_fblock_set_warning(sc, XFS_DATA_FORK, offset);
+ xchk_fblock_set_warning(sc, XFS_DATA_FORK, offset);
if (isoft > ihard)
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
if (rhard > mp->m_sb.sb_rblocks)
- xfs_scrub_fblock_set_warning(sc, XFS_DATA_FORK, offset);
+ xchk_fblock_set_warning(sc, XFS_DATA_FORK, offset);
if (rsoft > rhard)
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
/* Check the resource counts. */
bcount = be64_to_cpu(d->d_bcount);
@@ -167,15 +167,15 @@ xfs_scrub_quota_item(
*/
if (xfs_sb_version_hasreflink(&mp->m_sb)) {
if (mp->m_sb.sb_dblocks < bcount)
- xfs_scrub_fblock_set_warning(sc, XFS_DATA_FORK,
+ xchk_fblock_set_warning(sc, XFS_DATA_FORK,
offset);
} else {
if (mp->m_sb.sb_dblocks < bcount)
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK,
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK,
offset);
}
if (icount > fs_icount || rcount > mp->m_sb.sb_rblocks)
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
/*
* We can violate the hard limits if the admin suddenly sets a
@@ -183,18 +183,18 @@ xfs_scrub_quota_item(
* admin review.
*/
if (id != 0 && bhard != 0 && bcount > bhard)
- xfs_scrub_fblock_set_warning(sc, XFS_DATA_FORK, offset);
+ xchk_fblock_set_warning(sc, XFS_DATA_FORK, offset);
if (id != 0 && ihard != 0 && icount > ihard)
- xfs_scrub_fblock_set_warning(sc, XFS_DATA_FORK, offset);
+ xchk_fblock_set_warning(sc, XFS_DATA_FORK, offset);
if (id != 0 && rhard != 0 && rcount > rhard)
- xfs_scrub_fblock_set_warning(sc, XFS_DATA_FORK, offset);
+ xchk_fblock_set_warning(sc, XFS_DATA_FORK, offset);
return 0;
}
/* Check the quota's data fork. */
STATIC int
-xfs_scrub_quota_data_fork(
+xchk_quota_data_fork(
struct xfs_scrub_context *sc)
{
struct xfs_bmbt_irec irec = { 0 };
@@ -205,7 +205,7 @@ xfs_scrub_quota_data_fork(
int error = 0;
/* Invoke the fork scrubber. */
- error = xfs_scrub_metadata_inode_forks(sc);
+ error = xchk_metadata_inode_forks(sc);
if (error || (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT))
return error;
@@ -213,7 +213,7 @@ xfs_scrub_quota_data_fork(
max_dqid_off = ((xfs_dqid_t)-1) / qi->qi_dqperchunk;
ifp = XFS_IFORK_PTR(sc->ip, XFS_DATA_FORK);
for_each_xfs_iext(ifp, &icur, &irec) {
- if (xfs_scrub_should_terminate(sc, &error))
+ if (xchk_should_terminate(sc, &error))
break;
/*
* delalloc extents or blocks mapped above the highest
@@ -222,7 +222,7 @@ xfs_scrub_quota_data_fork(
if (isnullstartblock(irec.br_startblock) ||
irec.br_startoff > max_dqid_off ||
irec.br_startoff + irec.br_blockcount - 1 > max_dqid_off) {
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK,
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK,
irec.br_startoff);
break;
}
@@ -233,19 +233,19 @@ xfs_scrub_quota_data_fork(
/* Scrub all of a quota type's items. */
int
-xfs_scrub_quota(
+xchk_quota(
struct xfs_scrub_context *sc)
{
- struct xfs_scrub_quota_info sqi;
+ struct xchk_quota_info sqi;
struct xfs_mount *mp = sc->mp;
struct xfs_quotainfo *qi = mp->m_quotainfo;
uint dqtype;
int error = 0;
- dqtype = xfs_scrub_quota_to_dqtype(sc);
+ dqtype = xchk_quota_to_dqtype(sc);
/* Look for problem extents. */
- error = xfs_scrub_quota_data_fork(sc);
+ error = xchk_quota_data_fork(sc);
if (error)
goto out;
if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
@@ -260,10 +260,10 @@ xfs_scrub_quota(
sc->ilock_flags = 0;
sqi.sc = sc;
sqi.last_id = 0;
- error = xfs_qm_dqiterate(mp, dqtype, xfs_scrub_quota_item, &sqi);
+ error = xfs_qm_dqiterate(mp, dqtype, xchk_quota_item, &sqi);
sc->ilock_flags = XFS_ILOCK_EXCL;
xfs_ilock(sc->ip, sc->ilock_flags);
- if (!xfs_scrub_fblock_process_error(sc, XFS_DATA_FORK,
+ if (!xchk_fblock_process_error(sc, XFS_DATA_FORK,
sqi.last_id * qi->qi_dqperchunk, &error))
goto out;
diff --git a/fs/xfs/scrub/refcount.c b/fs/xfs/scrub/refcount.c
index 607a9faa8ecc..274febc49b23 100644
--- a/fs/xfs/scrub/refcount.c
+++ b/fs/xfs/scrub/refcount.c
@@ -28,11 +28,11 @@
* Set us up to scrub reference count btrees.
*/
int
-xfs_scrub_setup_ag_refcountbt(
+xchk_setup_ag_refcountbt(
struct xfs_scrub_context *sc,
struct xfs_inode *ip)
{
- return xfs_scrub_setup_ag_btree(sc, ip, false);
+ return xchk_setup_ag_btree(sc, ip, false);
}
/* Reference count btree scrubber. */
@@ -73,12 +73,12 @@ xfs_scrub_setup_ag_refcountbt(
* If the refcount is correct, all the check conditions in the algorithm
* should always hold true. If not, the refcount is incorrect.
*/
-struct xfs_scrub_refcnt_frag {
+struct xchk_refcnt_frag {
struct list_head list;
struct xfs_rmap_irec rm;
};
-struct xfs_scrub_refcnt_check {
+struct xchk_refcnt_check {
struct xfs_scrub_context *sc;
struct list_head fragments;
@@ -99,18 +99,18 @@ struct xfs_scrub_refcnt_check {
* fragments as the refcountbt says we should have.
*/
STATIC int
-xfs_scrub_refcountbt_rmap_check(
+xchk_refcountbt_rmap_check(
struct xfs_btree_cur *cur,
struct xfs_rmap_irec *rec,
void *priv)
{
- struct xfs_scrub_refcnt_check *refchk = priv;
- struct xfs_scrub_refcnt_frag *frag;
+ struct xchk_refcnt_check *refchk = priv;
+ struct xchk_refcnt_frag *frag;
xfs_agblock_t rm_last;
xfs_agblock_t rc_last;
int error = 0;
- if (xfs_scrub_should_terminate(refchk->sc, &error))
+ if (xchk_should_terminate(refchk->sc, &error))
return error;
rm_last = rec->rm_startblock + rec->rm_blockcount - 1;
@@ -118,7 +118,7 @@ xfs_scrub_refcountbt_rmap_check(
/* Confirm that a single-owner refc extent is a CoW stage. */
if (refchk->refcount == 1 && rec->rm_owner != XFS_RMAP_OWN_COW) {
- xfs_scrub_btree_xref_set_corrupt(refchk->sc, cur, 0);
+ xchk_btree_xref_set_corrupt(refchk->sc, cur, 0);
return 0;
}
@@ -135,7 +135,7 @@ xfs_scrub_refcountbt_rmap_check(
* is healthy each rmap_irec we see will be in agbno order
* so we don't need insertion sort here.
*/
- frag = kmem_alloc(sizeof(struct xfs_scrub_refcnt_frag),
+ frag = kmem_alloc(sizeof(struct xchk_refcnt_frag),
KM_MAYFAIL);
if (!frag)
return -ENOMEM;
@@ -154,12 +154,12 @@ xfs_scrub_refcountbt_rmap_check(
* we have a refcountbt error.
*/
STATIC void
-xfs_scrub_refcountbt_process_rmap_fragments(
- struct xfs_scrub_refcnt_check *refchk)
+xchk_refcountbt_process_rmap_fragments(
+ struct xchk_refcnt_check *refchk)
{
struct list_head worklist;
- struct xfs_scrub_refcnt_frag *frag;
- struct xfs_scrub_refcnt_frag *n;
+ struct xchk_refcnt_frag *frag;
+ struct xchk_refcnt_frag *n;
xfs_agblock_t bno;
xfs_agblock_t rbno;
xfs_agblock_t next_rbno;
@@ -277,13 +277,13 @@ xfs_scrub_refcountbt_process_rmap_fragments(
/* Use the rmap entries covering this extent to verify the refcount. */
STATIC void
-xfs_scrub_refcountbt_xref_rmap(
+xchk_refcountbt_xref_rmap(
struct xfs_scrub_context *sc,
xfs_agblock_t bno,
xfs_extlen_t len,
xfs_nlink_t refcount)
{
- struct xfs_scrub_refcnt_check refchk = {
+ struct xchk_refcnt_check refchk = {
.sc = sc,
.bno = bno,
.len = len,
@@ -292,11 +292,11 @@ xfs_scrub_refcountbt_xref_rmap(
};
struct xfs_rmap_irec low;
struct xfs_rmap_irec high;
- struct xfs_scrub_refcnt_frag *frag;
- struct xfs_scrub_refcnt_frag *n;
+ struct xchk_refcnt_frag *frag;
+ struct xchk_refcnt_frag *n;
int error;
- if (!sc->sa.rmap_cur || xfs_scrub_skip_xref(sc->sm))
+ if (!sc->sa.rmap_cur || xchk_skip_xref(sc->sm))
return;
/* Cross-reference with the rmapbt to confirm the refcount. */
@@ -307,13 +307,13 @@ xfs_scrub_refcountbt_xref_rmap(
INIT_LIST_HEAD(&refchk.fragments);
error = xfs_rmap_query_range(sc->sa.rmap_cur, &low, &high,
- &xfs_scrub_refcountbt_rmap_check, &refchk);
- if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.rmap_cur))
+ &xchk_refcountbt_rmap_check, &refchk);
+ if (!xchk_should_check_xref(sc, &error, &sc->sa.rmap_cur))
goto out_free;
- xfs_scrub_refcountbt_process_rmap_fragments(&refchk);
+ xchk_refcountbt_process_rmap_fragments(&refchk);
if (refcount != refchk.seen)
- xfs_scrub_btree_xref_set_corrupt(sc, sc->sa.rmap_cur, 0);
+ xchk_btree_xref_set_corrupt(sc, sc->sa.rmap_cur, 0);
out_free:
list_for_each_entry_safe(frag, n, &refchk.fragments, list) {
@@ -324,7 +324,7 @@ xfs_scrub_refcountbt_xref_rmap(
/* Cross-reference with the other btrees. */
STATIC void
-xfs_scrub_refcountbt_xref(
+xchk_refcountbt_xref(
struct xfs_scrub_context *sc,
xfs_agblock_t agbno,
xfs_extlen_t len,
@@ -333,15 +333,15 @@ xfs_scrub_refcountbt_xref(
if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
return;
- xfs_scrub_xref_is_used_space(sc, agbno, len);
- xfs_scrub_xref_is_not_inode_chunk(sc, agbno, len);
- xfs_scrub_refcountbt_xref_rmap(sc, agbno, len, refcount);
+ xchk_xref_is_used_space(sc, agbno, len);
+ xchk_xref_is_not_inode_chunk(sc, agbno, len);
+ xchk_refcountbt_xref_rmap(sc, agbno, len, refcount);
}
/* Scrub a refcountbt record. */
STATIC int
-xfs_scrub_refcountbt_rec(
- struct xfs_scrub_btree *bs,
+xchk_refcountbt_rec(
+ struct xchk_btree *bs,
union xfs_btree_rec *rec)
{
struct xfs_mount *mp = bs->cur->bc_mp;
@@ -360,7 +360,7 @@ xfs_scrub_refcountbt_rec(
/* Only CoW records can have refcount == 1. */
has_cowflag = (bno & XFS_REFC_COW_START);
if ((refcount == 1 && !has_cowflag) || (refcount != 1 && has_cowflag))
- xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
+ xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
if (has_cowflag)
(*cow_blocks) += len;
@@ -369,19 +369,19 @@ xfs_scrub_refcountbt_rec(
if (bno + len <= bno ||
!xfs_verify_agbno(mp, agno, bno) ||
!xfs_verify_agbno(mp, agno, bno + len - 1))
- xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
+ xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
if (refcount == 0)
- xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
+ xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
- xfs_scrub_refcountbt_xref(bs->sc, bno, len, refcount);
+ xchk_refcountbt_xref(bs->sc, bno, len, refcount);
return error;
}
/* Make sure we have as many refc blocks as the rmap says. */
STATIC void
-xfs_scrub_refcount_xref_rmap(
+xchk_refcount_xref_rmap(
struct xfs_scrub_context *sc,
struct xfs_owner_info *oinfo,
xfs_filblks_t cow_blocks)
@@ -390,33 +390,33 @@ xfs_scrub_refcount_xref_rmap(
xfs_filblks_t blocks;
int error;
- if (!sc->sa.rmap_cur || xfs_scrub_skip_xref(sc->sm))
+ if (!sc->sa.rmap_cur || xchk_skip_xref(sc->sm))
return;
/* Check that we saw as many refcbt blocks as the rmap knows about. */
error = xfs_btree_count_blocks(sc->sa.refc_cur, &refcbt_blocks);
- if (!xfs_scrub_btree_process_error(sc, sc->sa.refc_cur, 0, &error))
+ if (!xchk_btree_process_error(sc, sc->sa.refc_cur, 0, &error))
return;
- error = xfs_scrub_count_rmap_ownedby_ag(sc, sc->sa.rmap_cur, oinfo,
+ error = xchk_count_rmap_ownedby_ag(sc, sc->sa.rmap_cur, oinfo,
&blocks);
- if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.rmap_cur))
+ if (!xchk_should_check_xref(sc, &error, &sc->sa.rmap_cur))
return;
if (blocks != refcbt_blocks)
- xfs_scrub_btree_xref_set_corrupt(sc, sc->sa.rmap_cur, 0);
+ xchk_btree_xref_set_corrupt(sc, sc->sa.rmap_cur, 0);
/* Check that we saw as many cow blocks as the rmap knows about. */
xfs_rmap_ag_owner(oinfo, XFS_RMAP_OWN_COW);
- error = xfs_scrub_count_rmap_ownedby_ag(sc, sc->sa.rmap_cur, oinfo,
+ error = xchk_count_rmap_ownedby_ag(sc, sc->sa.rmap_cur, oinfo,
&blocks);
- if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.rmap_cur))
+ if (!xchk_should_check_xref(sc, &error, &sc->sa.rmap_cur))
return;
if (blocks != cow_blocks)
- xfs_scrub_btree_xref_set_corrupt(sc, sc->sa.rmap_cur, 0);
+ xchk_btree_xref_set_corrupt(sc, sc->sa.rmap_cur, 0);
}
/* Scrub the refcount btree for some AG. */
int
-xfs_scrub_refcountbt(
+xchk_refcountbt(
struct xfs_scrub_context *sc)
{
struct xfs_owner_info oinfo;
@@ -424,19 +424,19 @@ xfs_scrub_refcountbt(
int error;
xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_REFC);
- error = xfs_scrub_btree(sc, sc->sa.refc_cur, xfs_scrub_refcountbt_rec,
+ error = xchk_btree(sc, sc->sa.refc_cur, xchk_refcountbt_rec,
&oinfo, &cow_blocks);
if (error)
return error;
- xfs_scrub_refcount_xref_rmap(sc, &oinfo, cow_blocks);
+ xchk_refcount_xref_rmap(sc, &oinfo, cow_blocks);
return 0;
}
/* xref check that a cow staging extent is marked in the refcountbt. */
void
-xfs_scrub_xref_is_cow_staging(
+xchk_xref_is_cow_staging(
struct xfs_scrub_context *sc,
xfs_agblock_t agbno,
xfs_extlen_t len)
@@ -446,35 +446,35 @@ xfs_scrub_xref_is_cow_staging(
int has_refcount;
int error;
- if (!sc->sa.refc_cur || xfs_scrub_skip_xref(sc->sm))
+ if (!sc->sa.refc_cur || xchk_skip_xref(sc->sm))
return;
/* Find the CoW staging extent. */
error = xfs_refcount_lookup_le(sc->sa.refc_cur,
agbno + XFS_REFC_COW_START, &has_refcount);
- if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.refc_cur))
+ if (!xchk_should_check_xref(sc, &error, &sc->sa.refc_cur))
return;
if (!has_refcount) {
- xfs_scrub_btree_xref_set_corrupt(sc, sc->sa.refc_cur, 0);
+ xchk_btree_xref_set_corrupt(sc, sc->sa.refc_cur, 0);
return;
}
error = xfs_refcount_get_rec(sc->sa.refc_cur, &rc, &has_refcount);
- if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.refc_cur))
+ if (!xchk_should_check_xref(sc, &error, &sc->sa.refc_cur))
return;
if (!has_refcount) {
- xfs_scrub_btree_xref_set_corrupt(sc, sc->sa.refc_cur, 0);
+ xchk_btree_xref_set_corrupt(sc, sc->sa.refc_cur, 0);
return;
}
/* CoW flag must be set, refcount must be 1. */
has_cowflag = (rc.rc_startblock & XFS_REFC_COW_START);
if (!has_cowflag || rc.rc_refcount != 1)
- xfs_scrub_btree_xref_set_corrupt(sc, sc->sa.refc_cur, 0);
+ xchk_btree_xref_set_corrupt(sc, sc->sa.refc_cur, 0);
/* Must be at least as long as what was passed in */
if (rc.rc_blockcount < len)
- xfs_scrub_btree_xref_set_corrupt(sc, sc->sa.refc_cur, 0);
+ xchk_btree_xref_set_corrupt(sc, sc->sa.refc_cur, 0);
}
/*
@@ -482,7 +482,7 @@ xfs_scrub_xref_is_cow_staging(
* can have multiple owners.
*/
void
-xfs_scrub_xref_is_not_shared(
+xchk_xref_is_not_shared(
struct xfs_scrub_context *sc,
xfs_agblock_t agbno,
xfs_extlen_t len)
@@ -490,12 +490,12 @@ xfs_scrub_xref_is_not_shared(
bool shared;
int error;
- if (!sc->sa.refc_cur || xfs_scrub_skip_xref(sc->sm))
+ if (!sc->sa.refc_cur || xchk_skip_xref(sc->sm))
return;
error = xfs_refcount_has_record(sc->sa.refc_cur, agbno, len, &shared);
- if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.refc_cur))
+ if (!xchk_should_check_xref(sc, &error, &sc->sa.refc_cur))
return;
if (shared)
- xfs_scrub_btree_xref_set_corrupt(sc, sc->sa.refc_cur, 0);
+ xchk_btree_xref_set_corrupt(sc, sc->sa.refc_cur, 0);
}
diff --git a/fs/xfs/scrub/repair.c b/fs/xfs/scrub/repair.c
index ea39e2bdc96a..5eccd89c64a8 100644
--- a/fs/xfs/scrub/repair.c
+++ b/fs/xfs/scrub/repair.c
@@ -50,7 +50,7 @@ xfs_repair_attempt(
trace_xfs_repair_attempt(ip, sc->sm, error);
- xfs_scrub_ag_btcur_free(&sc->sa);
+ xchk_ag_btcur_free(&sc->sa);
/* Repair whatever's broken. */
ASSERT(sc->ops->repair);
@@ -110,7 +110,7 @@ xfs_repair_probe(
{
int error = 0;
- if (xfs_scrub_should_terminate(sc, &error))
+ if (xchk_should_terminate(sc, &error))
return error;
return 0;
diff --git a/fs/xfs/scrub/rmap.c b/fs/xfs/scrub/rmap.c
index c6d763236ba7..4b75fc2f31f3 100644
--- a/fs/xfs/scrub/rmap.c
+++ b/fs/xfs/scrub/rmap.c
@@ -29,18 +29,18 @@
* Set us up to scrub reverse mapping btrees.
*/
int
-xfs_scrub_setup_ag_rmapbt(
+xchk_setup_ag_rmapbt(
struct xfs_scrub_context *sc,
struct xfs_inode *ip)
{
- return xfs_scrub_setup_ag_btree(sc, ip, false);
+ return xchk_setup_ag_btree(sc, ip, false);
}
/* Reverse-mapping scrubber. */
/* Cross-reference a rmap against the refcount btree. */
STATIC void
-xfs_scrub_rmapbt_xref_refc(
+xchk_rmapbt_xref_refc(
struct xfs_scrub_context *sc,
struct xfs_rmap_irec *irec)
{
@@ -52,7 +52,7 @@ xfs_scrub_rmapbt_xref_refc(
bool is_unwritten;
int error;
- if (!sc->sa.refc_cur || xfs_scrub_skip_xref(sc->sm))
+ if (!sc->sa.refc_cur || xchk_skip_xref(sc->sm))
return;
non_inode = XFS_RMAP_NON_INODE_OWNER(irec->rm_owner);
@@ -63,15 +63,15 @@ xfs_scrub_rmapbt_xref_refc(
/* If this is shared, must be a data fork extent. */
error = xfs_refcount_find_shared(sc->sa.refc_cur, irec->rm_startblock,
irec->rm_blockcount, &fbno, &flen, false);
- if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.refc_cur))
+ if (!xchk_should_check_xref(sc, &error, &sc->sa.refc_cur))
return;
if (flen != 0 && (non_inode || is_attr || is_bmbt || is_unwritten))
- xfs_scrub_btree_xref_set_corrupt(sc, sc->sa.refc_cur, 0);
+ xchk_btree_xref_set_corrupt(sc, sc->sa.refc_cur, 0);
}
/* Cross-reference with the other btrees. */
STATIC void
-xfs_scrub_rmapbt_xref(
+xchk_rmapbt_xref(
struct xfs_scrub_context *sc,
struct xfs_rmap_irec *irec)
{
@@ -81,22 +81,22 @@ xfs_scrub_rmapbt_xref(
if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
return;
- xfs_scrub_xref_is_used_space(sc, agbno, len);
+ xchk_xref_is_used_space(sc, agbno, len);
if (irec->rm_owner == XFS_RMAP_OWN_INODES)
- xfs_scrub_xref_is_inode_chunk(sc, agbno, len);
+ xchk_xref_is_inode_chunk(sc, agbno, len);
else
- xfs_scrub_xref_is_not_inode_chunk(sc, agbno, len);
+ xchk_xref_is_not_inode_chunk(sc, agbno, len);
if (irec->rm_owner == XFS_RMAP_OWN_COW)
- xfs_scrub_xref_is_cow_staging(sc, irec->rm_startblock,
+ xchk_xref_is_cow_staging(sc, irec->rm_startblock,
irec->rm_blockcount);
else
- xfs_scrub_rmapbt_xref_refc(sc, irec);
+ xchk_rmapbt_xref_refc(sc, irec);
}
/* Scrub an rmapbt record. */
STATIC int
-xfs_scrub_rmapbt_rec(
- struct xfs_scrub_btree *bs,
+xchk_rmapbt_rec(
+ struct xchk_btree *bs,
union xfs_btree_rec *rec)
{
struct xfs_mount *mp = bs->cur->bc_mp;
@@ -109,12 +109,12 @@ xfs_scrub_rmapbt_rec(
int error;
error = xfs_rmap_btrec_to_irec(rec, &irec);
- if (!xfs_scrub_btree_process_error(bs->sc, bs->cur, 0, &error))
+ if (!xchk_btree_process_error(bs->sc, bs->cur, 0, &error))
goto out;
/* Check extent. */
if (irec.rm_startblock + irec.rm_blockcount <= irec.rm_startblock)
- xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
+ xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
if (irec.rm_owner == XFS_RMAP_OWN_FS) {
/*
@@ -124,7 +124,7 @@ xfs_scrub_rmapbt_rec(
*/
if (irec.rm_startblock != 0 ||
irec.rm_blockcount != XFS_AGFL_BLOCK(mp) + 1)
- xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
+ xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
} else {
/*
* Otherwise we must point somewhere past the static metadata
@@ -133,7 +133,7 @@ xfs_scrub_rmapbt_rec(
if (!xfs_verify_agbno(mp, agno, irec.rm_startblock) ||
!xfs_verify_agbno(mp, agno, irec.rm_startblock +
irec.rm_blockcount - 1))
- xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
+ xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
}
/* Check flags. */
@@ -143,47 +143,47 @@ xfs_scrub_rmapbt_rec(
is_unwritten = irec.rm_flags & XFS_RMAP_UNWRITTEN;
if (is_bmbt && irec.rm_offset != 0)
- xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
+ xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
if (non_inode && irec.rm_offset != 0)
- xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
+ xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
if (is_unwritten && (is_bmbt || non_inode || is_attr))
- xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
+ xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
if (non_inode && (is_bmbt || is_unwritten || is_attr))
- xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
+ xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
if (!non_inode) {
if (!xfs_verify_ino(mp, irec.rm_owner))
- xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
+ xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
} else {
/* Non-inode owner within the magic values? */
if (irec.rm_owner <= XFS_RMAP_OWN_MIN ||
irec.rm_owner > XFS_RMAP_OWN_FS)
- xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
+ xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
}
- xfs_scrub_rmapbt_xref(bs->sc, &irec);
+ xchk_rmapbt_xref(bs->sc, &irec);
out:
return error;
}
/* Scrub the rmap btree for some AG. */
int
-xfs_scrub_rmapbt(
+xchk_rmapbt(
struct xfs_scrub_context *sc)
{
struct xfs_owner_info oinfo;
xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_AG);
- return xfs_scrub_btree(sc, sc->sa.rmap_cur, xfs_scrub_rmapbt_rec,
+ return xchk_btree(sc, sc->sa.rmap_cur, xchk_rmapbt_rec,
&oinfo, NULL);
}
/* xref check that the extent is owned by a given owner */
static inline void
-xfs_scrub_xref_check_owner(
+xchk_xref_check_owner(
struct xfs_scrub_context *sc,
xfs_agblock_t bno,
xfs_extlen_t len,
@@ -193,42 +193,42 @@ xfs_scrub_xref_check_owner(
bool has_rmap;
int error;
- if (!sc->sa.rmap_cur || xfs_scrub_skip_xref(sc->sm))
+ if (!sc->sa.rmap_cur || xchk_skip_xref(sc->sm))
return;
error = xfs_rmap_record_exists(sc->sa.rmap_cur, bno, len, oinfo,
&has_rmap);
- if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.rmap_cur))
+ if (!xchk_should_check_xref(sc, &error, &sc->sa.rmap_cur))
return;
if (has_rmap != should_have_rmap)
- xfs_scrub_btree_xref_set_corrupt(sc, sc->sa.rmap_cur, 0);
+ xchk_btree_xref_set_corrupt(sc, sc->sa.rmap_cur, 0);
}
/* xref check that the extent is owned by a given owner */
void
-xfs_scrub_xref_is_owned_by(
+xchk_xref_is_owned_by(
struct xfs_scrub_context *sc,
xfs_agblock_t bno,
xfs_extlen_t len,
struct xfs_owner_info *oinfo)
{
- xfs_scrub_xref_check_owner(sc, bno, len, oinfo, true);
+ xchk_xref_check_owner(sc, bno, len, oinfo, true);
}
/* xref check that the extent is not owned by a given owner */
void
-xfs_scrub_xref_is_not_owned_by(
+xchk_xref_is_not_owned_by(
struct xfs_scrub_context *sc,
xfs_agblock_t bno,
xfs_extlen_t len,
struct xfs_owner_info *oinfo)
{
- xfs_scrub_xref_check_owner(sc, bno, len, oinfo, false);
+ xchk_xref_check_owner(sc, bno, len, oinfo, false);
}
/* xref check that the extent has no reverse mapping at all */
void
-xfs_scrub_xref_has_no_owner(
+xchk_xref_has_no_owner(
struct xfs_scrub_context *sc,
xfs_agblock_t bno,
xfs_extlen_t len)
@@ -236,12 +236,12 @@ xfs_scrub_xref_has_no_owner(
bool has_rmap;
int error;
- if (!sc->sa.rmap_cur || xfs_scrub_skip_xref(sc->sm))
+ if (!sc->sa.rmap_cur || xchk_skip_xref(sc->sm))
return;
error = xfs_rmap_has_record(sc->sa.rmap_cur, bno, len, &has_rmap);
- if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.rmap_cur))
+ if (!xchk_should_check_xref(sc, &error, &sc->sa.rmap_cur))
return;
if (has_rmap)
- xfs_scrub_btree_xref_set_corrupt(sc, sc->sa.rmap_cur, 0);
+ xchk_btree_xref_set_corrupt(sc, sc->sa.rmap_cur, 0);
}
diff --git a/fs/xfs/scrub/rtbitmap.c b/fs/xfs/scrub/rtbitmap.c
index 1f86e02a07ca..3f0fc83562ae 100644
--- a/fs/xfs/scrub/rtbitmap.c
+++ b/fs/xfs/scrub/rtbitmap.c
@@ -25,13 +25,13 @@
/* Set us up with the realtime metadata locked. */
int
-xfs_scrub_setup_rt(
+xchk_setup_rt(
struct xfs_scrub_context *sc,
struct xfs_inode *ip)
{
int error;
- error = xfs_scrub_setup_fs(sc, ip);
+ error = xchk_setup_fs(sc, ip);
if (error)
return error;
@@ -46,7 +46,7 @@ xfs_scrub_setup_rt(
/* Scrub a free extent record from the realtime bitmap. */
STATIC int
-xfs_scrub_rtbitmap_rec(
+xchk_rtbitmap_rec(
struct xfs_trans *tp,
struct xfs_rtalloc_rec *rec,
void *priv)
@@ -61,24 +61,24 @@ xfs_scrub_rtbitmap_rec(
if (startblock + blockcount <= startblock ||
!xfs_verify_rtbno(sc->mp, startblock) ||
!xfs_verify_rtbno(sc->mp, startblock + blockcount - 1))
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
return 0;
}
/* Scrub the realtime bitmap. */
int
-xfs_scrub_rtbitmap(
+xchk_rtbitmap(
struct xfs_scrub_context *sc)
{
int error;
/* Invoke the fork scrubber. */
- error = xfs_scrub_metadata_inode_forks(sc);
+ error = xchk_metadata_inode_forks(sc);
if (error || (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT))
return error;
- error = xfs_rtalloc_query_all(sc->tp, xfs_scrub_rtbitmap_rec, sc);
- if (!xfs_scrub_fblock_process_error(sc, XFS_DATA_FORK, 0, &error))
+ error = xfs_rtalloc_query_all(sc->tp, xchk_rtbitmap_rec, sc);
+ if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, 0, &error))
goto out;
out:
@@ -87,7 +87,7 @@ xfs_scrub_rtbitmap(
/* Scrub the realtime summary. */
int
-xfs_scrub_rtsummary(
+xchk_rtsummary(
struct xfs_scrub_context *sc)
{
struct xfs_inode *rsumip = sc->mp->m_rsumip;
@@ -107,12 +107,12 @@ xfs_scrub_rtsummary(
xfs_ilock(sc->ip, sc->ilock_flags);
/* Invoke the fork scrubber. */
- error = xfs_scrub_metadata_inode_forks(sc);
+ error = xchk_metadata_inode_forks(sc);
if (error || (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT))
goto out;
/* XXX: implement this some day */
- xfs_scrub_set_incomplete(sc);
+ xchk_set_incomplete(sc);
out:
/* Switch back to the rtbitmap inode and lock flags. */
xfs_iunlock(sc->ip, sc->ilock_flags);
@@ -124,7 +124,7 @@ xfs_scrub_rtsummary(
/* xref check that the extent is not free in the rtbitmap */
void
-xfs_scrub_xref_is_used_rt_space(
+xchk_xref_is_used_rt_space(
struct xfs_scrub_context *sc,
xfs_rtblock_t fsbno,
xfs_extlen_t len)
@@ -135,7 +135,7 @@ xfs_scrub_xref_is_used_rt_space(
bool is_free;
int error;
- if (xfs_scrub_skip_xref(sc->sm))
+ if (xchk_skip_xref(sc->sm))
return;
startext = fsbno;
@@ -147,10 +147,10 @@ xfs_scrub_xref_is_used_rt_space(
xfs_ilock(sc->mp->m_rbmip, XFS_ILOCK_SHARED | XFS_ILOCK_RTBITMAP);
error = xfs_rtalloc_extent_is_free(sc->mp, sc->tp, startext, extcount,
&is_free);
- if (!xfs_scrub_should_check_xref(sc, &error, NULL))
+ if (!xchk_should_check_xref(sc, &error, NULL))
goto out_unlock;
if (is_free)
- xfs_scrub_ino_xref_set_corrupt(sc, sc->mp->m_rbmip->i_ino);
+ xchk_ino_xref_set_corrupt(sc, sc->mp->m_rbmip->i_ino);
out_unlock:
xfs_iunlock(sc->mp->m_rbmip, XFS_ILOCK_SHARED | XFS_ILOCK_RTBITMAP);
}
diff --git a/fs/xfs/scrub/scrub.c b/fs/xfs/scrub/scrub.c
index 58ae76b3a421..ead97ab91a3c 100644
--- a/fs/xfs/scrub/scrub.c
+++ b/fs/xfs/scrub/scrub.c
@@ -131,6 +131,12 @@
* optimize the structure so that the rebuild knows what to do. The
* second check evaluates the completeness of the repair; that is what
* is reported to userspace.
+ *
+ * A quick note on symbol prefixes:
+ * - "xfs_" are general XFS symbols.
+ * - "xchk_" are symbols related to metadata checking.
+ * - "xrep_" are symbols related to metadata repair.
+ * - "xfs_scrub_" are symbols that tie online fsck to the rest of XFS.
*/
/*
@@ -144,12 +150,12 @@
* supported by the running kernel.
*/
static int
-xfs_scrub_probe(
+xchk_probe(
struct xfs_scrub_context *sc)
{
int error = 0;
- if (xfs_scrub_should_terminate(sc, &error))
+ if (xchk_should_terminate(sc, &error))
return error;
return 0;
@@ -159,12 +165,12 @@ xfs_scrub_probe(
/* Free all the resources and finish the transactions. */
STATIC int
-xfs_scrub_teardown(
+xchk_teardown(
struct xfs_scrub_context *sc,
struct xfs_inode *ip_in,
int error)
{
- xfs_scrub_ag_free(sc, &sc->sa);
+ xchk_ag_free(sc, &sc->sa);
if (sc->tp) {
if (error == 0 && (sc->sm->sm_flags & XFS_SCRUB_IFLAG_REPAIR))
error = xfs_trans_commit(sc->tp);
@@ -191,165 +197,165 @@ xfs_scrub_teardown(
/* Scrubbing dispatch. */
-static const struct xfs_scrub_meta_ops meta_scrub_ops[] = {
+static const struct xchk_meta_ops meta_scrub_ops[] = {
[XFS_SCRUB_TYPE_PROBE] = { /* ioctl presence test */
.type = ST_NONE,
- .setup = xfs_scrub_setup_fs,
- .scrub = xfs_scrub_probe,
+ .setup = xchk_setup_fs,
+ .scrub = xchk_probe,
.repair = xfs_repair_probe,
},
[XFS_SCRUB_TYPE_SB] = { /* superblock */
.type = ST_PERAG,
- .setup = xfs_scrub_setup_fs,
- .scrub = xfs_scrub_superblock,
+ .setup = xchk_setup_fs,
+ .scrub = xchk_superblock,
.repair = xfs_repair_superblock,
},
[XFS_SCRUB_TYPE_AGF] = { /* agf */
.type = ST_PERAG,
- .setup = xfs_scrub_setup_fs,
- .scrub = xfs_scrub_agf,
+ .setup = xchk_setup_fs,
+ .scrub = xchk_agf,
.repair = xfs_repair_notsupported,
},
[XFS_SCRUB_TYPE_AGFL]= { /* agfl */
.type = ST_PERAG,
- .setup = xfs_scrub_setup_fs,
- .scrub = xfs_scrub_agfl,
+ .setup = xchk_setup_fs,
+ .scrub = xchk_agfl,
.repair = xfs_repair_notsupported,
},
[XFS_SCRUB_TYPE_AGI] = { /* agi */
.type = ST_PERAG,
- .setup = xfs_scrub_setup_fs,
- .scrub = xfs_scrub_agi,
+ .setup = xchk_setup_fs,
+ .scrub = xchk_agi,
.repair = xfs_repair_notsupported,
},
[XFS_SCRUB_TYPE_BNOBT] = { /* bnobt */
.type = ST_PERAG,
- .setup = xfs_scrub_setup_ag_allocbt,
- .scrub = xfs_scrub_bnobt,
+ .setup = xchk_setup_ag_allocbt,
+ .scrub = xchk_bnobt,
.repair = xfs_repair_notsupported,
},
[XFS_SCRUB_TYPE_CNTBT] = { /* cntbt */
.type = ST_PERAG,
- .setup = xfs_scrub_setup_ag_allocbt,
- .scrub = xfs_scrub_cntbt,
+ .setup = xchk_setup_ag_allocbt,
+ .scrub = xchk_cntbt,
.repair = xfs_repair_notsupported,
},
[XFS_SCRUB_TYPE_INOBT] = { /* inobt */
.type = ST_PERAG,
- .setup = xfs_scrub_setup_ag_iallocbt,
- .scrub = xfs_scrub_inobt,
+ .setup = xchk_setup_ag_iallocbt,
+ .scrub = xchk_inobt,
.repair = xfs_repair_notsupported,
},
[XFS_SCRUB_TYPE_FINOBT] = { /* finobt */
.type = ST_PERAG,
- .setup = xfs_scrub_setup_ag_iallocbt,
- .scrub = xfs_scrub_finobt,
+ .setup = xchk_setup_ag_iallocbt,
+ .scrub = xchk_finobt,
.has = xfs_sb_version_hasfinobt,
.repair = xfs_repair_notsupported,
},
[XFS_SCRUB_TYPE_RMAPBT] = { /* rmapbt */
.type = ST_PERAG,
- .setup = xfs_scrub_setup_ag_rmapbt,
- .scrub = xfs_scrub_rmapbt,
+ .setup = xchk_setup_ag_rmapbt,
+ .scrub = xchk_rmapbt,
.has = xfs_sb_version_hasrmapbt,
.repair = xfs_repair_notsupported,
},
[XFS_SCRUB_TYPE_REFCNTBT] = { /* refcountbt */
.type = ST_PERAG,
- .setup = xfs_scrub_setup_ag_refcountbt,
- .scrub = xfs_scrub_refcountbt,
+ .setup = xchk_setup_ag_refcountbt,
+ .scrub = xchk_refcountbt,
.has = xfs_sb_version_hasreflink,
.repair = xfs_repair_notsupported,
},
[XFS_SCRUB_TYPE_INODE] = { /* inode record */
.type = ST_INODE,
- .setup = xfs_scrub_setup_inode,
- .scrub = xfs_scrub_inode,
+ .setup = xchk_setup_inode,
+ .scrub = xchk_inode,
.repair = xfs_repair_notsupported,
},
[XFS_SCRUB_TYPE_BMBTD] = { /* inode data fork */
.type = ST_INODE,
- .setup = xfs_scrub_setup_inode_bmap,
- .scrub = xfs_scrub_bmap_data,
+ .setup = xchk_setup_inode_bmap,
+ .scrub = xchk_bmap_data,
.repair = xfs_repair_notsupported,
},
[XFS_SCRUB_TYPE_BMBTA] = { /* inode attr fork */
.type = ST_INODE,
- .setup = xfs_scrub_setup_inode_bmap,
- .scrub = xfs_scrub_bmap_attr,
+ .setup = xchk_setup_inode_bmap,
+ .scrub = xchk_bmap_attr,
.repair = xfs_repair_notsupported,
},
[XFS_SCRUB_TYPE_BMBTC] = { /* inode CoW fork */
.type = ST_INODE,
- .setup = xfs_scrub_setup_inode_bmap,
- .scrub = xfs_scrub_bmap_cow,
+ .setup = xchk_setup_inode_bmap,
+ .scrub = xchk_bmap_cow,
.repair = xfs_repair_notsupported,
},
[XFS_SCRUB_TYPE_DIR] = { /* directory */
.type = ST_INODE,
- .setup = xfs_scrub_setup_directory,
- .scrub = xfs_scrub_directory,
+ .setup = xchk_setup_directory,
+ .scrub = xchk_directory,
.repair = xfs_repair_notsupported,
},
[XFS_SCRUB_TYPE_XATTR] = { /* extended attributes */
.type = ST_INODE,
- .setup = xfs_scrub_setup_xattr,
- .scrub = xfs_scrub_xattr,
+ .setup = xchk_setup_xattr,
+ .scrub = xchk_xattr,
.repair = xfs_repair_notsupported,
},
[XFS_SCRUB_TYPE_SYMLINK] = { /* symbolic link */
.type = ST_INODE,
- .setup = xfs_scrub_setup_symlink,
- .scrub = xfs_scrub_symlink,
+ .setup = xchk_setup_symlink,
+ .scrub = xchk_symlink,
.repair = xfs_repair_notsupported,
},
[XFS_SCRUB_TYPE_PARENT] = { /* parent pointers */
.type = ST_INODE,
- .setup = xfs_scrub_setup_parent,
- .scrub = xfs_scrub_parent,
+ .setup = xchk_setup_parent,
+ .scrub = xchk_parent,
.repair = xfs_repair_notsupported,
},
[XFS_SCRUB_TYPE_RTBITMAP] = { /* realtime bitmap */
.type = ST_FS,
- .setup = xfs_scrub_setup_rt,
- .scrub = xfs_scrub_rtbitmap,
+ .setup = xchk_setup_rt,
+ .scrub = xchk_rtbitmap,
.has = xfs_sb_version_hasrealtime,
.repair = xfs_repair_notsupported,
},
[XFS_SCRUB_TYPE_RTSUM] = { /* realtime summary */
.type = ST_FS,
- .setup = xfs_scrub_setup_rt,
- .scrub = xfs_scrub_rtsummary,
+ .setup = xchk_setup_rt,
+ .scrub = xchk_rtsummary,
.has = xfs_sb_version_hasrealtime,
.repair = xfs_repair_notsupported,
},
[XFS_SCRUB_TYPE_UQUOTA] = { /* user quota */
.type = ST_FS,
- .setup = xfs_scrub_setup_quota,
- .scrub = xfs_scrub_quota,
+ .setup = xchk_setup_quota,
+ .scrub = xchk_quota,
.repair = xfs_repair_notsupported,
},
[XFS_SCRUB_TYPE_GQUOTA] = { /* group quota */
.type = ST_FS,
- .setup = xfs_scrub_setup_quota,
- .scrub = xfs_scrub_quota,
+ .setup = xchk_setup_quota,
+ .scrub = xchk_quota,
.repair = xfs_repair_notsupported,
},
[XFS_SCRUB_TYPE_PQUOTA] = { /* project quota */
.type = ST_FS,
- .setup = xfs_scrub_setup_quota,
- .scrub = xfs_scrub_quota,
+ .setup = xchk_setup_quota,
+ .scrub = xchk_quota,
.repair = xfs_repair_notsupported,
},
};
/* This isn't a stable feature, warn once per day. */
static inline void
-xfs_scrub_experimental_warning(
+xchk_experimental_warning(
struct xfs_mount *mp)
{
static struct ratelimit_state scrub_warning = RATELIMIT_STATE_INIT(
- "xfs_scrub_warning", 86400 * HZ, 1);
+ "xchk_warning", 86400 * HZ, 1);
ratelimit_set_flags(&scrub_warning, RATELIMIT_MSG_ON_RELEASE);
if (__ratelimit(&scrub_warning))
@@ -358,12 +364,12 @@ xfs_scrub_experimental_warning(
}
static int
-xfs_scrub_validate_inputs(
+xchk_validate_inputs(
struct xfs_mount *mp,
struct xfs_scrub_metadata *sm)
{
int error;
- const struct xfs_scrub_meta_ops *ops;
+ const struct xchk_meta_ops *ops;
error = -EINVAL;
/* Check our inputs. */
@@ -441,7 +447,7 @@ xfs_scrub_validate_inputs(
}
#ifdef CONFIG_XFS_ONLINE_REPAIR
-static inline void xfs_scrub_postmortem(struct xfs_scrub_context *sc)
+static inline void xchk_postmortem(struct xfs_scrub_context *sc)
{
/*
* Userspace asked us to repair something, we repaired it, rescanned
@@ -454,7 +460,7 @@ static inline void xfs_scrub_postmortem(struct xfs_scrub_context *sc)
xfs_repair_failure(sc->mp);
}
#else
-static inline void xfs_scrub_postmortem(struct xfs_scrub_context *sc)
+static inline void xchk_postmortem(struct xfs_scrub_context *sc)
{
/*
* Userspace asked us to scrub something, it's broken, and we have no
@@ -480,9 +486,9 @@ xfs_scrub_metadata(
int error = 0;
BUILD_BUG_ON(sizeof(meta_scrub_ops) !=
- (sizeof(struct xfs_scrub_meta_ops) * XFS_SCRUB_TYPE_NR));
+ (sizeof(struct xchk_meta_ops) * XFS_SCRUB_TYPE_NR));
- trace_xfs_scrub_start(ip, sm, error);
+ trace_xchk_start(ip, sm, error);
/* Forbidden if we are shut down or mounted norecovery. */
error = -ESHUTDOWN;
@@ -492,11 +498,11 @@ xfs_scrub_metadata(
if (mp->m_flags & XFS_MOUNT_NORECOVERY)
goto out;
- error = xfs_scrub_validate_inputs(mp, sm);
+ error = xchk_validate_inputs(mp, sm);
if (error)
goto out;
- xfs_scrub_experimental_warning(mp);
+ xchk_experimental_warning(mp);
retry_op:
/* Set up for the operation. */
@@ -518,7 +524,7 @@ xfs_scrub_metadata(
* Tear down everything we hold, then set up again with
* preparation for worst-case scenarios.
*/
- error = xfs_scrub_teardown(&sc, ip, 0);
+ error = xchk_teardown(&sc, ip, 0);
if (error)
goto out;
try_harder = true;
@@ -553,7 +559,7 @@ xfs_scrub_metadata(
if (error == -EAGAIN) {
if (sc.try_harder)
try_harder = true;
- error = xfs_scrub_teardown(&sc, ip, 0);
+ error = xchk_teardown(&sc, ip, 0);
if (error) {
xfs_repair_failure(mp);
goto out;
@@ -563,11 +569,11 @@ xfs_scrub_metadata(
}
out_nofix:
- xfs_scrub_postmortem(&sc);
+ xchk_postmortem(&sc);
out_teardown:
- error = xfs_scrub_teardown(&sc, ip, error);
+ error = xchk_teardown(&sc, ip, error);
out:
- trace_xfs_scrub_done(ip, sm, error);
+ trace_xchk_done(ip, sm, error);
if (error == -EFSCORRUPTED || error == -EFSBADCRC) {
sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT;
error = 0;
diff --git a/fs/xfs/scrub/scrub.h b/fs/xfs/scrub/scrub.h
index b295edd5fc0e..0f59a47c4bb0 100644
--- a/fs/xfs/scrub/scrub.h
+++ b/fs/xfs/scrub/scrub.h
@@ -9,14 +9,14 @@
struct xfs_scrub_context;
/* Type info and names for the scrub types. */
-enum xfs_scrub_type {
+enum xchk_type {
ST_NONE = 1, /* disabled */
ST_PERAG, /* per-AG metadata */
ST_FS, /* per-FS metadata */
ST_INODE, /* per-inode metadata */
};
-struct xfs_scrub_meta_ops {
+struct xchk_meta_ops {
/* Acquire whatever resources are needed for the operation. */
int (*setup)(struct xfs_scrub_context *,
struct xfs_inode *);
@@ -31,11 +31,11 @@ struct xfs_scrub_meta_ops {
bool (*has)(struct xfs_sb *);
/* type describing required/allowed inputs */
- enum xfs_scrub_type type;
+ enum xchk_type type;
};
/* Buffer pointers and btree cursors for an entire AG. */
-struct xfs_scrub_ag {
+struct xchk_ag {
xfs_agnumber_t agno;
struct xfs_perag *pag;
@@ -57,7 +57,7 @@ struct xfs_scrub_context {
/* General scrub state. */
struct xfs_mount *mp;
struct xfs_scrub_metadata *sm;
- const struct xfs_scrub_meta_ops *ops;
+ const struct xchk_meta_ops *ops;
struct xfs_trans *tp;
struct xfs_inode *ip;
void *buf;
@@ -66,78 +66,78 @@ struct xfs_scrub_context {
bool has_quotaofflock;
/* State tracking for single-AG operations. */
- struct xfs_scrub_ag sa;
+ struct xchk_ag sa;
};
/* Metadata scrubbers */
-int xfs_scrub_tester(struct xfs_scrub_context *sc);
-int xfs_scrub_superblock(struct xfs_scrub_context *sc);
-int xfs_scrub_agf(struct xfs_scrub_context *sc);
-int xfs_scrub_agfl(struct xfs_scrub_context *sc);
-int xfs_scrub_agi(struct xfs_scrub_context *sc);
-int xfs_scrub_bnobt(struct xfs_scrub_context *sc);
-int xfs_scrub_cntbt(struct xfs_scrub_context *sc);
-int xfs_scrub_inobt(struct xfs_scrub_context *sc);
-int xfs_scrub_finobt(struct xfs_scrub_context *sc);
-int xfs_scrub_rmapbt(struct xfs_scrub_context *sc);
-int xfs_scrub_refcountbt(struct xfs_scrub_context *sc);
-int xfs_scrub_inode(struct xfs_scrub_context *sc);
-int xfs_scrub_bmap_data(struct xfs_scrub_context *sc);
-int xfs_scrub_bmap_attr(struct xfs_scrub_context *sc);
-int xfs_scrub_bmap_cow(struct xfs_scrub_context *sc);
-int xfs_scrub_directory(struct xfs_scrub_context *sc);
-int xfs_scrub_xattr(struct xfs_scrub_context *sc);
-int xfs_scrub_symlink(struct xfs_scrub_context *sc);
-int xfs_scrub_parent(struct xfs_scrub_context *sc);
+int xchk_tester(struct xfs_scrub_context *sc);
+int xchk_superblock(struct xfs_scrub_context *sc);
+int xchk_agf(struct xfs_scrub_context *sc);
+int xchk_agfl(struct xfs_scrub_context *sc);
+int xchk_agi(struct xfs_scrub_context *sc);
+int xchk_bnobt(struct xfs_scrub_context *sc);
+int xchk_cntbt(struct xfs_scrub_context *sc);
+int xchk_inobt(struct xfs_scrub_context *sc);
+int xchk_finobt(struct xfs_scrub_context *sc);
+int xchk_rmapbt(struct xfs_scrub_context *sc);
+int xchk_refcountbt(struct xfs_scrub_context *sc);
+int xchk_inode(struct xfs_scrub_context *sc);
+int xchk_bmap_data(struct xfs_scrub_context *sc);
+int xchk_bmap_attr(struct xfs_scrub_context *sc);
+int xchk_bmap_cow(struct xfs_scrub_context *sc);
+int xchk_directory(struct xfs_scrub_context *sc);
+int xchk_xattr(struct xfs_scrub_context *sc);
+int xchk_symlink(struct xfs_scrub_context *sc);
+int xchk_parent(struct xfs_scrub_context *sc);
#ifdef CONFIG_XFS_RT
-int xfs_scrub_rtbitmap(struct xfs_scrub_context *sc);
-int xfs_scrub_rtsummary(struct xfs_scrub_context *sc);
+int xchk_rtbitmap(struct xfs_scrub_context *sc);
+int xchk_rtsummary(struct xfs_scrub_context *sc);
#else
static inline int
-xfs_scrub_rtbitmap(struct xfs_scrub_context *sc)
+xchk_rtbitmap(struct xfs_scrub_context *sc)
{
return -ENOENT;
}
static inline int
-xfs_scrub_rtsummary(struct xfs_scrub_context *sc)
+xchk_rtsummary(struct xfs_scrub_context *sc)
{
return -ENOENT;
}
#endif
#ifdef CONFIG_XFS_QUOTA
-int xfs_scrub_quota(struct xfs_scrub_context *sc);
+int xchk_quota(struct xfs_scrub_context *sc);
#else
static inline int
-xfs_scrub_quota(struct xfs_scrub_context *sc)
+xchk_quota(struct xfs_scrub_context *sc)
{
return -ENOENT;
}
#endif
/* cross-referencing helpers */
-void xfs_scrub_xref_is_used_space(struct xfs_scrub_context *sc,
+void xchk_xref_is_used_space(struct xfs_scrub_context *sc,
xfs_agblock_t agbno, xfs_extlen_t len);
-void xfs_scrub_xref_is_not_inode_chunk(struct xfs_scrub_context *sc,
+void xchk_xref_is_not_inode_chunk(struct xfs_scrub_context *sc,
xfs_agblock_t agbno, xfs_extlen_t len);
-void xfs_scrub_xref_is_inode_chunk(struct xfs_scrub_context *sc,
+void xchk_xref_is_inode_chunk(struct xfs_scrub_context *sc,
xfs_agblock_t agbno, xfs_extlen_t len);
-void xfs_scrub_xref_is_owned_by(struct xfs_scrub_context *sc,
+void xchk_xref_is_owned_by(struct xfs_scrub_context *sc,
xfs_agblock_t agbno, xfs_extlen_t len,
struct xfs_owner_info *oinfo);
-void xfs_scrub_xref_is_not_owned_by(struct xfs_scrub_context *sc,
+void xchk_xref_is_not_owned_by(struct xfs_scrub_context *sc,
xfs_agblock_t agbno, xfs_extlen_t len,
struct xfs_owner_info *oinfo);
-void xfs_scrub_xref_has_no_owner(struct xfs_scrub_context *sc,
+void xchk_xref_has_no_owner(struct xfs_scrub_context *sc,
xfs_agblock_t agbno, xfs_extlen_t len);
-void xfs_scrub_xref_is_cow_staging(struct xfs_scrub_context *sc,
+void xchk_xref_is_cow_staging(struct xfs_scrub_context *sc,
xfs_agblock_t bno, xfs_extlen_t len);
-void xfs_scrub_xref_is_not_shared(struct xfs_scrub_context *sc,
+void xchk_xref_is_not_shared(struct xfs_scrub_context *sc,
xfs_agblock_t bno, xfs_extlen_t len);
#ifdef CONFIG_XFS_RT
-void xfs_scrub_xref_is_used_rt_space(struct xfs_scrub_context *sc,
+void xchk_xref_is_used_rt_space(struct xfs_scrub_context *sc,
xfs_rtblock_t rtbno, xfs_extlen_t len);
#else
-# define xfs_scrub_xref_is_used_rt_space(sc, rtbno, len) do { } while (0)
+# define xchk_xref_is_used_rt_space(sc, rtbno, len) do { } while (0)
#endif
#endif /* __XFS_SCRUB_SCRUB_H__ */
diff --git a/fs/xfs/scrub/symlink.c b/fs/xfs/scrub/symlink.c
index 570a89812116..e2a288e34337 100644
--- a/fs/xfs/scrub/symlink.c
+++ b/fs/xfs/scrub/symlink.c
@@ -25,7 +25,7 @@
/* Set us up to scrub a symbolic link. */
int
-xfs_scrub_setup_symlink(
+xchk_setup_symlink(
struct xfs_scrub_context *sc,
struct xfs_inode *ip)
{
@@ -34,13 +34,13 @@ xfs_scrub_setup_symlink(
if (!sc->buf)
return -ENOMEM;
- return xfs_scrub_setup_inode_contents(sc, ip, 0);
+ return xchk_setup_inode_contents(sc, ip, 0);
}
/* Symbolic links. */
int
-xfs_scrub_symlink(
+xchk_symlink(
struct xfs_scrub_context *sc)
{
struct xfs_inode *ip = sc->ip;
@@ -55,7 +55,7 @@ xfs_scrub_symlink(
/* Plausible size? */
if (len > XFS_SYMLINK_MAXLEN || len <= 0) {
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
goto out;
}
@@ -63,16 +63,16 @@ xfs_scrub_symlink(
if (ifp->if_flags & XFS_IFINLINE) {
if (len > XFS_IFORK_DSIZE(ip) ||
len > strnlen(ifp->if_u1.if_data, XFS_IFORK_DSIZE(ip)))
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
goto out;
}
/* Remote symlink; must read the contents. */
error = xfs_readlink_bmap_ilocked(sc->ip, sc->buf);
- if (!xfs_scrub_fblock_process_error(sc, XFS_DATA_FORK, 0, &error))
+ if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, 0, &error))
goto out;
if (strnlen(sc->buf, XFS_SYMLINK_MAXLEN) < len)
- xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
+ xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
out:
return error;
}
diff --git a/fs/xfs/scrub/trace.c b/fs/xfs/scrub/trace.c
index 7c76d8b5cb05..1ef1202a1e45 100644
--- a/fs/xfs/scrub/trace.c
+++ b/fs/xfs/scrub/trace.c
@@ -22,7 +22,7 @@
/* Figure out which block the btree cursor was pointing to. */
static inline xfs_fsblock_t
-xfs_scrub_btree_cur_fsbno(
+xchk_btree_cur_fsbno(
struct xfs_btree_cur *cur,
int level)
{
diff --git a/fs/xfs/scrub/trace.h b/fs/xfs/scrub/trace.h
index cec3e5ece5a1..11967d3942ac 100644
--- a/fs/xfs/scrub/trace.h
+++ b/fs/xfs/scrub/trace.h
@@ -12,7 +12,7 @@
#include <linux/tracepoint.h>
#include "xfs_bit.h"
-DECLARE_EVENT_CLASS(xfs_scrub_class,
+DECLARE_EVENT_CLASS(xchk_class,
TP_PROTO(struct xfs_inode *ip, struct xfs_scrub_metadata *sm,
int error),
TP_ARGS(ip, sm, error),
@@ -47,18 +47,18 @@ DECLARE_EVENT_CLASS(xfs_scrub_class,
__entry->error)
)
#define DEFINE_SCRUB_EVENT(name) \
-DEFINE_EVENT(xfs_scrub_class, name, \
+DEFINE_EVENT(xchk_class, name, \
TP_PROTO(struct xfs_inode *ip, struct xfs_scrub_metadata *sm, \
int error), \
TP_ARGS(ip, sm, error))
-DEFINE_SCRUB_EVENT(xfs_scrub_start);
-DEFINE_SCRUB_EVENT(xfs_scrub_done);
-DEFINE_SCRUB_EVENT(xfs_scrub_deadlock_retry);
+DEFINE_SCRUB_EVENT(xchk_start);
+DEFINE_SCRUB_EVENT(xchk_done);
+DEFINE_SCRUB_EVENT(xchk_deadlock_retry);
DEFINE_SCRUB_EVENT(xfs_repair_attempt);
DEFINE_SCRUB_EVENT(xfs_repair_done);
-TRACE_EVENT(xfs_scrub_op_error,
+TRACE_EVENT(xchk_op_error,
TP_PROTO(struct xfs_scrub_context *sc, xfs_agnumber_t agno,
xfs_agblock_t bno, int error, void *ret_ip),
TP_ARGS(sc, agno, bno, error, ret_ip),
@@ -87,7 +87,7 @@ TRACE_EVENT(xfs_scrub_op_error,
__entry->ret_ip)
);
-TRACE_EVENT(xfs_scrub_file_op_error,
+TRACE_EVENT(xchk_file_op_error,
TP_PROTO(struct xfs_scrub_context *sc, int whichfork,
xfs_fileoff_t offset, int error, void *ret_ip),
TP_ARGS(sc, whichfork, offset, error, ret_ip),
@@ -119,7 +119,7 @@ TRACE_EVENT(xfs_scrub_file_op_error,
__entry->ret_ip)
);
-DECLARE_EVENT_CLASS(xfs_scrub_block_error_class,
+DECLARE_EVENT_CLASS(xchk_block_error_class,
TP_PROTO(struct xfs_scrub_context *sc, xfs_daddr_t daddr, void *ret_ip),
TP_ARGS(sc, daddr, ret_ip),
TP_STRUCT__entry(
@@ -153,15 +153,15 @@ DECLARE_EVENT_CLASS(xfs_scrub_block_error_class,
)
#define DEFINE_SCRUB_BLOCK_ERROR_EVENT(name) \
-DEFINE_EVENT(xfs_scrub_block_error_class, name, \
+DEFINE_EVENT(xchk_block_error_class, name, \
TP_PROTO(struct xfs_scrub_context *sc, xfs_daddr_t daddr, \
void *ret_ip), \
TP_ARGS(sc, daddr, ret_ip))
-DEFINE_SCRUB_BLOCK_ERROR_EVENT(xfs_scrub_block_error);
-DEFINE_SCRUB_BLOCK_ERROR_EVENT(xfs_scrub_block_preen);
+DEFINE_SCRUB_BLOCK_ERROR_EVENT(xchk_block_error);
+DEFINE_SCRUB_BLOCK_ERROR_EVENT(xchk_block_preen);
-DECLARE_EVENT_CLASS(xfs_scrub_ino_error_class,
+DECLARE_EVENT_CLASS(xchk_ino_error_class,
TP_PROTO(struct xfs_scrub_context *sc, xfs_ino_t ino, void *ret_ip),
TP_ARGS(sc, ino, ret_ip),
TP_STRUCT__entry(
@@ -184,16 +184,16 @@ DECLARE_EVENT_CLASS(xfs_scrub_ino_error_class,
)
#define DEFINE_SCRUB_INO_ERROR_EVENT(name) \
-DEFINE_EVENT(xfs_scrub_ino_error_class, name, \
+DEFINE_EVENT(xchk_ino_error_class, name, \
TP_PROTO(struct xfs_scrub_context *sc, xfs_ino_t ino, \
void *ret_ip), \
TP_ARGS(sc, ino, ret_ip))
-DEFINE_SCRUB_INO_ERROR_EVENT(xfs_scrub_ino_error);
-DEFINE_SCRUB_INO_ERROR_EVENT(xfs_scrub_ino_preen);
-DEFINE_SCRUB_INO_ERROR_EVENT(xfs_scrub_ino_warning);
+DEFINE_SCRUB_INO_ERROR_EVENT(xchk_ino_error);
+DEFINE_SCRUB_INO_ERROR_EVENT(xchk_ino_preen);
+DEFINE_SCRUB_INO_ERROR_EVENT(xchk_ino_warning);
-DECLARE_EVENT_CLASS(xfs_scrub_fblock_error_class,
+DECLARE_EVENT_CLASS(xchk_fblock_error_class,
TP_PROTO(struct xfs_scrub_context *sc, int whichfork,
xfs_fileoff_t offset, void *ret_ip),
TP_ARGS(sc, whichfork, offset, ret_ip),
@@ -223,15 +223,15 @@ DECLARE_EVENT_CLASS(xfs_scrub_fblock_error_class,
);
#define DEFINE_SCRUB_FBLOCK_ERROR_EVENT(name) \
-DEFINE_EVENT(xfs_scrub_fblock_error_class, name, \
+DEFINE_EVENT(xchk_fblock_error_class, name, \
TP_PROTO(struct xfs_scrub_context *sc, int whichfork, \
xfs_fileoff_t offset, void *ret_ip), \
TP_ARGS(sc, whichfork, offset, ret_ip))
-DEFINE_SCRUB_FBLOCK_ERROR_EVENT(xfs_scrub_fblock_error);
-DEFINE_SCRUB_FBLOCK_ERROR_EVENT(xfs_scrub_fblock_warning);
+DEFINE_SCRUB_FBLOCK_ERROR_EVENT(xchk_fblock_error);
+DEFINE_SCRUB_FBLOCK_ERROR_EVENT(xchk_fblock_warning);
-TRACE_EVENT(xfs_scrub_incomplete,
+TRACE_EVENT(xchk_incomplete,
TP_PROTO(struct xfs_scrub_context *sc, void *ret_ip),
TP_ARGS(sc, ret_ip),
TP_STRUCT__entry(
@@ -250,7 +250,7 @@ TRACE_EVENT(xfs_scrub_incomplete,
__entry->ret_ip)
);
-TRACE_EVENT(xfs_scrub_btree_op_error,
+TRACE_EVENT(xchk_btree_op_error,
TP_PROTO(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur,
int level, int error, void *ret_ip),
TP_ARGS(sc, cur, level, error, ret_ip),
@@ -266,7 +266,7 @@ TRACE_EVENT(xfs_scrub_btree_op_error,
__field(void *, ret_ip)
),
TP_fast_assign(
- xfs_fsblock_t fsbno = xfs_scrub_btree_cur_fsbno(cur, level);
+ xfs_fsblock_t fsbno = xchk_btree_cur_fsbno(cur, level);
__entry->dev = sc->mp->m_super->s_dev;
__entry->type = sc->sm->sm_type;
@@ -290,7 +290,7 @@ TRACE_EVENT(xfs_scrub_btree_op_error,
__entry->ret_ip)
);
-TRACE_EVENT(xfs_scrub_ifork_btree_op_error,
+TRACE_EVENT(xchk_ifork_btree_op_error,
TP_PROTO(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur,
int level, int error, void *ret_ip),
TP_ARGS(sc, cur, level, error, ret_ip),
@@ -308,7 +308,7 @@ TRACE_EVENT(xfs_scrub_ifork_btree_op_error,
__field(void *, ret_ip)
),
TP_fast_assign(
- xfs_fsblock_t fsbno = xfs_scrub_btree_cur_fsbno(cur, level);
+ xfs_fsblock_t fsbno = xchk_btree_cur_fsbno(cur, level);
__entry->dev = sc->mp->m_super->s_dev;
__entry->ino = sc->ip->i_ino;
__entry->whichfork = cur->bc_private.b.whichfork;
@@ -335,7 +335,7 @@ TRACE_EVENT(xfs_scrub_ifork_btree_op_error,
__entry->ret_ip)
);
-TRACE_EVENT(xfs_scrub_btree_error,
+TRACE_EVENT(xchk_btree_error,
TP_PROTO(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur,
int level, void *ret_ip),
TP_ARGS(sc, cur, level, ret_ip),
@@ -350,7 +350,7 @@ TRACE_EVENT(xfs_scrub_btree_error,
__field(void *, ret_ip)
),
TP_fast_assign(
- xfs_fsblock_t fsbno = xfs_scrub_btree_cur_fsbno(cur, level);
+ xfs_fsblock_t fsbno = xchk_btree_cur_fsbno(cur, level);
__entry->dev = sc->mp->m_super->s_dev;
__entry->type = sc->sm->sm_type;
__entry->btnum = cur->bc_btnum;
@@ -371,7 +371,7 @@ TRACE_EVENT(xfs_scrub_btree_error,
__entry->ret_ip)
);
-TRACE_EVENT(xfs_scrub_ifork_btree_error,
+TRACE_EVENT(xchk_ifork_btree_error,
TP_PROTO(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur,
int level, void *ret_ip),
TP_ARGS(sc, cur, level, ret_ip),
@@ -388,7 +388,7 @@ TRACE_EVENT(xfs_scrub_ifork_btree_error,
__field(void *, ret_ip)
),
TP_fast_assign(
- xfs_fsblock_t fsbno = xfs_scrub_btree_cur_fsbno(cur, level);
+ xfs_fsblock_t fsbno = xchk_btree_cur_fsbno(cur, level);
__entry->dev = sc->mp->m_super->s_dev;
__entry->ino = sc->ip->i_ino;
__entry->whichfork = cur->bc_private.b.whichfork;
@@ -413,7 +413,7 @@ TRACE_EVENT(xfs_scrub_ifork_btree_error,
__entry->ret_ip)
);
-DECLARE_EVENT_CLASS(xfs_scrub_sbtree_class,
+DECLARE_EVENT_CLASS(xchk_sbtree_class,
TP_PROTO(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur,
int level),
TP_ARGS(sc, cur, level),
@@ -428,7 +428,7 @@ DECLARE_EVENT_CLASS(xfs_scrub_sbtree_class,
__field(int, ptr)
),
TP_fast_assign(
- xfs_fsblock_t fsbno = xfs_scrub_btree_cur_fsbno(cur, level);
+ xfs_fsblock_t fsbno = xchk_btree_cur_fsbno(cur, level);
__entry->dev = sc->mp->m_super->s_dev;
__entry->type = sc->sm->sm_type;
@@ -450,15 +450,15 @@ DECLARE_EVENT_CLASS(xfs_scrub_sbtree_class,
__entry->ptr)
)
#define DEFINE_SCRUB_SBTREE_EVENT(name) \
-DEFINE_EVENT(xfs_scrub_sbtree_class, name, \
+DEFINE_EVENT(xchk_sbtree_class, name, \
TP_PROTO(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur, \
int level), \
TP_ARGS(sc, cur, level))
-DEFINE_SCRUB_SBTREE_EVENT(xfs_scrub_btree_rec);
-DEFINE_SCRUB_SBTREE_EVENT(xfs_scrub_btree_key);
+DEFINE_SCRUB_SBTREE_EVENT(xchk_btree_rec);
+DEFINE_SCRUB_SBTREE_EVENT(xchk_btree_key);
-TRACE_EVENT(xfs_scrub_xref_error,
+TRACE_EVENT(xchk_xref_error,
TP_PROTO(struct xfs_scrub_context *sc, int error, void *ret_ip),
TP_ARGS(sc, error, ret_ip),
TP_STRUCT__entry(
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 6/8] xfs: shorten xfs_repair_ prefix to xrep_
2018-07-18 15:50 [PATCH 0/8] xfs-4.19: fixes & cleanups Darrick J. Wong
` (4 preceding siblings ...)
2018-07-18 15:51 ` [PATCH 5/8] xfs: shorten xfs_scrub_ prefix Darrick J. Wong
@ 2018-07-18 15:51 ` Darrick J. Wong
2018-07-19 12:59 ` Brian Foster
2018-07-18 15:52 ` [PATCH 7/8] xfs: shorten struct xfs_scrub_context to struct xfs_scrub Darrick J. Wong
2018-07-18 15:52 ` [PATCH 8/8] xfs: fix indentation and other whitespace problems in scrub/repair Darrick J. Wong
7 siblings, 1 reply; 30+ messages in thread
From: Darrick J. Wong @ 2018-07-18 15:51 UTC (permalink / raw)
To: darrick.wong; +Cc: linux-xfs
From: Darrick J. Wong <darrick.wong@oracle.com>
Shorten all the metadata repair xfs_repair_* symbols to xrep_.
Whitespace damage will be fixed by a subsequent patch. There are no
functional changes.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
| 2
fs/xfs/scrub/common.c | 2
fs/xfs/scrub/repair.c | 164 ++++++++++++++++++++--------------------
fs/xfs/scrub/repair.h | 74 +++++++++---------
fs/xfs/scrub/scrub.c | 54 +++++++------
fs/xfs/scrub/trace.h | 40 +++++-----
6 files changed, 168 insertions(+), 168 deletions(-)
--git a/fs/xfs/scrub/agheader_repair.c b/fs/xfs/scrub/agheader_repair.c
index 117eedac53df..631940f3ca4d 100644
--- a/fs/xfs/scrub/agheader_repair.c
+++ b/fs/xfs/scrub/agheader_repair.c
@@ -28,7 +28,7 @@
/* Repair the superblock. */
int
-xfs_repair_superblock(
+xrep_superblock(
struct xfs_scrub_context *sc)
{
struct xfs_mount *mp = sc->mp;
diff --git a/fs/xfs/scrub/common.c b/fs/xfs/scrub/common.c
index a4004a06f482..fa1c16063d17 100644
--- a/fs/xfs/scrub/common.c
+++ b/fs/xfs/scrub/common.c
@@ -604,7 +604,7 @@ xchk_setup_fs(
{
uint resblks;
- resblks = xfs_repair_calc_ag_resblks(sc);
+ resblks = xrep_calc_ag_resblks(sc);
return xchk_trans_alloc(sc, resblks);
}
diff --git a/fs/xfs/scrub/repair.c b/fs/xfs/scrub/repair.c
index 5eccd89c64a8..7e6a56a5f59d 100644
--- a/fs/xfs/scrub/repair.c
+++ b/fs/xfs/scrub/repair.c
@@ -41,21 +41,21 @@
* and will set *fixed to true if it thinks it repaired anything.
*/
int
-xfs_repair_attempt(
+xrep_attempt(
struct xfs_inode *ip,
struct xfs_scrub_context *sc,
bool *fixed)
{
int error = 0;
- trace_xfs_repair_attempt(ip, sc->sm, error);
+ trace_xrep_attempt(ip, sc->sm, error);
xchk_ag_btcur_free(&sc->sa);
/* Repair whatever's broken. */
ASSERT(sc->ops->repair);
error = sc->ops->repair(sc);
- trace_xfs_repair_done(ip, sc->sm, error);
+ trace_xrep_done(ip, sc->sm, error);
switch (error) {
case 0:
/*
@@ -93,7 +93,7 @@ xfs_repair_attempt(
* structure to track rate limiting information.
*/
void
-xfs_repair_failure(
+xrep_failure(
struct xfs_mount *mp)
{
xfs_alert_ratelimited(mp,
@@ -105,7 +105,7 @@ xfs_repair_failure(
* given mountpoint.
*/
int
-xfs_repair_probe(
+xrep_probe(
struct xfs_scrub_context *sc)
{
int error = 0;
@@ -121,7 +121,7 @@ xfs_repair_probe(
* the btree cursors.
*/
int
-xfs_repair_roll_ag_trans(
+xrep_roll_ag_trans(
struct xfs_scrub_context *sc)
{
int error;
@@ -162,7 +162,7 @@ xfs_repair_roll_ag_trans(
* in AG reservations) to construct a whole btree.
*/
bool
-xfs_repair_ag_has_space(
+xrep_ag_has_space(
struct xfs_perag *pag,
xfs_extlen_t nr_blocks,
enum xfs_ag_resv_type type)
@@ -178,7 +178,7 @@ xfs_repair_ag_has_space(
* any type of per-AG btree.
*/
xfs_extlen_t
-xfs_repair_calc_ag_resblks(
+xrep_calc_ag_resblks(
struct xfs_scrub_context *sc)
{
struct xfs_mount *mp = sc->mp;
@@ -231,7 +231,7 @@ xfs_repair_calc_ag_resblks(
}
xfs_perag_put(pag);
- trace_xfs_repair_calc_ag_resblks(mp, sm->sm_agno, icount, aglen,
+ trace_xrep_calc_ag_resblks(mp, sm->sm_agno, icount, aglen,
freelen, usedlen);
/*
@@ -270,7 +270,7 @@ xfs_repair_calc_ag_resblks(
rmapbt_sz = 0;
}
- trace_xfs_repair_calc_ag_resblks_btsize(mp, sm->sm_agno, bnobt_sz,
+ trace_xrep_calc_ag_resblks_btsize(mp, sm->sm_agno, bnobt_sz,
inobt_sz, rmapbt_sz, refcbt_sz);
return max(max(bnobt_sz, inobt_sz), max(rmapbt_sz, refcbt_sz));
@@ -278,7 +278,7 @@ xfs_repair_calc_ag_resblks(
/* Allocate a block in an AG. */
int
-xfs_repair_alloc_ag_block(
+xrep_alloc_ag_block(
struct xfs_scrub_context *sc,
struct xfs_owner_info *oinfo,
xfs_fsblock_t *fsbno,
@@ -329,7 +329,7 @@ xfs_repair_alloc_ag_block(
/* Initialize a new AG btree root block with zero entries. */
int
-xfs_repair_init_btblock(
+xrep_init_btblock(
struct xfs_scrub_context *sc,
xfs_fsblock_t fsb,
struct xfs_buf **bpp,
@@ -340,7 +340,7 @@ xfs_repair_init_btblock(
struct xfs_mount *mp = sc->mp;
struct xfs_buf *bp;
- trace_xfs_repair_init_btblock(mp, XFS_FSB_TO_AGNO(mp, fsb),
+ trace_xrep_init_btblock(mp, XFS_FSB_TO_AGNO(mp, fsb),
XFS_FSB_TO_AGBNO(mp, fsb), btnum);
ASSERT(XFS_FSB_TO_AGNO(mp, fsb) == sc->sa.agno);
@@ -384,19 +384,19 @@ xfs_repair_init_btblock(
/* Collect a dead btree extent for later disposal. */
int
-xfs_repair_collect_btree_extent(
+xrep_collect_btree_extent(
struct xfs_scrub_context *sc,
- struct xfs_repair_extent_list *exlist,
+ struct xrep_extent_list *exlist,
xfs_fsblock_t fsbno,
xfs_extlen_t len)
{
- struct xfs_repair_extent *rex;
+ struct xrep_extent *rex;
- trace_xfs_repair_collect_btree_extent(sc->mp,
+ trace_xrep_collect_btree_extent(sc->mp,
XFS_FSB_TO_AGNO(sc->mp, fsbno),
XFS_FSB_TO_AGBNO(sc->mp, fsbno), len);
- rex = kmem_alloc(sizeof(struct xfs_repair_extent), KM_MAYFAIL);
+ rex = kmem_alloc(sizeof(struct xrep_extent), KM_MAYFAIL);
if (!rex)
return -ENOMEM;
@@ -414,14 +414,14 @@ xfs_repair_collect_btree_extent(
* Therefore, free all the memory associated with the list so we can die.
*/
void
-xfs_repair_cancel_btree_extents(
+xrep_cancel_btree_extents(
struct xfs_scrub_context *sc,
- struct xfs_repair_extent_list *exlist)
+ struct xrep_extent_list *exlist)
{
- struct xfs_repair_extent *rex;
- struct xfs_repair_extent *n;
+ struct xrep_extent *rex;
+ struct xrep_extent *n;
- for_each_xfs_repair_extent_safe(rex, n, exlist) {
+ for_each_xrep_extent_safe(rex, n, exlist) {
list_del(&rex->list);
kmem_free(rex);
}
@@ -429,16 +429,16 @@ xfs_repair_cancel_btree_extents(
/* Compare two btree extents. */
static int
-xfs_repair_btree_extent_cmp(
+xrep_btree_extent_cmp(
void *priv,
struct list_head *a,
struct list_head *b)
{
- struct xfs_repair_extent *ap;
- struct xfs_repair_extent *bp;
+ struct xrep_extent *ap;
+ struct xrep_extent *bp;
- ap = container_of(a, struct xfs_repair_extent, list);
- bp = container_of(b, struct xfs_repair_extent, list);
+ ap = container_of(a, struct xrep_extent, list);
+ bp = container_of(b, struct xrep_extent, list);
if (ap->fsbno > bp->fsbno)
return 1;
@@ -462,15 +462,15 @@ xfs_repair_btree_extent_cmp(
#define LEFT_ALIGNED (1 << 0)
#define RIGHT_ALIGNED (1 << 1)
int
-xfs_repair_subtract_extents(
+xrep_subtract_extents(
struct xfs_scrub_context *sc,
- struct xfs_repair_extent_list *exlist,
- struct xfs_repair_extent_list *sublist)
+ struct xrep_extent_list *exlist,
+ struct xrep_extent_list *sublist)
{
struct list_head *lp;
- struct xfs_repair_extent *ex;
- struct xfs_repair_extent *newex;
- struct xfs_repair_extent *subex;
+ struct xrep_extent *ex;
+ struct xrep_extent *newex;
+ struct xrep_extent *subex;
xfs_fsblock_t sub_fsb;
xfs_extlen_t sub_len;
int state;
@@ -480,8 +480,8 @@ xfs_repair_subtract_extents(
return 0;
ASSERT(!list_empty(&sublist->list));
- list_sort(NULL, &exlist->list, xfs_repair_btree_extent_cmp);
- list_sort(NULL, &sublist->list, xfs_repair_btree_extent_cmp);
+ list_sort(NULL, &exlist->list, xrep_btree_extent_cmp);
+ list_sort(NULL, &sublist->list, xrep_btree_extent_cmp);
/*
* Now that we've sorted both lists, we iterate exlist once, rolling
@@ -491,11 +491,11 @@ xfs_repair_subtract_extents(
* list traversal is similar to merge sort, but we're deleting
* instead. In this manner we avoid O(n^2) operations.
*/
- subex = list_first_entry(&sublist->list, struct xfs_repair_extent,
+ subex = list_first_entry(&sublist->list, struct xrep_extent,
list);
lp = exlist->list.next;
while (lp != &exlist->list) {
- ex = list_entry(lp, struct xfs_repair_extent, list);
+ ex = list_entry(lp, struct xrep_extent, list);
/*
* Advance subex and/or ex until we find a pair that
@@ -548,7 +548,7 @@ xfs_repair_subtract_extents(
* Deleting from the middle: add the new right extent
* and then shrink the left extent.
*/
- newex = kmem_alloc(sizeof(struct xfs_repair_extent),
+ newex = kmem_alloc(sizeof(struct xrep_extent),
KM_MAYFAIL);
if (!newex) {
error = -ENOMEM;
@@ -619,12 +619,12 @@ xfs_repair_subtract_extents(
* is not intended for use with file data repairs; we have bunmapi for that.
*/
int
-xfs_repair_invalidate_blocks(
+xrep_invalidate_blocks(
struct xfs_scrub_context *sc,
- struct xfs_repair_extent_list *exlist)
+ struct xrep_extent_list *exlist)
{
- struct xfs_repair_extent *rex;
- struct xfs_repair_extent *n;
+ struct xrep_extent *rex;
+ struct xrep_extent *n;
struct xfs_buf *bp;
xfs_fsblock_t fsbno;
xfs_agblock_t i;
@@ -637,7 +637,7 @@ xfs_repair_invalidate_blocks(
* because we never own those; and if we can't TRYLOCK the buffer we
* assume it's owned by someone else.
*/
- for_each_xfs_repair_extent_safe(rex, n, exlist) {
+ for_each_xrep_extent_safe(rex, n, exlist) {
for (fsbno = rex->fsbno, i = rex->len; i > 0; fsbno++, i--) {
/* Skip AG headers and post-EOFS blocks */
if (!xfs_verify_fsbno(sc->mp, fsbno))
@@ -657,7 +657,7 @@ xfs_repair_invalidate_blocks(
/* Ensure the freelist is the correct size. */
int
-xfs_repair_fix_freelist(
+xrep_fix_freelist(
struct xfs_scrub_context *sc,
bool can_shrink)
{
@@ -677,7 +677,7 @@ xfs_repair_fix_freelist(
* Put a block back on the AGFL.
*/
STATIC int
-xfs_repair_put_freelist(
+xrep_put_freelist(
struct xfs_scrub_context *sc,
xfs_agblock_t agbno)
{
@@ -685,7 +685,7 @@ xfs_repair_put_freelist(
int error;
/* Make sure there's space on the freelist. */
- error = xfs_repair_fix_freelist(sc, true);
+ error = xrep_fix_freelist(sc, true);
if (error)
return error;
@@ -713,7 +713,7 @@ xfs_repair_put_freelist(
/* Dispose of a single metadata block. */
STATIC int
-xfs_repair_dispose_btree_block(
+xrep_dispose_btree_block(
struct xfs_scrub_context *sc,
xfs_fsblock_t fsbno,
struct xfs_owner_info *oinfo,
@@ -767,7 +767,7 @@ xfs_repair_dispose_btree_block(
if (has_other_rmap)
error = xfs_rmap_free(sc->tp, agf_bp, agno, agbno, 1, oinfo);
else if (resv == XFS_AG_RESV_AGFL)
- error = xfs_repair_put_freelist(sc, agbno);
+ error = xrep_put_freelist(sc, agbno);
else
error = xfs_free_extent(sc->tp, fsbno, 1, oinfo, resv);
if (agf_bp != sc->sa.agf_bp)
@@ -777,7 +777,7 @@ xfs_repair_dispose_btree_block(
if (sc->ip)
return xfs_trans_roll_inode(&sc->tp, sc->ip);
- return xfs_repair_roll_ag_trans(sc);
+ return xrep_roll_ag_trans(sc);
out_free:
if (agf_bp != sc->sa.agf_bp)
@@ -787,29 +787,29 @@ xfs_repair_dispose_btree_block(
/* Dispose of btree blocks from an old per-AG btree. */
int
-xfs_repair_reap_btree_extents(
+xrep_reap_btree_extents(
struct xfs_scrub_context *sc,
- struct xfs_repair_extent_list *exlist,
+ struct xrep_extent_list *exlist,
struct xfs_owner_info *oinfo,
enum xfs_ag_resv_type type)
{
- struct xfs_repair_extent *rex;
- struct xfs_repair_extent *n;
+ struct xrep_extent *rex;
+ struct xrep_extent *n;
int error = 0;
ASSERT(xfs_sb_version_hasrmapbt(&sc->mp->m_sb));
/* Dispose of every block from the old btree. */
- for_each_xfs_repair_extent_safe(rex, n, exlist) {
+ for_each_xrep_extent_safe(rex, n, exlist) {
ASSERT(sc->ip != NULL ||
XFS_FSB_TO_AGNO(sc->mp, rex->fsbno) == sc->sa.agno);
- trace_xfs_repair_dispose_btree_extent(sc->mp,
+ trace_xrep_dispose_btree_extent(sc->mp,
XFS_FSB_TO_AGNO(sc->mp, rex->fsbno),
XFS_FSB_TO_AGBNO(sc->mp, rex->fsbno), rex->len);
for (; rex->len > 0; rex->len--, rex->fsbno++) {
- error = xfs_repair_dispose_btree_block(sc, rex->fsbno,
+ error = xrep_dispose_btree_block(sc, rex->fsbno,
oinfo, type);
if (error)
goto out;
@@ -819,7 +819,7 @@ xfs_repair_reap_btree_extents(
}
out:
- xfs_repair_cancel_btree_extents(sc, exlist);
+ xrep_cancel_btree_extents(sc, exlist);
return error;
}
@@ -831,12 +831,12 @@ xfs_repair_reap_btree_extents(
* btree roots. This is not guaranteed to work if the AG is heavily damaged
* or the rmap data are corrupt.
*
- * Callers of xfs_repair_find_ag_btree_roots must lock the AGF and AGFL
+ * Callers of xrep_find_ag_btree_roots must lock the AGF and AGFL
* buffers if the AGF is being rebuilt; or the AGF and AGI buffers if the
* AGI is being rebuilt. It must maintain these locks until it's safe for
* other threads to change the btrees' shapes. The caller provides
* information about the btrees to look for by passing in an array of
- * xfs_repair_find_ag_btree with the (rmap owner, buf_ops, magic) fields set.
+ * xrep_find_ag_btree with the (rmap owner, buf_ops, magic) fields set.
* The (root, height) fields will be set on return if anything is found. The
* last element of the array should have a NULL buf_ops to mark the end of the
* array.
@@ -850,16 +850,16 @@ xfs_repair_reap_btree_extents(
* should be the roots.
*/
-struct xfs_repair_findroot {
+struct xrep_findroot {
struct xfs_scrub_context *sc;
struct xfs_buf *agfl_bp;
struct xfs_agf *agf;
- struct xfs_repair_find_ag_btree *btree_info;
+ struct xrep_find_ag_btree *btree_info;
};
/* See if our block is in the AGFL. */
STATIC int
-xfs_repair_findroot_agfl_walk(
+xrep_findroot_agfl_walk(
struct xfs_mount *mp,
xfs_agblock_t bno,
void *priv)
@@ -871,9 +871,9 @@ xfs_repair_findroot_agfl_walk(
/* Does this block match the btree information passed in? */
STATIC int
-xfs_repair_findroot_block(
- struct xfs_repair_findroot *ri,
- struct xfs_repair_find_ag_btree *fab,
+xrep_findroot_block(
+ struct xrep_findroot *ri,
+ struct xrep_find_ag_btree *fab,
uint64_t owner,
xfs_agblock_t agbno,
bool *found_it)
@@ -894,7 +894,7 @@ xfs_repair_findroot_block(
*/
if (owner == XFS_RMAP_OWN_AG) {
error = xfs_agfl_walk(mp, ri->agf, ri->agfl_bp,
- xfs_repair_findroot_agfl_walk, &agbno);
+ xrep_findroot_agfl_walk, &agbno);
if (error == XFS_BTREE_QUERY_RANGE_ABORT)
return 0;
if (error)
@@ -932,7 +932,7 @@ xfs_repair_findroot_block(
fab->height = xfs_btree_get_level(btblock) + 1;
*found_it = true;
- trace_xfs_repair_findroot_block(mp, ri->sc->sa.agno, agbno,
+ trace_xrep_findroot_block(mp, ri->sc->sa.agno, agbno,
be32_to_cpu(btblock->bb_magic), fab->height - 1);
out:
xfs_trans_brelse(ri->sc->tp, bp);
@@ -944,13 +944,13 @@ xfs_repair_findroot_block(
* looking for?
*/
STATIC int
-xfs_repair_findroot_rmap(
+xrep_findroot_rmap(
struct xfs_btree_cur *cur,
struct xfs_rmap_irec *rec,
void *priv)
{
- struct xfs_repair_findroot *ri = priv;
- struct xfs_repair_find_ag_btree *fab;
+ struct xrep_findroot *ri = priv;
+ struct xrep_find_ag_btree *fab;
xfs_agblock_t b;
bool found_it;
int error = 0;
@@ -965,7 +965,7 @@ xfs_repair_findroot_rmap(
for (fab = ri->btree_info; fab->buf_ops; fab++) {
if (rec->rm_owner != fab->rmap_owner)
continue;
- error = xfs_repair_findroot_block(ri, fab,
+ error = xrep_findroot_block(ri, fab,
rec->rm_owner, rec->rm_startblock + b,
&found_it);
if (error)
@@ -980,15 +980,15 @@ xfs_repair_findroot_rmap(
/* Find the roots of the per-AG btrees described in btree_info. */
int
-xfs_repair_find_ag_btree_roots(
+xrep_find_ag_btree_roots(
struct xfs_scrub_context *sc,
struct xfs_buf *agf_bp,
- struct xfs_repair_find_ag_btree *btree_info,
+ struct xrep_find_ag_btree *btree_info,
struct xfs_buf *agfl_bp)
{
struct xfs_mount *mp = sc->mp;
- struct xfs_repair_findroot ri;
- struct xfs_repair_find_ag_btree *fab;
+ struct xrep_findroot ri;
+ struct xrep_find_ag_btree *fab;
struct xfs_btree_cur *cur;
int error;
@@ -1007,7 +1007,7 @@ xfs_repair_find_ag_btree_roots(
}
cur = xfs_rmapbt_init_cursor(mp, sc->tp, agf_bp, sc->sa.agno);
- error = xfs_rmap_query_all(cur, xfs_repair_findroot_rmap, &ri);
+ error = xfs_rmap_query_all(cur, xrep_findroot_rmap, &ri);
xfs_btree_del_cursor(cur, error);
return error;
@@ -1015,7 +1015,7 @@ xfs_repair_find_ag_btree_roots(
/* Force a quotacheck the next time we mount. */
void
-xfs_repair_force_quotacheck(
+xrep_force_quotacheck(
struct xfs_scrub_context *sc,
uint dqtype)
{
@@ -1043,7 +1043,7 @@ xfs_repair_force_quotacheck(
* repair corruptions in the quota metadata.
*/
int
-xfs_repair_ino_dqattach(
+xrep_ino_dqattach(
struct xfs_scrub_context *sc)
{
int error;
@@ -1057,11 +1057,11 @@ xfs_repair_ino_dqattach(
"inode %llu repair encountered quota error %d, quotacheck forced.",
(unsigned long long)sc->ip->i_ino, error);
if (XFS_IS_UQUOTA_ON(sc->mp) && !sc->ip->i_udquot)
- xfs_repair_force_quotacheck(sc, XFS_DQ_USER);
+ xrep_force_quotacheck(sc, XFS_DQ_USER);
if (XFS_IS_GQUOTA_ON(sc->mp) && !sc->ip->i_gdquot)
- xfs_repair_force_quotacheck(sc, XFS_DQ_GROUP);
+ xrep_force_quotacheck(sc, XFS_DQ_GROUP);
if (XFS_IS_PQUOTA_ON(sc->mp) && !sc->ip->i_pdquot)
- xfs_repair_force_quotacheck(sc, XFS_DQ_PROJ);
+ xrep_force_quotacheck(sc, XFS_DQ_PROJ);
/* fall through */
case -ESRCH:
error = 0;
diff --git a/fs/xfs/scrub/repair.h b/fs/xfs/scrub/repair.h
index ef47826b6725..60d81294797b 100644
--- a/fs/xfs/scrub/repair.h
+++ b/fs/xfs/scrub/repair.h
@@ -6,7 +6,7 @@
#ifndef __XFS_SCRUB_REPAIR_H__
#define __XFS_SCRUB_REPAIR_H__
-static inline int xfs_repair_notsupported(struct xfs_scrub_context *sc)
+static inline int xrep_notsupported(struct xfs_scrub_context *sc)
{
return -EOPNOTSUPP;
}
@@ -15,55 +15,55 @@ static inline int xfs_repair_notsupported(struct xfs_scrub_context *sc)
/* Repair helpers */
-int xfs_repair_attempt(struct xfs_inode *ip, struct xfs_scrub_context *sc,
+int xrep_attempt(struct xfs_inode *ip, struct xfs_scrub_context *sc,
bool *fixed);
-void xfs_repair_failure(struct xfs_mount *mp);
-int xfs_repair_roll_ag_trans(struct xfs_scrub_context *sc);
-bool xfs_repair_ag_has_space(struct xfs_perag *pag, xfs_extlen_t nr_blocks,
+void xrep_failure(struct xfs_mount *mp);
+int xrep_roll_ag_trans(struct xfs_scrub_context *sc);
+bool xrep_ag_has_space(struct xfs_perag *pag, xfs_extlen_t nr_blocks,
enum xfs_ag_resv_type type);
-xfs_extlen_t xfs_repair_calc_ag_resblks(struct xfs_scrub_context *sc);
-int xfs_repair_alloc_ag_block(struct xfs_scrub_context *sc,
+xfs_extlen_t xrep_calc_ag_resblks(struct xfs_scrub_context *sc);
+int xrep_alloc_ag_block(struct xfs_scrub_context *sc,
struct xfs_owner_info *oinfo, xfs_fsblock_t *fsbno,
enum xfs_ag_resv_type resv);
-int xfs_repair_init_btblock(struct xfs_scrub_context *sc, xfs_fsblock_t fsb,
+int xrep_init_btblock(struct xfs_scrub_context *sc, xfs_fsblock_t fsb,
struct xfs_buf **bpp, xfs_btnum_t btnum,
const struct xfs_buf_ops *ops);
-struct xfs_repair_extent {
+struct xrep_extent {
struct list_head list;
xfs_fsblock_t fsbno;
xfs_extlen_t len;
};
-struct xfs_repair_extent_list {
+struct xrep_extent_list {
struct list_head list;
};
static inline void
-xfs_repair_init_extent_list(
- struct xfs_repair_extent_list *exlist)
+xrep_init_extent_list(
+ struct xrep_extent_list *exlist)
{
INIT_LIST_HEAD(&exlist->list);
}
-#define for_each_xfs_repair_extent_safe(rbe, n, exlist) \
+#define for_each_xrep_extent_safe(rbe, n, exlist) \
list_for_each_entry_safe((rbe), (n), &(exlist)->list, list)
-int xfs_repair_collect_btree_extent(struct xfs_scrub_context *sc,
- struct xfs_repair_extent_list *btlist, xfs_fsblock_t fsbno,
+int xrep_collect_btree_extent(struct xfs_scrub_context *sc,
+ struct xrep_extent_list *btlist, xfs_fsblock_t fsbno,
xfs_extlen_t len);
-void xfs_repair_cancel_btree_extents(struct xfs_scrub_context *sc,
- struct xfs_repair_extent_list *btlist);
-int xfs_repair_subtract_extents(struct xfs_scrub_context *sc,
- struct xfs_repair_extent_list *exlist,
- struct xfs_repair_extent_list *sublist);
-int xfs_repair_fix_freelist(struct xfs_scrub_context *sc, bool can_shrink);
-int xfs_repair_invalidate_blocks(struct xfs_scrub_context *sc,
- struct xfs_repair_extent_list *btlist);
-int xfs_repair_reap_btree_extents(struct xfs_scrub_context *sc,
- struct xfs_repair_extent_list *exlist,
+void xrep_cancel_btree_extents(struct xfs_scrub_context *sc,
+ struct xrep_extent_list *btlist);
+int xrep_subtract_extents(struct xfs_scrub_context *sc,
+ struct xrep_extent_list *exlist,
+ struct xrep_extent_list *sublist);
+int xrep_fix_freelist(struct xfs_scrub_context *sc, bool can_shrink);
+int xrep_invalidate_blocks(struct xfs_scrub_context *sc,
+ struct xrep_extent_list *btlist);
+int xrep_reap_btree_extents(struct xfs_scrub_context *sc,
+ struct xrep_extent_list *exlist,
struct xfs_owner_info *oinfo, enum xfs_ag_resv_type type);
-struct xfs_repair_find_ag_btree {
+struct xrep_find_ag_btree {
/* in: rmap owner of the btree we're looking for */
uint64_t rmap_owner;
@@ -78,21 +78,21 @@ struct xfs_repair_find_ag_btree {
unsigned int height;
};
-int xfs_repair_find_ag_btree_roots(struct xfs_scrub_context *sc,
+int xrep_find_ag_btree_roots(struct xfs_scrub_context *sc,
struct xfs_buf *agf_bp,
- struct xfs_repair_find_ag_btree *btree_info,
+ struct xrep_find_ag_btree *btree_info,
struct xfs_buf *agfl_bp);
-void xfs_repair_force_quotacheck(struct xfs_scrub_context *sc, uint dqtype);
-int xfs_repair_ino_dqattach(struct xfs_scrub_context *sc);
+void xrep_force_quotacheck(struct xfs_scrub_context *sc, uint dqtype);
+int xrep_ino_dqattach(struct xfs_scrub_context *sc);
/* Metadata repairers */
-int xfs_repair_probe(struct xfs_scrub_context *sc);
-int xfs_repair_superblock(struct xfs_scrub_context *sc);
+int xrep_probe(struct xfs_scrub_context *sc);
+int xrep_superblock(struct xfs_scrub_context *sc);
#else
-static inline int xfs_repair_attempt(
+static inline int xrep_attempt(
struct xfs_inode *ip,
struct xfs_scrub_context *sc,
bool *fixed)
@@ -100,18 +100,18 @@ static inline int xfs_repair_attempt(
return -EOPNOTSUPP;
}
-static inline void xfs_repair_failure(struct xfs_mount *mp) {}
+static inline void xrep_failure(struct xfs_mount *mp) {}
static inline xfs_extlen_t
-xfs_repair_calc_ag_resblks(
+xrep_calc_ag_resblks(
struct xfs_scrub_context *sc)
{
ASSERT(!(sc->sm->sm_flags & XFS_SCRUB_IFLAG_REPAIR));
return 0;
}
-#define xfs_repair_probe xfs_repair_notsupported
-#define xfs_repair_superblock xfs_repair_notsupported
+#define xrep_probe xrep_notsupported
+#define xrep_superblock xrep_notsupported
#endif /* CONFIG_XFS_ONLINE_REPAIR */
diff --git a/fs/xfs/scrub/scrub.c b/fs/xfs/scrub/scrub.c
index ead97ab91a3c..a6efede6e430 100644
--- a/fs/xfs/scrub/scrub.c
+++ b/fs/xfs/scrub/scrub.c
@@ -202,150 +202,150 @@ static const struct xchk_meta_ops meta_scrub_ops[] = {
.type = ST_NONE,
.setup = xchk_setup_fs,
.scrub = xchk_probe,
- .repair = xfs_repair_probe,
+ .repair = xrep_probe,
},
[XFS_SCRUB_TYPE_SB] = { /* superblock */
.type = ST_PERAG,
.setup = xchk_setup_fs,
.scrub = xchk_superblock,
- .repair = xfs_repair_superblock,
+ .repair = xrep_superblock,
},
[XFS_SCRUB_TYPE_AGF] = { /* agf */
.type = ST_PERAG,
.setup = xchk_setup_fs,
.scrub = xchk_agf,
- .repair = xfs_repair_notsupported,
+ .repair = xrep_notsupported,
},
[XFS_SCRUB_TYPE_AGFL]= { /* agfl */
.type = ST_PERAG,
.setup = xchk_setup_fs,
.scrub = xchk_agfl,
- .repair = xfs_repair_notsupported,
+ .repair = xrep_notsupported,
},
[XFS_SCRUB_TYPE_AGI] = { /* agi */
.type = ST_PERAG,
.setup = xchk_setup_fs,
.scrub = xchk_agi,
- .repair = xfs_repair_notsupported,
+ .repair = xrep_notsupported,
},
[XFS_SCRUB_TYPE_BNOBT] = { /* bnobt */
.type = ST_PERAG,
.setup = xchk_setup_ag_allocbt,
.scrub = xchk_bnobt,
- .repair = xfs_repair_notsupported,
+ .repair = xrep_notsupported,
},
[XFS_SCRUB_TYPE_CNTBT] = { /* cntbt */
.type = ST_PERAG,
.setup = xchk_setup_ag_allocbt,
.scrub = xchk_cntbt,
- .repair = xfs_repair_notsupported,
+ .repair = xrep_notsupported,
},
[XFS_SCRUB_TYPE_INOBT] = { /* inobt */
.type = ST_PERAG,
.setup = xchk_setup_ag_iallocbt,
.scrub = xchk_inobt,
- .repair = xfs_repair_notsupported,
+ .repair = xrep_notsupported,
},
[XFS_SCRUB_TYPE_FINOBT] = { /* finobt */
.type = ST_PERAG,
.setup = xchk_setup_ag_iallocbt,
.scrub = xchk_finobt,
.has = xfs_sb_version_hasfinobt,
- .repair = xfs_repair_notsupported,
+ .repair = xrep_notsupported,
},
[XFS_SCRUB_TYPE_RMAPBT] = { /* rmapbt */
.type = ST_PERAG,
.setup = xchk_setup_ag_rmapbt,
.scrub = xchk_rmapbt,
.has = xfs_sb_version_hasrmapbt,
- .repair = xfs_repair_notsupported,
+ .repair = xrep_notsupported,
},
[XFS_SCRUB_TYPE_REFCNTBT] = { /* refcountbt */
.type = ST_PERAG,
.setup = xchk_setup_ag_refcountbt,
.scrub = xchk_refcountbt,
.has = xfs_sb_version_hasreflink,
- .repair = xfs_repair_notsupported,
+ .repair = xrep_notsupported,
},
[XFS_SCRUB_TYPE_INODE] = { /* inode record */
.type = ST_INODE,
.setup = xchk_setup_inode,
.scrub = xchk_inode,
- .repair = xfs_repair_notsupported,
+ .repair = xrep_notsupported,
},
[XFS_SCRUB_TYPE_BMBTD] = { /* inode data fork */
.type = ST_INODE,
.setup = xchk_setup_inode_bmap,
.scrub = xchk_bmap_data,
- .repair = xfs_repair_notsupported,
+ .repair = xrep_notsupported,
},
[XFS_SCRUB_TYPE_BMBTA] = { /* inode attr fork */
.type = ST_INODE,
.setup = xchk_setup_inode_bmap,
.scrub = xchk_bmap_attr,
- .repair = xfs_repair_notsupported,
+ .repair = xrep_notsupported,
},
[XFS_SCRUB_TYPE_BMBTC] = { /* inode CoW fork */
.type = ST_INODE,
.setup = xchk_setup_inode_bmap,
.scrub = xchk_bmap_cow,
- .repair = xfs_repair_notsupported,
+ .repair = xrep_notsupported,
},
[XFS_SCRUB_TYPE_DIR] = { /* directory */
.type = ST_INODE,
.setup = xchk_setup_directory,
.scrub = xchk_directory,
- .repair = xfs_repair_notsupported,
+ .repair = xrep_notsupported,
},
[XFS_SCRUB_TYPE_XATTR] = { /* extended attributes */
.type = ST_INODE,
.setup = xchk_setup_xattr,
.scrub = xchk_xattr,
- .repair = xfs_repair_notsupported,
+ .repair = xrep_notsupported,
},
[XFS_SCRUB_TYPE_SYMLINK] = { /* symbolic link */
.type = ST_INODE,
.setup = xchk_setup_symlink,
.scrub = xchk_symlink,
- .repair = xfs_repair_notsupported,
+ .repair = xrep_notsupported,
},
[XFS_SCRUB_TYPE_PARENT] = { /* parent pointers */
.type = ST_INODE,
.setup = xchk_setup_parent,
.scrub = xchk_parent,
- .repair = xfs_repair_notsupported,
+ .repair = xrep_notsupported,
},
[XFS_SCRUB_TYPE_RTBITMAP] = { /* realtime bitmap */
.type = ST_FS,
.setup = xchk_setup_rt,
.scrub = xchk_rtbitmap,
.has = xfs_sb_version_hasrealtime,
- .repair = xfs_repair_notsupported,
+ .repair = xrep_notsupported,
},
[XFS_SCRUB_TYPE_RTSUM] = { /* realtime summary */
.type = ST_FS,
.setup = xchk_setup_rt,
.scrub = xchk_rtsummary,
.has = xfs_sb_version_hasrealtime,
- .repair = xfs_repair_notsupported,
+ .repair = xrep_notsupported,
},
[XFS_SCRUB_TYPE_UQUOTA] = { /* user quota */
.type = ST_FS,
.setup = xchk_setup_quota,
.scrub = xchk_quota,
- .repair = xfs_repair_notsupported,
+ .repair = xrep_notsupported,
},
[XFS_SCRUB_TYPE_GQUOTA] = { /* group quota */
.type = ST_FS,
.setup = xchk_setup_quota,
.scrub = xchk_quota,
- .repair = xfs_repair_notsupported,
+ .repair = xrep_notsupported,
},
[XFS_SCRUB_TYPE_PQUOTA] = { /* project quota */
.type = ST_FS,
.setup = xchk_setup_quota,
.scrub = xchk_quota,
- .repair = xfs_repair_notsupported,
+ .repair = xrep_notsupported,
},
};
@@ -457,7 +457,7 @@ static inline void xchk_postmortem(struct xfs_scrub_context *sc)
if ((sc->sm->sm_flags & XFS_SCRUB_IFLAG_REPAIR) &&
(sc->sm->sm_flags & (XFS_SCRUB_OFLAG_CORRUPT |
XFS_SCRUB_OFLAG_XCORRUPT)))
- xfs_repair_failure(sc->mp);
+ xrep_failure(sc->mp);
}
#else
static inline void xchk_postmortem(struct xfs_scrub_context *sc)
@@ -555,13 +555,13 @@ xfs_scrub_metadata(
* If it's broken, userspace wants us to fix it, and we haven't
* already tried to fix it, then attempt a repair.
*/
- error = xfs_repair_attempt(ip, &sc, &already_fixed);
+ error = xrep_attempt(ip, &sc, &already_fixed);
if (error == -EAGAIN) {
if (sc.try_harder)
try_harder = true;
error = xchk_teardown(&sc, ip, 0);
if (error) {
- xfs_repair_failure(mp);
+ xrep_failure(mp);
goto out;
}
goto retry_op;
diff --git a/fs/xfs/scrub/trace.h b/fs/xfs/scrub/trace.h
index 11967d3942ac..96f3edda3e91 100644
--- a/fs/xfs/scrub/trace.h
+++ b/fs/xfs/scrub/trace.h
@@ -55,8 +55,8 @@ DEFINE_EVENT(xchk_class, name, \
DEFINE_SCRUB_EVENT(xchk_start);
DEFINE_SCRUB_EVENT(xchk_done);
DEFINE_SCRUB_EVENT(xchk_deadlock_retry);
-DEFINE_SCRUB_EVENT(xfs_repair_attempt);
-DEFINE_SCRUB_EVENT(xfs_repair_done);
+DEFINE_SCRUB_EVENT(xrep_attempt);
+DEFINE_SCRUB_EVENT(xrep_done);
TRACE_EVENT(xchk_op_error,
TP_PROTO(struct xfs_scrub_context *sc, xfs_agnumber_t agno,
@@ -483,7 +483,7 @@ TRACE_EVENT(xchk_xref_error,
/* repair tracepoints */
#if IS_ENABLED(CONFIG_XFS_ONLINE_REPAIR)
-DECLARE_EVENT_CLASS(xfs_repair_extent_class,
+DECLARE_EVENT_CLASS(xrep_extent_class,
TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
xfs_agblock_t agbno, xfs_extlen_t len),
TP_ARGS(mp, agno, agbno, len),
@@ -506,15 +506,15 @@ DECLARE_EVENT_CLASS(xfs_repair_extent_class,
__entry->len)
);
#define DEFINE_REPAIR_EXTENT_EVENT(name) \
-DEFINE_EVENT(xfs_repair_extent_class, name, \
+DEFINE_EVENT(xrep_extent_class, name, \
TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
xfs_agblock_t agbno, xfs_extlen_t len), \
TP_ARGS(mp, agno, agbno, len))
-DEFINE_REPAIR_EXTENT_EVENT(xfs_repair_dispose_btree_extent);
-DEFINE_REPAIR_EXTENT_EVENT(xfs_repair_collect_btree_extent);
-DEFINE_REPAIR_EXTENT_EVENT(xfs_repair_agfl_insert);
+DEFINE_REPAIR_EXTENT_EVENT(xrep_dispose_btree_extent);
+DEFINE_REPAIR_EXTENT_EVENT(xrep_collect_btree_extent);
+DEFINE_REPAIR_EXTENT_EVENT(xrep_agfl_insert);
-DECLARE_EVENT_CLASS(xfs_repair_rmap_class,
+DECLARE_EVENT_CLASS(xrep_rmap_class,
TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
xfs_agblock_t agbno, xfs_extlen_t len,
uint64_t owner, uint64_t offset, unsigned int flags),
@@ -547,17 +547,17 @@ DECLARE_EVENT_CLASS(xfs_repair_rmap_class,
__entry->flags)
);
#define DEFINE_REPAIR_RMAP_EVENT(name) \
-DEFINE_EVENT(xfs_repair_rmap_class, name, \
+DEFINE_EVENT(xrep_rmap_class, name, \
TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
xfs_agblock_t agbno, xfs_extlen_t len, \
uint64_t owner, uint64_t offset, unsigned int flags), \
TP_ARGS(mp, agno, agbno, len, owner, offset, flags))
-DEFINE_REPAIR_RMAP_EVENT(xfs_repair_alloc_extent_fn);
-DEFINE_REPAIR_RMAP_EVENT(xfs_repair_ialloc_extent_fn);
-DEFINE_REPAIR_RMAP_EVENT(xfs_repair_rmap_extent_fn);
-DEFINE_REPAIR_RMAP_EVENT(xfs_repair_bmap_extent_fn);
+DEFINE_REPAIR_RMAP_EVENT(xrep_alloc_extent_fn);
+DEFINE_REPAIR_RMAP_EVENT(xrep_ialloc_extent_fn);
+DEFINE_REPAIR_RMAP_EVENT(xrep_rmap_extent_fn);
+DEFINE_REPAIR_RMAP_EVENT(xrep_bmap_extent_fn);
-TRACE_EVENT(xfs_repair_refcount_extent_fn,
+TRACE_EVENT(xrep_refcount_extent_fn,
TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
struct xfs_refcount_irec *irec),
TP_ARGS(mp, agno, irec),
@@ -583,7 +583,7 @@ TRACE_EVENT(xfs_repair_refcount_extent_fn,
__entry->refcount)
)
-TRACE_EVENT(xfs_repair_init_btblock,
+TRACE_EVENT(xrep_init_btblock,
TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
xfs_btnum_t btnum),
TP_ARGS(mp, agno, agbno, btnum),
@@ -605,7 +605,7 @@ TRACE_EVENT(xfs_repair_init_btblock,
__entry->agbno,
__entry->btnum)
)
-TRACE_EVENT(xfs_repair_findroot_block,
+TRACE_EVENT(xrep_findroot_block,
TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
uint32_t magic, uint16_t level),
TP_ARGS(mp, agno, agbno, magic, level),
@@ -630,7 +630,7 @@ TRACE_EVENT(xfs_repair_findroot_block,
__entry->magic,
__entry->level)
)
-TRACE_EVENT(xfs_repair_calc_ag_resblks,
+TRACE_EVENT(xrep_calc_ag_resblks,
TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
xfs_agino_t icount, xfs_agblock_t aglen, xfs_agblock_t freelen,
xfs_agblock_t usedlen),
@@ -659,7 +659,7 @@ TRACE_EVENT(xfs_repair_calc_ag_resblks,
__entry->freelen,
__entry->usedlen)
)
-TRACE_EVENT(xfs_repair_calc_ag_resblks_btsize,
+TRACE_EVENT(xrep_calc_ag_resblks_btsize,
TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
xfs_agblock_t bnobt_sz, xfs_agblock_t inobt_sz,
xfs_agblock_t rmapbt_sz, xfs_agblock_t refcbt_sz),
@@ -688,7 +688,7 @@ TRACE_EVENT(xfs_repair_calc_ag_resblks_btsize,
__entry->rmapbt_sz,
__entry->refcbt_sz)
)
-TRACE_EVENT(xfs_repair_reset_counters,
+TRACE_EVENT(xrep_reset_counters,
TP_PROTO(struct xfs_mount *mp),
TP_ARGS(mp),
TP_STRUCT__entry(
@@ -701,7 +701,7 @@ TRACE_EVENT(xfs_repair_reset_counters,
MAJOR(__entry->dev), MINOR(__entry->dev))
)
-TRACE_EVENT(xfs_repair_ialloc_insert,
+TRACE_EVENT(xrep_ialloc_insert,
TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
xfs_agino_t startino, uint16_t holemask, uint8_t count,
uint8_t freecount, uint64_t freemask),
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 7/8] xfs: shorten struct xfs_scrub_context to struct xfs_scrub
2018-07-18 15:50 [PATCH 0/8] xfs-4.19: fixes & cleanups Darrick J. Wong
` (5 preceding siblings ...)
2018-07-18 15:51 ` [PATCH 6/8] xfs: shorten xfs_repair_ prefix to xrep_ Darrick J. Wong
@ 2018-07-18 15:52 ` Darrick J. Wong
2018-07-19 12:59 ` Brian Foster
2018-07-18 15:52 ` [PATCH 8/8] xfs: fix indentation and other whitespace problems in scrub/repair Darrick J. Wong
7 siblings, 1 reply; 30+ messages in thread
From: Darrick J. Wong @ 2018-07-18 15:52 UTC (permalink / raw)
To: darrick.wong; +Cc: linux-xfs
From: Darrick J. Wong <darrick.wong@oracle.com>
Shorten the name of the online fsck context structure. Whitespace
damage will be fixed by a subsequent patch. There are no functional
changes.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
| 32 +++++++--------
| 2 -
fs/xfs/scrub/alloc.c | 14 +++---
fs/xfs/scrub/attr.c | 10 ++---
fs/xfs/scrub/bmap.c | 22 +++++-----
fs/xfs/scrub/btree.c | 14 +++---
fs/xfs/scrub/btree.h | 12 +++--
fs/xfs/scrub/common.c | 62 ++++++++++++++--------------
fs/xfs/scrub/common.h | 88 ++++++++++++++++++++--------------------
fs/xfs/scrub/dabtree.c | 6 +--
fs/xfs/scrub/dabtree.h | 4 +-
fs/xfs/scrub/dir.c | 18 ++++----
fs/xfs/scrub/ialloc.c | 22 +++++-----
fs/xfs/scrub/inode.c | 22 +++++-----
fs/xfs/scrub/parent.c | 8 ++--
fs/xfs/scrub/quota.c | 12 +++--
fs/xfs/scrub/refcount.c | 16 ++++---
fs/xfs/scrub/repair.c | 36 ++++++++--------
fs/xfs/scrub/repair.h | 38 +++++++++--------
fs/xfs/scrub/rmap.c | 16 ++++---
fs/xfs/scrub/rtbitmap.c | 10 ++---
fs/xfs/scrub/scrub.c | 10 ++---
fs/xfs/scrub/scrub.h | 78 ++++++++++++++++++-----------------
fs/xfs/scrub/symlink.c | 4 +-
fs/xfs/scrub/trace.h | 32 +++++++--------
25 files changed, 294 insertions(+), 294 deletions(-)
--git a/fs/xfs/scrub/agheader.c b/fs/xfs/scrub/agheader.c
index c0625ec16d63..14ba4189ae8f 100644
--- a/fs/xfs/scrub/agheader.c
+++ b/fs/xfs/scrub/agheader.c
@@ -29,7 +29,7 @@
/* Cross-reference with the other btrees. */
STATIC void
xchk_superblock_xref(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_buf *bp)
{
struct xfs_owner_info oinfo;
@@ -66,7 +66,7 @@ xchk_superblock_xref(
*/
int
xchk_superblock(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
struct xfs_mount *mp = sc->mp;
struct xfs_buf *bp;
@@ -365,7 +365,7 @@ xchk_agf_record_bno_lengths(
/* Check agf_freeblks */
static inline void
xchk_agf_xref_freeblks(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
struct xfs_agf *agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
xfs_extlen_t blocks = 0;
@@ -385,7 +385,7 @@ xchk_agf_xref_freeblks(
/* Cross reference the AGF with the cntbt (freespace by length btree) */
static inline void
xchk_agf_xref_cntbt(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
struct xfs_agf *agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
xfs_agblock_t agbno;
@@ -417,7 +417,7 @@ xchk_agf_xref_cntbt(
/* Check the btree block counts in the AGF against the btrees. */
STATIC void
xchk_agf_xref_btreeblks(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
struct xfs_agf *agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
struct xfs_mount *mp = sc->mp;
@@ -463,7 +463,7 @@ xchk_agf_xref_btreeblks(
/* Check agf_refcount_blocks against tree size */
static inline void
xchk_agf_xref_refcblks(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
struct xfs_agf *agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
xfs_agblock_t blocks;
@@ -482,7 +482,7 @@ xchk_agf_xref_refcblks(
/* Cross-reference with the other btrees. */
STATIC void
xchk_agf_xref(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
struct xfs_owner_info oinfo;
struct xfs_mount *mp = sc->mp;
@@ -514,7 +514,7 @@ xchk_agf_xref(
/* Scrub the AGF. */
int
xchk_agf(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
struct xfs_mount *mp = sc->mp;
struct xfs_agf *agf;
@@ -602,13 +602,13 @@ struct xchk_agfl_info {
unsigned int sz_entries;
unsigned int nr_entries;
xfs_agblock_t *entries;
- struct xfs_scrub_context *sc;
+ struct xfs_scrub *sc;
};
/* Cross-reference with the other btrees. */
STATIC void
xchk_agfl_block_xref(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_agblock_t agbno,
struct xfs_owner_info *oinfo)
{
@@ -629,7 +629,7 @@ xchk_agfl_block(
void *priv)
{
struct xchk_agfl_info *sai = priv;
- struct xfs_scrub_context *sc = sai->sc;
+ struct xfs_scrub *sc = sai->sc;
xfs_agnumber_t agno = sc->sa.agno;
if (xfs_verify_agbno(mp, agno, agbno) &&
@@ -660,7 +660,7 @@ xchk_agblock_cmp(
/* Cross-reference with the other btrees. */
STATIC void
xchk_agfl_xref(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
struct xfs_owner_info oinfo;
struct xfs_mount *mp = sc->mp;
@@ -691,7 +691,7 @@ xchk_agfl_xref(
/* Scrub the AGFL. */
int
xchk_agfl(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
struct xchk_agfl_info sai;
struct xfs_agf *agf;
@@ -768,7 +768,7 @@ xchk_agfl(
/* Check agi_count/agi_freecount */
static inline void
xchk_agi_xref_icounts(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
struct xfs_agi *agi = XFS_BUF_TO_AGI(sc->sa.agi_bp);
xfs_agino_t icount;
@@ -789,7 +789,7 @@ xchk_agi_xref_icounts(
/* Cross-reference with the other btrees. */
STATIC void
xchk_agi_xref(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
struct xfs_owner_info oinfo;
struct xfs_mount *mp = sc->mp;
@@ -818,7 +818,7 @@ xchk_agi_xref(
/* Scrub the AGI. */
int
xchk_agi(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
struct xfs_mount *mp = sc->mp;
struct xfs_agi *agi;
--git a/fs/xfs/scrub/agheader_repair.c b/fs/xfs/scrub/agheader_repair.c
index 631940f3ca4d..2457968482f8 100644
--- a/fs/xfs/scrub/agheader_repair.c
+++ b/fs/xfs/scrub/agheader_repair.c
@@ -29,7 +29,7 @@
/* Repair the superblock. */
int
xrep_superblock(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
struct xfs_mount *mp = sc->mp;
struct xfs_buf *bp;
diff --git a/fs/xfs/scrub/alloc.c b/fs/xfs/scrub/alloc.c
index 1f6e3a6a1fdd..653d80b3aa39 100644
--- a/fs/xfs/scrub/alloc.c
+++ b/fs/xfs/scrub/alloc.c
@@ -29,7 +29,7 @@
*/
int
xchk_setup_ag_allocbt(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_inode *ip)
{
return xchk_setup_ag_btree(sc, ip, false);
@@ -42,7 +42,7 @@ xchk_setup_ag_allocbt(
*/
STATIC void
xchk_allocbt_xref_other(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_agblock_t agbno,
xfs_extlen_t len)
{
@@ -82,7 +82,7 @@ xchk_allocbt_xref_other(
/* Cross-reference with the other btrees. */
STATIC void
xchk_allocbt_xref(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_agblock_t agbno,
xfs_extlen_t len)
{
@@ -123,7 +123,7 @@ xchk_allocbt_rec(
/* Scrub the freespace btrees for some AG. */
STATIC int
xchk_allocbt(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_btnum_t which)
{
struct xfs_owner_info oinfo;
@@ -136,14 +136,14 @@ xchk_allocbt(
int
xchk_bnobt(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
return xchk_allocbt(sc, XFS_BTNUM_BNO);
}
int
xchk_cntbt(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
return xchk_allocbt(sc, XFS_BTNUM_CNT);
}
@@ -151,7 +151,7 @@ xchk_cntbt(
/* xref check that the extent is not free */
void
xchk_xref_is_used_space(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_agblock_t agbno,
xfs_extlen_t len)
{
diff --git a/fs/xfs/scrub/attr.c b/fs/xfs/scrub/attr.c
index 0068bebddf3e..6650fb3010b6 100644
--- a/fs/xfs/scrub/attr.c
+++ b/fs/xfs/scrub/attr.c
@@ -33,7 +33,7 @@
/* Set us up to scrub an inode's extended attributes. */
int
xchk_setup_xattr(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_inode *ip)
{
size_t sz;
@@ -57,7 +57,7 @@ xchk_setup_xattr(
struct xchk_xattr {
struct xfs_attr_list_context context;
- struct xfs_scrub_context *sc;
+ struct xfs_scrub *sc;
};
/*
@@ -127,7 +127,7 @@ xchk_xattr_listent(
*/
STATIC bool
xchk_xattr_set_map(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
unsigned long *map,
unsigned int start,
unsigned int len)
@@ -155,7 +155,7 @@ xchk_xattr_set_map(
*/
STATIC bool
xchk_xattr_check_freemap(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
unsigned long *map,
struct xfs_attr3_icleaf_hdr *leafhdr)
{
@@ -405,7 +405,7 @@ xchk_xattr_rec(
/* Scrub the extended attribute metadata. */
int
xchk_xattr(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
struct xchk_xattr sx;
struct attrlist_cursor_kern cursor = { 0 };
diff --git a/fs/xfs/scrub/bmap.c b/fs/xfs/scrub/bmap.c
index 19cfbd3910a2..0e5166232b15 100644
--- a/fs/xfs/scrub/bmap.c
+++ b/fs/xfs/scrub/bmap.c
@@ -34,7 +34,7 @@
/* Set us up with an inode's bmap. */
int
xchk_setup_inode_bmap(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_inode *ip)
{
int error;
@@ -79,7 +79,7 @@ xchk_setup_inode_bmap(
*/
struct xchk_bmap_info {
- struct xfs_scrub_context *sc;
+ struct xfs_scrub *sc;
xfs_fileoff_t lastoff;
bool is_rt;
bool is_shared;
@@ -391,7 +391,7 @@ xchk_bmapbt_rec(
/* Scan the btree records. */
STATIC int
xchk_bmap_btree(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
int whichfork,
struct xchk_bmap_info *info)
{
@@ -409,7 +409,7 @@ xchk_bmap_btree(
}
struct xchk_bmap_check_rmap_info {
- struct xfs_scrub_context *sc;
+ struct xfs_scrub *sc;
int whichfork;
struct xfs_iext_cursor icur;
};
@@ -424,7 +424,7 @@ xchk_bmap_check_rmap(
struct xfs_bmbt_irec irec;
struct xchk_bmap_check_rmap_info *sbcri = priv;
struct xfs_ifork *ifp;
- struct xfs_scrub_context *sc = sbcri->sc;
+ struct xfs_scrub *sc = sbcri->sc;
bool have_map;
/* Is this even the right fork? */
@@ -488,7 +488,7 @@ xchk_bmap_check_rmap(
/* Make sure each rmap has a corresponding bmbt entry. */
STATIC int
xchk_bmap_check_ag_rmaps(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
int whichfork,
xfs_agnumber_t agno)
{
@@ -522,7 +522,7 @@ xchk_bmap_check_ag_rmaps(
/* Make sure each rmap has a corresponding bmbt entry. */
STATIC int
xchk_bmap_check_rmaps(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
int whichfork)
{
loff_t size;
@@ -579,7 +579,7 @@ xchk_bmap_check_rmaps(
*/
STATIC int
xchk_bmap(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
int whichfork)
{
struct xfs_bmbt_irec irec;
@@ -694,7 +694,7 @@ xchk_bmap(
/* Scrub an inode's data fork. */
int
xchk_bmap_data(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
return xchk_bmap(sc, XFS_DATA_FORK);
}
@@ -702,7 +702,7 @@ xchk_bmap_data(
/* Scrub an inode's attr fork. */
int
xchk_bmap_attr(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
return xchk_bmap(sc, XFS_ATTR_FORK);
}
@@ -710,7 +710,7 @@ xchk_bmap_attr(
/* Scrub an inode's CoW fork. */
int
xchk_bmap_cow(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
if (!xfs_is_reflink_inode(sc->ip))
return -ENOENT;
diff --git a/fs/xfs/scrub/btree.c b/fs/xfs/scrub/btree.c
index 30fe9a147959..c4e1dce8c5b3 100644
--- a/fs/xfs/scrub/btree.c
+++ b/fs/xfs/scrub/btree.c
@@ -30,7 +30,7 @@
*/
static bool
__xchk_btree_process_error(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_btree_cur *cur,
int level,
int *error,
@@ -65,7 +65,7 @@ __xchk_btree_process_error(
bool
xchk_btree_process_error(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_btree_cur *cur,
int level,
int *error)
@@ -76,7 +76,7 @@ xchk_btree_process_error(
bool
xchk_btree_xref_process_error(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_btree_cur *cur,
int level,
int *error)
@@ -88,7 +88,7 @@ xchk_btree_xref_process_error(
/* Record btree block corruption. */
static void
__xchk_btree_set_corrupt(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_btree_cur *cur,
int level,
__u32 errflag,
@@ -106,7 +106,7 @@ __xchk_btree_set_corrupt(
void
xchk_btree_set_corrupt(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_btree_cur *cur,
int level)
{
@@ -116,7 +116,7 @@ xchk_btree_set_corrupt(
void
xchk_btree_xref_set_corrupt(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_btree_cur *cur,
int level)
{
@@ -583,7 +583,7 @@ xchk_btree_block_keys(
*/
int
xchk_btree(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_btree_cur *cur,
xchk_btree_rec_fn scrub_fn,
struct xfs_owner_info *oinfo,
diff --git a/fs/xfs/scrub/btree.h b/fs/xfs/scrub/btree.h
index 598ac04a6c3e..a0b74b515b9b 100644
--- a/fs/xfs/scrub/btree.h
+++ b/fs/xfs/scrub/btree.h
@@ -9,20 +9,20 @@
/* btree scrub */
/* Check for btree operation errors. */
-bool xchk_btree_process_error(struct xfs_scrub_context *sc,
+bool xchk_btree_process_error(struct xfs_scrub *sc,
struct xfs_btree_cur *cur, int level, int *error);
/* Check for btree xref operation errors. */
-bool xchk_btree_xref_process_error(struct xfs_scrub_context *sc,
+bool xchk_btree_xref_process_error(struct xfs_scrub *sc,
struct xfs_btree_cur *cur, int level,
int *error);
/* Check for btree corruption. */
-void xchk_btree_set_corrupt(struct xfs_scrub_context *sc,
+void xchk_btree_set_corrupt(struct xfs_scrub *sc,
struct xfs_btree_cur *cur, int level);
/* Check for btree xref discrepancies. */
-void xchk_btree_xref_set_corrupt(struct xfs_scrub_context *sc,
+void xchk_btree_xref_set_corrupt(struct xfs_scrub *sc,
struct xfs_btree_cur *cur, int level);
struct xchk_btree;
@@ -32,7 +32,7 @@ typedef int (*xchk_btree_rec_fn)(
struct xchk_btree {
/* caller-provided scrub state */
- struct xfs_scrub_context *sc;
+ struct xfs_scrub *sc;
struct xfs_btree_cur *cur;
xchk_btree_rec_fn scrub_rec;
struct xfs_owner_info *oinfo;
@@ -45,7 +45,7 @@ struct xchk_btree {
bool firstkey[XFS_BTREE_MAXLEVELS];
struct list_head to_check;
};
-int xchk_btree(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur,
+int xchk_btree(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
xchk_btree_rec_fn scrub_fn,
struct xfs_owner_info *oinfo, void *private);
diff --git a/fs/xfs/scrub/common.c b/fs/xfs/scrub/common.c
index fa1c16063d17..81e8bb7d5486 100644
--- a/fs/xfs/scrub/common.c
+++ b/fs/xfs/scrub/common.c
@@ -69,7 +69,7 @@
/* Check for operational errors. */
static bool
__xchk_process_error(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_agnumber_t agno,
xfs_agblock_t bno,
int *error,
@@ -99,7 +99,7 @@ __xchk_process_error(
bool
xchk_process_error(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_agnumber_t agno,
xfs_agblock_t bno,
int *error)
@@ -110,7 +110,7 @@ xchk_process_error(
bool
xchk_xref_process_error(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_agnumber_t agno,
xfs_agblock_t bno,
int *error)
@@ -122,7 +122,7 @@ xchk_xref_process_error(
/* Check for operational errors for a file offset. */
static bool
__xchk_fblock_process_error(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
int whichfork,
xfs_fileoff_t offset,
int *error,
@@ -152,7 +152,7 @@ __xchk_fblock_process_error(
bool
xchk_fblock_process_error(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
int whichfork,
xfs_fileoff_t offset,
int *error)
@@ -163,7 +163,7 @@ xchk_fblock_process_error(
bool
xchk_fblock_xref_process_error(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
int whichfork,
xfs_fileoff_t offset,
int *error)
@@ -187,7 +187,7 @@ xchk_fblock_xref_process_error(
/* Record a block which could be optimized. */
void
xchk_block_set_preen(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_buf *bp)
{
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_PREEN;
@@ -201,7 +201,7 @@ xchk_block_set_preen(
*/
void
xchk_ino_set_preen(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_ino_t ino)
{
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_PREEN;
@@ -211,7 +211,7 @@ xchk_ino_set_preen(
/* Record a corrupt block. */
void
xchk_block_set_corrupt(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_buf *bp)
{
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT;
@@ -221,7 +221,7 @@ xchk_block_set_corrupt(
/* Record a corruption while cross-referencing. */
void
xchk_block_xref_set_corrupt(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_buf *bp)
{
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_XCORRUPT;
@@ -235,7 +235,7 @@ xchk_block_xref_set_corrupt(
*/
void
xchk_ino_set_corrupt(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_ino_t ino)
{
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT;
@@ -245,7 +245,7 @@ xchk_ino_set_corrupt(
/* Record a corruption while cross-referencing with an inode. */
void
xchk_ino_xref_set_corrupt(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_ino_t ino)
{
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_XCORRUPT;
@@ -255,7 +255,7 @@ xchk_ino_xref_set_corrupt(
/* Record corruption in a block indexed by a file fork. */
void
xchk_fblock_set_corrupt(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
int whichfork,
xfs_fileoff_t offset)
{
@@ -266,7 +266,7 @@ xchk_fblock_set_corrupt(
/* Record a corruption while cross-referencing a fork block. */
void
xchk_fblock_xref_set_corrupt(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
int whichfork,
xfs_fileoff_t offset)
{
@@ -280,7 +280,7 @@ xchk_fblock_xref_set_corrupt(
*/
void
xchk_ino_set_warning(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_ino_t ino)
{
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_WARNING;
@@ -290,7 +290,7 @@ xchk_ino_set_warning(
/* Warn about a block indexed by a file fork that needs review. */
void
xchk_fblock_set_warning(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
int whichfork,
xfs_fileoff_t offset)
{
@@ -301,7 +301,7 @@ xchk_fblock_set_warning(
/* Signal an incomplete scrub. */
void
xchk_set_incomplete(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_INCOMPLETE;
trace_xchk_incomplete(sc, __return_address);
@@ -345,7 +345,7 @@ xchk_count_rmap_ownedby_irec(
*/
int
xchk_count_rmap_ownedby_ag(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_btree_cur *cur,
struct xfs_owner_info *oinfo,
xfs_filblks_t *blocks)
@@ -371,7 +371,7 @@ xchk_count_rmap_ownedby_ag(
/* Decide if we want to return an AG header read failure. */
static inline bool
want_ag_read_header_failure(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
unsigned int type)
{
/* Return all AG header read failures when scanning btrees. */
@@ -398,7 +398,7 @@ want_ag_read_header_failure(
*/
int
xchk_ag_read_headers(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_agnumber_t agno,
struct xfs_buf **agi,
struct xfs_buf **agf,
@@ -452,7 +452,7 @@ xchk_ag_btcur_free(
/* Initialize all the btree cursors for an AG. */
int
xchk_ag_btcur_init(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xchk_ag *sa)
{
struct xfs_mount *mp = sc->mp;
@@ -512,7 +512,7 @@ xchk_ag_btcur_init(
/* Release the AG header context and btree cursors. */
void
xchk_ag_free(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xchk_ag *sa)
{
xchk_ag_btcur_free(sa);
@@ -544,7 +544,7 @@ xchk_ag_free(
*/
int
xchk_ag_init(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_agnumber_t agno,
struct xchk_ag *sa)
{
@@ -586,7 +586,7 @@ xchk_perag_get(
*/
int
xchk_trans_alloc(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
uint resblks)
{
if (sc->sm->sm_flags & XFS_SCRUB_IFLAG_REPAIR)
@@ -599,7 +599,7 @@ xchk_trans_alloc(
/* Set us up with a transaction and an empty context. */
int
xchk_setup_fs(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_inode *ip)
{
uint resblks;
@@ -611,7 +611,7 @@ xchk_setup_fs(
/* Set us up with AG headers and btree cursors. */
int
xchk_setup_ag_btree(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_inode *ip,
bool force_log)
{
@@ -658,7 +658,7 @@ xchk_checkpoint_log(
*/
int
xchk_get_inode(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_inode *ip_in)
{
struct xfs_imap imap;
@@ -722,7 +722,7 @@ xchk_get_inode(
/* Set us up to scrub a file's contents. */
int
xchk_setup_inode_contents(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_inode *ip,
unsigned int resblks)
{
@@ -753,7 +753,7 @@ xchk_setup_inode_contents(
*/
bool
xchk_should_check_xref(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
int *error,
struct xfs_btree_cur **curpp)
{
@@ -788,7 +788,7 @@ xchk_should_check_xref(
/* Run the structure verifiers on in-memory buffers to detect bad memory. */
void
xchk_buffer_recheck(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_buf *bp)
{
xfs_failaddr_t fa;
@@ -814,7 +814,7 @@ xchk_buffer_recheck(
*/
int
xchk_metadata_inode_forks(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
__u32 smtype;
bool shared;
diff --git a/fs/xfs/scrub/common.h b/fs/xfs/scrub/common.h
index 5881cb2ecc26..c321230d32dc 100644
--- a/fs/xfs/scrub/common.h
+++ b/fs/xfs/scrub/common.h
@@ -13,7 +13,7 @@
*/
static inline bool
xchk_should_terminate(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
int *error)
{
if (fatal_signal_pending(current)) {
@@ -24,109 +24,109 @@ xchk_should_terminate(
return false;
}
-int xchk_trans_alloc(struct xfs_scrub_context *sc, uint resblks);
-bool xchk_process_error(struct xfs_scrub_context *sc, xfs_agnumber_t agno,
+int xchk_trans_alloc(struct xfs_scrub *sc, uint resblks);
+bool xchk_process_error(struct xfs_scrub *sc, xfs_agnumber_t agno,
xfs_agblock_t bno, int *error);
-bool xchk_fblock_process_error(struct xfs_scrub_context *sc, int whichfork,
+bool xchk_fblock_process_error(struct xfs_scrub *sc, int whichfork,
xfs_fileoff_t offset, int *error);
-bool xchk_xref_process_error(struct xfs_scrub_context *sc,
+bool xchk_xref_process_error(struct xfs_scrub *sc,
xfs_agnumber_t agno, xfs_agblock_t bno, int *error);
-bool xchk_fblock_xref_process_error(struct xfs_scrub_context *sc,
+bool xchk_fblock_xref_process_error(struct xfs_scrub *sc,
int whichfork, xfs_fileoff_t offset, int *error);
-void xchk_block_set_preen(struct xfs_scrub_context *sc,
+void xchk_block_set_preen(struct xfs_scrub *sc,
struct xfs_buf *bp);
-void xchk_ino_set_preen(struct xfs_scrub_context *sc, xfs_ino_t ino);
+void xchk_ino_set_preen(struct xfs_scrub *sc, xfs_ino_t ino);
-void xchk_block_set_corrupt(struct xfs_scrub_context *sc,
+void xchk_block_set_corrupt(struct xfs_scrub *sc,
struct xfs_buf *bp);
-void xchk_ino_set_corrupt(struct xfs_scrub_context *sc, xfs_ino_t ino);
-void xchk_fblock_set_corrupt(struct xfs_scrub_context *sc, int whichfork,
+void xchk_ino_set_corrupt(struct xfs_scrub *sc, xfs_ino_t ino);
+void xchk_fblock_set_corrupt(struct xfs_scrub *sc, int whichfork,
xfs_fileoff_t offset);
-void xchk_block_xref_set_corrupt(struct xfs_scrub_context *sc,
+void xchk_block_xref_set_corrupt(struct xfs_scrub *sc,
struct xfs_buf *bp);
-void xchk_ino_xref_set_corrupt(struct xfs_scrub_context *sc,
+void xchk_ino_xref_set_corrupt(struct xfs_scrub *sc,
xfs_ino_t ino);
-void xchk_fblock_xref_set_corrupt(struct xfs_scrub_context *sc,
+void xchk_fblock_xref_set_corrupt(struct xfs_scrub *sc,
int whichfork, xfs_fileoff_t offset);
-void xchk_ino_set_warning(struct xfs_scrub_context *sc, xfs_ino_t ino);
-void xchk_fblock_set_warning(struct xfs_scrub_context *sc, int whichfork,
+void xchk_ino_set_warning(struct xfs_scrub *sc, xfs_ino_t ino);
+void xchk_fblock_set_warning(struct xfs_scrub *sc, int whichfork,
xfs_fileoff_t offset);
-void xchk_set_incomplete(struct xfs_scrub_context *sc);
+void xchk_set_incomplete(struct xfs_scrub *sc);
int xchk_checkpoint_log(struct xfs_mount *mp);
/* Are we set up for a cross-referencing check? */
-bool xchk_should_check_xref(struct xfs_scrub_context *sc, int *error,
+bool xchk_should_check_xref(struct xfs_scrub *sc, int *error,
struct xfs_btree_cur **curpp);
/* Setup functions */
-int xchk_setup_fs(struct xfs_scrub_context *sc, struct xfs_inode *ip);
-int xchk_setup_ag_allocbt(struct xfs_scrub_context *sc,
+int xchk_setup_fs(struct xfs_scrub *sc, struct xfs_inode *ip);
+int xchk_setup_ag_allocbt(struct xfs_scrub *sc,
struct xfs_inode *ip);
-int xchk_setup_ag_iallocbt(struct xfs_scrub_context *sc,
+int xchk_setup_ag_iallocbt(struct xfs_scrub *sc,
struct xfs_inode *ip);
-int xchk_setup_ag_rmapbt(struct xfs_scrub_context *sc,
+int xchk_setup_ag_rmapbt(struct xfs_scrub *sc,
struct xfs_inode *ip);
-int xchk_setup_ag_refcountbt(struct xfs_scrub_context *sc,
+int xchk_setup_ag_refcountbt(struct xfs_scrub *sc,
struct xfs_inode *ip);
-int xchk_setup_inode(struct xfs_scrub_context *sc,
+int xchk_setup_inode(struct xfs_scrub *sc,
struct xfs_inode *ip);
-int xchk_setup_inode_bmap(struct xfs_scrub_context *sc,
+int xchk_setup_inode_bmap(struct xfs_scrub *sc,
struct xfs_inode *ip);
-int xchk_setup_inode_bmap_data(struct xfs_scrub_context *sc,
+int xchk_setup_inode_bmap_data(struct xfs_scrub *sc,
struct xfs_inode *ip);
-int xchk_setup_directory(struct xfs_scrub_context *sc,
+int xchk_setup_directory(struct xfs_scrub *sc,
struct xfs_inode *ip);
-int xchk_setup_xattr(struct xfs_scrub_context *sc,
+int xchk_setup_xattr(struct xfs_scrub *sc,
struct xfs_inode *ip);
-int xchk_setup_symlink(struct xfs_scrub_context *sc,
+int xchk_setup_symlink(struct xfs_scrub *sc,
struct xfs_inode *ip);
-int xchk_setup_parent(struct xfs_scrub_context *sc,
+int xchk_setup_parent(struct xfs_scrub *sc,
struct xfs_inode *ip);
#ifdef CONFIG_XFS_RT
-int xchk_setup_rt(struct xfs_scrub_context *sc, struct xfs_inode *ip);
+int xchk_setup_rt(struct xfs_scrub *sc, struct xfs_inode *ip);
#else
static inline int
-xchk_setup_rt(struct xfs_scrub_context *sc, struct xfs_inode *ip)
+xchk_setup_rt(struct xfs_scrub *sc, struct xfs_inode *ip)
{
return -ENOENT;
}
#endif
#ifdef CONFIG_XFS_QUOTA
-int xchk_setup_quota(struct xfs_scrub_context *sc, struct xfs_inode *ip);
+int xchk_setup_quota(struct xfs_scrub *sc, struct xfs_inode *ip);
#else
static inline int
-xchk_setup_quota(struct xfs_scrub_context *sc, struct xfs_inode *ip)
+xchk_setup_quota(struct xfs_scrub *sc, struct xfs_inode *ip)
{
return -ENOENT;
}
#endif
-void xchk_ag_free(struct xfs_scrub_context *sc, struct xchk_ag *sa);
-int xchk_ag_init(struct xfs_scrub_context *sc, xfs_agnumber_t agno,
+void xchk_ag_free(struct xfs_scrub *sc, struct xchk_ag *sa);
+int xchk_ag_init(struct xfs_scrub *sc, xfs_agnumber_t agno,
struct xchk_ag *sa);
void xchk_perag_get(struct xfs_mount *mp, struct xchk_ag *sa);
-int xchk_ag_read_headers(struct xfs_scrub_context *sc, xfs_agnumber_t agno,
+int xchk_ag_read_headers(struct xfs_scrub *sc, xfs_agnumber_t agno,
struct xfs_buf **agi, struct xfs_buf **agf,
struct xfs_buf **agfl);
void xchk_ag_btcur_free(struct xchk_ag *sa);
-int xchk_ag_btcur_init(struct xfs_scrub_context *sc,
+int xchk_ag_btcur_init(struct xfs_scrub *sc,
struct xchk_ag *sa);
-int xchk_count_rmap_ownedby_ag(struct xfs_scrub_context *sc,
+int xchk_count_rmap_ownedby_ag(struct xfs_scrub *sc,
struct xfs_btree_cur *cur,
struct xfs_owner_info *oinfo,
xfs_filblks_t *blocks);
-int xchk_setup_ag_btree(struct xfs_scrub_context *sc,
+int xchk_setup_ag_btree(struct xfs_scrub *sc,
struct xfs_inode *ip, bool force_log);
-int xchk_get_inode(struct xfs_scrub_context *sc, struct xfs_inode *ip_in);
-int xchk_setup_inode_contents(struct xfs_scrub_context *sc,
+int xchk_get_inode(struct xfs_scrub *sc, struct xfs_inode *ip_in);
+int xchk_setup_inode_contents(struct xfs_scrub *sc,
struct xfs_inode *ip, unsigned int resblks);
-void xchk_buffer_recheck(struct xfs_scrub_context *sc, struct xfs_buf *bp);
+void xchk_buffer_recheck(struct xfs_scrub *sc, struct xfs_buf *bp);
/*
* Don't bother cross-referencing if we already found corruption or cross
@@ -138,7 +138,7 @@ static inline bool xchk_skip_xref(struct xfs_scrub_metadata *sm)
XFS_SCRUB_OFLAG_XCORRUPT);
}
-int xchk_metadata_inode_forks(struct xfs_scrub_context *sc);
+int xchk_metadata_inode_forks(struct xfs_scrub *sc);
int xchk_ilock_inverted(struct xfs_inode *ip, uint lock_mode);
#endif /* __XFS_SCRUB_COMMON_H__ */
diff --git a/fs/xfs/scrub/dabtree.c b/fs/xfs/scrub/dabtree.c
index fee80f6ddfd7..7fc12d540ea6 100644
--- a/fs/xfs/scrub/dabtree.c
+++ b/fs/xfs/scrub/dabtree.c
@@ -40,7 +40,7 @@ xchk_da_process_error(
int level,
int *error)
{
- struct xfs_scrub_context *sc = ds->sc;
+ struct xfs_scrub *sc = ds->sc;
if (*error == 0)
return true;
@@ -75,7 +75,7 @@ xchk_da_set_corrupt(
struct xchk_da_btree *ds,
int level)
{
- struct xfs_scrub_context *sc = ds->sc;
+ struct xfs_scrub *sc = ds->sc;
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT;
@@ -474,7 +474,7 @@ xchk_da_btree_block(
/* Visit all nodes and leaves of a da btree. */
int
xchk_da_btree(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
int whichfork,
xchk_da_btree_rec_fn scrub_fn,
void *private)
diff --git a/fs/xfs/scrub/dabtree.h b/fs/xfs/scrub/dabtree.h
index 80e4af0e2589..a15c03389e8f 100644
--- a/fs/xfs/scrub/dabtree.h
+++ b/fs/xfs/scrub/dabtree.h
@@ -13,7 +13,7 @@ struct xchk_da_btree {
xfs_dahash_t hashes[XFS_DA_NODE_MAXDEPTH];
int maxrecs[XFS_DA_NODE_MAXDEPTH];
struct xfs_da_state *state;
- struct xfs_scrub_context *sc;
+ struct xfs_scrub *sc;
void *private;
/*
@@ -39,7 +39,7 @@ void xchk_da_set_corrupt(struct xchk_da_btree *ds, int level);
int xchk_da_btree_hash(struct xchk_da_btree *ds, int level,
__be32 *hashp);
-int xchk_da_btree(struct xfs_scrub_context *sc, int whichfork,
+int xchk_da_btree(struct xfs_scrub *sc, int whichfork,
xchk_da_btree_rec_fn scrub_fn, void *private);
#endif /* __XFS_SCRUB_DABTREE_H__ */
diff --git a/fs/xfs/scrub/dir.c b/fs/xfs/scrub/dir.c
index 2ac07bb73478..194a3ef69a9f 100644
--- a/fs/xfs/scrub/dir.c
+++ b/fs/xfs/scrub/dir.c
@@ -32,7 +32,7 @@
/* Set us up to scrub directories. */
int
xchk_setup_directory(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_inode *ip)
{
return xchk_setup_inode_contents(sc, ip, 0);
@@ -46,7 +46,7 @@ struct xchk_dir_ctx {
/* VFS fill-directory iterator */
struct dir_context dir_iter;
- struct xfs_scrub_context *sc;
+ struct xfs_scrub *sc;
};
/* Check that an inode's mode matches a given DT_ type. */
@@ -289,7 +289,7 @@ xchk_dir_rec(
*/
STATIC void
xchk_directory_check_free_entry(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_dablk_t lblk,
struct xfs_dir2_data_free *bf,
struct xfs_dir2_data_unused *dup)
@@ -314,7 +314,7 @@ xchk_directory_check_free_entry(
/* Check free space info in a directory data block. */
STATIC int
xchk_directory_data_bestfree(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_dablk_t lblk,
bool is_block)
{
@@ -455,7 +455,7 @@ xchk_directory_data_bestfree(
*/
STATIC void
xchk_directory_check_freesp(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_dablk_t lblk,
struct xfs_buf *dbp,
unsigned int len)
@@ -474,7 +474,7 @@ xchk_directory_check_freesp(
/* Check free space info in a directory leaf1 block. */
STATIC int
xchk_directory_leaf1_bestfree(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_da_args *args,
xfs_dablk_t lblk)
{
@@ -572,7 +572,7 @@ xchk_directory_leaf1_bestfree(
/* Check free space info in a directory freespace block. */
STATIC int
xchk_directory_free_bestfree(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_da_args *args,
xfs_dablk_t lblk)
{
@@ -626,7 +626,7 @@ xchk_directory_free_bestfree(
/* Check free space information in directories. */
STATIC int
xchk_directory_blocks(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
struct xfs_bmbt_irec got;
struct xfs_da_args args;
@@ -770,7 +770,7 @@ xchk_directory_blocks(
/* Scrub a whole directory. */
int
xchk_directory(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
struct xchk_dir_ctx sdc = {
.dir_iter.actor = xchk_dir_actor,
diff --git a/fs/xfs/scrub/ialloc.c b/fs/xfs/scrub/ialloc.c
index 69d652b7299c..6df8eba9f52b 100644
--- a/fs/xfs/scrub/ialloc.c
+++ b/fs/xfs/scrub/ialloc.c
@@ -36,7 +36,7 @@
*/
int
xchk_setup_ag_iallocbt(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_inode *ip)
{
return xchk_setup_ag_btree(sc, ip, sc->try_harder);
@@ -51,7 +51,7 @@ xchk_setup_ag_iallocbt(
*/
static inline void
xchk_iallocbt_chunk_xref_other(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_inobt_rec_incore *irec,
xfs_agino_t agino)
{
@@ -76,7 +76,7 @@ xchk_iallocbt_chunk_xref_other(
/* Cross-reference with the other btrees. */
STATIC void
xchk_iallocbt_chunk_xref(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_inobt_rec_incore *irec,
xfs_agino_t agino,
xfs_agblock_t agbno,
@@ -363,7 +363,7 @@ xchk_iallocbt_rec(
*/
STATIC void
xchk_iallocbt_xref_rmap_btreeblks(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
int which)
{
struct xfs_owner_info oinfo;
@@ -403,7 +403,7 @@ xchk_iallocbt_xref_rmap_btreeblks(
*/
STATIC void
xchk_iallocbt_xref_rmap_inodes(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
int which,
xfs_filblks_t inode_blocks)
{
@@ -427,7 +427,7 @@ xchk_iallocbt_xref_rmap_inodes(
/* Scrub the inode btrees for some AG. */
STATIC int
xchk_iallocbt(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_btnum_t which)
{
struct xfs_btree_cur *cur;
@@ -459,14 +459,14 @@ xchk_iallocbt(
int
xchk_inobt(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
return xchk_iallocbt(sc, XFS_BTNUM_INO);
}
int
xchk_finobt(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
return xchk_iallocbt(sc, XFS_BTNUM_FINO);
}
@@ -474,7 +474,7 @@ xchk_finobt(
/* See if an inode btree has (or doesn't have) an inode chunk record. */
static inline void
xchk_xref_inode_check(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_agblock_t agbno,
xfs_extlen_t len,
struct xfs_btree_cur **icur,
@@ -496,7 +496,7 @@ xchk_xref_inode_check(
/* xref check that the extent is not covered by inodes */
void
xchk_xref_is_not_inode_chunk(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_agblock_t agbno,
xfs_extlen_t len)
{
@@ -507,7 +507,7 @@ xchk_xref_is_not_inode_chunk(
/* xref check that the extent is covered by inodes */
void
xchk_xref_is_inode_chunk(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_agblock_t agbno,
xfs_extlen_t len)
{
diff --git a/fs/xfs/scrub/inode.c b/fs/xfs/scrub/inode.c
index d85fbec39e52..6cc027983c13 100644
--- a/fs/xfs/scrub/inode.c
+++ b/fs/xfs/scrub/inode.c
@@ -38,7 +38,7 @@
*/
int
xchk_setup_inode(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_inode *ip)
{
int error;
@@ -77,7 +77,7 @@ xchk_setup_inode(
/* Validate di_extsize hint. */
STATIC void
xchk_inode_extsize(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_dinode *dip,
xfs_ino_t ino,
uint16_t mode,
@@ -99,7 +99,7 @@ xchk_inode_extsize(
*/
STATIC void
xchk_inode_cowextsize(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_dinode *dip,
xfs_ino_t ino,
uint16_t mode,
@@ -118,7 +118,7 @@ xchk_inode_cowextsize(
/* Make sure the di_flags make sense for the inode. */
STATIC void
xchk_inode_flags(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_dinode *dip,
xfs_ino_t ino,
uint16_t mode,
@@ -163,7 +163,7 @@ xchk_inode_flags(
/* Make sure the di_flags2 make sense for the inode. */
STATIC void
xchk_inode_flags2(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_dinode *dip,
xfs_ino_t ino,
uint16_t mode,
@@ -206,7 +206,7 @@ xchk_inode_flags2(
/* Scrub all the ondisk inode fields. */
STATIC void
xchk_dinode(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_dinode *dip,
xfs_ino_t ino)
{
@@ -426,7 +426,7 @@ xchk_dinode(
*/
static void
xchk_inode_xref_finobt(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_ino_t ino)
{
struct xfs_inobt_rec_incore rec;
@@ -469,7 +469,7 @@ xchk_inode_xref_finobt(
/* Cross reference the inode fields with the forks. */
STATIC void
xchk_inode_xref_bmap(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_dinode *dip)
{
xfs_extnum_t nextents;
@@ -503,7 +503,7 @@ xchk_inode_xref_bmap(
/* Cross-reference with the other btrees. */
STATIC void
xchk_inode_xref(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_ino_t ino,
struct xfs_dinode *dip)
{
@@ -540,7 +540,7 @@ xchk_inode_xref(
*/
static void
xchk_inode_check_reflink_iflag(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_ino_t ino)
{
struct xfs_mount *mp = sc->mp;
@@ -564,7 +564,7 @@ xchk_inode_check_reflink_iflag(
/* Scrub an inode. */
int
xchk_inode(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
struct xfs_dinode di;
int error = 0;
diff --git a/fs/xfs/scrub/parent.c b/fs/xfs/scrub/parent.c
index 0a78d8411f23..808459ad0c35 100644
--- a/fs/xfs/scrub/parent.c
+++ b/fs/xfs/scrub/parent.c
@@ -28,7 +28,7 @@
/* Set us up to scrub parents. */
int
xchk_setup_parent(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_inode *ip)
{
return xchk_setup_inode_contents(sc, ip, 0);
@@ -65,7 +65,7 @@ xchk_parent_actor(
/* Count the number of dentries in the parent dir that point to this inode. */
STATIC int
xchk_parent_count_parent_dentries(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_inode *parent,
xfs_nlink_t *nlink)
{
@@ -121,7 +121,7 @@ xchk_parent_count_parent_dentries(
*/
STATIC int
xchk_parent_validate(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_ino_t dnum,
bool *try_again)
{
@@ -255,7 +255,7 @@ xchk_parent_validate(
/* Scrub a parent pointer. */
int
xchk_parent(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
struct xfs_mount *mp = sc->mp;
xfs_ino_t dnum;
diff --git a/fs/xfs/scrub/quota.c b/fs/xfs/scrub/quota.c
index d1b52dd7efcd..309ebeecfa5d 100644
--- a/fs/xfs/scrub/quota.c
+++ b/fs/xfs/scrub/quota.c
@@ -31,7 +31,7 @@
/* Convert a scrub type code to a DQ flag, or return 0 if error. */
static inline uint
xchk_quota_to_dqtype(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
switch (sc->sm->sm_type) {
case XFS_SCRUB_TYPE_UQUOTA:
@@ -48,7 +48,7 @@ xchk_quota_to_dqtype(
/* Set us up to scrub a quota. */
int
xchk_setup_quota(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_inode *ip)
{
uint dqtype;
@@ -76,7 +76,7 @@ xchk_setup_quota(
/* Quotas. */
struct xchk_quota_info {
- struct xfs_scrub_context *sc;
+ struct xfs_scrub *sc;
xfs_dqid_t last_id;
};
@@ -88,7 +88,7 @@ xchk_quota_item(
void *priv)
{
struct xchk_quota_info *sqi = priv;
- struct xfs_scrub_context *sc = sqi->sc;
+ struct xfs_scrub *sc = sqi->sc;
struct xfs_mount *mp = sc->mp;
struct xfs_disk_dquot *d = &dq->q_core;
struct xfs_quotainfo *qi = mp->m_quotainfo;
@@ -195,7 +195,7 @@ xchk_quota_item(
/* Check the quota's data fork. */
STATIC int
xchk_quota_data_fork(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
struct xfs_bmbt_irec irec = { 0 };
struct xfs_iext_cursor icur;
@@ -234,7 +234,7 @@ xchk_quota_data_fork(
/* Scrub all of a quota type's items. */
int
xchk_quota(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
struct xchk_quota_info sqi;
struct xfs_mount *mp = sc->mp;
diff --git a/fs/xfs/scrub/refcount.c b/fs/xfs/scrub/refcount.c
index 274febc49b23..c1162d408987 100644
--- a/fs/xfs/scrub/refcount.c
+++ b/fs/xfs/scrub/refcount.c
@@ -29,7 +29,7 @@
*/
int
xchk_setup_ag_refcountbt(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_inode *ip)
{
return xchk_setup_ag_btree(sc, ip, false);
@@ -79,7 +79,7 @@ struct xchk_refcnt_frag {
};
struct xchk_refcnt_check {
- struct xfs_scrub_context *sc;
+ struct xfs_scrub *sc;
struct list_head fragments;
/* refcount extent we're examining */
@@ -278,7 +278,7 @@ xchk_refcountbt_process_rmap_fragments(
/* Use the rmap entries covering this extent to verify the refcount. */
STATIC void
xchk_refcountbt_xref_rmap(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_agblock_t bno,
xfs_extlen_t len,
xfs_nlink_t refcount)
@@ -325,7 +325,7 @@ xchk_refcountbt_xref_rmap(
/* Cross-reference with the other btrees. */
STATIC void
xchk_refcountbt_xref(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_agblock_t agbno,
xfs_extlen_t len,
xfs_nlink_t refcount)
@@ -382,7 +382,7 @@ xchk_refcountbt_rec(
/* Make sure we have as many refc blocks as the rmap says. */
STATIC void
xchk_refcount_xref_rmap(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_owner_info *oinfo,
xfs_filblks_t cow_blocks)
{
@@ -417,7 +417,7 @@ xchk_refcount_xref_rmap(
/* Scrub the refcount btree for some AG. */
int
xchk_refcountbt(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
struct xfs_owner_info oinfo;
xfs_agblock_t cow_blocks = 0;
@@ -437,7 +437,7 @@ xchk_refcountbt(
/* xref check that a cow staging extent is marked in the refcountbt. */
void
xchk_xref_is_cow_staging(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_agblock_t agbno,
xfs_extlen_t len)
{
@@ -483,7 +483,7 @@ xchk_xref_is_cow_staging(
*/
void
xchk_xref_is_not_shared(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_agblock_t agbno,
xfs_extlen_t len)
{
diff --git a/fs/xfs/scrub/repair.c b/fs/xfs/scrub/repair.c
index 7e6a56a5f59d..29debd5649ac 100644
--- a/fs/xfs/scrub/repair.c
+++ b/fs/xfs/scrub/repair.c
@@ -43,7 +43,7 @@
int
xrep_attempt(
struct xfs_inode *ip,
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
bool *fixed)
{
int error = 0;
@@ -106,7 +106,7 @@ xrep_failure(
*/
int
xrep_probe(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
int error = 0;
@@ -122,7 +122,7 @@ xrep_probe(
*/
int
xrep_roll_ag_trans(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
int error;
@@ -179,7 +179,7 @@ xrep_ag_has_space(
*/
xfs_extlen_t
xrep_calc_ag_resblks(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
struct xfs_mount *mp = sc->mp;
struct xfs_scrub_metadata *sm = sc->sm;
@@ -279,7 +279,7 @@ xrep_calc_ag_resblks(
/* Allocate a block in an AG. */
int
xrep_alloc_ag_block(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_owner_info *oinfo,
xfs_fsblock_t *fsbno,
enum xfs_ag_resv_type resv)
@@ -330,7 +330,7 @@ xrep_alloc_ag_block(
/* Initialize a new AG btree root block with zero entries. */
int
xrep_init_btblock(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_fsblock_t fsb,
struct xfs_buf **bpp,
xfs_btnum_t btnum,
@@ -385,7 +385,7 @@ xrep_init_btblock(
/* Collect a dead btree extent for later disposal. */
int
xrep_collect_btree_extent(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xrep_extent_list *exlist,
xfs_fsblock_t fsbno,
xfs_extlen_t len)
@@ -415,7 +415,7 @@ xrep_collect_btree_extent(
*/
void
xrep_cancel_btree_extents(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xrep_extent_list *exlist)
{
struct xrep_extent *rex;
@@ -463,7 +463,7 @@ xrep_btree_extent_cmp(
#define RIGHT_ALIGNED (1 << 1)
int
xrep_subtract_extents(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xrep_extent_list *exlist,
struct xrep_extent_list *sublist)
{
@@ -620,7 +620,7 @@ xrep_subtract_extents(
*/
int
xrep_invalidate_blocks(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xrep_extent_list *exlist)
{
struct xrep_extent *rex;
@@ -658,7 +658,7 @@ xrep_invalidate_blocks(
/* Ensure the freelist is the correct size. */
int
xrep_fix_freelist(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
bool can_shrink)
{
struct xfs_alloc_arg args = {0};
@@ -678,7 +678,7 @@ xrep_fix_freelist(
*/
STATIC int
xrep_put_freelist(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_agblock_t agbno)
{
struct xfs_owner_info oinfo;
@@ -714,7 +714,7 @@ xrep_put_freelist(
/* Dispose of a single metadata block. */
STATIC int
xrep_dispose_btree_block(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_fsblock_t fsbno,
struct xfs_owner_info *oinfo,
enum xfs_ag_resv_type resv)
@@ -788,7 +788,7 @@ xrep_dispose_btree_block(
/* Dispose of btree blocks from an old per-AG btree. */
int
xrep_reap_btree_extents(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xrep_extent_list *exlist,
struct xfs_owner_info *oinfo,
enum xfs_ag_resv_type type)
@@ -851,7 +851,7 @@ xrep_reap_btree_extents(
*/
struct xrep_findroot {
- struct xfs_scrub_context *sc;
+ struct xfs_scrub *sc;
struct xfs_buf *agfl_bp;
struct xfs_agf *agf;
struct xrep_find_ag_btree *btree_info;
@@ -981,7 +981,7 @@ xrep_findroot_rmap(
/* Find the roots of the per-AG btrees described in btree_info. */
int
xrep_find_ag_btree_roots(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_buf *agf_bp,
struct xrep_find_ag_btree *btree_info,
struct xfs_buf *agfl_bp)
@@ -1016,7 +1016,7 @@ xrep_find_ag_btree_roots(
/* Force a quotacheck the next time we mount. */
void
xrep_force_quotacheck(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
uint dqtype)
{
uint flag;
@@ -1044,7 +1044,7 @@ xrep_force_quotacheck(
*/
int
xrep_ino_dqattach(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
int error;
diff --git a/fs/xfs/scrub/repair.h b/fs/xfs/scrub/repair.h
index 60d81294797b..677f4b73b5ec 100644
--- a/fs/xfs/scrub/repair.h
+++ b/fs/xfs/scrub/repair.h
@@ -6,7 +6,7 @@
#ifndef __XFS_SCRUB_REPAIR_H__
#define __XFS_SCRUB_REPAIR_H__
-static inline int xrep_notsupported(struct xfs_scrub_context *sc)
+static inline int xrep_notsupported(struct xfs_scrub *sc)
{
return -EOPNOTSUPP;
}
@@ -15,17 +15,17 @@ static inline int xrep_notsupported(struct xfs_scrub_context *sc)
/* Repair helpers */
-int xrep_attempt(struct xfs_inode *ip, struct xfs_scrub_context *sc,
+int xrep_attempt(struct xfs_inode *ip, struct xfs_scrub *sc,
bool *fixed);
void xrep_failure(struct xfs_mount *mp);
-int xrep_roll_ag_trans(struct xfs_scrub_context *sc);
+int xrep_roll_ag_trans(struct xfs_scrub *sc);
bool xrep_ag_has_space(struct xfs_perag *pag, xfs_extlen_t nr_blocks,
enum xfs_ag_resv_type type);
-xfs_extlen_t xrep_calc_ag_resblks(struct xfs_scrub_context *sc);
-int xrep_alloc_ag_block(struct xfs_scrub_context *sc,
+xfs_extlen_t xrep_calc_ag_resblks(struct xfs_scrub *sc);
+int xrep_alloc_ag_block(struct xfs_scrub *sc,
struct xfs_owner_info *oinfo, xfs_fsblock_t *fsbno,
enum xfs_ag_resv_type resv);
-int xrep_init_btblock(struct xfs_scrub_context *sc, xfs_fsblock_t fsb,
+int xrep_init_btblock(struct xfs_scrub *sc, xfs_fsblock_t fsb,
struct xfs_buf **bpp, xfs_btnum_t btnum,
const struct xfs_buf_ops *ops);
@@ -48,18 +48,18 @@ xrep_init_extent_list(
#define for_each_xrep_extent_safe(rbe, n, exlist) \
list_for_each_entry_safe((rbe), (n), &(exlist)->list, list)
-int xrep_collect_btree_extent(struct xfs_scrub_context *sc,
+int xrep_collect_btree_extent(struct xfs_scrub *sc,
struct xrep_extent_list *btlist, xfs_fsblock_t fsbno,
xfs_extlen_t len);
-void xrep_cancel_btree_extents(struct xfs_scrub_context *sc,
+void xrep_cancel_btree_extents(struct xfs_scrub *sc,
struct xrep_extent_list *btlist);
-int xrep_subtract_extents(struct xfs_scrub_context *sc,
+int xrep_subtract_extents(struct xfs_scrub *sc,
struct xrep_extent_list *exlist,
struct xrep_extent_list *sublist);
-int xrep_fix_freelist(struct xfs_scrub_context *sc, bool can_shrink);
-int xrep_invalidate_blocks(struct xfs_scrub_context *sc,
+int xrep_fix_freelist(struct xfs_scrub *sc, bool can_shrink);
+int xrep_invalidate_blocks(struct xfs_scrub *sc,
struct xrep_extent_list *btlist);
-int xrep_reap_btree_extents(struct xfs_scrub_context *sc,
+int xrep_reap_btree_extents(struct xfs_scrub *sc,
struct xrep_extent_list *exlist,
struct xfs_owner_info *oinfo, enum xfs_ag_resv_type type);
@@ -78,23 +78,23 @@ struct xrep_find_ag_btree {
unsigned int height;
};
-int xrep_find_ag_btree_roots(struct xfs_scrub_context *sc,
+int xrep_find_ag_btree_roots(struct xfs_scrub *sc,
struct xfs_buf *agf_bp,
struct xrep_find_ag_btree *btree_info,
struct xfs_buf *agfl_bp);
-void xrep_force_quotacheck(struct xfs_scrub_context *sc, uint dqtype);
-int xrep_ino_dqattach(struct xfs_scrub_context *sc);
+void xrep_force_quotacheck(struct xfs_scrub *sc, uint dqtype);
+int xrep_ino_dqattach(struct xfs_scrub *sc);
/* Metadata repairers */
-int xrep_probe(struct xfs_scrub_context *sc);
-int xrep_superblock(struct xfs_scrub_context *sc);
+int xrep_probe(struct xfs_scrub *sc);
+int xrep_superblock(struct xfs_scrub *sc);
#else
static inline int xrep_attempt(
struct xfs_inode *ip,
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
bool *fixed)
{
return -EOPNOTSUPP;
@@ -104,7 +104,7 @@ static inline void xrep_failure(struct xfs_mount *mp) {}
static inline xfs_extlen_t
xrep_calc_ag_resblks(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
ASSERT(!(sc->sm->sm_flags & XFS_SCRUB_IFLAG_REPAIR));
return 0;
diff --git a/fs/xfs/scrub/rmap.c b/fs/xfs/scrub/rmap.c
index 4b75fc2f31f3..dc9c91a706ff 100644
--- a/fs/xfs/scrub/rmap.c
+++ b/fs/xfs/scrub/rmap.c
@@ -30,7 +30,7 @@
*/
int
xchk_setup_ag_rmapbt(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_inode *ip)
{
return xchk_setup_ag_btree(sc, ip, false);
@@ -41,7 +41,7 @@ xchk_setup_ag_rmapbt(
/* Cross-reference a rmap against the refcount btree. */
STATIC void
xchk_rmapbt_xref_refc(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_rmap_irec *irec)
{
xfs_agblock_t fbno;
@@ -72,7 +72,7 @@ xchk_rmapbt_xref_refc(
/* Cross-reference with the other btrees. */
STATIC void
xchk_rmapbt_xref(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_rmap_irec *irec)
{
xfs_agblock_t agbno = irec->rm_startblock;
@@ -172,7 +172,7 @@ xchk_rmapbt_rec(
/* Scrub the rmap btree for some AG. */
int
xchk_rmapbt(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
struct xfs_owner_info oinfo;
@@ -184,7 +184,7 @@ xchk_rmapbt(
/* xref check that the extent is owned by a given owner */
static inline void
xchk_xref_check_owner(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_agblock_t bno,
xfs_extlen_t len,
struct xfs_owner_info *oinfo,
@@ -207,7 +207,7 @@ xchk_xref_check_owner(
/* xref check that the extent is owned by a given owner */
void
xchk_xref_is_owned_by(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_agblock_t bno,
xfs_extlen_t len,
struct xfs_owner_info *oinfo)
@@ -218,7 +218,7 @@ xchk_xref_is_owned_by(
/* xref check that the extent is not owned by a given owner */
void
xchk_xref_is_not_owned_by(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_agblock_t bno,
xfs_extlen_t len,
struct xfs_owner_info *oinfo)
@@ -229,7 +229,7 @@ xchk_xref_is_not_owned_by(
/* xref check that the extent has no reverse mapping at all */
void
xchk_xref_has_no_owner(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_agblock_t bno,
xfs_extlen_t len)
{
diff --git a/fs/xfs/scrub/rtbitmap.c b/fs/xfs/scrub/rtbitmap.c
index 3f0fc83562ae..653a809bba34 100644
--- a/fs/xfs/scrub/rtbitmap.c
+++ b/fs/xfs/scrub/rtbitmap.c
@@ -26,7 +26,7 @@
/* Set us up with the realtime metadata locked. */
int
xchk_setup_rt(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_inode *ip)
{
int error;
@@ -51,7 +51,7 @@ xchk_rtbitmap_rec(
struct xfs_rtalloc_rec *rec,
void *priv)
{
- struct xfs_scrub_context *sc = priv;
+ struct xfs_scrub *sc = priv;
xfs_rtblock_t startblock;
xfs_rtblock_t blockcount;
@@ -68,7 +68,7 @@ xchk_rtbitmap_rec(
/* Scrub the realtime bitmap. */
int
xchk_rtbitmap(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
int error;
@@ -88,7 +88,7 @@ xchk_rtbitmap(
/* Scrub the realtime summary. */
int
xchk_rtsummary(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
struct xfs_inode *rsumip = sc->mp->m_rsumip;
struct xfs_inode *old_ip = sc->ip;
@@ -125,7 +125,7 @@ xchk_rtsummary(
/* xref check that the extent is not free in the rtbitmap */
void
xchk_xref_is_used_rt_space(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
xfs_rtblock_t fsbno,
xfs_extlen_t len)
{
diff --git a/fs/xfs/scrub/scrub.c b/fs/xfs/scrub/scrub.c
index a6efede6e430..b3c6420ccae5 100644
--- a/fs/xfs/scrub/scrub.c
+++ b/fs/xfs/scrub/scrub.c
@@ -151,7 +151,7 @@
*/
static int
xchk_probe(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
int error = 0;
@@ -166,7 +166,7 @@ xchk_probe(
/* Free all the resources and finish the transactions. */
STATIC int
xchk_teardown(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_inode *ip_in,
int error)
{
@@ -447,7 +447,7 @@ xchk_validate_inputs(
}
#ifdef CONFIG_XFS_ONLINE_REPAIR
-static inline void xchk_postmortem(struct xfs_scrub_context *sc)
+static inline void xchk_postmortem(struct xfs_scrub *sc)
{
/*
* Userspace asked us to repair something, we repaired it, rescanned
@@ -460,7 +460,7 @@ static inline void xchk_postmortem(struct xfs_scrub_context *sc)
xrep_failure(sc->mp);
}
#else
-static inline void xchk_postmortem(struct xfs_scrub_context *sc)
+static inline void xchk_postmortem(struct xfs_scrub *sc)
{
/*
* Userspace asked us to scrub something, it's broken, and we have no
@@ -479,7 +479,7 @@ xfs_scrub_metadata(
struct xfs_inode *ip,
struct xfs_scrub_metadata *sm)
{
- struct xfs_scrub_context sc;
+ struct xfs_scrub sc;
struct xfs_mount *mp = ip->i_mount;
bool try_harder = false;
bool already_fixed = false;
diff --git a/fs/xfs/scrub/scrub.h b/fs/xfs/scrub/scrub.h
index 0f59a47c4bb0..47c75d2f28da 100644
--- a/fs/xfs/scrub/scrub.h
+++ b/fs/xfs/scrub/scrub.h
@@ -6,7 +6,7 @@
#ifndef __XFS_SCRUB_SCRUB_H__
#define __XFS_SCRUB_SCRUB_H__
-struct xfs_scrub_context;
+struct xfs_scrub;
/* Type info and names for the scrub types. */
enum xchk_type {
@@ -18,14 +18,14 @@ enum xchk_type {
struct xchk_meta_ops {
/* Acquire whatever resources are needed for the operation. */
- int (*setup)(struct xfs_scrub_context *,
+ int (*setup)(struct xfs_scrub *,
struct xfs_inode *);
/* Examine metadata for errors. */
- int (*scrub)(struct xfs_scrub_context *);
+ int (*scrub)(struct xfs_scrub *);
/* Repair or optimize the metadata. */
- int (*repair)(struct xfs_scrub_context *);
+ int (*repair)(struct xfs_scrub *);
/* Decide if we even have this piece of metadata. */
bool (*has)(struct xfs_sb *);
@@ -53,7 +53,7 @@ struct xchk_ag {
struct xfs_btree_cur *refc_cur;
};
-struct xfs_scrub_context {
+struct xfs_scrub {
/* General scrub state. */
struct xfs_mount *mp;
struct xfs_scrub_metadata *sm;
@@ -70,71 +70,71 @@ struct xfs_scrub_context {
};
/* Metadata scrubbers */
-int xchk_tester(struct xfs_scrub_context *sc);
-int xchk_superblock(struct xfs_scrub_context *sc);
-int xchk_agf(struct xfs_scrub_context *sc);
-int xchk_agfl(struct xfs_scrub_context *sc);
-int xchk_agi(struct xfs_scrub_context *sc);
-int xchk_bnobt(struct xfs_scrub_context *sc);
-int xchk_cntbt(struct xfs_scrub_context *sc);
-int xchk_inobt(struct xfs_scrub_context *sc);
-int xchk_finobt(struct xfs_scrub_context *sc);
-int xchk_rmapbt(struct xfs_scrub_context *sc);
-int xchk_refcountbt(struct xfs_scrub_context *sc);
-int xchk_inode(struct xfs_scrub_context *sc);
-int xchk_bmap_data(struct xfs_scrub_context *sc);
-int xchk_bmap_attr(struct xfs_scrub_context *sc);
-int xchk_bmap_cow(struct xfs_scrub_context *sc);
-int xchk_directory(struct xfs_scrub_context *sc);
-int xchk_xattr(struct xfs_scrub_context *sc);
-int xchk_symlink(struct xfs_scrub_context *sc);
-int xchk_parent(struct xfs_scrub_context *sc);
+int xchk_tester(struct xfs_scrub *sc);
+int xchk_superblock(struct xfs_scrub *sc);
+int xchk_agf(struct xfs_scrub *sc);
+int xchk_agfl(struct xfs_scrub *sc);
+int xchk_agi(struct xfs_scrub *sc);
+int xchk_bnobt(struct xfs_scrub *sc);
+int xchk_cntbt(struct xfs_scrub *sc);
+int xchk_inobt(struct xfs_scrub *sc);
+int xchk_finobt(struct xfs_scrub *sc);
+int xchk_rmapbt(struct xfs_scrub *sc);
+int xchk_refcountbt(struct xfs_scrub *sc);
+int xchk_inode(struct xfs_scrub *sc);
+int xchk_bmap_data(struct xfs_scrub *sc);
+int xchk_bmap_attr(struct xfs_scrub *sc);
+int xchk_bmap_cow(struct xfs_scrub *sc);
+int xchk_directory(struct xfs_scrub *sc);
+int xchk_xattr(struct xfs_scrub *sc);
+int xchk_symlink(struct xfs_scrub *sc);
+int xchk_parent(struct xfs_scrub *sc);
#ifdef CONFIG_XFS_RT
-int xchk_rtbitmap(struct xfs_scrub_context *sc);
-int xchk_rtsummary(struct xfs_scrub_context *sc);
+int xchk_rtbitmap(struct xfs_scrub *sc);
+int xchk_rtsummary(struct xfs_scrub *sc);
#else
static inline int
-xchk_rtbitmap(struct xfs_scrub_context *sc)
+xchk_rtbitmap(struct xfs_scrub *sc)
{
return -ENOENT;
}
static inline int
-xchk_rtsummary(struct xfs_scrub_context *sc)
+xchk_rtsummary(struct xfs_scrub *sc)
{
return -ENOENT;
}
#endif
#ifdef CONFIG_XFS_QUOTA
-int xchk_quota(struct xfs_scrub_context *sc);
+int xchk_quota(struct xfs_scrub *sc);
#else
static inline int
-xchk_quota(struct xfs_scrub_context *sc)
+xchk_quota(struct xfs_scrub *sc)
{
return -ENOENT;
}
#endif
/* cross-referencing helpers */
-void xchk_xref_is_used_space(struct xfs_scrub_context *sc,
+void xchk_xref_is_used_space(struct xfs_scrub *sc,
xfs_agblock_t agbno, xfs_extlen_t len);
-void xchk_xref_is_not_inode_chunk(struct xfs_scrub_context *sc,
+void xchk_xref_is_not_inode_chunk(struct xfs_scrub *sc,
xfs_agblock_t agbno, xfs_extlen_t len);
-void xchk_xref_is_inode_chunk(struct xfs_scrub_context *sc,
+void xchk_xref_is_inode_chunk(struct xfs_scrub *sc,
xfs_agblock_t agbno, xfs_extlen_t len);
-void xchk_xref_is_owned_by(struct xfs_scrub_context *sc,
+void xchk_xref_is_owned_by(struct xfs_scrub *sc,
xfs_agblock_t agbno, xfs_extlen_t len,
struct xfs_owner_info *oinfo);
-void xchk_xref_is_not_owned_by(struct xfs_scrub_context *sc,
+void xchk_xref_is_not_owned_by(struct xfs_scrub *sc,
xfs_agblock_t agbno, xfs_extlen_t len,
struct xfs_owner_info *oinfo);
-void xchk_xref_has_no_owner(struct xfs_scrub_context *sc,
+void xchk_xref_has_no_owner(struct xfs_scrub *sc,
xfs_agblock_t agbno, xfs_extlen_t len);
-void xchk_xref_is_cow_staging(struct xfs_scrub_context *sc,
+void xchk_xref_is_cow_staging(struct xfs_scrub *sc,
xfs_agblock_t bno, xfs_extlen_t len);
-void xchk_xref_is_not_shared(struct xfs_scrub_context *sc,
+void xchk_xref_is_not_shared(struct xfs_scrub *sc,
xfs_agblock_t bno, xfs_extlen_t len);
#ifdef CONFIG_XFS_RT
-void xchk_xref_is_used_rt_space(struct xfs_scrub_context *sc,
+void xchk_xref_is_used_rt_space(struct xfs_scrub *sc,
xfs_rtblock_t rtbno, xfs_extlen_t len);
#else
# define xchk_xref_is_used_rt_space(sc, rtbno, len) do { } while (0)
diff --git a/fs/xfs/scrub/symlink.c b/fs/xfs/scrub/symlink.c
index e2a288e34337..56c6347e9482 100644
--- a/fs/xfs/scrub/symlink.c
+++ b/fs/xfs/scrub/symlink.c
@@ -26,7 +26,7 @@
/* Set us up to scrub a symbolic link. */
int
xchk_setup_symlink(
- struct xfs_scrub_context *sc,
+ struct xfs_scrub *sc,
struct xfs_inode *ip)
{
/* Allocate the buffer without the inode lock held. */
@@ -41,7 +41,7 @@ xchk_setup_symlink(
int
xchk_symlink(
- struct xfs_scrub_context *sc)
+ struct xfs_scrub *sc)
{
struct xfs_inode *ip = sc->ip;
struct xfs_ifork *ifp;
diff --git a/fs/xfs/scrub/trace.h b/fs/xfs/scrub/trace.h
index 96f3edda3e91..93db22c39b51 100644
--- a/fs/xfs/scrub/trace.h
+++ b/fs/xfs/scrub/trace.h
@@ -59,7 +59,7 @@ DEFINE_SCRUB_EVENT(xrep_attempt);
DEFINE_SCRUB_EVENT(xrep_done);
TRACE_EVENT(xchk_op_error,
- TP_PROTO(struct xfs_scrub_context *sc, xfs_agnumber_t agno,
+ TP_PROTO(struct xfs_scrub *sc, xfs_agnumber_t agno,
xfs_agblock_t bno, int error, void *ret_ip),
TP_ARGS(sc, agno, bno, error, ret_ip),
TP_STRUCT__entry(
@@ -88,7 +88,7 @@ TRACE_EVENT(xchk_op_error,
);
TRACE_EVENT(xchk_file_op_error,
- TP_PROTO(struct xfs_scrub_context *sc, int whichfork,
+ TP_PROTO(struct xfs_scrub *sc, int whichfork,
xfs_fileoff_t offset, int error, void *ret_ip),
TP_ARGS(sc, whichfork, offset, error, ret_ip),
TP_STRUCT__entry(
@@ -120,7 +120,7 @@ TRACE_EVENT(xchk_file_op_error,
);
DECLARE_EVENT_CLASS(xchk_block_error_class,
- TP_PROTO(struct xfs_scrub_context *sc, xfs_daddr_t daddr, void *ret_ip),
+ TP_PROTO(struct xfs_scrub *sc, xfs_daddr_t daddr, void *ret_ip),
TP_ARGS(sc, daddr, ret_ip),
TP_STRUCT__entry(
__field(dev_t, dev)
@@ -154,7 +154,7 @@ DECLARE_EVENT_CLASS(xchk_block_error_class,
#define DEFINE_SCRUB_BLOCK_ERROR_EVENT(name) \
DEFINE_EVENT(xchk_block_error_class, name, \
- TP_PROTO(struct xfs_scrub_context *sc, xfs_daddr_t daddr, \
+ TP_PROTO(struct xfs_scrub *sc, xfs_daddr_t daddr, \
void *ret_ip), \
TP_ARGS(sc, daddr, ret_ip))
@@ -162,7 +162,7 @@ DEFINE_SCRUB_BLOCK_ERROR_EVENT(xchk_block_error);
DEFINE_SCRUB_BLOCK_ERROR_EVENT(xchk_block_preen);
DECLARE_EVENT_CLASS(xchk_ino_error_class,
- TP_PROTO(struct xfs_scrub_context *sc, xfs_ino_t ino, void *ret_ip),
+ TP_PROTO(struct xfs_scrub *sc, xfs_ino_t ino, void *ret_ip),
TP_ARGS(sc, ino, ret_ip),
TP_STRUCT__entry(
__field(dev_t, dev)
@@ -185,7 +185,7 @@ DECLARE_EVENT_CLASS(xchk_ino_error_class,
#define DEFINE_SCRUB_INO_ERROR_EVENT(name) \
DEFINE_EVENT(xchk_ino_error_class, name, \
- TP_PROTO(struct xfs_scrub_context *sc, xfs_ino_t ino, \
+ TP_PROTO(struct xfs_scrub *sc, xfs_ino_t ino, \
void *ret_ip), \
TP_ARGS(sc, ino, ret_ip))
@@ -194,7 +194,7 @@ DEFINE_SCRUB_INO_ERROR_EVENT(xchk_ino_preen);
DEFINE_SCRUB_INO_ERROR_EVENT(xchk_ino_warning);
DECLARE_EVENT_CLASS(xchk_fblock_error_class,
- TP_PROTO(struct xfs_scrub_context *sc, int whichfork,
+ TP_PROTO(struct xfs_scrub *sc, int whichfork,
xfs_fileoff_t offset, void *ret_ip),
TP_ARGS(sc, whichfork, offset, ret_ip),
TP_STRUCT__entry(
@@ -224,7 +224,7 @@ DECLARE_EVENT_CLASS(xchk_fblock_error_class,
#define DEFINE_SCRUB_FBLOCK_ERROR_EVENT(name) \
DEFINE_EVENT(xchk_fblock_error_class, name, \
- TP_PROTO(struct xfs_scrub_context *sc, int whichfork, \
+ TP_PROTO(struct xfs_scrub *sc, int whichfork, \
xfs_fileoff_t offset, void *ret_ip), \
TP_ARGS(sc, whichfork, offset, ret_ip))
@@ -232,7 +232,7 @@ DEFINE_SCRUB_FBLOCK_ERROR_EVENT(xchk_fblock_error);
DEFINE_SCRUB_FBLOCK_ERROR_EVENT(xchk_fblock_warning);
TRACE_EVENT(xchk_incomplete,
- TP_PROTO(struct xfs_scrub_context *sc, void *ret_ip),
+ TP_PROTO(struct xfs_scrub *sc, void *ret_ip),
TP_ARGS(sc, ret_ip),
TP_STRUCT__entry(
__field(dev_t, dev)
@@ -251,7 +251,7 @@ TRACE_EVENT(xchk_incomplete,
);
TRACE_EVENT(xchk_btree_op_error,
- TP_PROTO(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur,
+ TP_PROTO(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
int level, int error, void *ret_ip),
TP_ARGS(sc, cur, level, error, ret_ip),
TP_STRUCT__entry(
@@ -291,7 +291,7 @@ TRACE_EVENT(xchk_btree_op_error,
);
TRACE_EVENT(xchk_ifork_btree_op_error,
- TP_PROTO(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur,
+ TP_PROTO(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
int level, int error, void *ret_ip),
TP_ARGS(sc, cur, level, error, ret_ip),
TP_STRUCT__entry(
@@ -336,7 +336,7 @@ TRACE_EVENT(xchk_ifork_btree_op_error,
);
TRACE_EVENT(xchk_btree_error,
- TP_PROTO(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur,
+ TP_PROTO(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
int level, void *ret_ip),
TP_ARGS(sc, cur, level, ret_ip),
TP_STRUCT__entry(
@@ -372,7 +372,7 @@ TRACE_EVENT(xchk_btree_error,
);
TRACE_EVENT(xchk_ifork_btree_error,
- TP_PROTO(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur,
+ TP_PROTO(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
int level, void *ret_ip),
TP_ARGS(sc, cur, level, ret_ip),
TP_STRUCT__entry(
@@ -414,7 +414,7 @@ TRACE_EVENT(xchk_ifork_btree_error,
);
DECLARE_EVENT_CLASS(xchk_sbtree_class,
- TP_PROTO(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur,
+ TP_PROTO(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
int level),
TP_ARGS(sc, cur, level),
TP_STRUCT__entry(
@@ -451,7 +451,7 @@ DECLARE_EVENT_CLASS(xchk_sbtree_class,
)
#define DEFINE_SCRUB_SBTREE_EVENT(name) \
DEFINE_EVENT(xchk_sbtree_class, name, \
- TP_PROTO(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur, \
+ TP_PROTO(struct xfs_scrub *sc, struct xfs_btree_cur *cur, \
int level), \
TP_ARGS(sc, cur, level))
@@ -459,7 +459,7 @@ DEFINE_SCRUB_SBTREE_EVENT(xchk_btree_rec);
DEFINE_SCRUB_SBTREE_EVENT(xchk_btree_key);
TRACE_EVENT(xchk_xref_error,
- TP_PROTO(struct xfs_scrub_context *sc, int error, void *ret_ip),
+ TP_PROTO(struct xfs_scrub *sc, int error, void *ret_ip),
TP_ARGS(sc, error, ret_ip),
TP_STRUCT__entry(
__field(dev_t, dev)
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 8/8] xfs: fix indentation and other whitespace problems in scrub/repair
2018-07-18 15:50 [PATCH 0/8] xfs-4.19: fixes & cleanups Darrick J. Wong
` (6 preceding siblings ...)
2018-07-18 15:52 ` [PATCH 7/8] xfs: shorten struct xfs_scrub_context to struct xfs_scrub Darrick J. Wong
@ 2018-07-18 15:52 ` Darrick J. Wong
2018-07-19 12:59 ` Brian Foster
7 siblings, 1 reply; 30+ messages in thread
From: Darrick J. Wong @ 2018-07-18 15:52 UTC (permalink / raw)
To: darrick.wong; +Cc: linux-xfs
From: Darrick J. Wong <darrick.wong@oracle.com>
Now that we've shortened everything, fix up all the indentation and
whitespace problems. There are no functional changes.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
| 172 ++++++++++++++++++++--------------------
| 8 +-
fs/xfs/scrub/alloc.c | 48 ++++++-----
fs/xfs/scrub/attr.c | 20 ++---
fs/xfs/scrub/bmap.c | 150 +++++++++++++++++------------------
fs/xfs/scrub/btree.c | 172 ++++++++++++++++++++--------------------
fs/xfs/scrub/btree.h | 25 +++---
fs/xfs/scrub/common.c | 158 ++++++++++++++++++-------------------
fs/xfs/scrub/common.h | 23 ++---
fs/xfs/scrub/dabtree.c | 56 +++++++------
fs/xfs/scrub/dabtree.h | 21 ++---
fs/xfs/scrub/dir.c | 88 ++++++++++----------
fs/xfs/scrub/ialloc.c | 58 +++++++------
fs/xfs/scrub/inode.c | 102 ++++++++++++------------
fs/xfs/scrub/parent.c | 60 +++++++-------
fs/xfs/scrub/quota.c | 68 ++++++++--------
fs/xfs/scrub/refcount.c | 70 ++++++++--------
fs/xfs/scrub/repair.c | 148 +++++++++++++++++-----------------
fs/xfs/scrub/repair.h | 28 +++----
fs/xfs/scrub/rmap.c | 78 +++++++++---------
fs/xfs/scrub/rtbitmap.c | 38 ++++-----
fs/xfs/scrub/scrub.c | 8 +-
fs/xfs/scrub/scrub.h | 62 +++++++-------
fs/xfs/scrub/symlink.c | 10 +-
fs/xfs/scrub/trace.c | 4 -
25 files changed, 832 insertions(+), 843 deletions(-)
--git a/fs/xfs/scrub/agheader.c b/fs/xfs/scrub/agheader.c
index 14ba4189ae8f..3068a9382feb 100644
--- a/fs/xfs/scrub/agheader.c
+++ b/fs/xfs/scrub/agheader.c
@@ -30,13 +30,13 @@
STATIC void
xchk_superblock_xref(
struct xfs_scrub *sc,
- struct xfs_buf *bp)
+ struct xfs_buf *bp)
{
- struct xfs_owner_info oinfo;
- struct xfs_mount *mp = sc->mp;
- xfs_agnumber_t agno = sc->sm->sm_agno;
- xfs_agblock_t agbno;
- int error;
+ struct xfs_owner_info oinfo;
+ struct xfs_mount *mp = sc->mp;
+ xfs_agnumber_t agno = sc->sm->sm_agno;
+ xfs_agblock_t agbno;
+ int error;
if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
return;
@@ -68,14 +68,14 @@ int
xchk_superblock(
struct xfs_scrub *sc)
{
- struct xfs_mount *mp = sc->mp;
- struct xfs_buf *bp;
- struct xfs_dsb *sb;
- xfs_agnumber_t agno;
- uint32_t v2_ok;
- __be32 features_mask;
- int error;
- __be16 vernum_mask;
+ struct xfs_mount *mp = sc->mp;
+ struct xfs_buf *bp;
+ struct xfs_dsb *sb;
+ xfs_agnumber_t agno;
+ uint32_t v2_ok;
+ __be32 features_mask;
+ int error;
+ __be16 vernum_mask;
agno = sc->sm->sm_agno;
if (agno == 0)
@@ -367,9 +367,9 @@ static inline void
xchk_agf_xref_freeblks(
struct xfs_scrub *sc)
{
- struct xfs_agf *agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
- xfs_extlen_t blocks = 0;
- int error;
+ struct xfs_agf *agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
+ xfs_extlen_t blocks = 0;
+ int error;
if (!sc->sa.bno_cur)
return;
@@ -387,11 +387,11 @@ static inline void
xchk_agf_xref_cntbt(
struct xfs_scrub *sc)
{
- struct xfs_agf *agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
- xfs_agblock_t agbno;
- xfs_extlen_t blocks;
- int have;
- int error;
+ struct xfs_agf *agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
+ xfs_agblock_t agbno;
+ xfs_extlen_t blocks;
+ int have;
+ int error;
if (!sc->sa.cnt_cur)
return;
@@ -419,11 +419,11 @@ STATIC void
xchk_agf_xref_btreeblks(
struct xfs_scrub *sc)
{
- struct xfs_agf *agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
- struct xfs_mount *mp = sc->mp;
- xfs_agblock_t blocks;
- xfs_agblock_t btreeblks;
- int error;
+ struct xfs_agf *agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
+ struct xfs_mount *mp = sc->mp;
+ xfs_agblock_t blocks;
+ xfs_agblock_t btreeblks;
+ int error;
/* Check agf_rmap_blocks; set up for agf_btreeblks check */
if (sc->sa.rmap_cur) {
@@ -465,9 +465,9 @@ static inline void
xchk_agf_xref_refcblks(
struct xfs_scrub *sc)
{
- struct xfs_agf *agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
- xfs_agblock_t blocks;
- int error;
+ struct xfs_agf *agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
+ xfs_agblock_t blocks;
+ int error;
if (!sc->sa.refc_cur)
return;
@@ -484,10 +484,10 @@ STATIC void
xchk_agf_xref(
struct xfs_scrub *sc)
{
- struct xfs_owner_info oinfo;
- struct xfs_mount *mp = sc->mp;
- xfs_agblock_t agbno;
- int error;
+ struct xfs_owner_info oinfo;
+ struct xfs_mount *mp = sc->mp;
+ xfs_agblock_t agbno;
+ int error;
if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
return;
@@ -516,17 +516,17 @@ int
xchk_agf(
struct xfs_scrub *sc)
{
- struct xfs_mount *mp = sc->mp;
- struct xfs_agf *agf;
- xfs_agnumber_t agno;
- xfs_agblock_t agbno;
- xfs_agblock_t eoag;
- xfs_agblock_t agfl_first;
- xfs_agblock_t agfl_last;
- xfs_agblock_t agfl_count;
- xfs_agblock_t fl_count;
- int level;
- int error = 0;
+ struct xfs_mount *mp = sc->mp;
+ struct xfs_agf *agf;
+ xfs_agnumber_t agno;
+ xfs_agblock_t agbno;
+ xfs_agblock_t eoag;
+ xfs_agblock_t agfl_first;
+ xfs_agblock_t agfl_last;
+ xfs_agblock_t agfl_count;
+ xfs_agblock_t fl_count;
+ int level;
+ int error = 0;
agno = sc->sa.agno = sc->sm->sm_agno;
error = xchk_ag_read_headers(sc, agno, &sc->sa.agi_bp,
@@ -598,10 +598,10 @@ xchk_agf(
/* AGFL */
struct xchk_agfl_info {
- struct xfs_owner_info oinfo;
- unsigned int sz_entries;
- unsigned int nr_entries;
- xfs_agblock_t *entries;
+ struct xfs_owner_info oinfo;
+ unsigned int sz_entries;
+ unsigned int nr_entries;
+ xfs_agblock_t *entries;
struct xfs_scrub *sc;
};
@@ -609,8 +609,8 @@ struct xchk_agfl_info {
STATIC void
xchk_agfl_block_xref(
struct xfs_scrub *sc,
- xfs_agblock_t agbno,
- struct xfs_owner_info *oinfo)
+ xfs_agblock_t agbno,
+ struct xfs_owner_info *oinfo)
{
if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
return;
@@ -624,13 +624,13 @@ xchk_agfl_block_xref(
/* Scrub an AGFL block. */
STATIC int
xchk_agfl_block(
- struct xfs_mount *mp,
- xfs_agblock_t agbno,
- void *priv)
+ struct xfs_mount *mp,
+ xfs_agblock_t agbno,
+ void *priv)
{
- struct xchk_agfl_info *sai = priv;
+ struct xchk_agfl_info *sai = priv;
struct xfs_scrub *sc = sai->sc;
- xfs_agnumber_t agno = sc->sa.agno;
+ xfs_agnumber_t agno = sc->sa.agno;
if (xfs_verify_agbno(mp, agno, agbno) &&
sai->nr_entries < sai->sz_entries)
@@ -662,10 +662,10 @@ STATIC void
xchk_agfl_xref(
struct xfs_scrub *sc)
{
- struct xfs_owner_info oinfo;
- struct xfs_mount *mp = sc->mp;
- xfs_agblock_t agbno;
- int error;
+ struct xfs_owner_info oinfo;
+ struct xfs_mount *mp = sc->mp;
+ xfs_agblock_t agbno;
+ int error;
if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
return;
@@ -693,12 +693,12 @@ int
xchk_agfl(
struct xfs_scrub *sc)
{
- struct xchk_agfl_info sai;
- struct xfs_agf *agf;
- xfs_agnumber_t agno;
- unsigned int agflcount;
- unsigned int i;
- int error;
+ struct xchk_agfl_info sai;
+ struct xfs_agf *agf;
+ xfs_agnumber_t agno;
+ unsigned int agflcount;
+ unsigned int i;
+ int error;
agno = sc->sa.agno = sc->sm->sm_agno;
error = xchk_ag_read_headers(sc, agno, &sc->sa.agi_bp,
@@ -770,10 +770,10 @@ static inline void
xchk_agi_xref_icounts(
struct xfs_scrub *sc)
{
- struct xfs_agi *agi = XFS_BUF_TO_AGI(sc->sa.agi_bp);
- xfs_agino_t icount;
- xfs_agino_t freecount;
- int error;
+ struct xfs_agi *agi = XFS_BUF_TO_AGI(sc->sa.agi_bp);
+ xfs_agino_t icount;
+ xfs_agino_t freecount;
+ int error;
if (!sc->sa.ino_cur)
return;
@@ -791,10 +791,10 @@ STATIC void
xchk_agi_xref(
struct xfs_scrub *sc)
{
- struct xfs_owner_info oinfo;
- struct xfs_mount *mp = sc->mp;
- xfs_agblock_t agbno;
- int error;
+ struct xfs_owner_info oinfo;
+ struct xfs_mount *mp = sc->mp;
+ xfs_agblock_t agbno;
+ int error;
if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
return;
@@ -820,18 +820,18 @@ int
xchk_agi(
struct xfs_scrub *sc)
{
- struct xfs_mount *mp = sc->mp;
- struct xfs_agi *agi;
- xfs_agnumber_t agno;
- xfs_agblock_t agbno;
- xfs_agblock_t eoag;
- xfs_agino_t agino;
- xfs_agino_t first_agino;
- xfs_agino_t last_agino;
- xfs_agino_t icount;
- int i;
- int level;
- int error = 0;
+ struct xfs_mount *mp = sc->mp;
+ struct xfs_agi *agi;
+ xfs_agnumber_t agno;
+ xfs_agblock_t agbno;
+ xfs_agblock_t eoag;
+ xfs_agino_t agino;
+ xfs_agino_t first_agino;
+ xfs_agino_t last_agino;
+ xfs_agino_t icount;
+ int i;
+ int level;
+ int error = 0;
agno = sc->sa.agno = sc->sm->sm_agno;
error = xchk_ag_read_headers(sc, agno, &sc->sa.agi_bp,
--git a/fs/xfs/scrub/agheader_repair.c b/fs/xfs/scrub/agheader_repair.c
index 2457968482f8..1e96621ece3a 100644
--- a/fs/xfs/scrub/agheader_repair.c
+++ b/fs/xfs/scrub/agheader_repair.c
@@ -31,10 +31,10 @@ int
xrep_superblock(
struct xfs_scrub *sc)
{
- struct xfs_mount *mp = sc->mp;
- struct xfs_buf *bp;
- xfs_agnumber_t agno;
- int error;
+ struct xfs_mount *mp = sc->mp;
+ struct xfs_buf *bp;
+ xfs_agnumber_t agno;
+ int error;
/* Don't try to repair AG 0's sb; let xfs_repair deal with it. */
agno = sc->sm->sm_agno;
diff --git a/fs/xfs/scrub/alloc.c b/fs/xfs/scrub/alloc.c
index 653d80b3aa39..036b5c7021eb 100644
--- a/fs/xfs/scrub/alloc.c
+++ b/fs/xfs/scrub/alloc.c
@@ -30,7 +30,7 @@
int
xchk_setup_ag_allocbt(
struct xfs_scrub *sc,
- struct xfs_inode *ip)
+ struct xfs_inode *ip)
{
return xchk_setup_ag_btree(sc, ip, false);
}
@@ -43,14 +43,14 @@ xchk_setup_ag_allocbt(
STATIC void
xchk_allocbt_xref_other(
struct xfs_scrub *sc,
- xfs_agblock_t agbno,
- xfs_extlen_t len)
+ xfs_agblock_t agbno,
+ xfs_extlen_t len)
{
- struct xfs_btree_cur **pcur;
- xfs_agblock_t fbno;
- xfs_extlen_t flen;
- int has_otherrec;
- int error;
+ struct xfs_btree_cur **pcur;
+ xfs_agblock_t fbno;
+ xfs_extlen_t flen;
+ int has_otherrec;
+ int error;
if (sc->sm->sm_type == XFS_SCRUB_TYPE_BNOBT)
pcur = &sc->sa.cnt_cur;
@@ -83,8 +83,8 @@ xchk_allocbt_xref_other(
STATIC void
xchk_allocbt_xref(
struct xfs_scrub *sc,
- xfs_agblock_t agbno,
- xfs_extlen_t len)
+ xfs_agblock_t agbno,
+ xfs_extlen_t len)
{
if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
return;
@@ -98,14 +98,14 @@ xchk_allocbt_xref(
/* Scrub a bnobt/cntbt record. */
STATIC int
xchk_allocbt_rec(
- struct xchk_btree *bs,
- union xfs_btree_rec *rec)
+ struct xchk_btree *bs,
+ union xfs_btree_rec *rec)
{
- struct xfs_mount *mp = bs->cur->bc_mp;
- xfs_agnumber_t agno = bs->cur->bc_private.a.agno;
- xfs_agblock_t bno;
- xfs_extlen_t len;
- int error = 0;
+ struct xfs_mount *mp = bs->cur->bc_mp;
+ xfs_agnumber_t agno = bs->cur->bc_private.a.agno;
+ xfs_agblock_t bno;
+ xfs_extlen_t len;
+ int error = 0;
bno = be32_to_cpu(rec->alloc.ar_startblock);
len = be32_to_cpu(rec->alloc.ar_blockcount);
@@ -124,10 +124,10 @@ xchk_allocbt_rec(
STATIC int
xchk_allocbt(
struct xfs_scrub *sc,
- xfs_btnum_t which)
+ xfs_btnum_t which)
{
- struct xfs_owner_info oinfo;
- struct xfs_btree_cur *cur;
+ struct xfs_owner_info oinfo;
+ struct xfs_btree_cur *cur;
xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_AG);
cur = which == XFS_BTNUM_BNO ? sc->sa.bno_cur : sc->sa.cnt_cur;
@@ -152,11 +152,11 @@ xchk_cntbt(
void
xchk_xref_is_used_space(
struct xfs_scrub *sc,
- xfs_agblock_t agbno,
- xfs_extlen_t len)
+ xfs_agblock_t agbno,
+ xfs_extlen_t len)
{
- bool is_freesp;
- int error;
+ bool is_freesp;
+ int error;
if (!sc->sa.bno_cur || xchk_skip_xref(sc->sm))
return;
diff --git a/fs/xfs/scrub/attr.c b/fs/xfs/scrub/attr.c
index 6650fb3010b6..81d5e90547a1 100644
--- a/fs/xfs/scrub/attr.c
+++ b/fs/xfs/scrub/attr.c
@@ -34,9 +34,9 @@
int
xchk_setup_xattr(
struct xfs_scrub *sc,
- struct xfs_inode *ip)
+ struct xfs_inode *ip)
{
- size_t sz;
+ size_t sz;
/*
* Allocate the buffer without the inode lock held. We need enough
@@ -57,7 +57,7 @@ xchk_setup_xattr(
struct xchk_xattr {
struct xfs_attr_list_context context;
- struct xfs_scrub *sc;
+ struct xfs_scrub *sc;
};
/*
@@ -128,12 +128,12 @@ xchk_xattr_listent(
STATIC bool
xchk_xattr_set_map(
struct xfs_scrub *sc,
- unsigned long *map,
- unsigned int start,
- unsigned int len)
+ unsigned long *map,
+ unsigned int start,
+ unsigned int len)
{
- unsigned int mapsize = sc->mp->m_attr_geo->blksize;
- bool ret = true;
+ unsigned int mapsize = sc->mp->m_attr_geo->blksize;
+ bool ret = true;
if (start >= mapsize)
return false;
@@ -155,7 +155,7 @@ xchk_xattr_set_map(
*/
STATIC bool
xchk_xattr_check_freemap(
- struct xfs_scrub *sc,
+ struct xfs_scrub *sc,
unsigned long *map,
struct xfs_attr3_icleaf_hdr *leafhdr)
{
@@ -405,7 +405,7 @@ xchk_xattr_rec(
/* Scrub the extended attribute metadata. */
int
xchk_xattr(
- struct xfs_scrub *sc)
+ struct xfs_scrub *sc)
{
struct xchk_xattr sx;
struct attrlist_cursor_kern cursor = { 0 };
diff --git a/fs/xfs/scrub/bmap.c b/fs/xfs/scrub/bmap.c
index 0e5166232b15..e1d11f3223e3 100644
--- a/fs/xfs/scrub/bmap.c
+++ b/fs/xfs/scrub/bmap.c
@@ -35,9 +35,9 @@
int
xchk_setup_inode_bmap(
struct xfs_scrub *sc,
- struct xfs_inode *ip)
+ struct xfs_inode *ip)
{
- int error;
+ int error;
error = xchk_get_inode(sc, ip);
if (error)
@@ -80,25 +80,25 @@ xchk_setup_inode_bmap(
struct xchk_bmap_info {
struct xfs_scrub *sc;
- xfs_fileoff_t lastoff;
- bool is_rt;
- bool is_shared;
- int whichfork;
+ xfs_fileoff_t lastoff;
+ bool is_rt;
+ bool is_shared;
+ int whichfork;
};
/* Look for a corresponding rmap for this irec. */
static inline bool
xchk_bmap_get_rmap(
- struct xchk_bmap_info *info,
- struct xfs_bmbt_irec *irec,
- xfs_agblock_t agbno,
- uint64_t owner,
- struct xfs_rmap_irec *rmap)
+ struct xchk_bmap_info *info,
+ struct xfs_bmbt_irec *irec,
+ xfs_agblock_t agbno,
+ uint64_t owner,
+ struct xfs_rmap_irec *rmap)
{
- xfs_fileoff_t offset;
- unsigned int rflags = 0;
- int has_rmap;
- int error;
+ xfs_fileoff_t offset;
+ unsigned int rflags = 0;
+ int has_rmap;
+ int error;
if (info->whichfork == XFS_ATTR_FORK)
rflags |= XFS_RMAP_ATTR_FORK;
@@ -152,13 +152,13 @@ xchk_bmap_get_rmap(
/* Make sure that we have rmapbt records for this extent. */
STATIC void
xchk_bmap_xref_rmap(
- struct xchk_bmap_info *info,
- struct xfs_bmbt_irec *irec,
- xfs_agblock_t agbno)
+ struct xchk_bmap_info *info,
+ struct xfs_bmbt_irec *irec,
+ xfs_agblock_t agbno)
{
- struct xfs_rmap_irec rmap;
- unsigned long long rmap_end;
- uint64_t owner;
+ struct xfs_rmap_irec rmap;
+ unsigned long long rmap_end;
+ uint64_t owner;
if (!info->sc->sa.rmap_cur || xchk_skip_xref(info->sc->sm))
return;
@@ -222,10 +222,10 @@ xchk_bmap_xref_rmap(
/* Cross-reference a single rtdev extent record. */
STATIC void
xchk_bmap_rt_extent_xref(
- struct xchk_bmap_info *info,
- struct xfs_inode *ip,
- struct xfs_btree_cur *cur,
- struct xfs_bmbt_irec *irec)
+ struct xchk_bmap_info *info,
+ struct xfs_inode *ip,
+ struct xfs_btree_cur *cur,
+ struct xfs_bmbt_irec *irec)
{
if (info->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
return;
@@ -237,16 +237,16 @@ xchk_bmap_rt_extent_xref(
/* Cross-reference a single datadev extent record. */
STATIC void
xchk_bmap_extent_xref(
- struct xchk_bmap_info *info,
- struct xfs_inode *ip,
- struct xfs_btree_cur *cur,
- struct xfs_bmbt_irec *irec)
+ struct xchk_bmap_info *info,
+ struct xfs_inode *ip,
+ struct xfs_btree_cur *cur,
+ struct xfs_bmbt_irec *irec)
{
- struct xfs_mount *mp = info->sc->mp;
- xfs_agnumber_t agno;
- xfs_agblock_t agbno;
- xfs_extlen_t len;
- int error;
+ struct xfs_mount *mp = info->sc->mp;
+ xfs_agnumber_t agno;
+ xfs_agblock_t agbno;
+ xfs_extlen_t len;
+ int error;
if (info->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
return;
@@ -284,15 +284,15 @@ xchk_bmap_extent_xref(
/* Scrub a single extent record. */
STATIC int
xchk_bmap_extent(
- struct xfs_inode *ip,
- struct xfs_btree_cur *cur,
- struct xchk_bmap_info *info,
- struct xfs_bmbt_irec *irec)
+ struct xfs_inode *ip,
+ struct xfs_btree_cur *cur,
+ struct xchk_bmap_info *info,
+ struct xfs_bmbt_irec *irec)
{
- struct xfs_mount *mp = info->sc->mp;
- struct xfs_buf *bp = NULL;
- xfs_filblks_t end;
- int error = 0;
+ struct xfs_mount *mp = info->sc->mp;
+ struct xfs_buf *bp = NULL;
+ xfs_filblks_t end;
+ int error = 0;
if (cur)
xfs_btree_get_block(cur, 0, &bp);
@@ -357,16 +357,16 @@ xchk_bmap_extent(
/* Scrub a bmbt record. */
STATIC int
xchk_bmapbt_rec(
- struct xchk_btree *bs,
- union xfs_btree_rec *rec)
+ struct xchk_btree *bs,
+ union xfs_btree_rec *rec)
{
- struct xfs_bmbt_irec irec;
- struct xchk_bmap_info *info = bs->private;
- struct xfs_inode *ip = bs->cur->bc_private.b.ip;
- struct xfs_buf *bp = NULL;
- struct xfs_btree_block *block;
- uint64_t owner;
- int i;
+ struct xfs_bmbt_irec irec;
+ struct xchk_bmap_info *info = bs->private;
+ struct xfs_inode *ip = bs->cur->bc_private.b.ip;
+ struct xfs_buf *bp = NULL;
+ struct xfs_btree_block *block;
+ uint64_t owner;
+ int i;
/*
* Check the owners of the btree blocks up to the level below
@@ -392,14 +392,14 @@ xchk_bmapbt_rec(
STATIC int
xchk_bmap_btree(
struct xfs_scrub *sc,
- int whichfork,
- struct xchk_bmap_info *info)
+ int whichfork,
+ struct xchk_bmap_info *info)
{
- struct xfs_owner_info oinfo;
- struct xfs_mount *mp = sc->mp;
- struct xfs_inode *ip = sc->ip;
- struct xfs_btree_cur *cur;
- int error;
+ struct xfs_owner_info oinfo;
+ struct xfs_mount *mp = sc->mp;
+ struct xfs_inode *ip = sc->ip;
+ struct xfs_btree_cur *cur;
+ int error;
cur = xfs_bmbt_init_cursor(mp, sc->tp, ip, whichfork);
xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, whichfork);
@@ -410,8 +410,8 @@ xchk_bmap_btree(
struct xchk_bmap_check_rmap_info {
struct xfs_scrub *sc;
- int whichfork;
- struct xfs_iext_cursor icur;
+ int whichfork;
+ struct xfs_iext_cursor icur;
};
/* Can we find bmaps that fit this rmap? */
@@ -424,7 +424,7 @@ xchk_bmap_check_rmap(
struct xfs_bmbt_irec irec;
struct xchk_bmap_check_rmap_info *sbcri = priv;
struct xfs_ifork *ifp;
- struct xfs_scrub *sc = sbcri->sc;
+ struct xfs_scrub *sc = sbcri->sc;
bool have_map;
/* Is this even the right fork? */
@@ -488,7 +488,7 @@ xchk_bmap_check_rmap(
/* Make sure each rmap has a corresponding bmbt entry. */
STATIC int
xchk_bmap_check_ag_rmaps(
- struct xfs_scrub *sc,
+ struct xfs_scrub *sc,
int whichfork,
xfs_agnumber_t agno)
{
@@ -523,11 +523,11 @@ xchk_bmap_check_ag_rmaps(
STATIC int
xchk_bmap_check_rmaps(
struct xfs_scrub *sc,
- int whichfork)
+ int whichfork)
{
- loff_t size;
- xfs_agnumber_t agno;
- int error;
+ loff_t size;
+ xfs_agnumber_t agno;
+ int error;
if (!xfs_sb_version_hasrmapbt(&sc->mp->m_sb) ||
whichfork == XFS_COW_FORK ||
@@ -580,16 +580,16 @@ xchk_bmap_check_rmaps(
STATIC int
xchk_bmap(
struct xfs_scrub *sc,
- int whichfork)
+ int whichfork)
{
- struct xfs_bmbt_irec irec;
- struct xchk_bmap_info info = { NULL };
- struct xfs_mount *mp = sc->mp;
- struct xfs_inode *ip = sc->ip;
- struct xfs_ifork *ifp;
- xfs_fileoff_t endoff;
- struct xfs_iext_cursor icur;
- int error = 0;
+ struct xfs_bmbt_irec irec;
+ struct xchk_bmap_info info = { NULL };
+ struct xfs_mount *mp = sc->mp;
+ struct xfs_inode *ip = sc->ip;
+ struct xfs_ifork *ifp;
+ xfs_fileoff_t endoff;
+ struct xfs_iext_cursor icur;
+ int error = 0;
ifp = XFS_IFORK_PTR(ip, whichfork);
diff --git a/fs/xfs/scrub/btree.c b/fs/xfs/scrub/btree.c
index c4e1dce8c5b3..4ae959f7ad2c 100644
--- a/fs/xfs/scrub/btree.c
+++ b/fs/xfs/scrub/btree.c
@@ -31,11 +31,11 @@
static bool
__xchk_btree_process_error(
struct xfs_scrub *sc,
- struct xfs_btree_cur *cur,
- int level,
- int *error,
- __u32 errflag,
- void *ret_ip)
+ struct xfs_btree_cur *cur,
+ int level,
+ int *error,
+ __u32 errflag,
+ void *ret_ip)
{
if (*error == 0)
return true;
@@ -66,9 +66,9 @@ __xchk_btree_process_error(
bool
xchk_btree_process_error(
struct xfs_scrub *sc,
- struct xfs_btree_cur *cur,
- int level,
- int *error)
+ struct xfs_btree_cur *cur,
+ int level,
+ int *error)
{
return __xchk_btree_process_error(sc, cur, level, error,
XFS_SCRUB_OFLAG_CORRUPT, __return_address);
@@ -77,9 +77,9 @@ xchk_btree_process_error(
bool
xchk_btree_xref_process_error(
struct xfs_scrub *sc,
- struct xfs_btree_cur *cur,
- int level,
- int *error)
+ struct xfs_btree_cur *cur,
+ int level,
+ int *error)
{
return __xchk_btree_process_error(sc, cur, level, error,
XFS_SCRUB_OFLAG_XFAIL, __return_address);
@@ -89,10 +89,10 @@ xchk_btree_xref_process_error(
static void
__xchk_btree_set_corrupt(
struct xfs_scrub *sc,
- struct xfs_btree_cur *cur,
- int level,
- __u32 errflag,
- void *ret_ip)
+ struct xfs_btree_cur *cur,
+ int level,
+ __u32 errflag,
+ void *ret_ip)
{
sc->sm->sm_flags |= errflag;
@@ -107,8 +107,8 @@ __xchk_btree_set_corrupt(
void
xchk_btree_set_corrupt(
struct xfs_scrub *sc,
- struct xfs_btree_cur *cur,
- int level)
+ struct xfs_btree_cur *cur,
+ int level)
{
__xchk_btree_set_corrupt(sc, cur, level, XFS_SCRUB_OFLAG_CORRUPT,
__return_address);
@@ -117,8 +117,8 @@ xchk_btree_set_corrupt(
void
xchk_btree_xref_set_corrupt(
struct xfs_scrub *sc,
- struct xfs_btree_cur *cur,
- int level)
+ struct xfs_btree_cur *cur,
+ int level)
{
__xchk_btree_set_corrupt(sc, cur, level, XFS_SCRUB_OFLAG_XCORRUPT,
__return_address);
@@ -225,11 +225,11 @@ xchk_btree_key(
*/
static bool
xchk_btree_ptr_ok(
- struct xchk_btree *bs,
- int level,
- union xfs_btree_ptr *ptr)
+ struct xchk_btree *bs,
+ int level,
+ union xfs_btree_ptr *ptr)
{
- bool res;
+ bool res;
/* A btree rooted in an inode has no block pointer to the root. */
if ((bs->cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) &&
@@ -250,18 +250,18 @@ xchk_btree_ptr_ok(
/* Check that a btree block's sibling matches what we expect it. */
STATIC int
xchk_btree_block_check_sibling(
- struct xchk_btree *bs,
- int level,
- int direction,
- union xfs_btree_ptr *sibling)
+ struct xchk_btree *bs,
+ int level,
+ int direction,
+ union xfs_btree_ptr *sibling)
{
- struct xfs_btree_cur *cur = bs->cur;
- struct xfs_btree_block *pblock;
- struct xfs_buf *pbp;
- struct xfs_btree_cur *ncur = NULL;
- union xfs_btree_ptr *pp;
- int success;
- int error;
+ struct xfs_btree_cur *cur = bs->cur;
+ struct xfs_btree_block *pblock;
+ struct xfs_buf *pbp;
+ struct xfs_btree_cur *ncur = NULL;
+ union xfs_btree_ptr *pp;
+ int success;
+ int error;
error = xfs_btree_dup_cursor(cur, &ncur);
if (!xchk_btree_process_error(bs->sc, cur, level + 1, &error) ||
@@ -313,14 +313,14 @@ xchk_btree_block_check_sibling(
/* Check the siblings of a btree block. */
STATIC int
xchk_btree_block_check_siblings(
- struct xchk_btree *bs,
- struct xfs_btree_block *block)
+ struct xchk_btree *bs,
+ struct xfs_btree_block *block)
{
- struct xfs_btree_cur *cur = bs->cur;
- union xfs_btree_ptr leftsib;
- union xfs_btree_ptr rightsib;
- int level;
- int error = 0;
+ struct xfs_btree_cur *cur = bs->cur;
+ union xfs_btree_ptr leftsib;
+ union xfs_btree_ptr rightsib;
+ int level;
+ int error = 0;
xfs_btree_get_sibling(cur, block, &leftsib, XFS_BB_LEFTSIB);
xfs_btree_get_sibling(cur, block, &rightsib, XFS_BB_RIGHTSIB);
@@ -361,15 +361,15 @@ struct check_owner {
*/
STATIC int
xchk_btree_check_block_owner(
- struct xchk_btree *bs,
- int level,
- xfs_daddr_t daddr)
+ struct xchk_btree *bs,
+ int level,
+ xfs_daddr_t daddr)
{
- xfs_agnumber_t agno;
- xfs_agblock_t agbno;
- xfs_btnum_t btnum;
- bool init_sa;
- int error = 0;
+ xfs_agnumber_t agno;
+ xfs_agblock_t agbno;
+ xfs_btnum_t btnum;
+ bool init_sa;
+ int error = 0;
if (!bs->cur)
return 0;
@@ -408,12 +408,12 @@ xchk_btree_check_block_owner(
/* Check the owner of a btree block. */
STATIC int
xchk_btree_check_owner(
- struct xchk_btree *bs,
- int level,
- struct xfs_buf *bp)
+ struct xchk_btree *bs,
+ int level,
+ struct xfs_buf *bp)
{
- struct xfs_btree_cur *cur = bs->cur;
- struct check_owner *co;
+ struct xfs_btree_cur *cur = bs->cur;
+ struct check_owner *co;
if ((cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) && bp == NULL)
return 0;
@@ -484,14 +484,14 @@ xchk_btree_check_minrecs(
*/
STATIC int
xchk_btree_get_block(
- struct xchk_btree *bs,
- int level,
- union xfs_btree_ptr *pp,
- struct xfs_btree_block **pblock,
- struct xfs_buf **pbp)
+ struct xchk_btree *bs,
+ int level,
+ union xfs_btree_ptr *pp,
+ struct xfs_btree_block **pblock,
+ struct xfs_buf **pbp)
{
- void *failed_at;
- int error;
+ xfs_failaddr_t failed_at;
+ int error;
*pblock = NULL;
*pbp = NULL;
@@ -538,17 +538,17 @@ xchk_btree_get_block(
*/
STATIC void
xchk_btree_block_keys(
- struct xchk_btree *bs,
- int level,
- struct xfs_btree_block *block)
+ struct xchk_btree *bs,
+ int level,
+ struct xfs_btree_block *block)
{
- union xfs_btree_key block_keys;
- struct xfs_btree_cur *cur = bs->cur;
- union xfs_btree_key *high_bk;
- union xfs_btree_key *parent_keys;
- union xfs_btree_key *high_pk;
- struct xfs_btree_block *parent_block;
- struct xfs_buf *bp;
+ union xfs_btree_key block_keys;
+ struct xfs_btree_cur *cur = bs->cur;
+ union xfs_btree_key *high_bk;
+ union xfs_btree_key *parent_keys;
+ union xfs_btree_key *high_pk;
+ struct xfs_btree_block *parent_block;
+ struct xfs_buf *bp;
if (level >= cur->bc_nlevels - 1)
return;
@@ -584,22 +584,22 @@ xchk_btree_block_keys(
int
xchk_btree(
struct xfs_scrub *sc,
- struct xfs_btree_cur *cur,
- xchk_btree_rec_fn scrub_fn,
- struct xfs_owner_info *oinfo,
- void *private)
+ struct xfs_btree_cur *cur,
+ xchk_btree_rec_fn scrub_fn,
+ struct xfs_owner_info *oinfo,
+ void *private)
{
- struct xchk_btree bs = { NULL };
- union xfs_btree_ptr ptr;
- union xfs_btree_ptr *pp;
- union xfs_btree_rec *recp;
- struct xfs_btree_block *block;
- int level;
- struct xfs_buf *bp;
- struct check_owner *co;
- struct check_owner *n;
- int i;
- int error = 0;
+ struct xchk_btree bs = { NULL };
+ union xfs_btree_ptr ptr;
+ union xfs_btree_ptr *pp;
+ union xfs_btree_rec *recp;
+ struct xfs_btree_block *block;
+ int level;
+ struct xfs_buf *bp;
+ struct check_owner *co;
+ struct check_owner *n;
+ int i;
+ int error = 0;
/* Initialize scrub state */
bs.cur = cur;
diff --git a/fs/xfs/scrub/btree.h b/fs/xfs/scrub/btree.h
index a0b74b515b9b..aada763cd006 100644
--- a/fs/xfs/scrub/btree.h
+++ b/fs/xfs/scrub/btree.h
@@ -14,8 +14,7 @@ bool xchk_btree_process_error(struct xfs_scrub *sc,
/* Check for btree xref operation errors. */
bool xchk_btree_xref_process_error(struct xfs_scrub *sc,
- struct xfs_btree_cur *cur, int level,
- int *error);
+ struct xfs_btree_cur *cur, int level, int *error);
/* Check for btree corruption. */
void xchk_btree_set_corrupt(struct xfs_scrub *sc,
@@ -33,20 +32,20 @@ typedef int (*xchk_btree_rec_fn)(
struct xchk_btree {
/* caller-provided scrub state */
struct xfs_scrub *sc;
- struct xfs_btree_cur *cur;
- xchk_btree_rec_fn scrub_rec;
- struct xfs_owner_info *oinfo;
- void *private;
+ struct xfs_btree_cur *cur;
+ xchk_btree_rec_fn scrub_rec;
+ struct xfs_owner_info *oinfo;
+ void *private;
/* internal scrub state */
- union xfs_btree_rec lastrec;
- bool firstrec;
- union xfs_btree_key lastkey[XFS_BTREE_MAXLEVELS];
- bool firstkey[XFS_BTREE_MAXLEVELS];
- struct list_head to_check;
+ union xfs_btree_rec lastrec;
+ bool firstrec;
+ union xfs_btree_key lastkey[XFS_BTREE_MAXLEVELS];
+ bool firstkey[XFS_BTREE_MAXLEVELS];
+ struct list_head to_check;
};
int xchk_btree(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
- xchk_btree_rec_fn scrub_fn,
- struct xfs_owner_info *oinfo, void *private);
+ xchk_btree_rec_fn scrub_fn, struct xfs_owner_info *oinfo,
+ void *private);
#endif /* __XFS_SCRUB_BTREE_H__ */
diff --git a/fs/xfs/scrub/common.c b/fs/xfs/scrub/common.c
index 81e8bb7d5486..248efa74c390 100644
--- a/fs/xfs/scrub/common.c
+++ b/fs/xfs/scrub/common.c
@@ -70,11 +70,11 @@
static bool
__xchk_process_error(
struct xfs_scrub *sc,
- xfs_agnumber_t agno,
- xfs_agblock_t bno,
- int *error,
- __u32 errflag,
- void *ret_ip)
+ xfs_agnumber_t agno,
+ xfs_agblock_t bno,
+ int *error,
+ __u32 errflag,
+ void *ret_ip)
{
switch (*error) {
case 0:
@@ -100,9 +100,9 @@ __xchk_process_error(
bool
xchk_process_error(
struct xfs_scrub *sc,
- xfs_agnumber_t agno,
- xfs_agblock_t bno,
- int *error)
+ xfs_agnumber_t agno,
+ xfs_agblock_t bno,
+ int *error)
{
return __xchk_process_error(sc, agno, bno, error,
XFS_SCRUB_OFLAG_CORRUPT, __return_address);
@@ -111,9 +111,9 @@ xchk_process_error(
bool
xchk_xref_process_error(
struct xfs_scrub *sc,
- xfs_agnumber_t agno,
- xfs_agblock_t bno,
- int *error)
+ xfs_agnumber_t agno,
+ xfs_agblock_t bno,
+ int *error)
{
return __xchk_process_error(sc, agno, bno, error,
XFS_SCRUB_OFLAG_XFAIL, __return_address);
@@ -123,11 +123,11 @@ xchk_xref_process_error(
static bool
__xchk_fblock_process_error(
struct xfs_scrub *sc,
- int whichfork,
- xfs_fileoff_t offset,
- int *error,
- __u32 errflag,
- void *ret_ip)
+ int whichfork,
+ xfs_fileoff_t offset,
+ int *error,
+ __u32 errflag,
+ void *ret_ip)
{
switch (*error) {
case 0:
@@ -153,9 +153,9 @@ __xchk_fblock_process_error(
bool
xchk_fblock_process_error(
struct xfs_scrub *sc,
- int whichfork,
- xfs_fileoff_t offset,
- int *error)
+ int whichfork,
+ xfs_fileoff_t offset,
+ int *error)
{
return __xchk_fblock_process_error(sc, whichfork, offset, error,
XFS_SCRUB_OFLAG_CORRUPT, __return_address);
@@ -164,9 +164,9 @@ xchk_fblock_process_error(
bool
xchk_fblock_xref_process_error(
struct xfs_scrub *sc,
- int whichfork,
- xfs_fileoff_t offset,
- int *error)
+ int whichfork,
+ xfs_fileoff_t offset,
+ int *error)
{
return __xchk_fblock_process_error(sc, whichfork, offset, error,
XFS_SCRUB_OFLAG_XFAIL, __return_address);
@@ -188,7 +188,7 @@ xchk_fblock_xref_process_error(
void
xchk_block_set_preen(
struct xfs_scrub *sc,
- struct xfs_buf *bp)
+ struct xfs_buf *bp)
{
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_PREEN;
trace_xchk_block_preen(sc, bp->b_bn, __return_address);
@@ -202,7 +202,7 @@ xchk_block_set_preen(
void
xchk_ino_set_preen(
struct xfs_scrub *sc,
- xfs_ino_t ino)
+ xfs_ino_t ino)
{
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_PREEN;
trace_xchk_ino_preen(sc, ino, __return_address);
@@ -212,7 +212,7 @@ xchk_ino_set_preen(
void
xchk_block_set_corrupt(
struct xfs_scrub *sc,
- struct xfs_buf *bp)
+ struct xfs_buf *bp)
{
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT;
trace_xchk_block_error(sc, bp->b_bn, __return_address);
@@ -222,7 +222,7 @@ xchk_block_set_corrupt(
void
xchk_block_xref_set_corrupt(
struct xfs_scrub *sc,
- struct xfs_buf *bp)
+ struct xfs_buf *bp)
{
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_XCORRUPT;
trace_xchk_block_error(sc, bp->b_bn, __return_address);
@@ -236,7 +236,7 @@ xchk_block_xref_set_corrupt(
void
xchk_ino_set_corrupt(
struct xfs_scrub *sc,
- xfs_ino_t ino)
+ xfs_ino_t ino)
{
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT;
trace_xchk_ino_error(sc, ino, __return_address);
@@ -246,7 +246,7 @@ xchk_ino_set_corrupt(
void
xchk_ino_xref_set_corrupt(
struct xfs_scrub *sc,
- xfs_ino_t ino)
+ xfs_ino_t ino)
{
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_XCORRUPT;
trace_xchk_ino_error(sc, ino, __return_address);
@@ -256,8 +256,8 @@ xchk_ino_xref_set_corrupt(
void
xchk_fblock_set_corrupt(
struct xfs_scrub *sc,
- int whichfork,
- xfs_fileoff_t offset)
+ int whichfork,
+ xfs_fileoff_t offset)
{
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT;
trace_xchk_fblock_error(sc, whichfork, offset, __return_address);
@@ -267,8 +267,8 @@ xchk_fblock_set_corrupt(
void
xchk_fblock_xref_set_corrupt(
struct xfs_scrub *sc,
- int whichfork,
- xfs_fileoff_t offset)
+ int whichfork,
+ xfs_fileoff_t offset)
{
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_XCORRUPT;
trace_xchk_fblock_error(sc, whichfork, offset, __return_address);
@@ -281,7 +281,7 @@ xchk_fblock_xref_set_corrupt(
void
xchk_ino_set_warning(
struct xfs_scrub *sc,
- xfs_ino_t ino)
+ xfs_ino_t ino)
{
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_WARNING;
trace_xchk_ino_warning(sc, ino, __return_address);
@@ -291,8 +291,8 @@ xchk_ino_set_warning(
void
xchk_fblock_set_warning(
struct xfs_scrub *sc,
- int whichfork,
- xfs_fileoff_t offset)
+ int whichfork,
+ xfs_fileoff_t offset)
{
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_WARNING;
trace_xchk_fblock_warning(sc, whichfork, offset, __return_address);
@@ -319,13 +319,13 @@ struct xchk_rmap_ownedby_info {
STATIC int
xchk_count_rmap_ownedby_irec(
- struct xfs_btree_cur *cur,
- struct xfs_rmap_irec *rec,
- void *priv)
+ struct xfs_btree_cur *cur,
+ struct xfs_rmap_irec *rec,
+ void *priv)
{
- struct xchk_rmap_ownedby_info *sroi = priv;
- bool irec_attr;
- bool oinfo_attr;
+ struct xchk_rmap_ownedby_info *sroi = priv;
+ bool irec_attr;
+ bool oinfo_attr;
irec_attr = rec->rm_flags & XFS_RMAP_ATTR_FORK;
oinfo_attr = sroi->oinfo->oi_flags & XFS_OWNER_INFO_ATTR_FORK;
@@ -346,11 +346,11 @@ xchk_count_rmap_ownedby_irec(
int
xchk_count_rmap_ownedby_ag(
struct xfs_scrub *sc,
- struct xfs_btree_cur *cur,
- struct xfs_owner_info *oinfo,
- xfs_filblks_t *blocks)
+ struct xfs_btree_cur *cur,
+ struct xfs_owner_info *oinfo,
+ xfs_filblks_t *blocks)
{
- struct xchk_rmap_ownedby_info sroi;
+ struct xchk_rmap_ownedby_info sroi;
sroi.oinfo = oinfo;
*blocks = 0;
@@ -372,7 +372,7 @@ xchk_count_rmap_ownedby_ag(
static inline bool
want_ag_read_header_failure(
struct xfs_scrub *sc,
- unsigned int type)
+ unsigned int type)
{
/* Return all AG header read failures when scanning btrees. */
if (sc->sm->sm_type != XFS_SCRUB_TYPE_AGF &&
@@ -399,13 +399,13 @@ want_ag_read_header_failure(
int
xchk_ag_read_headers(
struct xfs_scrub *sc,
- xfs_agnumber_t agno,
- struct xfs_buf **agi,
- struct xfs_buf **agf,
- struct xfs_buf **agfl)
+ xfs_agnumber_t agno,
+ struct xfs_buf **agi,
+ struct xfs_buf **agf,
+ struct xfs_buf **agfl)
{
- struct xfs_mount *mp = sc->mp;
- int error;
+ struct xfs_mount *mp = sc->mp;
+ int error;
error = xfs_ialloc_read_agi(mp, sc->tp, agno, agi);
if (error && want_ag_read_header_failure(sc, XFS_SCRUB_TYPE_AGI))
@@ -455,8 +455,8 @@ xchk_ag_btcur_init(
struct xfs_scrub *sc,
struct xchk_ag *sa)
{
- struct xfs_mount *mp = sc->mp;
- xfs_agnumber_t agno = sa->agno;
+ struct xfs_mount *mp = sc->mp;
+ xfs_agnumber_t agno = sa->agno;
if (sa->agf_bp) {
/* Set up a bnobt cursor for cross-referencing. */
@@ -545,10 +545,10 @@ xchk_ag_free(
int
xchk_ag_init(
struct xfs_scrub *sc,
- xfs_agnumber_t agno,
+ xfs_agnumber_t agno,
struct xchk_ag *sa)
{
- int error;
+ int error;
sa->agno = agno;
error = xchk_ag_read_headers(sc, agno, &sa->agi_bp,
@@ -566,7 +566,7 @@ xchk_ag_init(
void
xchk_perag_get(
struct xfs_mount *mp,
- struct xchk_ag *sa)
+ struct xchk_ag *sa)
{
if (!sa->pag)
sa->pag = xfs_perag_get(mp, sa->agno);
@@ -587,7 +587,7 @@ xchk_perag_get(
int
xchk_trans_alloc(
struct xfs_scrub *sc,
- uint resblks)
+ uint resblks)
{
if (sc->sm->sm_flags & XFS_SCRUB_IFLAG_REPAIR)
return xfs_trans_alloc(sc->mp, &M_RES(sc->mp)->tr_itruncate,
@@ -600,9 +600,9 @@ xchk_trans_alloc(
int
xchk_setup_fs(
struct xfs_scrub *sc,
- struct xfs_inode *ip)
+ struct xfs_inode *ip)
{
- uint resblks;
+ uint resblks;
resblks = xrep_calc_ag_resblks(sc);
return xchk_trans_alloc(sc, resblks);
@@ -612,11 +612,11 @@ xchk_setup_fs(
int
xchk_setup_ag_btree(
struct xfs_scrub *sc,
- struct xfs_inode *ip,
- bool force_log)
+ struct xfs_inode *ip,
+ bool force_log)
{
- struct xfs_mount *mp = sc->mp;
- int error;
+ struct xfs_mount *mp = sc->mp;
+ int error;
/*
* If the caller asks us to checkpont the log, do so. This
@@ -659,12 +659,12 @@ xchk_checkpoint_log(
int
xchk_get_inode(
struct xfs_scrub *sc,
- struct xfs_inode *ip_in)
+ struct xfs_inode *ip_in)
{
- struct xfs_imap imap;
- struct xfs_mount *mp = sc->mp;
- struct xfs_inode *ip = NULL;
- int error;
+ struct xfs_imap imap;
+ struct xfs_mount *mp = sc->mp;
+ struct xfs_inode *ip = NULL;
+ int error;
/* We want to scan the inode we already had opened. */
if (sc->sm->sm_ino == 0 || sc->sm->sm_ino == ip_in->i_ino) {
@@ -723,10 +723,10 @@ xchk_get_inode(
int
xchk_setup_inode_contents(
struct xfs_scrub *sc,
- struct xfs_inode *ip,
- unsigned int resblks)
+ struct xfs_inode *ip,
+ unsigned int resblks)
{
- int error;
+ int error;
error = xchk_get_inode(sc, ip);
if (error)
@@ -754,8 +754,8 @@ xchk_setup_inode_contents(
bool
xchk_should_check_xref(
struct xfs_scrub *sc,
- int *error,
- struct xfs_btree_cur **curpp)
+ int *error,
+ struct xfs_btree_cur **curpp)
{
/* No point in xref if we already know we're corrupt. */
if (xchk_skip_xref(sc->sm))
@@ -789,9 +789,9 @@ xchk_should_check_xref(
void
xchk_buffer_recheck(
struct xfs_scrub *sc,
- struct xfs_buf *bp)
+ struct xfs_buf *bp)
{
- xfs_failaddr_t fa;
+ xfs_failaddr_t fa;
if (bp->b_ops == NULL) {
xchk_block_set_corrupt(sc, bp);
@@ -816,9 +816,9 @@ int
xchk_metadata_inode_forks(
struct xfs_scrub *sc)
{
- __u32 smtype;
- bool shared;
- int error;
+ __u32 smtype;
+ bool shared;
+ int error;
if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
return 0;
diff --git a/fs/xfs/scrub/common.h b/fs/xfs/scrub/common.h
index c321230d32dc..2d4324d12f9a 100644
--- a/fs/xfs/scrub/common.h
+++ b/fs/xfs/scrub/common.h
@@ -108,24 +108,21 @@ xchk_setup_quota(struct xfs_scrub *sc, struct xfs_inode *ip)
void xchk_ag_free(struct xfs_scrub *sc, struct xchk_ag *sa);
int xchk_ag_init(struct xfs_scrub *sc, xfs_agnumber_t agno,
- struct xchk_ag *sa);
+ struct xchk_ag *sa);
void xchk_perag_get(struct xfs_mount *mp, struct xchk_ag *sa);
int xchk_ag_read_headers(struct xfs_scrub *sc, xfs_agnumber_t agno,
- struct xfs_buf **agi, struct xfs_buf **agf,
- struct xfs_buf **agfl);
+ struct xfs_buf **agi, struct xfs_buf **agf,
+ struct xfs_buf **agfl);
void xchk_ag_btcur_free(struct xchk_ag *sa);
-int xchk_ag_btcur_init(struct xfs_scrub *sc,
- struct xchk_ag *sa);
-int xchk_count_rmap_ownedby_ag(struct xfs_scrub *sc,
- struct xfs_btree_cur *cur,
- struct xfs_owner_info *oinfo,
- xfs_filblks_t *blocks);
+int xchk_ag_btcur_init(struct xfs_scrub *sc, struct xchk_ag *sa);
+int xchk_count_rmap_ownedby_ag(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
+ struct xfs_owner_info *oinfo, xfs_filblks_t *blocks);
-int xchk_setup_ag_btree(struct xfs_scrub *sc,
- struct xfs_inode *ip, bool force_log);
+int xchk_setup_ag_btree(struct xfs_scrub *sc, struct xfs_inode *ip,
+ bool force_log);
int xchk_get_inode(struct xfs_scrub *sc, struct xfs_inode *ip_in);
-int xchk_setup_inode_contents(struct xfs_scrub *sc,
- struct xfs_inode *ip, unsigned int resblks);
+int xchk_setup_inode_contents(struct xfs_scrub *sc, struct xfs_inode *ip,
+ unsigned int resblks);
void xchk_buffer_recheck(struct xfs_scrub *sc, struct xfs_buf *bp);
/*
diff --git a/fs/xfs/scrub/dabtree.c b/fs/xfs/scrub/dabtree.c
index 7fc12d540ea6..f1260b4bfdee 100644
--- a/fs/xfs/scrub/dabtree.c
+++ b/fs/xfs/scrub/dabtree.c
@@ -36,9 +36,9 @@
*/
bool
xchk_da_process_error(
- struct xchk_da_btree *ds,
- int level,
- int *error)
+ struct xchk_da_btree *ds,
+ int level,
+ int *error)
{
struct xfs_scrub *sc = ds->sc;
@@ -72,8 +72,8 @@ xchk_da_process_error(
*/
void
xchk_da_set_corrupt(
- struct xchk_da_btree *ds,
- int level)
+ struct xchk_da_btree *ds,
+ int level)
{
struct xfs_scrub *sc = ds->sc;
@@ -88,13 +88,13 @@ xchk_da_set_corrupt(
/* Find an entry at a certain level in a da btree. */
STATIC void *
xchk_da_btree_entry(
- struct xchk_da_btree *ds,
- int level,
- int rec)
+ struct xchk_da_btree *ds,
+ int level,
+ int rec)
{
- char *ents;
- struct xfs_da_state_blk *blk;
- void *baddr;
+ char *ents;
+ struct xfs_da_state_blk *blk;
+ void *baddr;
/* Dispatch the entry finding function. */
blk = &ds->state->path.blk[level];
@@ -158,9 +158,9 @@ xchk_da_btree_hash(
*/
STATIC bool
xchk_da_btree_ptr_ok(
- struct xchk_da_btree *ds,
- int level,
- xfs_dablk_t blkno)
+ struct xchk_da_btree *ds,
+ int level,
+ xfs_dablk_t blkno)
{
if (blkno < ds->lowest || (ds->highest != 0 && blkno >= ds->highest)) {
xchk_da_set_corrupt(ds, level);
@@ -246,13 +246,13 @@ static const struct xfs_buf_ops xchk_da_btree_buf_ops = {
/* Check a block's sibling. */
STATIC int
xchk_da_btree_block_check_sibling(
- struct xchk_da_btree *ds,
- int level,
- int direction,
- xfs_dablk_t sibling)
+ struct xchk_da_btree *ds,
+ int level,
+ int direction,
+ xfs_dablk_t sibling)
{
- int retval;
- int error;
+ int retval;
+ int error;
memcpy(&ds->state->altpath, &ds->state->path,
sizeof(ds->state->altpath));
@@ -294,13 +294,13 @@ xchk_da_btree_block_check_sibling(
/* Check a block's sibling pointers. */
STATIC int
xchk_da_btree_block_check_siblings(
- struct xchk_da_btree *ds,
- int level,
- struct xfs_da_blkinfo *hdr)
+ struct xchk_da_btree *ds,
+ int level,
+ struct xfs_da_blkinfo *hdr)
{
- xfs_dablk_t forw;
- xfs_dablk_t back;
- int error = 0;
+ xfs_dablk_t forw;
+ xfs_dablk_t back;
+ int error = 0;
forw = be32_to_cpu(hdr->forw);
back = be32_to_cpu(hdr->back);
@@ -474,9 +474,9 @@ xchk_da_btree_block(
/* Visit all nodes and leaves of a da btree. */
int
xchk_da_btree(
- struct xfs_scrub *sc,
+ struct xfs_scrub *sc,
int whichfork,
- xchk_da_btree_rec_fn scrub_fn,
+ xchk_da_btree_rec_fn scrub_fn,
void *private)
{
struct xchk_da_btree ds = {};
diff --git a/fs/xfs/scrub/dabtree.h b/fs/xfs/scrub/dabtree.h
index a15c03389e8f..cb3f0003245b 100644
--- a/fs/xfs/scrub/dabtree.h
+++ b/fs/xfs/scrub/dabtree.h
@@ -9,12 +9,12 @@
/* dir/attr btree */
struct xchk_da_btree {
- struct xfs_da_args dargs;
- xfs_dahash_t hashes[XFS_DA_NODE_MAXDEPTH];
- int maxrecs[XFS_DA_NODE_MAXDEPTH];
- struct xfs_da_state *state;
+ struct xfs_da_args dargs;
+ xfs_dahash_t hashes[XFS_DA_NODE_MAXDEPTH];
+ int maxrecs[XFS_DA_NODE_MAXDEPTH];
+ struct xfs_da_state *state;
struct xfs_scrub *sc;
- void *private;
+ void *private;
/*
* Lowest and highest directory block address in which we expect
@@ -22,10 +22,10 @@ struct xchk_da_btree {
* (presumably) means between LEAF_OFFSET and FREE_OFFSET; for
* attributes there is no limit.
*/
- xfs_dablk_t lowest;
- xfs_dablk_t highest;
+ xfs_dablk_t lowest;
+ xfs_dablk_t highest;
- int tree_level;
+ int tree_level;
};
typedef int (*xchk_da_btree_rec_fn)(struct xchk_da_btree *ds,
@@ -37,9 +37,8 @@ bool xchk_da_process_error(struct xchk_da_btree *ds, int level, int *error);
/* Check for da btree corruption. */
void xchk_da_set_corrupt(struct xchk_da_btree *ds, int level);
-int xchk_da_btree_hash(struct xchk_da_btree *ds, int level,
- __be32 *hashp);
+int xchk_da_btree_hash(struct xchk_da_btree *ds, int level, __be32 *hashp);
int xchk_da_btree(struct xfs_scrub *sc, int whichfork,
- xchk_da_btree_rec_fn scrub_fn, void *private);
+ xchk_da_btree_rec_fn scrub_fn, void *private);
#endif /* __XFS_SCRUB_DABTREE_H__ */
diff --git a/fs/xfs/scrub/dir.c b/fs/xfs/scrub/dir.c
index 194a3ef69a9f..f58709052b03 100644
--- a/fs/xfs/scrub/dir.c
+++ b/fs/xfs/scrub/dir.c
@@ -33,7 +33,7 @@
int
xchk_setup_directory(
struct xfs_scrub *sc,
- struct xfs_inode *ip)
+ struct xfs_inode *ip)
{
return xchk_setup_inode_contents(sc, ip, 0);
}
@@ -44,7 +44,7 @@ xchk_setup_directory(
struct xchk_dir_ctx {
/* VFS fill-directory iterator */
- struct dir_context dir_iter;
+ struct dir_context dir_iter;
struct xfs_scrub *sc;
};
@@ -52,15 +52,15 @@ struct xchk_dir_ctx {
/* Check that an inode's mode matches a given DT_ type. */
STATIC int
xchk_dir_check_ftype(
- struct xchk_dir_ctx *sdc,
- xfs_fileoff_t offset,
- xfs_ino_t inum,
- int dtype)
+ struct xchk_dir_ctx *sdc,
+ xfs_fileoff_t offset,
+ xfs_ino_t inum,
+ int dtype)
{
- struct xfs_mount *mp = sdc->sc->mp;
- struct xfs_inode *ip;
- int ino_dtype;
- int error = 0;
+ struct xfs_mount *mp = sdc->sc->mp;
+ struct xfs_inode *ip;
+ int ino_dtype;
+ int error = 0;
if (!xfs_sb_version_hasftype(&mp->m_sb)) {
if (dtype != DT_UNKNOWN && dtype != DT_DIR)
@@ -102,20 +102,20 @@ xchk_dir_check_ftype(
*/
STATIC int
xchk_dir_actor(
- struct dir_context *dir_iter,
- const char *name,
- int namelen,
- loff_t pos,
- u64 ino,
- unsigned type)
+ struct dir_context *dir_iter,
+ const char *name,
+ int namelen,
+ loff_t pos,
+ u64 ino,
+ unsigned type)
{
- struct xfs_mount *mp;
- struct xfs_inode *ip;
- struct xchk_dir_ctx *sdc;
- struct xfs_name xname;
- xfs_ino_t lookup_ino;
- xfs_dablk_t offset;
- int error = 0;
+ struct xfs_mount *mp;
+ struct xfs_inode *ip;
+ struct xchk_dir_ctx *sdc;
+ struct xfs_name xname;
+ xfs_ino_t lookup_ino;
+ xfs_dablk_t offset;
+ int error = 0;
sdc = container_of(dir_iter, struct xchk_dir_ctx, dir_iter);
ip = sdc->sc->ip;
@@ -289,7 +289,7 @@ xchk_dir_rec(
*/
STATIC void
xchk_directory_check_free_entry(
- struct xfs_scrub *sc,
+ struct xfs_scrub *sc,
xfs_dablk_t lblk,
struct xfs_dir2_data_free *bf,
struct xfs_dir2_data_unused *dup)
@@ -314,7 +314,7 @@ xchk_directory_check_free_entry(
/* Check free space info in a directory data block. */
STATIC int
xchk_directory_data_bestfree(
- struct xfs_scrub *sc,
+ struct xfs_scrub *sc,
xfs_dablk_t lblk,
bool is_block)
{
@@ -455,7 +455,7 @@ xchk_directory_data_bestfree(
*/
STATIC void
xchk_directory_check_freesp(
- struct xfs_scrub *sc,
+ struct xfs_scrub *sc,
xfs_dablk_t lblk,
struct xfs_buf *dbp,
unsigned int len)
@@ -474,7 +474,7 @@ xchk_directory_check_freesp(
/* Check free space info in a directory leaf1 block. */
STATIC int
xchk_directory_leaf1_bestfree(
- struct xfs_scrub *sc,
+ struct xfs_scrub *sc,
struct xfs_da_args *args,
xfs_dablk_t lblk)
{
@@ -572,7 +572,7 @@ xchk_directory_leaf1_bestfree(
/* Check free space info in a directory freespace block. */
STATIC int
xchk_directory_free_bestfree(
- struct xfs_scrub *sc,
+ struct xfs_scrub *sc,
struct xfs_da_args *args,
xfs_dablk_t lblk)
{
@@ -628,18 +628,18 @@ STATIC int
xchk_directory_blocks(
struct xfs_scrub *sc)
{
- struct xfs_bmbt_irec got;
- struct xfs_da_args args;
- struct xfs_ifork *ifp;
- struct xfs_mount *mp = sc->mp;
- xfs_fileoff_t leaf_lblk;
- xfs_fileoff_t free_lblk;
- xfs_fileoff_t lblk;
- struct xfs_iext_cursor icur;
- xfs_dablk_t dabno;
- bool found;
- int is_block = 0;
- int error;
+ struct xfs_bmbt_irec got;
+ struct xfs_da_args args;
+ struct xfs_ifork *ifp;
+ struct xfs_mount *mp = sc->mp;
+ xfs_fileoff_t leaf_lblk;
+ xfs_fileoff_t free_lblk;
+ xfs_fileoff_t lblk;
+ struct xfs_iext_cursor icur;
+ xfs_dablk_t dabno;
+ bool found;
+ int is_block = 0;
+ int error;
/* Ignore local format directories. */
if (sc->ip->i_d.di_format != XFS_DINODE_FMT_EXTENTS &&
@@ -772,14 +772,14 @@ int
xchk_directory(
struct xfs_scrub *sc)
{
- struct xchk_dir_ctx sdc = {
+ struct xchk_dir_ctx sdc = {
.dir_iter.actor = xchk_dir_actor,
.dir_iter.pos = 0,
.sc = sc,
};
- size_t bufsize;
- loff_t oldpos;
- int error = 0;
+ size_t bufsize;
+ loff_t oldpos;
+ int error = 0;
if (!S_ISDIR(VFS_I(sc->ip)->i_mode))
return -ENOENT;
diff --git a/fs/xfs/scrub/ialloc.c b/fs/xfs/scrub/ialloc.c
index 6df8eba9f52b..224dba937492 100644
--- a/fs/xfs/scrub/ialloc.c
+++ b/fs/xfs/scrub/ialloc.c
@@ -37,7 +37,7 @@
int
xchk_setup_ag_iallocbt(
struct xfs_scrub *sc,
- struct xfs_inode *ip)
+ struct xfs_inode *ip)
{
return xchk_setup_ag_btree(sc, ip, sc->try_harder);
}
@@ -51,7 +51,7 @@ xchk_setup_ag_iallocbt(
*/
static inline void
xchk_iallocbt_chunk_xref_other(
- struct xfs_scrub *sc,
+ struct xfs_scrub *sc,
struct xfs_inobt_rec_incore *irec,
xfs_agino_t agino)
{
@@ -76,7 +76,7 @@ xchk_iallocbt_chunk_xref_other(
/* Cross-reference with the other btrees. */
STATIC void
xchk_iallocbt_chunk_xref(
- struct xfs_scrub *sc,
+ struct xfs_scrub *sc,
struct xfs_inobt_rec_incore *irec,
xfs_agino_t agino,
xfs_agblock_t agbno,
@@ -364,13 +364,13 @@ xchk_iallocbt_rec(
STATIC void
xchk_iallocbt_xref_rmap_btreeblks(
struct xfs_scrub *sc,
- int which)
+ int which)
{
- struct xfs_owner_info oinfo;
- xfs_filblks_t blocks;
- xfs_extlen_t inobt_blocks = 0;
- xfs_extlen_t finobt_blocks = 0;
- int error;
+ struct xfs_owner_info oinfo;
+ xfs_filblks_t blocks;
+ xfs_extlen_t inobt_blocks = 0;
+ xfs_extlen_t finobt_blocks = 0;
+ int error;
if (!sc->sa.ino_cur || !sc->sa.rmap_cur ||
(xfs_sb_version_hasfinobt(&sc->mp->m_sb) && !sc->sa.fino_cur) ||
@@ -404,12 +404,12 @@ xchk_iallocbt_xref_rmap_btreeblks(
STATIC void
xchk_iallocbt_xref_rmap_inodes(
struct xfs_scrub *sc,
- int which,
- xfs_filblks_t inode_blocks)
+ int which,
+ xfs_filblks_t inode_blocks)
{
- struct xfs_owner_info oinfo;
- xfs_filblks_t blocks;
- int error;
+ struct xfs_owner_info oinfo;
+ xfs_filblks_t blocks;
+ int error;
if (!sc->sa.rmap_cur || xchk_skip_xref(sc->sm))
return;
@@ -428,12 +428,12 @@ xchk_iallocbt_xref_rmap_inodes(
STATIC int
xchk_iallocbt(
struct xfs_scrub *sc,
- xfs_btnum_t which)
+ xfs_btnum_t which)
{
- struct xfs_btree_cur *cur;
- struct xfs_owner_info oinfo;
- xfs_filblks_t inode_blocks = 0;
- int error;
+ struct xfs_btree_cur *cur;
+ struct xfs_owner_info oinfo;
+ xfs_filblks_t inode_blocks = 0;
+ int error;
xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_INOBT);
cur = which == XFS_BTNUM_INO ? sc->sa.ino_cur : sc->sa.fino_cur;
@@ -475,13 +475,13 @@ xchk_finobt(
static inline void
xchk_xref_inode_check(
struct xfs_scrub *sc,
- xfs_agblock_t agbno,
- xfs_extlen_t len,
- struct xfs_btree_cur **icur,
- bool should_have_inodes)
+ xfs_agblock_t agbno,
+ xfs_extlen_t len,
+ struct xfs_btree_cur **icur,
+ bool should_have_inodes)
{
- bool has_inodes;
- int error;
+ bool has_inodes;
+ int error;
if (!(*icur) || xchk_skip_xref(sc->sm))
return;
@@ -497,8 +497,8 @@ xchk_xref_inode_check(
void
xchk_xref_is_not_inode_chunk(
struct xfs_scrub *sc,
- xfs_agblock_t agbno,
- xfs_extlen_t len)
+ xfs_agblock_t agbno,
+ xfs_extlen_t len)
{
xchk_xref_inode_check(sc, agbno, len, &sc->sa.ino_cur, false);
xchk_xref_inode_check(sc, agbno, len, &sc->sa.fino_cur, false);
@@ -508,8 +508,8 @@ xchk_xref_is_not_inode_chunk(
void
xchk_xref_is_inode_chunk(
struct xfs_scrub *sc,
- xfs_agblock_t agbno,
- xfs_extlen_t len)
+ xfs_agblock_t agbno,
+ xfs_extlen_t len)
{
xchk_xref_inode_check(sc, agbno, len, &sc->sa.ino_cur, true);
}
diff --git a/fs/xfs/scrub/inode.c b/fs/xfs/scrub/inode.c
index 6cc027983c13..5b3b177c0fc9 100644
--- a/fs/xfs/scrub/inode.c
+++ b/fs/xfs/scrub/inode.c
@@ -39,9 +39,9 @@
int
xchk_setup_inode(
struct xfs_scrub *sc,
- struct xfs_inode *ip)
+ struct xfs_inode *ip)
{
- int error;
+ int error;
/*
* Try to get the inode. If the verifiers fail, we try again
@@ -78,12 +78,12 @@ xchk_setup_inode(
STATIC void
xchk_inode_extsize(
struct xfs_scrub *sc,
- struct xfs_dinode *dip,
- xfs_ino_t ino,
- uint16_t mode,
- uint16_t flags)
+ struct xfs_dinode *dip,
+ xfs_ino_t ino,
+ uint16_t mode,
+ uint16_t flags)
{
- xfs_failaddr_t fa;
+ xfs_failaddr_t fa;
fa = xfs_inode_validate_extsize(sc->mp, be32_to_cpu(dip->di_extsize),
mode, flags);
@@ -100,13 +100,13 @@ xchk_inode_extsize(
STATIC void
xchk_inode_cowextsize(
struct xfs_scrub *sc,
- struct xfs_dinode *dip,
- xfs_ino_t ino,
- uint16_t mode,
- uint16_t flags,
- uint64_t flags2)
+ struct xfs_dinode *dip,
+ xfs_ino_t ino,
+ uint16_t mode,
+ uint16_t flags,
+ uint64_t flags2)
{
- xfs_failaddr_t fa;
+ xfs_failaddr_t fa;
fa = xfs_inode_validate_cowextsize(sc->mp,
be32_to_cpu(dip->di_cowextsize), mode, flags,
@@ -119,12 +119,12 @@ xchk_inode_cowextsize(
STATIC void
xchk_inode_flags(
struct xfs_scrub *sc,
- struct xfs_dinode *dip,
- xfs_ino_t ino,
- uint16_t mode,
- uint16_t flags)
+ struct xfs_dinode *dip,
+ xfs_ino_t ino,
+ uint16_t mode,
+ uint16_t flags)
{
- struct xfs_mount *mp = sc->mp;
+ struct xfs_mount *mp = sc->mp;
if (flags & ~XFS_DIFLAG_ANY)
goto bad;
@@ -164,13 +164,13 @@ xchk_inode_flags(
STATIC void
xchk_inode_flags2(
struct xfs_scrub *sc,
- struct xfs_dinode *dip,
- xfs_ino_t ino,
- uint16_t mode,
- uint16_t flags,
- uint64_t flags2)
+ struct xfs_dinode *dip,
+ xfs_ino_t ino,
+ uint16_t mode,
+ uint16_t flags,
+ uint64_t flags2)
{
- struct xfs_mount *mp = sc->mp;
+ struct xfs_mount *mp = sc->mp;
if (flags2 & ~XFS_DIFLAG2_ANY)
goto bad;
@@ -207,16 +207,16 @@ xchk_inode_flags2(
STATIC void
xchk_dinode(
struct xfs_scrub *sc,
- struct xfs_dinode *dip,
- xfs_ino_t ino)
+ struct xfs_dinode *dip,
+ xfs_ino_t ino)
{
- struct xfs_mount *mp = sc->mp;
- size_t fork_recs;
- unsigned long long isize;
- uint64_t flags2;
- uint32_t nextents;
- uint16_t flags;
- uint16_t mode;
+ struct xfs_mount *mp = sc->mp;
+ size_t fork_recs;
+ unsigned long long isize;
+ uint64_t flags2;
+ uint32_t nextents;
+ uint16_t flags;
+ uint16_t mode;
flags = be16_to_cpu(dip->di_flags);
if (dip->di_version >= 3)
@@ -426,7 +426,7 @@ xchk_dinode(
*/
static void
xchk_inode_xref_finobt(
- struct xfs_scrub *sc,
+ struct xfs_scrub *sc,
xfs_ino_t ino)
{
struct xfs_inobt_rec_incore rec;
@@ -470,12 +470,12 @@ xchk_inode_xref_finobt(
STATIC void
xchk_inode_xref_bmap(
struct xfs_scrub *sc,
- struct xfs_dinode *dip)
+ struct xfs_dinode *dip)
{
- xfs_extnum_t nextents;
- xfs_filblks_t count;
- xfs_filblks_t acount;
- int error;
+ xfs_extnum_t nextents;
+ xfs_filblks_t count;
+ xfs_filblks_t acount;
+ int error;
if (xchk_skip_xref(sc->sm))
return;
@@ -504,13 +504,13 @@ xchk_inode_xref_bmap(
STATIC void
xchk_inode_xref(
struct xfs_scrub *sc,
- xfs_ino_t ino,
- struct xfs_dinode *dip)
+ xfs_ino_t ino,
+ struct xfs_dinode *dip)
{
- struct xfs_owner_info oinfo;
- xfs_agnumber_t agno;
- xfs_agblock_t agbno;
- int error;
+ struct xfs_owner_info oinfo;
+ xfs_agnumber_t agno;
+ xfs_agblock_t agbno;
+ int error;
if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
return;
@@ -541,11 +541,11 @@ xchk_inode_xref(
static void
xchk_inode_check_reflink_iflag(
struct xfs_scrub *sc,
- xfs_ino_t ino)
+ xfs_ino_t ino)
{
- struct xfs_mount *mp = sc->mp;
- bool has_shared;
- int error;
+ struct xfs_mount *mp = sc->mp;
+ bool has_shared;
+ int error;
if (!xfs_sb_version_hasreflink(&mp->m_sb))
return;
@@ -566,8 +566,8 @@ int
xchk_inode(
struct xfs_scrub *sc)
{
- struct xfs_dinode di;
- int error = 0;
+ struct xfs_dinode di;
+ int error = 0;
/*
* If sc->ip is NULL, that means that the setup function called
diff --git a/fs/xfs/scrub/parent.c b/fs/xfs/scrub/parent.c
index 808459ad0c35..aacb0284c48a 100644
--- a/fs/xfs/scrub/parent.c
+++ b/fs/xfs/scrub/parent.c
@@ -29,7 +29,7 @@
int
xchk_setup_parent(
struct xfs_scrub *sc,
- struct xfs_inode *ip)
+ struct xfs_inode *ip)
{
return xchk_setup_inode_contents(sc, ip, 0);
}
@@ -39,22 +39,22 @@ xchk_setup_parent(
/* Look for an entry in a parent pointing to this inode. */
struct xchk_parent_ctx {
- struct dir_context dc;
- xfs_ino_t ino;
- xfs_nlink_t nlink;
+ struct dir_context dc;
+ xfs_ino_t ino;
+ xfs_nlink_t nlink;
};
/* Look for a single entry in a directory pointing to an inode. */
STATIC int
xchk_parent_actor(
- struct dir_context *dc,
- const char *name,
- int namelen,
- loff_t pos,
- u64 ino,
- unsigned type)
+ struct dir_context *dc,
+ const char *name,
+ int namelen,
+ loff_t pos,
+ u64 ino,
+ unsigned type)
{
- struct xchk_parent_ctx *spc;
+ struct xchk_parent_ctx *spc;
spc = container_of(dc, struct xchk_parent_ctx, dc);
if (spc->ino == ino)
@@ -66,19 +66,19 @@ xchk_parent_actor(
STATIC int
xchk_parent_count_parent_dentries(
struct xfs_scrub *sc,
- struct xfs_inode *parent,
- xfs_nlink_t *nlink)
+ struct xfs_inode *parent,
+ xfs_nlink_t *nlink)
{
- struct xchk_parent_ctx spc = {
+ struct xchk_parent_ctx spc = {
.dc.actor = xchk_parent_actor,
.dc.pos = 0,
.ino = sc->ip->i_ino,
.nlink = 0,
};
- size_t bufsize;
- loff_t oldpos;
- uint lock_mode;
- int error = 0;
+ size_t bufsize;
+ loff_t oldpos;
+ uint lock_mode;
+ int error = 0;
/*
* If there are any blocks, read-ahead block 0 as we're almost
@@ -122,14 +122,14 @@ xchk_parent_count_parent_dentries(
STATIC int
xchk_parent_validate(
struct xfs_scrub *sc,
- xfs_ino_t dnum,
- bool *try_again)
+ xfs_ino_t dnum,
+ bool *try_again)
{
- struct xfs_mount *mp = sc->mp;
- struct xfs_inode *dp = NULL;
- xfs_nlink_t expected_nlink;
- xfs_nlink_t nlink;
- int error = 0;
+ struct xfs_mount *mp = sc->mp;
+ struct xfs_inode *dp = NULL;
+ xfs_nlink_t expected_nlink;
+ xfs_nlink_t nlink;
+ int error = 0;
*try_again = false;
@@ -257,11 +257,11 @@ int
xchk_parent(
struct xfs_scrub *sc)
{
- struct xfs_mount *mp = sc->mp;
- xfs_ino_t dnum;
- bool try_again;
- int tries = 0;
- int error = 0;
+ struct xfs_mount *mp = sc->mp;
+ xfs_ino_t dnum;
+ bool try_again;
+ int tries = 0;
+ int error = 0;
/*
* If we're a directory, check that the '..' link points up to
diff --git a/fs/xfs/scrub/quota.c b/fs/xfs/scrub/quota.c
index 309ebeecfa5d..782d582d3edd 100644
--- a/fs/xfs/scrub/quota.c
+++ b/fs/xfs/scrub/quota.c
@@ -49,10 +49,10 @@ xchk_quota_to_dqtype(
int
xchk_setup_quota(
struct xfs_scrub *sc,
- struct xfs_inode *ip)
+ struct xfs_inode *ip)
{
- uint dqtype;
- int error;
+ uint dqtype;
+ int error;
if (!XFS_IS_QUOTA_RUNNING(sc->mp) || !XFS_IS_QUOTA_ON(sc->mp))
return -ENOENT;
@@ -77,33 +77,33 @@ xchk_setup_quota(
struct xchk_quota_info {
struct xfs_scrub *sc;
- xfs_dqid_t last_id;
+ xfs_dqid_t last_id;
};
/* Scrub the fields in an individual quota item. */
STATIC int
xchk_quota_item(
- struct xfs_dquot *dq,
- uint dqtype,
- void *priv)
+ struct xfs_dquot *dq,
+ uint dqtype,
+ void *priv)
{
- struct xchk_quota_info *sqi = priv;
+ struct xchk_quota_info *sqi = priv;
struct xfs_scrub *sc = sqi->sc;
- struct xfs_mount *mp = sc->mp;
- struct xfs_disk_dquot *d = &dq->q_core;
- struct xfs_quotainfo *qi = mp->m_quotainfo;
- xfs_fileoff_t offset;
- unsigned long long bsoft;
- unsigned long long isoft;
- unsigned long long rsoft;
- unsigned long long bhard;
- unsigned long long ihard;
- unsigned long long rhard;
- unsigned long long bcount;
- unsigned long long icount;
- unsigned long long rcount;
- xfs_ino_t fs_icount;
- xfs_dqid_t id = be32_to_cpu(d->d_id);
+ struct xfs_mount *mp = sc->mp;
+ struct xfs_disk_dquot *d = &dq->q_core;
+ struct xfs_quotainfo *qi = mp->m_quotainfo;
+ xfs_fileoff_t offset;
+ unsigned long long bsoft;
+ unsigned long long isoft;
+ unsigned long long rsoft;
+ unsigned long long bhard;
+ unsigned long long ihard;
+ unsigned long long rhard;
+ unsigned long long bcount;
+ unsigned long long icount;
+ unsigned long long rcount;
+ xfs_ino_t fs_icount;
+ xfs_dqid_t id = be32_to_cpu(d->d_id);
/*
* Except for the root dquot, the actual dquot we got must either have
@@ -197,12 +197,12 @@ STATIC int
xchk_quota_data_fork(
struct xfs_scrub *sc)
{
- struct xfs_bmbt_irec irec = { 0 };
- struct xfs_iext_cursor icur;
- struct xfs_quotainfo *qi = sc->mp->m_quotainfo;
- struct xfs_ifork *ifp;
- xfs_fileoff_t max_dqid_off;
- int error = 0;
+ struct xfs_bmbt_irec irec = { 0 };
+ struct xfs_iext_cursor icur;
+ struct xfs_quotainfo *qi = sc->mp->m_quotainfo;
+ struct xfs_ifork *ifp;
+ xfs_fileoff_t max_dqid_off;
+ int error = 0;
/* Invoke the fork scrubber. */
error = xchk_metadata_inode_forks(sc);
@@ -236,11 +236,11 @@ int
xchk_quota(
struct xfs_scrub *sc)
{
- struct xchk_quota_info sqi;
- struct xfs_mount *mp = sc->mp;
- struct xfs_quotainfo *qi = mp->m_quotainfo;
- uint dqtype;
- int error = 0;
+ struct xchk_quota_info sqi;
+ struct xfs_mount *mp = sc->mp;
+ struct xfs_quotainfo *qi = mp->m_quotainfo;
+ uint dqtype;
+ int error = 0;
dqtype = xchk_quota_to_dqtype(sc);
diff --git a/fs/xfs/scrub/refcount.c b/fs/xfs/scrub/refcount.c
index c1162d408987..e8c82b026083 100644
--- a/fs/xfs/scrub/refcount.c
+++ b/fs/xfs/scrub/refcount.c
@@ -30,7 +30,7 @@
int
xchk_setup_ag_refcountbt(
struct xfs_scrub *sc,
- struct xfs_inode *ip)
+ struct xfs_inode *ip)
{
return xchk_setup_ag_btree(sc, ip, false);
}
@@ -74,21 +74,21 @@ xchk_setup_ag_refcountbt(
* should always hold true. If not, the refcount is incorrect.
*/
struct xchk_refcnt_frag {
- struct list_head list;
- struct xfs_rmap_irec rm;
+ struct list_head list;
+ struct xfs_rmap_irec rm;
};
struct xchk_refcnt_check {
struct xfs_scrub *sc;
- struct list_head fragments;
+ struct list_head fragments;
/* refcount extent we're examining */
- xfs_agblock_t bno;
- xfs_extlen_t len;
- xfs_nlink_t refcount;
+ xfs_agblock_t bno;
+ xfs_extlen_t len;
+ xfs_nlink_t refcount;
/* number of owners seen */
- xfs_nlink_t seen;
+ xfs_nlink_t seen;
};
/*
@@ -278,7 +278,7 @@ xchk_refcountbt_process_rmap_fragments(
/* Use the rmap entries covering this extent to verify the refcount. */
STATIC void
xchk_refcountbt_xref_rmap(
- struct xfs_scrub *sc,
+ struct xfs_scrub *sc,
xfs_agblock_t bno,
xfs_extlen_t len,
xfs_nlink_t refcount)
@@ -326,9 +326,9 @@ xchk_refcountbt_xref_rmap(
STATIC void
xchk_refcountbt_xref(
struct xfs_scrub *sc,
- xfs_agblock_t agbno,
- xfs_extlen_t len,
- xfs_nlink_t refcount)
+ xfs_agblock_t agbno,
+ xfs_extlen_t len,
+ xfs_nlink_t refcount)
{
if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
return;
@@ -341,17 +341,17 @@ xchk_refcountbt_xref(
/* Scrub a refcountbt record. */
STATIC int
xchk_refcountbt_rec(
- struct xchk_btree *bs,
- union xfs_btree_rec *rec)
+ struct xchk_btree *bs,
+ union xfs_btree_rec *rec)
{
- struct xfs_mount *mp = bs->cur->bc_mp;
- xfs_agblock_t *cow_blocks = bs->private;
- xfs_agnumber_t agno = bs->cur->bc_private.a.agno;
- xfs_agblock_t bno;
- xfs_extlen_t len;
- xfs_nlink_t refcount;
- bool has_cowflag;
- int error = 0;
+ struct xfs_mount *mp = bs->cur->bc_mp;
+ xfs_agblock_t *cow_blocks = bs->private;
+ xfs_agnumber_t agno = bs->cur->bc_private.a.agno;
+ xfs_agblock_t bno;
+ xfs_extlen_t len;
+ xfs_nlink_t refcount;
+ bool has_cowflag;
+ int error = 0;
bno = be32_to_cpu(rec->refc.rc_startblock);
len = be32_to_cpu(rec->refc.rc_blockcount);
@@ -383,12 +383,12 @@ xchk_refcountbt_rec(
STATIC void
xchk_refcount_xref_rmap(
struct xfs_scrub *sc,
- struct xfs_owner_info *oinfo,
- xfs_filblks_t cow_blocks)
+ struct xfs_owner_info *oinfo,
+ xfs_filblks_t cow_blocks)
{
- xfs_extlen_t refcbt_blocks = 0;
- xfs_filblks_t blocks;
- int error;
+ xfs_extlen_t refcbt_blocks = 0;
+ xfs_filblks_t blocks;
+ int error;
if (!sc->sa.rmap_cur || xchk_skip_xref(sc->sm))
return;
@@ -419,9 +419,9 @@ int
xchk_refcountbt(
struct xfs_scrub *sc)
{
- struct xfs_owner_info oinfo;
- xfs_agblock_t cow_blocks = 0;
- int error;
+ struct xfs_owner_info oinfo;
+ xfs_agblock_t cow_blocks = 0;
+ int error;
xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_REFC);
error = xchk_btree(sc, sc->sa.refc_cur, xchk_refcountbt_rec,
@@ -437,7 +437,7 @@ xchk_refcountbt(
/* xref check that a cow staging extent is marked in the refcountbt. */
void
xchk_xref_is_cow_staging(
- struct xfs_scrub *sc,
+ struct xfs_scrub *sc,
xfs_agblock_t agbno,
xfs_extlen_t len)
{
@@ -484,11 +484,11 @@ xchk_xref_is_cow_staging(
void
xchk_xref_is_not_shared(
struct xfs_scrub *sc,
- xfs_agblock_t agbno,
- xfs_extlen_t len)
+ xfs_agblock_t agbno,
+ xfs_extlen_t len)
{
- bool shared;
- int error;
+ bool shared;
+ int error;
if (!sc->sa.refc_cur || xchk_skip_xref(sc->sm))
return;
diff --git a/fs/xfs/scrub/repair.c b/fs/xfs/scrub/repair.c
index 29debd5649ac..5de1cac424ec 100644
--- a/fs/xfs/scrub/repair.c
+++ b/fs/xfs/scrub/repair.c
@@ -42,11 +42,11 @@
*/
int
xrep_attempt(
- struct xfs_inode *ip,
+ struct xfs_inode *ip,
struct xfs_scrub *sc,
- bool *fixed)
+ bool *fixed)
{
- int error = 0;
+ int error = 0;
trace_xrep_attempt(ip, sc->sm, error);
@@ -94,7 +94,7 @@ xrep_attempt(
*/
void
xrep_failure(
- struct xfs_mount *mp)
+ struct xfs_mount *mp)
{
xfs_alert_ratelimited(mp,
"Corruption not fixed during online repair. Unmount and run xfs_repair.");
@@ -108,7 +108,7 @@ int
xrep_probe(
struct xfs_scrub *sc)
{
- int error = 0;
+ int error = 0;
if (xchk_should_terminate(sc, &error))
return error;
@@ -124,7 +124,7 @@ int
xrep_roll_ag_trans(
struct xfs_scrub *sc)
{
- int error;
+ int error;
/* Keep the AG header buffers locked so we can keep going. */
xfs_trans_bhold(sc->tp, sc->sa.agi_bp);
@@ -163,9 +163,9 @@ xrep_roll_ag_trans(
*/
bool
xrep_ag_has_space(
- struct xfs_perag *pag,
- xfs_extlen_t nr_blocks,
- enum xfs_ag_resv_type type)
+ struct xfs_perag *pag,
+ xfs_extlen_t nr_blocks,
+ enum xfs_ag_resv_type type)
{
return !xfs_ag_resv_critical(pag, XFS_AG_RESV_RMAPBT) &&
!xfs_ag_resv_critical(pag, XFS_AG_RESV_METADATA) &&
@@ -179,7 +179,7 @@ xrep_ag_has_space(
*/
xfs_extlen_t
xrep_calc_ag_resblks(
- struct xfs_scrub *sc)
+ struct xfs_scrub *sc)
{
struct xfs_mount *mp = sc->mp;
struct xfs_scrub_metadata *sm = sc->sm;
@@ -280,13 +280,13 @@ xrep_calc_ag_resblks(
int
xrep_alloc_ag_block(
struct xfs_scrub *sc,
- struct xfs_owner_info *oinfo,
- xfs_fsblock_t *fsbno,
- enum xfs_ag_resv_type resv)
+ struct xfs_owner_info *oinfo,
+ xfs_fsblock_t *fsbno,
+ enum xfs_ag_resv_type resv)
{
- struct xfs_alloc_arg args = {0};
- xfs_agblock_t bno;
- int error;
+ struct xfs_alloc_arg args = {0};
+ xfs_agblock_t bno;
+ int error;
switch (resv) {
case XFS_AG_RESV_AGFL:
@@ -330,7 +330,7 @@ xrep_alloc_ag_block(
/* Initialize a new AG btree root block with zero entries. */
int
xrep_init_btblock(
- struct xfs_scrub *sc,
+ struct xfs_scrub *sc,
xfs_fsblock_t fsb,
struct xfs_buf **bpp,
xfs_btnum_t btnum,
@@ -386,11 +386,11 @@ xrep_init_btblock(
int
xrep_collect_btree_extent(
struct xfs_scrub *sc,
- struct xrep_extent_list *exlist,
- xfs_fsblock_t fsbno,
- xfs_extlen_t len)
+ struct xrep_extent_list *exlist,
+ xfs_fsblock_t fsbno,
+ xfs_extlen_t len)
{
- struct xrep_extent *rex;
+ struct xrep_extent *rex;
trace_xrep_collect_btree_extent(sc->mp,
XFS_FSB_TO_AGNO(sc->mp, fsbno),
@@ -416,10 +416,10 @@ xrep_collect_btree_extent(
void
xrep_cancel_btree_extents(
struct xfs_scrub *sc,
- struct xrep_extent_list *exlist)
+ struct xrep_extent_list *exlist)
{
- struct xrep_extent *rex;
- struct xrep_extent *n;
+ struct xrep_extent *rex;
+ struct xrep_extent *n;
for_each_xrep_extent_safe(rex, n, exlist) {
list_del(&rex->list);
@@ -430,12 +430,12 @@ xrep_cancel_btree_extents(
/* Compare two btree extents. */
static int
xrep_btree_extent_cmp(
- void *priv,
- struct list_head *a,
- struct list_head *b)
+ void *priv,
+ struct list_head *a,
+ struct list_head *b)
{
- struct xrep_extent *ap;
- struct xrep_extent *bp;
+ struct xrep_extent *ap;
+ struct xrep_extent *bp;
ap = container_of(a, struct xrep_extent, list);
bp = container_of(b, struct xrep_extent, list);
@@ -464,17 +464,17 @@ xrep_btree_extent_cmp(
int
xrep_subtract_extents(
struct xfs_scrub *sc,
- struct xrep_extent_list *exlist,
- struct xrep_extent_list *sublist)
+ struct xrep_extent_list *exlist,
+ struct xrep_extent_list *sublist)
{
- struct list_head *lp;
- struct xrep_extent *ex;
- struct xrep_extent *newex;
- struct xrep_extent *subex;
- xfs_fsblock_t sub_fsb;
- xfs_extlen_t sub_len;
- int state;
- int error = 0;
+ struct list_head *lp;
+ struct xrep_extent *ex;
+ struct xrep_extent *newex;
+ struct xrep_extent *subex;
+ xfs_fsblock_t sub_fsb;
+ xfs_extlen_t sub_len;
+ int state;
+ int error = 0;
if (list_empty(&exlist->list) || list_empty(&sublist->list))
return 0;
@@ -621,13 +621,13 @@ xrep_subtract_extents(
int
xrep_invalidate_blocks(
struct xfs_scrub *sc,
- struct xrep_extent_list *exlist)
+ struct xrep_extent_list *exlist)
{
- struct xrep_extent *rex;
- struct xrep_extent *n;
- struct xfs_buf *bp;
- xfs_fsblock_t fsbno;
- xfs_agblock_t i;
+ struct xrep_extent *rex;
+ struct xrep_extent *n;
+ struct xfs_buf *bp;
+ xfs_fsblock_t fsbno;
+ xfs_agblock_t i;
/*
* For each block in each extent, see if there's an incore buffer for
@@ -659,9 +659,9 @@ xrep_invalidate_blocks(
int
xrep_fix_freelist(
struct xfs_scrub *sc,
- bool can_shrink)
+ bool can_shrink)
{
- struct xfs_alloc_arg args = {0};
+ struct xfs_alloc_arg args = {0};
args.mp = sc->mp;
args.tp = sc->tp;
@@ -679,10 +679,10 @@ xrep_fix_freelist(
STATIC int
xrep_put_freelist(
struct xfs_scrub *sc,
- xfs_agblock_t agbno)
+ xfs_agblock_t agbno)
{
- struct xfs_owner_info oinfo;
- int error;
+ struct xfs_owner_info oinfo;
+ int error;
/* Make sure there's space on the freelist. */
error = xrep_fix_freelist(sc, true);
@@ -715,16 +715,16 @@ xrep_put_freelist(
STATIC int
xrep_dispose_btree_block(
struct xfs_scrub *sc,
- xfs_fsblock_t fsbno,
- struct xfs_owner_info *oinfo,
- enum xfs_ag_resv_type resv)
+ xfs_fsblock_t fsbno,
+ struct xfs_owner_info *oinfo,
+ enum xfs_ag_resv_type resv)
{
- struct xfs_btree_cur *cur;
- struct xfs_buf *agf_bp = NULL;
- xfs_agnumber_t agno;
- xfs_agblock_t agbno;
- bool has_other_rmap;
- int error;
+ struct xfs_btree_cur *cur;
+ struct xfs_buf *agf_bp = NULL;
+ xfs_agnumber_t agno;
+ xfs_agblock_t agbno;
+ bool has_other_rmap;
+ int error;
agno = XFS_FSB_TO_AGNO(sc->mp, fsbno);
agbno = XFS_FSB_TO_AGBNO(sc->mp, fsbno);
@@ -789,13 +789,13 @@ xrep_dispose_btree_block(
int
xrep_reap_btree_extents(
struct xfs_scrub *sc,
- struct xrep_extent_list *exlist,
- struct xfs_owner_info *oinfo,
- enum xfs_ag_resv_type type)
+ struct xrep_extent_list *exlist,
+ struct xfs_owner_info *oinfo,
+ enum xfs_ag_resv_type type)
{
- struct xrep_extent *rex;
- struct xrep_extent *n;
- int error = 0;
+ struct xrep_extent *rex;
+ struct xrep_extent *n;
+ int error = 0;
ASSERT(xfs_sb_version_hasrmapbt(&sc->mp->m_sb));
@@ -851,7 +851,7 @@ xrep_reap_btree_extents(
*/
struct xrep_findroot {
- struct xfs_scrub *sc;
+ struct xfs_scrub *sc;
struct xfs_buf *agfl_bp;
struct xfs_agf *agf;
struct xrep_find_ag_btree *btree_info;
@@ -860,11 +860,11 @@ struct xrep_findroot {
/* See if our block is in the AGFL. */
STATIC int
xrep_findroot_agfl_walk(
- struct xfs_mount *mp,
- xfs_agblock_t bno,
- void *priv)
+ struct xfs_mount *mp,
+ xfs_agblock_t bno,
+ void *priv)
{
- xfs_agblock_t *agbno = priv;
+ xfs_agblock_t *agbno = priv;
return (*agbno == bno) ? XFS_BTREE_QUERY_RANGE_ABORT : 0;
}
@@ -981,7 +981,7 @@ xrep_findroot_rmap(
/* Find the roots of the per-AG btrees described in btree_info. */
int
xrep_find_ag_btree_roots(
- struct xfs_scrub *sc,
+ struct xfs_scrub *sc,
struct xfs_buf *agf_bp,
struct xrep_find_ag_btree *btree_info,
struct xfs_buf *agfl_bp)
@@ -1017,9 +1017,9 @@ xrep_find_ag_btree_roots(
void
xrep_force_quotacheck(
struct xfs_scrub *sc,
- uint dqtype)
+ uint dqtype)
{
- uint flag;
+ uint flag;
flag = xfs_quota_chkd_flag(dqtype);
if (!(flag & sc->mp->m_qflags))
@@ -1046,7 +1046,7 @@ int
xrep_ino_dqattach(
struct xfs_scrub *sc)
{
- int error;
+ int error;
error = xfs_qm_dqattach_locked(sc->ip, false);
switch (error) {
diff --git a/fs/xfs/scrub/repair.h b/fs/xfs/scrub/repair.h
index 677f4b73b5ec..91355f6b0087 100644
--- a/fs/xfs/scrub/repair.h
+++ b/fs/xfs/scrub/repair.h
@@ -15,33 +15,31 @@ static inline int xrep_notsupported(struct xfs_scrub *sc)
/* Repair helpers */
-int xrep_attempt(struct xfs_inode *ip, struct xfs_scrub *sc,
- bool *fixed);
+int xrep_attempt(struct xfs_inode *ip, struct xfs_scrub *sc, bool *fixed);
void xrep_failure(struct xfs_mount *mp);
int xrep_roll_ag_trans(struct xfs_scrub *sc);
bool xrep_ag_has_space(struct xfs_perag *pag, xfs_extlen_t nr_blocks,
enum xfs_ag_resv_type type);
xfs_extlen_t xrep_calc_ag_resblks(struct xfs_scrub *sc);
-int xrep_alloc_ag_block(struct xfs_scrub *sc,
- struct xfs_owner_info *oinfo, xfs_fsblock_t *fsbno,
- enum xfs_ag_resv_type resv);
+int xrep_alloc_ag_block(struct xfs_scrub *sc, struct xfs_owner_info *oinfo,
+ xfs_fsblock_t *fsbno, enum xfs_ag_resv_type resv);
int xrep_init_btblock(struct xfs_scrub *sc, xfs_fsblock_t fsb,
struct xfs_buf **bpp, xfs_btnum_t btnum,
const struct xfs_buf_ops *ops);
struct xrep_extent {
- struct list_head list;
- xfs_fsblock_t fsbno;
- xfs_extlen_t len;
+ struct list_head list;
+ xfs_fsblock_t fsbno;
+ xfs_extlen_t len;
};
struct xrep_extent_list {
- struct list_head list;
+ struct list_head list;
};
static inline void
xrep_init_extent_list(
- struct xrep_extent_list *exlist)
+ struct xrep_extent_list *exlist)
{
INIT_LIST_HEAD(&exlist->list);
}
@@ -78,10 +76,8 @@ struct xrep_find_ag_btree {
unsigned int height;
};
-int xrep_find_ag_btree_roots(struct xfs_scrub *sc,
- struct xfs_buf *agf_bp,
- struct xrep_find_ag_btree *btree_info,
- struct xfs_buf *agfl_bp);
+int xrep_find_ag_btree_roots(struct xfs_scrub *sc, struct xfs_buf *agf_bp,
+ struct xrep_find_ag_btree *btree_info, struct xfs_buf *agfl_bp);
void xrep_force_quotacheck(struct xfs_scrub *sc, uint dqtype);
int xrep_ino_dqattach(struct xfs_scrub *sc);
@@ -93,9 +89,9 @@ int xrep_superblock(struct xfs_scrub *sc);
#else
static inline int xrep_attempt(
- struct xfs_inode *ip,
+ struct xfs_inode *ip,
struct xfs_scrub *sc,
- bool *fixed)
+ bool *fixed)
{
return -EOPNOTSUPP;
}
diff --git a/fs/xfs/scrub/rmap.c b/fs/xfs/scrub/rmap.c
index dc9c91a706ff..5e293c129813 100644
--- a/fs/xfs/scrub/rmap.c
+++ b/fs/xfs/scrub/rmap.c
@@ -31,7 +31,7 @@
int
xchk_setup_ag_rmapbt(
struct xfs_scrub *sc,
- struct xfs_inode *ip)
+ struct xfs_inode *ip)
{
return xchk_setup_ag_btree(sc, ip, false);
}
@@ -42,15 +42,15 @@ xchk_setup_ag_rmapbt(
STATIC void
xchk_rmapbt_xref_refc(
struct xfs_scrub *sc,
- struct xfs_rmap_irec *irec)
+ struct xfs_rmap_irec *irec)
{
- xfs_agblock_t fbno;
- xfs_extlen_t flen;
- bool non_inode;
- bool is_bmbt;
- bool is_attr;
- bool is_unwritten;
- int error;
+ xfs_agblock_t fbno;
+ xfs_extlen_t flen;
+ bool non_inode;
+ bool is_bmbt;
+ bool is_attr;
+ bool is_unwritten;
+ int error;
if (!sc->sa.refc_cur || xchk_skip_xref(sc->sm))
return;
@@ -73,10 +73,10 @@ xchk_rmapbt_xref_refc(
STATIC void
xchk_rmapbt_xref(
struct xfs_scrub *sc,
- struct xfs_rmap_irec *irec)
+ struct xfs_rmap_irec *irec)
{
- xfs_agblock_t agbno = irec->rm_startblock;
- xfs_extlen_t len = irec->rm_blockcount;
+ xfs_agblock_t agbno = irec->rm_startblock;
+ xfs_extlen_t len = irec->rm_blockcount;
if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
return;
@@ -96,17 +96,17 @@ xchk_rmapbt_xref(
/* Scrub an rmapbt record. */
STATIC int
xchk_rmapbt_rec(
- struct xchk_btree *bs,
- union xfs_btree_rec *rec)
+ struct xchk_btree *bs,
+ union xfs_btree_rec *rec)
{
- struct xfs_mount *mp = bs->cur->bc_mp;
- struct xfs_rmap_irec irec;
- xfs_agnumber_t agno = bs->cur->bc_private.a.agno;
- bool non_inode;
- bool is_unwritten;
- bool is_bmbt;
- bool is_attr;
- int error;
+ struct xfs_mount *mp = bs->cur->bc_mp;
+ struct xfs_rmap_irec irec;
+ xfs_agnumber_t agno = bs->cur->bc_private.a.agno;
+ bool non_inode;
+ bool is_unwritten;
+ bool is_bmbt;
+ bool is_attr;
+ int error;
error = xfs_rmap_btrec_to_irec(rec, &irec);
if (!xchk_btree_process_error(bs->sc, bs->cur, 0, &error))
@@ -174,7 +174,7 @@ int
xchk_rmapbt(
struct xfs_scrub *sc)
{
- struct xfs_owner_info oinfo;
+ struct xfs_owner_info oinfo;
xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_AG);
return xchk_btree(sc, sc->sa.rmap_cur, xchk_rmapbt_rec,
@@ -185,13 +185,13 @@ xchk_rmapbt(
static inline void
xchk_xref_check_owner(
struct xfs_scrub *sc,
- xfs_agblock_t bno,
- xfs_extlen_t len,
- struct xfs_owner_info *oinfo,
- bool should_have_rmap)
+ xfs_agblock_t bno,
+ xfs_extlen_t len,
+ struct xfs_owner_info *oinfo,
+ bool should_have_rmap)
{
- bool has_rmap;
- int error;
+ bool has_rmap;
+ int error;
if (!sc->sa.rmap_cur || xchk_skip_xref(sc->sm))
return;
@@ -208,9 +208,9 @@ xchk_xref_check_owner(
void
xchk_xref_is_owned_by(
struct xfs_scrub *sc,
- xfs_agblock_t bno,
- xfs_extlen_t len,
- struct xfs_owner_info *oinfo)
+ xfs_agblock_t bno,
+ xfs_extlen_t len,
+ struct xfs_owner_info *oinfo)
{
xchk_xref_check_owner(sc, bno, len, oinfo, true);
}
@@ -219,9 +219,9 @@ xchk_xref_is_owned_by(
void
xchk_xref_is_not_owned_by(
struct xfs_scrub *sc,
- xfs_agblock_t bno,
- xfs_extlen_t len,
- struct xfs_owner_info *oinfo)
+ xfs_agblock_t bno,
+ xfs_extlen_t len,
+ struct xfs_owner_info *oinfo)
{
xchk_xref_check_owner(sc, bno, len, oinfo, false);
}
@@ -230,11 +230,11 @@ xchk_xref_is_not_owned_by(
void
xchk_xref_has_no_owner(
struct xfs_scrub *sc,
- xfs_agblock_t bno,
- xfs_extlen_t len)
+ xfs_agblock_t bno,
+ xfs_extlen_t len)
{
- bool has_rmap;
- int error;
+ bool has_rmap;
+ int error;
if (!sc->sa.rmap_cur || xchk_skip_xref(sc->sm))
return;
diff --git a/fs/xfs/scrub/rtbitmap.c b/fs/xfs/scrub/rtbitmap.c
index 653a809bba34..665d4bbb17cc 100644
--- a/fs/xfs/scrub/rtbitmap.c
+++ b/fs/xfs/scrub/rtbitmap.c
@@ -27,9 +27,9 @@
int
xchk_setup_rt(
struct xfs_scrub *sc,
- struct xfs_inode *ip)
+ struct xfs_inode *ip)
{
- int error;
+ int error;
error = xchk_setup_fs(sc, ip);
if (error)
@@ -47,13 +47,13 @@ xchk_setup_rt(
/* Scrub a free extent record from the realtime bitmap. */
STATIC int
xchk_rtbitmap_rec(
- struct xfs_trans *tp,
- struct xfs_rtalloc_rec *rec,
- void *priv)
+ struct xfs_trans *tp,
+ struct xfs_rtalloc_rec *rec,
+ void *priv)
{
struct xfs_scrub *sc = priv;
- xfs_rtblock_t startblock;
- xfs_rtblock_t blockcount;
+ xfs_rtblock_t startblock;
+ xfs_rtblock_t blockcount;
startblock = rec->ar_startext * tp->t_mountp->m_sb.sb_rextsize;
blockcount = rec->ar_extcount * tp->t_mountp->m_sb.sb_rextsize;
@@ -70,7 +70,7 @@ int
xchk_rtbitmap(
struct xfs_scrub *sc)
{
- int error;
+ int error;
/* Invoke the fork scrubber. */
error = xchk_metadata_inode_forks(sc);
@@ -90,10 +90,10 @@ int
xchk_rtsummary(
struct xfs_scrub *sc)
{
- struct xfs_inode *rsumip = sc->mp->m_rsumip;
- struct xfs_inode *old_ip = sc->ip;
- uint old_ilock_flags = sc->ilock_flags;
- int error = 0;
+ struct xfs_inode *rsumip = sc->mp->m_rsumip;
+ struct xfs_inode *old_ip = sc->ip;
+ uint old_ilock_flags = sc->ilock_flags;
+ int error = 0;
/*
* We ILOCK'd the rt bitmap ip in the setup routine, now lock the
@@ -126,14 +126,14 @@ xchk_rtsummary(
void
xchk_xref_is_used_rt_space(
struct xfs_scrub *sc,
- xfs_rtblock_t fsbno,
- xfs_extlen_t len)
+ xfs_rtblock_t fsbno,
+ xfs_extlen_t len)
{
- xfs_rtblock_t startext;
- xfs_rtblock_t endext;
- xfs_rtblock_t extcount;
- bool is_free;
- int error;
+ xfs_rtblock_t startext;
+ xfs_rtblock_t endext;
+ xfs_rtblock_t extcount;
+ bool is_free;
+ int error;
if (xchk_skip_xref(sc->sm))
return;
diff --git a/fs/xfs/scrub/scrub.c b/fs/xfs/scrub/scrub.c
index b3c6420ccae5..5956b8073e2f 100644
--- a/fs/xfs/scrub/scrub.c
+++ b/fs/xfs/scrub/scrub.c
@@ -153,7 +153,7 @@ static int
xchk_probe(
struct xfs_scrub *sc)
{
- int error = 0;
+ int error = 0;
if (xchk_should_terminate(sc, &error))
return error;
@@ -167,8 +167,8 @@ xchk_probe(
STATIC int
xchk_teardown(
struct xfs_scrub *sc,
- struct xfs_inode *ip_in,
- int error)
+ struct xfs_inode *ip_in,
+ int error)
{
xchk_ag_free(sc, &sc->sa);
if (sc->tp) {
@@ -479,7 +479,7 @@ xfs_scrub_metadata(
struct xfs_inode *ip,
struct xfs_scrub_metadata *sm)
{
- struct xfs_scrub sc;
+ struct xfs_scrub sc;
struct xfs_mount *mp = ip->i_mount;
bool try_harder = false;
bool already_fixed = false;
diff --git a/fs/xfs/scrub/scrub.h b/fs/xfs/scrub/scrub.h
index 47c75d2f28da..af323b229c4b 100644
--- a/fs/xfs/scrub/scrub.h
+++ b/fs/xfs/scrub/scrub.h
@@ -36,21 +36,21 @@ struct xchk_meta_ops {
/* Buffer pointers and btree cursors for an entire AG. */
struct xchk_ag {
- xfs_agnumber_t agno;
- struct xfs_perag *pag;
+ xfs_agnumber_t agno;
+ struct xfs_perag *pag;
/* AG btree roots */
- struct xfs_buf *agf_bp;
- struct xfs_buf *agfl_bp;
- struct xfs_buf *agi_bp;
+ struct xfs_buf *agf_bp;
+ struct xfs_buf *agfl_bp;
+ struct xfs_buf *agi_bp;
/* AG btrees */
- struct xfs_btree_cur *bno_cur;
- struct xfs_btree_cur *cnt_cur;
- struct xfs_btree_cur *ino_cur;
- struct xfs_btree_cur *fino_cur;
- struct xfs_btree_cur *rmap_cur;
- struct xfs_btree_cur *refc_cur;
+ struct xfs_btree_cur *bno_cur;
+ struct xfs_btree_cur *cnt_cur;
+ struct xfs_btree_cur *ino_cur;
+ struct xfs_btree_cur *fino_cur;
+ struct xfs_btree_cur *rmap_cur;
+ struct xfs_btree_cur *refc_cur;
};
struct xfs_scrub {
@@ -66,7 +66,7 @@ struct xfs_scrub {
bool has_quotaofflock;
/* State tracking for single-AG operations. */
- struct xchk_ag sa;
+ struct xchk_ag sa;
};
/* Metadata scrubbers */
@@ -115,27 +115,25 @@ xchk_quota(struct xfs_scrub *sc)
#endif
/* cross-referencing helpers */
-void xchk_xref_is_used_space(struct xfs_scrub *sc,
- xfs_agblock_t agbno, xfs_extlen_t len);
-void xchk_xref_is_not_inode_chunk(struct xfs_scrub *sc,
- xfs_agblock_t agbno, xfs_extlen_t len);
-void xchk_xref_is_inode_chunk(struct xfs_scrub *sc,
- xfs_agblock_t agbno, xfs_extlen_t len);
-void xchk_xref_is_owned_by(struct xfs_scrub *sc,
- xfs_agblock_t agbno, xfs_extlen_t len,
- struct xfs_owner_info *oinfo);
-void xchk_xref_is_not_owned_by(struct xfs_scrub *sc,
- xfs_agblock_t agbno, xfs_extlen_t len,
- struct xfs_owner_info *oinfo);
-void xchk_xref_has_no_owner(struct xfs_scrub *sc,
- xfs_agblock_t agbno, xfs_extlen_t len);
-void xchk_xref_is_cow_staging(struct xfs_scrub *sc,
- xfs_agblock_t bno, xfs_extlen_t len);
-void xchk_xref_is_not_shared(struct xfs_scrub *sc,
- xfs_agblock_t bno, xfs_extlen_t len);
+void xchk_xref_is_used_space(struct xfs_scrub *sc, xfs_agblock_t agbno,
+ xfs_extlen_t len);
+void xchk_xref_is_not_inode_chunk(struct xfs_scrub *sc, xfs_agblock_t agbno,
+ xfs_extlen_t len);
+void xchk_xref_is_inode_chunk(struct xfs_scrub *sc, xfs_agblock_t agbno,
+ xfs_extlen_t len);
+void xchk_xref_is_owned_by(struct xfs_scrub *sc, xfs_agblock_t agbno,
+ xfs_extlen_t len, struct xfs_owner_info *oinfo);
+void xchk_xref_is_not_owned_by(struct xfs_scrub *sc, xfs_agblock_t agbno,
+ xfs_extlen_t len, struct xfs_owner_info *oinfo);
+void xchk_xref_has_no_owner(struct xfs_scrub *sc, xfs_agblock_t agbno,
+ xfs_extlen_t len);
+void xchk_xref_is_cow_staging(struct xfs_scrub *sc, xfs_agblock_t bno,
+ xfs_extlen_t len);
+void xchk_xref_is_not_shared(struct xfs_scrub *sc, xfs_agblock_t bno,
+ xfs_extlen_t len);
#ifdef CONFIG_XFS_RT
-void xchk_xref_is_used_rt_space(struct xfs_scrub *sc,
- xfs_rtblock_t rtbno, xfs_extlen_t len);
+void xchk_xref_is_used_rt_space(struct xfs_scrub *sc, xfs_rtblock_t rtbno,
+ xfs_extlen_t len);
#else
# define xchk_xref_is_used_rt_space(sc, rtbno, len) do { } while (0)
#endif
diff --git a/fs/xfs/scrub/symlink.c b/fs/xfs/scrub/symlink.c
index 56c6347e9482..f7ebaa946999 100644
--- a/fs/xfs/scrub/symlink.c
+++ b/fs/xfs/scrub/symlink.c
@@ -27,7 +27,7 @@
int
xchk_setup_symlink(
struct xfs_scrub *sc,
- struct xfs_inode *ip)
+ struct xfs_inode *ip)
{
/* Allocate the buffer without the inode lock held. */
sc->buf = kmem_zalloc_large(XFS_SYMLINK_MAXLEN + 1, KM_SLEEP);
@@ -43,10 +43,10 @@ int
xchk_symlink(
struct xfs_scrub *sc)
{
- struct xfs_inode *ip = sc->ip;
- struct xfs_ifork *ifp;
- loff_t len;
- int error = 0;
+ struct xfs_inode *ip = sc->ip;
+ struct xfs_ifork *ifp;
+ loff_t len;
+ int error = 0;
if (!S_ISLNK(VFS_I(ip)->i_mode))
return -ENOENT;
diff --git a/fs/xfs/scrub/trace.c b/fs/xfs/scrub/trace.c
index 1ef1202a1e45..96feaf8dcdec 100644
--- a/fs/xfs/scrub/trace.c
+++ b/fs/xfs/scrub/trace.c
@@ -23,8 +23,8 @@
/* Figure out which block the btree cursor was pointing to. */
static inline xfs_fsblock_t
xchk_btree_cur_fsbno(
- struct xfs_btree_cur *cur,
- int level)
+ struct xfs_btree_cur *cur,
+ int level)
{
if (level < cur->bc_nlevels && cur->bc_bufs[level])
return XFS_DADDR_TO_FSB(cur->bc_mp, cur->bc_bufs[level]->b_bn);
^ permalink raw reply related [flat|nested] 30+ messages in thread
* Re: [PATCH 1/8] xfs: check leaf attribute block freemap in verifier
2018-07-18 15:50 ` [PATCH 1/8] xfs: check leaf attribute block freemap in verifier Darrick J. Wong
@ 2018-07-19 12:19 ` Carlos Maiolino
2018-07-19 12:24 ` Brian Foster
2018-07-19 15:25 ` [PATCH v2 " Darrick J. Wong
2 siblings, 0 replies; 30+ messages in thread
From: Carlos Maiolino @ 2018-07-19 12:19 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: darrick.wong, linux-xfs
On Wed, Jul 18, 2018 at 08:50:34AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Check the leaf attribute freemap when we we're verifying the block.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
> fs/xfs/libxfs/xfs_attr_leaf.c | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
>
> diff --git a/fs/xfs/libxfs/xfs_attr_leaf.c b/fs/xfs/libxfs/xfs_attr_leaf.c
> index 76e90046731c..b3c19339e1b5 100644
> --- a/fs/xfs/libxfs/xfs_attr_leaf.c
> +++ b/fs/xfs/libxfs/xfs_attr_leaf.c
> @@ -244,6 +244,8 @@ xfs_attr3_leaf_verify(
> struct xfs_attr_leafblock *leaf = bp->b_addr;
> struct xfs_perag *pag = bp->b_pag;
> struct xfs_attr_leaf_entry *entries;
> + uint16_t end;
> + int i;
>
> xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &ichdr, leaf);
>
> @@ -289,6 +291,22 @@ xfs_attr3_leaf_verify(
> /* XXX: need to range check rest of attr header values */
> /* XXX: hash order check? */
>
> + for (i = 0; i < XFS_ATTR_LEAF_MAPSIZE; i++) {
> + if (ichdr.freemap[i].base > mp->m_attr_geo->blksize)
> + return __this_address;
> + if (ichdr.freemap[i].base & 0x3)
> + return __this_address;
> + if (ichdr.freemap[i].size > mp->m_attr_geo->blksize)
> + return __this_address;
> + if (ichdr.freemap[i].size & 0x3)
What does 0x3 means here? This looks ok for me, giving the fact we have these
0x3 checks for base and size for decades, but out of curiosity, what they are
supposed to mean? :P
Other than that, you can add:
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
> + return __this_address;
> + end = ichdr.freemap[i].base + ichdr.freemap[i].size;
> + if (end < ichdr.freemap[i].base)
> + return __this_address;
> + if (end > mp->m_attr_geo->blksize)
> + return __this_address;
> + }
> +
> return NULL;
> }
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Carlos
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 1/8] xfs: check leaf attribute block freemap in verifier
2018-07-18 15:50 ` [PATCH 1/8] xfs: check leaf attribute block freemap in verifier Darrick J. Wong
2018-07-19 12:19 ` Carlos Maiolino
@ 2018-07-19 12:24 ` Brian Foster
2018-07-19 15:20 ` Darrick J. Wong
2018-07-19 15:25 ` [PATCH v2 " Darrick J. Wong
2 siblings, 1 reply; 30+ messages in thread
From: Brian Foster @ 2018-07-19 12:24 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: darrick.wong, linux-xfs
On Wed, Jul 18, 2018 at 08:50:34AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Check the leaf attribute freemap when we we're verifying the block.
>
s/we//
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
> fs/xfs/libxfs/xfs_attr_leaf.c | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
>
> diff --git a/fs/xfs/libxfs/xfs_attr_leaf.c b/fs/xfs/libxfs/xfs_attr_leaf.c
> index 76e90046731c..b3c19339e1b5 100644
> --- a/fs/xfs/libxfs/xfs_attr_leaf.c
> +++ b/fs/xfs/libxfs/xfs_attr_leaf.c
> @@ -244,6 +244,8 @@ xfs_attr3_leaf_verify(
> struct xfs_attr_leafblock *leaf = bp->b_addr;
> struct xfs_perag *pag = bp->b_pag;
> struct xfs_attr_leaf_entry *entries;
> + uint16_t end;
> + int i;
>
> xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &ichdr, leaf);
>
> @@ -289,6 +291,22 @@ xfs_attr3_leaf_verify(
> /* XXX: need to range check rest of attr header values */
> /* XXX: hash order check? */
>
> + for (i = 0; i < XFS_ATTR_LEAF_MAPSIZE; i++) {
> + if (ichdr.freemap[i].base > mp->m_attr_geo->blksize)
> + return __this_address;
> + if (ichdr.freemap[i].base & 0x3)
> + return __this_address;
Same question as Carlos.. can you elaborate on the 0x3 magic number? (A
one-liner comment might be useful).
Brian
> + if (ichdr.freemap[i].size > mp->m_attr_geo->blksize)
> + return __this_address;
> + if (ichdr.freemap[i].size & 0x3)
> + return __this_address;
> + end = ichdr.freemap[i].base + ichdr.freemap[i].size;
> + if (end < ichdr.freemap[i].base)
> + return __this_address;
> + if (end > mp->m_attr_geo->blksize)
> + return __this_address;
> + }
> +
> return NULL;
> }
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 2/8] xfs: return from _defer_finish with a clean transaction
2018-07-18 15:50 ` [PATCH 2/8] xfs: return from _defer_finish with a clean transaction Darrick J. Wong
@ 2018-07-19 12:24 ` Brian Foster
2018-07-19 16:41 ` Christoph Hellwig
1 sibling, 0 replies; 30+ messages in thread
From: Brian Foster @ 2018-07-19 12:24 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: linux-xfs, Christoph Hellwig
On Wed, Jul 18, 2018 at 08:50:40AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Christoph Hellwig reported seeing the following assertion in
> generic/051:
>
> XFS: Assertion failed: tp->t_firstblock == NULLFSBLOCK, file: fs/xfs/libxfs5
> ------------[ cut here ]------------
> kernel BUG at fs/xfs/xfs_message.c:102!
> invalid opcode: 0000 [#1] SMP PTI
> CPU: 2 PID: 20757 Comm: fsstress Not tainted 4.18.0-rc4+ #3969
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.1-1 04/01/4
> RIP: 0010:assfail+0x23/0x30
> Code: c3 66 0f 1f 44 00 00 48 89 f1 41 89 d0 48 c7 c6 88 e0 8c 82 48 89 fa
> RSP: 0018:ffff88012dc43c08 EFLAGS: 00010202
> RAX: 0000000000000000 RBX: ffff88012dc43ca0 RCX: 0000000000000000
> RDX: 00000000ffffffc0 RSI: 000000000000000a RDI: ffffffff828480eb
> RBP: ffff88012aa92758 R08: 0000000000000000 R09: 0000000000000000
> R10: 0000000000000000 R11: f000000000000000 R12: 0000000000000000
> R13: ffff88012dc43d48 R14: ffff88013092e7e8 R15: 0000000000000014
> FS: 00007f8d689b8e80(0000) GS:ffff88013fd00000(0000) knlGS:0000000000000000
> CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> CR2: 00007f8d689c7000 CR3: 000000012ba6a000 CR4: 00000000000006e0
> Call Trace:
> xfs_defer_init+0xff/0x160
> xfs_reflink_remap_extent+0x31b/0xa00
> xfs_reflink_remap_blocks+0xec/0x4a0
> xfs_reflink_remap_range+0x3a1/0x650
> xfs_file_dedupe_range+0x39/0x50
> vfs_dedupe_file_range+0x218/0x260
> do_vfs_ioctl+0x262/0x6a0
> ? __se_sys_newfstat+0x3c/0x60
> ksys_ioctl+0x35/0x60
> __x64_sys_ioctl+0x11/0x20
> do_syscall_64+0x4b/0x190
> entry_SYSCALL_64_after_hwframe+0x49/0xbe
>
> The root cause of the assertion failure is that xfs_defer_finish doesn't
> roll the transaction after processing all the deferred items. Therefore
> it returns a dirty transaction to the caller, which leaves the caller at
> risk of exceeding the transaction reservation if it logs more items.
>
> Brian Foster's patchset to move the defer_ops firstblock into the
> transaction requires t_firstblock == NULLFSBLOCK upon defer_ops
> initialization, which is how this was noticed at all.
>
> Reported-by: Christoph Hellwig <hch@lst.de>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
Reviewed-by: Brian Foster <bfoster@redhat.com>
I was about ready to post the embedded dfops series but this reminds me
that this last roll should be optimized out in the xfs_defer_finish() ->
xfs_trans_commit() case. Technically a commit of a clean transaction
doesn't have to do anything, but that would at least avoid the
unnecessary regrant that occurs during the roll. Hmm, I may just post
the series as is for initial review and then tack on a patch for the
last bit later..
Brian
> fs/xfs/libxfs/xfs_defer.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
>
> diff --git a/fs/xfs/libxfs/xfs_defer.c b/fs/xfs/libxfs/xfs_defer.c
> index c3e5bffda4f5..3ba8bb308c3c 100644
> --- a/fs/xfs/libxfs/xfs_defer.c
> +++ b/fs/xfs/libxfs/xfs_defer.c
> @@ -424,6 +424,12 @@ xfs_defer_finish(
> cleanup_fn(*tp, state, error);
> }
>
> + /*
> + * Roll the transaction once more to avoid returning to the caller
> + * with a dirty transaction.
> + */
> + if ((*tp)->t_flags & XFS_TRANS_DIRTY)
> + error = xfs_defer_trans_roll(tp, dop);
> out:
> (*tp)->t_agfl_dfops = orig_dop;
> if (error)
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 3/8] xfs: trivial xfs_btree_del_cursor cleanups
2018-07-18 15:50 ` [PATCH 3/8] xfs: trivial xfs_btree_del_cursor cleanups Darrick J. Wong
@ 2018-07-19 12:24 ` Brian Foster
2018-07-19 12:25 ` Carlos Maiolino
2018-07-19 16:43 ` Christoph Hellwig
2 siblings, 0 replies; 30+ messages in thread
From: Brian Foster @ 2018-07-19 12:24 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: linux-xfs
On Wed, Jul 18, 2018 at 08:50:51AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> The error argument to xfs_btree_del_cursor already understands the
> "nonzero for error" semantics, so remove pointless error testing in the
> callers and pass it directly.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
Reviewed-by: Brian Foster <bfoster@redhat.com>
> fs/xfs/libxfs/xfs_bmap.c | 24 ++++++++----------------
> fs/xfs/libxfs/xfs_bmap_btree.c | 2 +-
> fs/xfs/libxfs/xfs_ialloc.c | 2 +-
> fs/xfs/libxfs/xfs_ialloc_btree.c | 2 +-
> fs/xfs/libxfs/xfs_refcount.c | 2 +-
> fs/xfs/libxfs/xfs_rmap.c | 18 +++---------------
> fs/xfs/scrub/bmap.c | 5 ++---
> fs/xfs/scrub/repair.c | 2 +-
> fs/xfs/xfs_discard.c | 2 +-
> fs/xfs/xfs_fsmap.c | 2 +-
> fs/xfs/xfs_itable.c | 6 ++----
> fs/xfs/xfs_reflink.c | 2 +-
> 12 files changed, 23 insertions(+), 46 deletions(-)
>
>
> diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
> index 7205268b30bc..50119b54a2b5 100644
> --- a/fs/xfs/libxfs/xfs_bmap.c
> +++ b/fs/xfs/libxfs/xfs_bmap.c
> @@ -975,8 +975,7 @@ xfs_bmap_add_attrfork_extents(
> flags, XFS_DATA_FORK);
> if (cur) {
> cur->bc_private.b.allocated = 0;
> - xfs_btree_del_cursor(cur,
> - error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(cur, error);
> }
> return error;
> }
> @@ -4500,8 +4499,7 @@ xfs_bmapi_write(
> bma.cur->bc_private.b.firstblock));
> *firstblock = bma.cur->bc_private.b.firstblock;
> }
> - xfs_btree_del_cursor(bma.cur,
> - error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(bma.cur, error);
> }
> if (!error)
> xfs_bmap_validate_ret(orig_bno, orig_len, orig_flags, orig_mval,
> @@ -4599,10 +4597,8 @@ xfs_bmapi_remap(
>
> if (logflags)
> xfs_trans_log_inode(tp, ip, logflags);
> - if (cur) {
> - xfs_btree_del_cursor(cur,
> - error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> - }
> + if (cur)
> + xfs_btree_del_cursor(cur, error);
> return error;
> }
>
> @@ -5505,8 +5501,7 @@ __xfs_bunmapi(
> *firstblock = cur->bc_private.b.firstblock;
> cur->bc_private.b.allocated = 0;
> }
> - xfs_btree_del_cursor(cur,
> - error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(cur, error);
> }
> return error;
> }
> @@ -5773,8 +5768,7 @@ xfs_bmap_collapse_extents(
> *next_fsb = got.br_startoff;
> del_cursor:
> if (cur)
> - xfs_btree_del_cursor(cur,
> - error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(cur, error);
> if (logflags)
> xfs_trans_log_inode(tp, ip, logflags);
> return error;
> @@ -5905,8 +5899,7 @@ xfs_bmap_insert_extents(
> *next_fsb = got.br_startoff;
> del_cursor:
> if (cur)
> - xfs_btree_del_cursor(cur,
> - error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(cur, error);
> if (logflags)
> xfs_trans_log_inode(tp, ip, logflags);
> return error;
> @@ -6026,8 +6019,7 @@ xfs_bmap_split_extent_at(
> del_cursor:
> if (cur) {
> cur->bc_private.b.allocated = 0;
> - xfs_btree_del_cursor(cur,
> - error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(cur, error);
> }
>
> if (logflags)
> diff --git a/fs/xfs/libxfs/xfs_bmap_btree.c b/fs/xfs/libxfs/xfs_bmap_btree.c
> index e1a2d9ceb615..cd2da4ef614f 100644
> --- a/fs/xfs/libxfs/xfs_bmap_btree.c
> +++ b/fs/xfs/libxfs/xfs_bmap_btree.c
> @@ -645,7 +645,7 @@ xfs_bmbt_change_owner(
> cur->bc_private.b.flags |= XFS_BTCUR_BPRV_INVALID_OWNER;
>
> error = xfs_btree_change_owner(cur, new_owner, buffer_list);
> - xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(cur, error);
> return error;
> }
>
> diff --git a/fs/xfs/libxfs/xfs_ialloc.c b/fs/xfs/libxfs/xfs_ialloc.c
> index 0d968e8143aa..dd0a0fb0abc8 100644
> --- a/fs/xfs/libxfs/xfs_ialloc.c
> +++ b/fs/xfs/libxfs/xfs_ialloc.c
> @@ -2260,7 +2260,7 @@ xfs_imap_lookup(
> }
>
> xfs_trans_brelse(tp, agbp);
> - xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(cur, error);
> if (error)
> return error;
>
> diff --git a/fs/xfs/libxfs/xfs_ialloc_btree.c b/fs/xfs/libxfs/xfs_ialloc_btree.c
> index a5237afec5ab..735a33252eb2 100644
> --- a/fs/xfs/libxfs/xfs_ialloc_btree.c
> +++ b/fs/xfs/libxfs/xfs_ialloc_btree.c
> @@ -566,7 +566,7 @@ xfs_inobt_count_blocks(
>
> cur = xfs_inobt_init_cursor(mp, NULL, agbp, agno, btnum);
> error = xfs_btree_count_blocks(cur, tree_blocks);
> - xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(cur, error);
> xfs_buf_relse(agbp);
>
> return error;
> diff --git a/fs/xfs/libxfs/xfs_refcount.c b/fs/xfs/libxfs/xfs_refcount.c
> index 9dda6fd0bb13..240a32984d13 100644
> --- a/fs/xfs/libxfs/xfs_refcount.c
> +++ b/fs/xfs/libxfs/xfs_refcount.c
> @@ -1067,7 +1067,7 @@ xfs_refcount_finish_one_cleanup(
> if (rcur == NULL)
> return;
> agbp = rcur->bc_private.a.agbp;
> - xfs_btree_del_cursor(rcur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(rcur, error);
> if (error)
> xfs_trans_brelse(tp, agbp);
> }
> diff --git a/fs/xfs/libxfs/xfs_rmap.c b/fs/xfs/libxfs/xfs_rmap.c
> index 8b2a2f81d110..fb266fa2cc45 100644
> --- a/fs/xfs/libxfs/xfs_rmap.c
> +++ b/fs/xfs/libxfs/xfs_rmap.c
> @@ -670,14 +670,8 @@ xfs_rmap_free(
> cur = xfs_rmapbt_init_cursor(mp, tp, agbp, agno);
>
> error = xfs_rmap_unmap(cur, bno, len, false, oinfo);
> - if (error)
> - goto out_error;
>
> - xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR);
> - return 0;
> -
> -out_error:
> - xfs_btree_del_cursor(cur, XFS_BTREE_ERROR);
> + xfs_btree_del_cursor(cur, error);
> return error;
> }
>
> @@ -912,14 +906,8 @@ xfs_rmap_alloc(
>
> cur = xfs_rmapbt_init_cursor(mp, tp, agbp, agno);
> error = xfs_rmap_map(cur, bno, len, false, oinfo);
> - if (error)
> - goto out_error;
>
> - xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR);
> - return 0;
> -
> -out_error:
> - xfs_btree_del_cursor(cur, XFS_BTREE_ERROR);
> + xfs_btree_del_cursor(cur, error);
> return error;
> }
>
> @@ -2156,7 +2144,7 @@ xfs_rmap_finish_one_cleanup(
> if (rcur == NULL)
> return;
> agbp = rcur->bc_private.a.agbp;
> - xfs_btree_del_cursor(rcur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(rcur, error);
> if (error)
> xfs_trans_brelse(tp, agbp);
> }
> diff --git a/fs/xfs/scrub/bmap.c b/fs/xfs/scrub/bmap.c
> index 3d08589f5c60..ebbfab173e97 100644
> --- a/fs/xfs/scrub/bmap.c
> +++ b/fs/xfs/scrub/bmap.c
> @@ -404,8 +404,7 @@ xfs_scrub_bmap_btree(
> cur = xfs_bmbt_init_cursor(mp, sc->tp, ip, whichfork);
> xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, whichfork);
> error = xfs_scrub_btree(sc, cur, xfs_scrub_bmapbt_rec, &oinfo, info);
> - xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR :
> - XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(cur, error);
> return error;
> }
>
> @@ -514,7 +513,7 @@ xfs_scrub_bmap_check_ag_rmaps(
> if (error == XFS_BTREE_QUERY_RANGE_ABORT)
> error = 0;
>
> - xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(cur, error);
> out_agf:
> xfs_trans_brelse(sc->tp, agf);
> return error;
> diff --git a/fs/xfs/scrub/repair.c b/fs/xfs/scrub/repair.c
> index 326be4e8b71e..35c589a04fac 100644
> --- a/fs/xfs/scrub/repair.c
> +++ b/fs/xfs/scrub/repair.c
> @@ -1009,7 +1009,7 @@ xfs_repair_find_ag_btree_roots(
>
> cur = xfs_rmapbt_init_cursor(mp, sc->tp, agf_bp, sc->sa.agno);
> error = xfs_rmap_query_all(cur, xfs_repair_findroot_rmap, &ri);
> - xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(cur, error);
>
> return error;
> }
> diff --git a/fs/xfs/xfs_discard.c b/fs/xfs/xfs_discard.c
> index 678a5fcd7576..93f07edafd81 100644
> --- a/fs/xfs/xfs_discard.c
> +++ b/fs/xfs/xfs_discard.c
> @@ -128,7 +128,7 @@ xfs_trim_extents(
> }
>
> out_del_cursor:
> - xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(cur, error);
> xfs_buf_relse(agbp);
> out_put_perag:
> xfs_perag_put(pag);
> diff --git a/fs/xfs/xfs_fsmap.c b/fs/xfs/xfs_fsmap.c
> index c7157bc48bd1..f7e00e42f360 100644
> --- a/fs/xfs/xfs_fsmap.c
> +++ b/fs/xfs/xfs_fsmap.c
> @@ -219,7 +219,7 @@ xfs_getfsmap_is_shared(
> error = xfs_refcount_find_shared(cur, rec->rm_startblock,
> rec->rm_blockcount, &fbno, &flen, false);
>
> - xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(cur, error);
> if (error)
> return error;
>
> diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c
> index 24f4f1c555b5..65810827a8d0 100644
> --- a/fs/xfs/xfs_itable.c
> +++ b/fs/xfs/xfs_itable.c
> @@ -458,8 +458,7 @@ xfs_bulkstat(
> * pending error, then we are done.
> */
> del_cursor:
> - xfs_btree_del_cursor(cur, error ?
> - XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(cur, error);
> xfs_buf_relse(agbp);
> if (error)
> break;
> @@ -632,8 +631,7 @@ xfs_inumbers(
>
> kmem_free(buffer);
> if (cur)
> - xfs_btree_del_cursor(cur, (error ? XFS_BTREE_ERROR :
> - XFS_BTREE_NOERROR));
> + xfs_btree_del_cursor(cur, error);
> if (agbp)
> xfs_buf_relse(agbp);
>
> diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c
> index 592fb2071a03..268d51e35812 100644
> --- a/fs/xfs/xfs_reflink.c
> +++ b/fs/xfs/xfs_reflink.c
> @@ -162,7 +162,7 @@ xfs_reflink_find_shared(
> error = xfs_refcount_find_shared(cur, agbno, aglen, fbno, flen,
> find_end_of_shared);
>
> - xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(cur, error);
>
> xfs_trans_brelse(tp, agbp);
> return error;
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 4/8] xfs: clean up xfs_btree_del_cursor callers
2018-07-18 15:50 ` [PATCH 4/8] xfs: clean up xfs_btree_del_cursor callers Darrick J. Wong
@ 2018-07-19 12:24 ` Brian Foster
2018-07-19 12:28 ` Carlos Maiolino
2018-07-19 16:46 ` Christoph Hellwig
2 siblings, 0 replies; 30+ messages in thread
From: Brian Foster @ 2018-07-19 12:24 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: linux-xfs
On Wed, Jul 18, 2018 at 08:50:57AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Less trivial cleanups of the error argument to xfs_btree_del_cursor;
> these require some minor code refactoring.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
Reviewed-by: Brian Foster <bfoster@redhat.com>
> fs/xfs/libxfs/xfs_refcount.c | 11 +++--------
> fs/xfs/scrub/repair.c | 7 +++----
> 2 files changed, 6 insertions(+), 12 deletions(-)
>
>
> diff --git a/fs/xfs/libxfs/xfs_refcount.c b/fs/xfs/libxfs/xfs_refcount.c
> index 240a32984d13..a38e5840a73f 100644
> --- a/fs/xfs/libxfs/xfs_refcount.c
> +++ b/fs/xfs/libxfs/xfs_refcount.c
> @@ -1675,11 +1675,11 @@ xfs_refcount_recover_cow_leftovers(
> high.rc.rc_startblock = -1U;
> error = xfs_btree_query_range(cur, &low, &high,
> xfs_refcount_recover_extent, &debris);
> - if (error)
> - goto out_cursor;
> - xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(cur, error);
> xfs_trans_brelse(tp, agbp);
> xfs_trans_cancel(tp);
> + if (error)
> + goto out_free;
>
> /* Now iterate the list to free the leftovers */
> list_for_each_entry_safe(rr, n, &debris, rr_list) {
> @@ -1727,11 +1727,6 @@ xfs_refcount_recover_cow_leftovers(
> kmem_free(rr);
> }
> return error;
> -
> -out_cursor:
> - xfs_btree_del_cursor(cur, XFS_BTREE_ERROR);
> - xfs_trans_brelse(tp, agbp);
> - goto out_trans;
> }
>
> /* Is there a record covering a given extent? */
> diff --git a/fs/xfs/scrub/repair.c b/fs/xfs/scrub/repair.c
> index 35c589a04fac..ea39e2bdc96a 100644
> --- a/fs/xfs/scrub/repair.c
> +++ b/fs/xfs/scrub/repair.c
> @@ -747,9 +747,9 @@ xfs_repair_dispose_btree_block(
>
> /* Can we find any other rmappings? */
> error = xfs_rmap_has_other_keys(cur, agbno, 1, oinfo, &has_other_rmap);
> + xfs_btree_del_cursor(cur, error);
> if (error)
> - goto out_cur;
> - xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR);
> + goto out_free;
>
> /*
> * If there are other rmappings, this block is cross linked and must
> @@ -779,8 +779,7 @@ xfs_repair_dispose_btree_block(
> return xfs_trans_roll_inode(&sc->tp, sc->ip);
> return xfs_repair_roll_ag_trans(sc);
>
> -out_cur:
> - xfs_btree_del_cursor(cur, XFS_BTREE_ERROR);
> +out_free:
> if (agf_bp != sc->sa.agf_bp)
> xfs_trans_brelse(sc->tp, agf_bp);
> return error;
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 3/8] xfs: trivial xfs_btree_del_cursor cleanups
2018-07-18 15:50 ` [PATCH 3/8] xfs: trivial xfs_btree_del_cursor cleanups Darrick J. Wong
2018-07-19 12:24 ` Brian Foster
@ 2018-07-19 12:25 ` Carlos Maiolino
2018-07-19 16:43 ` Christoph Hellwig
2 siblings, 0 replies; 30+ messages in thread
From: Carlos Maiolino @ 2018-07-19 12:25 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: linux-xfs
On Wed, Jul 18, 2018 at 08:50:51AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> The error argument to xfs_btree_del_cursor already understands the
> "nonzero for error" semantics, so remove pointless error testing in the
> callers and pass it directly.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
> fs/xfs/libxfs/xfs_bmap.c | 24 ++++++++----------------
> fs/xfs/libxfs/xfs_bmap_btree.c | 2 +-
> fs/xfs/libxfs/xfs_ialloc.c | 2 +-
> fs/xfs/libxfs/xfs_ialloc_btree.c | 2 +-
> fs/xfs/libxfs/xfs_refcount.c | 2 +-
> fs/xfs/libxfs/xfs_rmap.c | 18 +++---------------
> fs/xfs/scrub/bmap.c | 5 ++---
> fs/xfs/scrub/repair.c | 2 +-
> fs/xfs/xfs_discard.c | 2 +-
> fs/xfs/xfs_fsmap.c | 2 +-
> fs/xfs/xfs_itable.c | 6 ++----
> fs/xfs/xfs_reflink.c | 2 +-
> 12 files changed, 23 insertions(+), 46 deletions(-)
>
>
> diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
> index 7205268b30bc..50119b54a2b5 100644
> --- a/fs/xfs/libxfs/xfs_bmap.c
> +++ b/fs/xfs/libxfs/xfs_bmap.c
> @@ -975,8 +975,7 @@ xfs_bmap_add_attrfork_extents(
> flags, XFS_DATA_FORK);
> if (cur) {
> cur->bc_private.b.allocated = 0;
> - xfs_btree_del_cursor(cur,
> - error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(cur, error);
> }
> return error;
> }
> @@ -4500,8 +4499,7 @@ xfs_bmapi_write(
> bma.cur->bc_private.b.firstblock));
> *firstblock = bma.cur->bc_private.b.firstblock;
> }
> - xfs_btree_del_cursor(bma.cur,
> - error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(bma.cur, error);
> }
> if (!error)
> xfs_bmap_validate_ret(orig_bno, orig_len, orig_flags, orig_mval,
> @@ -4599,10 +4597,8 @@ xfs_bmapi_remap(
>
> if (logflags)
> xfs_trans_log_inode(tp, ip, logflags);
> - if (cur) {
> - xfs_btree_del_cursor(cur,
> - error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> - }
> + if (cur)
> + xfs_btree_del_cursor(cur, error);
> return error;
> }
>
> @@ -5505,8 +5501,7 @@ __xfs_bunmapi(
> *firstblock = cur->bc_private.b.firstblock;
> cur->bc_private.b.allocated = 0;
> }
> - xfs_btree_del_cursor(cur,
> - error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(cur, error);
> }
> return error;
> }
> @@ -5773,8 +5768,7 @@ xfs_bmap_collapse_extents(
> *next_fsb = got.br_startoff;
> del_cursor:
> if (cur)
> - xfs_btree_del_cursor(cur,
> - error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(cur, error);
> if (logflags)
> xfs_trans_log_inode(tp, ip, logflags);
> return error;
> @@ -5905,8 +5899,7 @@ xfs_bmap_insert_extents(
> *next_fsb = got.br_startoff;
> del_cursor:
> if (cur)
> - xfs_btree_del_cursor(cur,
> - error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(cur, error);
> if (logflags)
> xfs_trans_log_inode(tp, ip, logflags);
> return error;
> @@ -6026,8 +6019,7 @@ xfs_bmap_split_extent_at(
> del_cursor:
> if (cur) {
> cur->bc_private.b.allocated = 0;
> - xfs_btree_del_cursor(cur,
> - error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(cur, error);
> }
>
> if (logflags)
> diff --git a/fs/xfs/libxfs/xfs_bmap_btree.c b/fs/xfs/libxfs/xfs_bmap_btree.c
> index e1a2d9ceb615..cd2da4ef614f 100644
> --- a/fs/xfs/libxfs/xfs_bmap_btree.c
> +++ b/fs/xfs/libxfs/xfs_bmap_btree.c
> @@ -645,7 +645,7 @@ xfs_bmbt_change_owner(
> cur->bc_private.b.flags |= XFS_BTCUR_BPRV_INVALID_OWNER;
>
> error = xfs_btree_change_owner(cur, new_owner, buffer_list);
> - xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(cur, error);
> return error;
> }
>
> diff --git a/fs/xfs/libxfs/xfs_ialloc.c b/fs/xfs/libxfs/xfs_ialloc.c
> index 0d968e8143aa..dd0a0fb0abc8 100644
> --- a/fs/xfs/libxfs/xfs_ialloc.c
> +++ b/fs/xfs/libxfs/xfs_ialloc.c
> @@ -2260,7 +2260,7 @@ xfs_imap_lookup(
> }
>
> xfs_trans_brelse(tp, agbp);
> - xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(cur, error);
> if (error)
> return error;
>
> diff --git a/fs/xfs/libxfs/xfs_ialloc_btree.c b/fs/xfs/libxfs/xfs_ialloc_btree.c
> index a5237afec5ab..735a33252eb2 100644
> --- a/fs/xfs/libxfs/xfs_ialloc_btree.c
> +++ b/fs/xfs/libxfs/xfs_ialloc_btree.c
> @@ -566,7 +566,7 @@ xfs_inobt_count_blocks(
>
> cur = xfs_inobt_init_cursor(mp, NULL, agbp, agno, btnum);
> error = xfs_btree_count_blocks(cur, tree_blocks);
> - xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(cur, error);
> xfs_buf_relse(agbp);
>
> return error;
> diff --git a/fs/xfs/libxfs/xfs_refcount.c b/fs/xfs/libxfs/xfs_refcount.c
> index 9dda6fd0bb13..240a32984d13 100644
> --- a/fs/xfs/libxfs/xfs_refcount.c
> +++ b/fs/xfs/libxfs/xfs_refcount.c
> @@ -1067,7 +1067,7 @@ xfs_refcount_finish_one_cleanup(
> if (rcur == NULL)
> return;
> agbp = rcur->bc_private.a.agbp;
> - xfs_btree_del_cursor(rcur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(rcur, error);
> if (error)
> xfs_trans_brelse(tp, agbp);
> }
> diff --git a/fs/xfs/libxfs/xfs_rmap.c b/fs/xfs/libxfs/xfs_rmap.c
> index 8b2a2f81d110..fb266fa2cc45 100644
> --- a/fs/xfs/libxfs/xfs_rmap.c
> +++ b/fs/xfs/libxfs/xfs_rmap.c
> @@ -670,14 +670,8 @@ xfs_rmap_free(
> cur = xfs_rmapbt_init_cursor(mp, tp, agbp, agno);
>
> error = xfs_rmap_unmap(cur, bno, len, false, oinfo);
> - if (error)
> - goto out_error;
>
> - xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR);
> - return 0;
> -
> -out_error:
> - xfs_btree_del_cursor(cur, XFS_BTREE_ERROR);
> + xfs_btree_del_cursor(cur, error);
> return error;
> }
>
> @@ -912,14 +906,8 @@ xfs_rmap_alloc(
>
> cur = xfs_rmapbt_init_cursor(mp, tp, agbp, agno);
> error = xfs_rmap_map(cur, bno, len, false, oinfo);
> - if (error)
> - goto out_error;
>
> - xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR);
> - return 0;
> -
> -out_error:
> - xfs_btree_del_cursor(cur, XFS_BTREE_ERROR);
> + xfs_btree_del_cursor(cur, error);
> return error;
> }
>
> @@ -2156,7 +2144,7 @@ xfs_rmap_finish_one_cleanup(
> if (rcur == NULL)
> return;
> agbp = rcur->bc_private.a.agbp;
> - xfs_btree_del_cursor(rcur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(rcur, error);
> if (error)
> xfs_trans_brelse(tp, agbp);
> }
> diff --git a/fs/xfs/scrub/bmap.c b/fs/xfs/scrub/bmap.c
> index 3d08589f5c60..ebbfab173e97 100644
> --- a/fs/xfs/scrub/bmap.c
> +++ b/fs/xfs/scrub/bmap.c
> @@ -404,8 +404,7 @@ xfs_scrub_bmap_btree(
> cur = xfs_bmbt_init_cursor(mp, sc->tp, ip, whichfork);
> xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, whichfork);
> error = xfs_scrub_btree(sc, cur, xfs_scrub_bmapbt_rec, &oinfo, info);
> - xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR :
> - XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(cur, error);
> return error;
> }
>
> @@ -514,7 +513,7 @@ xfs_scrub_bmap_check_ag_rmaps(
> if (error == XFS_BTREE_QUERY_RANGE_ABORT)
> error = 0;
>
> - xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(cur, error);
> out_agf:
> xfs_trans_brelse(sc->tp, agf);
> return error;
> diff --git a/fs/xfs/scrub/repair.c b/fs/xfs/scrub/repair.c
> index 326be4e8b71e..35c589a04fac 100644
> --- a/fs/xfs/scrub/repair.c
> +++ b/fs/xfs/scrub/repair.c
> @@ -1009,7 +1009,7 @@ xfs_repair_find_ag_btree_roots(
>
> cur = xfs_rmapbt_init_cursor(mp, sc->tp, agf_bp, sc->sa.agno);
> error = xfs_rmap_query_all(cur, xfs_repair_findroot_rmap, &ri);
> - xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(cur, error);
>
> return error;
> }
> diff --git a/fs/xfs/xfs_discard.c b/fs/xfs/xfs_discard.c
> index 678a5fcd7576..93f07edafd81 100644
> --- a/fs/xfs/xfs_discard.c
> +++ b/fs/xfs/xfs_discard.c
> @@ -128,7 +128,7 @@ xfs_trim_extents(
> }
>
> out_del_cursor:
> - xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(cur, error);
> xfs_buf_relse(agbp);
> out_put_perag:
> xfs_perag_put(pag);
> diff --git a/fs/xfs/xfs_fsmap.c b/fs/xfs/xfs_fsmap.c
> index c7157bc48bd1..f7e00e42f360 100644
> --- a/fs/xfs/xfs_fsmap.c
> +++ b/fs/xfs/xfs_fsmap.c
> @@ -219,7 +219,7 @@ xfs_getfsmap_is_shared(
> error = xfs_refcount_find_shared(cur, rec->rm_startblock,
> rec->rm_blockcount, &fbno, &flen, false);
>
> - xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(cur, error);
> if (error)
> return error;
>
> diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c
> index 24f4f1c555b5..65810827a8d0 100644
> --- a/fs/xfs/xfs_itable.c
> +++ b/fs/xfs/xfs_itable.c
> @@ -458,8 +458,7 @@ xfs_bulkstat(
> * pending error, then we are done.
> */
> del_cursor:
> - xfs_btree_del_cursor(cur, error ?
> - XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(cur, error);
> xfs_buf_relse(agbp);
> if (error)
> break;
> @@ -632,8 +631,7 @@ xfs_inumbers(
>
> kmem_free(buffer);
> if (cur)
> - xfs_btree_del_cursor(cur, (error ? XFS_BTREE_ERROR :
> - XFS_BTREE_NOERROR));
> + xfs_btree_del_cursor(cur, error);
> if (agbp)
> xfs_buf_relse(agbp);
>
> diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c
> index 592fb2071a03..268d51e35812 100644
> --- a/fs/xfs/xfs_reflink.c
> +++ b/fs/xfs/xfs_reflink.c
> @@ -162,7 +162,7 @@ xfs_reflink_find_shared(
> error = xfs_refcount_find_shared(cur, agbno, aglen, fbno, flen,
> find_end_of_shared);
>
> - xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(cur, error);
>
> xfs_trans_brelse(tp, agbp);
> return error;
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Carlos
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 4/8] xfs: clean up xfs_btree_del_cursor callers
2018-07-18 15:50 ` [PATCH 4/8] xfs: clean up xfs_btree_del_cursor callers Darrick J. Wong
2018-07-19 12:24 ` Brian Foster
@ 2018-07-19 12:28 ` Carlos Maiolino
2018-07-19 16:46 ` Christoph Hellwig
2 siblings, 0 replies; 30+ messages in thread
From: Carlos Maiolino @ 2018-07-19 12:28 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: linux-xfs
On Wed, Jul 18, 2018 at 08:50:57AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Less trivial cleanups of the error argument to xfs_btree_del_cursor;
> these require some minor code refactoring.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
> ---
> fs/xfs/libxfs/xfs_refcount.c | 11 +++--------
> fs/xfs/scrub/repair.c | 7 +++----
> 2 files changed, 6 insertions(+), 12 deletions(-)
>
>
> diff --git a/fs/xfs/libxfs/xfs_refcount.c b/fs/xfs/libxfs/xfs_refcount.c
> index 240a32984d13..a38e5840a73f 100644
> --- a/fs/xfs/libxfs/xfs_refcount.c
> +++ b/fs/xfs/libxfs/xfs_refcount.c
> @@ -1675,11 +1675,11 @@ xfs_refcount_recover_cow_leftovers(
> high.rc.rc_startblock = -1U;
> error = xfs_btree_query_range(cur, &low, &high,
> xfs_refcount_recover_extent, &debris);
> - if (error)
> - goto out_cursor;
> - xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(cur, error);
> xfs_trans_brelse(tp, agbp);
> xfs_trans_cancel(tp);
> + if (error)
> + goto out_free;
>
> /* Now iterate the list to free the leftovers */
> list_for_each_entry_safe(rr, n, &debris, rr_list) {
> @@ -1727,11 +1727,6 @@ xfs_refcount_recover_cow_leftovers(
> kmem_free(rr);
> }
> return error;
> -
> -out_cursor:
> - xfs_btree_del_cursor(cur, XFS_BTREE_ERROR);
> - xfs_trans_brelse(tp, agbp);
> - goto out_trans;
> }
>
> /* Is there a record covering a given extent? */
> diff --git a/fs/xfs/scrub/repair.c b/fs/xfs/scrub/repair.c
> index 35c589a04fac..ea39e2bdc96a 100644
> --- a/fs/xfs/scrub/repair.c
> +++ b/fs/xfs/scrub/repair.c
> @@ -747,9 +747,9 @@ xfs_repair_dispose_btree_block(
>
> /* Can we find any other rmappings? */
> error = xfs_rmap_has_other_keys(cur, agbno, 1, oinfo, &has_other_rmap);
> + xfs_btree_del_cursor(cur, error);
> if (error)
> - goto out_cur;
> - xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR);
> + goto out_free;
>
> /*
> * If there are other rmappings, this block is cross linked and must
> @@ -779,8 +779,7 @@ xfs_repair_dispose_btree_block(
> return xfs_trans_roll_inode(&sc->tp, sc->ip);
> return xfs_repair_roll_ag_trans(sc);
>
> -out_cur:
> - xfs_btree_del_cursor(cur, XFS_BTREE_ERROR);
> +out_free:
> if (agf_bp != sc->sa.agf_bp)
> xfs_trans_brelse(sc->tp, agf_bp);
> return error;
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Carlos
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 5/8] xfs: shorten xfs_scrub_ prefix
2018-07-18 15:51 ` [PATCH 5/8] xfs: shorten xfs_scrub_ prefix Darrick J. Wong
@ 2018-07-19 12:59 ` Brian Foster
0 siblings, 0 replies; 30+ messages in thread
From: Brian Foster @ 2018-07-19 12:59 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: linux-xfs
On Wed, Jul 18, 2018 at 08:51:51AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Shorten all the metadata checking xfs_scrub_ prefixes to xchk_. After
> this, the only xfs_scrub* symbols are the ones that pertain to both
> scrub and repair. Whitespace damage will be fixed in a subsequent
> patch. There are no functional changes.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
I have no major preference on the name, but looks like a straight
search/replace to me:
Reviewed-by: Brian Foster <bfoster@redhat.com>
> fs/xfs/scrub/agheader.c | 318 ++++++++++++++++++++++++-----------------------
> fs/xfs/scrub/alloc.c | 56 ++++----
> fs/xfs/scrub/attr.c | 106 ++++++++--------
> fs/xfs/scrub/bmap.c | 176 +++++++++++++-------------
> fs/xfs/scrub/btree.c | 166 ++++++++++++-------------
> fs/xfs/scrub/btree.h | 22 ++-
> fs/xfs/scrub/common.c | 172 +++++++++++++------------
> fs/xfs/scrub/common.h | 102 ++++++++-------
> fs/xfs/scrub/dabtree.c | 124 +++++++++---------
> fs/xfs/scrub/dabtree.h | 14 +-
> fs/xfs/scrub/dir.c | 170 +++++++++++++------------
> fs/xfs/scrub/ialloc.c | 138 ++++++++++----------
> fs/xfs/scrub/inode.c | 160 ++++++++++++------------
> fs/xfs/scrub/parent.c | 62 +++++----
> fs/xfs/scrub/quota.c | 64 +++++----
> fs/xfs/scrub/refcount.c | 114 ++++++++---------
> fs/xfs/scrub/repair.c | 4 -
> fs/xfs/scrub/rmap.c | 78 ++++++------
> fs/xfs/scrub/rtbitmap.c | 30 ++--
> fs/xfs/scrub/scrub.c | 142 +++++++++++----------
> fs/xfs/scrub/scrub.h | 82 ++++++------
> fs/xfs/scrub/symlink.c | 14 +-
> fs/xfs/scrub/trace.c | 2
> fs/xfs/scrub/trace.h | 70 +++++-----
> 24 files changed, 1196 insertions(+), 1190 deletions(-)
>
>
> diff --git a/fs/xfs/scrub/agheader.c b/fs/xfs/scrub/agheader.c
> index 9bb0745f1ad2..c0625ec16d63 100644
> --- a/fs/xfs/scrub/agheader.c
> +++ b/fs/xfs/scrub/agheader.c
> @@ -28,7 +28,7 @@
>
> /* Cross-reference with the other btrees. */
> STATIC void
> -xfs_scrub_superblock_xref(
> +xchk_superblock_xref(
> struct xfs_scrub_context *sc,
> struct xfs_buf *bp)
> {
> @@ -43,15 +43,15 @@ xfs_scrub_superblock_xref(
>
> agbno = XFS_SB_BLOCK(mp);
>
> - error = xfs_scrub_ag_init(sc, agno, &sc->sa);
> - if (!xfs_scrub_xref_process_error(sc, agno, agbno, &error))
> + error = xchk_ag_init(sc, agno, &sc->sa);
> + if (!xchk_xref_process_error(sc, agno, agbno, &error))
> return;
>
> - xfs_scrub_xref_is_used_space(sc, agbno, 1);
> - xfs_scrub_xref_is_not_inode_chunk(sc, agbno, 1);
> + xchk_xref_is_used_space(sc, agbno, 1);
> + xchk_xref_is_not_inode_chunk(sc, agbno, 1);
> xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_FS);
> - xfs_scrub_xref_is_owned_by(sc, agbno, 1, &oinfo);
> - xfs_scrub_xref_is_not_shared(sc, agbno, 1);
> + xchk_xref_is_owned_by(sc, agbno, 1, &oinfo);
> + xchk_xref_is_not_shared(sc, agbno, 1);
>
> /* scrub teardown will take care of sc->sa for us */
> }
> @@ -65,7 +65,7 @@ xfs_scrub_superblock_xref(
> * sb 0 is ok and we can use its information to check everything else.
> */
> int
> -xfs_scrub_superblock(
> +xchk_superblock(
> struct xfs_scrub_context *sc)
> {
> struct xfs_mount *mp = sc->mp;
> @@ -98,7 +98,7 @@ xfs_scrub_superblock(
> default:
> break;
> }
> - if (!xfs_scrub_process_error(sc, agno, XFS_SB_BLOCK(mp), &error))
> + if (!xchk_process_error(sc, agno, XFS_SB_BLOCK(mp), &error))
> return error;
>
> sb = XFS_BUF_TO_SBP(bp);
> @@ -110,46 +110,46 @@ xfs_scrub_superblock(
> * checked.
> */
> if (sb->sb_blocksize != cpu_to_be32(mp->m_sb.sb_blocksize))
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> if (sb->sb_dblocks != cpu_to_be64(mp->m_sb.sb_dblocks))
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> if (sb->sb_rblocks != cpu_to_be64(mp->m_sb.sb_rblocks))
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> if (sb->sb_rextents != cpu_to_be64(mp->m_sb.sb_rextents))
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> if (!uuid_equal(&sb->sb_uuid, &mp->m_sb.sb_uuid))
> - xfs_scrub_block_set_preen(sc, bp);
> + xchk_block_set_preen(sc, bp);
>
> if (sb->sb_logstart != cpu_to_be64(mp->m_sb.sb_logstart))
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> if (sb->sb_rootino != cpu_to_be64(mp->m_sb.sb_rootino))
> - xfs_scrub_block_set_preen(sc, bp);
> + xchk_block_set_preen(sc, bp);
>
> if (sb->sb_rbmino != cpu_to_be64(mp->m_sb.sb_rbmino))
> - xfs_scrub_block_set_preen(sc, bp);
> + xchk_block_set_preen(sc, bp);
>
> if (sb->sb_rsumino != cpu_to_be64(mp->m_sb.sb_rsumino))
> - xfs_scrub_block_set_preen(sc, bp);
> + xchk_block_set_preen(sc, bp);
>
> if (sb->sb_rextsize != cpu_to_be32(mp->m_sb.sb_rextsize))
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> if (sb->sb_agblocks != cpu_to_be32(mp->m_sb.sb_agblocks))
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> if (sb->sb_agcount != cpu_to_be32(mp->m_sb.sb_agcount))
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> if (sb->sb_rbmblocks != cpu_to_be32(mp->m_sb.sb_rbmblocks))
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> if (sb->sb_logblocks != cpu_to_be32(mp->m_sb.sb_logblocks))
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> /* Check sb_versionnum bits that are set at mkfs time. */
> vernum_mask = cpu_to_be16(~XFS_SB_VERSION_OKBITS |
> @@ -163,7 +163,7 @@ xfs_scrub_superblock(
> XFS_SB_VERSION_DIRV2BIT);
> if ((sb->sb_versionnum & vernum_mask) !=
> (cpu_to_be16(mp->m_sb.sb_versionnum) & vernum_mask))
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> /* Check sb_versionnum bits that can be set after mkfs time. */
> vernum_mask = cpu_to_be16(XFS_SB_VERSION_ATTRBIT |
> @@ -171,40 +171,40 @@ xfs_scrub_superblock(
> XFS_SB_VERSION_QUOTABIT);
> if ((sb->sb_versionnum & vernum_mask) !=
> (cpu_to_be16(mp->m_sb.sb_versionnum) & vernum_mask))
> - xfs_scrub_block_set_preen(sc, bp);
> + xchk_block_set_preen(sc, bp);
>
> if (sb->sb_sectsize != cpu_to_be16(mp->m_sb.sb_sectsize))
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> if (sb->sb_inodesize != cpu_to_be16(mp->m_sb.sb_inodesize))
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> if (sb->sb_inopblock != cpu_to_be16(mp->m_sb.sb_inopblock))
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> if (memcmp(sb->sb_fname, mp->m_sb.sb_fname, sizeof(sb->sb_fname)))
> - xfs_scrub_block_set_preen(sc, bp);
> + xchk_block_set_preen(sc, bp);
>
> if (sb->sb_blocklog != mp->m_sb.sb_blocklog)
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> if (sb->sb_sectlog != mp->m_sb.sb_sectlog)
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> if (sb->sb_inodelog != mp->m_sb.sb_inodelog)
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> if (sb->sb_inopblog != mp->m_sb.sb_inopblog)
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> if (sb->sb_agblklog != mp->m_sb.sb_agblklog)
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> if (sb->sb_rextslog != mp->m_sb.sb_rextslog)
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> if (sb->sb_imax_pct != mp->m_sb.sb_imax_pct)
> - xfs_scrub_block_set_preen(sc, bp);
> + xchk_block_set_preen(sc, bp);
>
> /*
> * Skip the summary counters since we track them in memory anyway.
> @@ -212,10 +212,10 @@ xfs_scrub_superblock(
> */
>
> if (sb->sb_uquotino != cpu_to_be64(mp->m_sb.sb_uquotino))
> - xfs_scrub_block_set_preen(sc, bp);
> + xchk_block_set_preen(sc, bp);
>
> if (sb->sb_gquotino != cpu_to_be64(mp->m_sb.sb_gquotino))
> - xfs_scrub_block_set_preen(sc, bp);
> + xchk_block_set_preen(sc, bp);
>
> /*
> * Skip the quota flags since repair will force quotacheck.
> @@ -223,46 +223,46 @@ xfs_scrub_superblock(
> */
>
> if (sb->sb_flags != mp->m_sb.sb_flags)
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> if (sb->sb_shared_vn != mp->m_sb.sb_shared_vn)
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> if (sb->sb_inoalignmt != cpu_to_be32(mp->m_sb.sb_inoalignmt))
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> if (sb->sb_unit != cpu_to_be32(mp->m_sb.sb_unit))
> - xfs_scrub_block_set_preen(sc, bp);
> + xchk_block_set_preen(sc, bp);
>
> if (sb->sb_width != cpu_to_be32(mp->m_sb.sb_width))
> - xfs_scrub_block_set_preen(sc, bp);
> + xchk_block_set_preen(sc, bp);
>
> if (sb->sb_dirblklog != mp->m_sb.sb_dirblklog)
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> if (sb->sb_logsectlog != mp->m_sb.sb_logsectlog)
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> if (sb->sb_logsectsize != cpu_to_be16(mp->m_sb.sb_logsectsize))
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> if (sb->sb_logsunit != cpu_to_be32(mp->m_sb.sb_logsunit))
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> /* Do we see any invalid bits in sb_features2? */
> if (!xfs_sb_version_hasmorebits(&mp->m_sb)) {
> if (sb->sb_features2 != 0)
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
> } else {
> v2_ok = XFS_SB_VERSION2_OKBITS;
> if (XFS_SB_VERSION_NUM(&mp->m_sb) >= XFS_SB_VERSION_5)
> v2_ok |= XFS_SB_VERSION2_CRCBIT;
>
> if (!!(sb->sb_features2 & cpu_to_be32(~v2_ok)))
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> if (sb->sb_features2 != sb->sb_bad_features2)
> - xfs_scrub_block_set_preen(sc, bp);
> + xchk_block_set_preen(sc, bp);
> }
>
> /* Check sb_features2 flags that are set at mkfs time. */
> @@ -272,26 +272,26 @@ xfs_scrub_superblock(
> XFS_SB_VERSION2_FTYPE);
> if ((sb->sb_features2 & features_mask) !=
> (cpu_to_be32(mp->m_sb.sb_features2) & features_mask))
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> /* Check sb_features2 flags that can be set after mkfs time. */
> features_mask = cpu_to_be32(XFS_SB_VERSION2_ATTR2BIT);
> if ((sb->sb_features2 & features_mask) !=
> (cpu_to_be32(mp->m_sb.sb_features2) & features_mask))
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> if (!xfs_sb_version_hascrc(&mp->m_sb)) {
> /* all v5 fields must be zero */
> if (memchr_inv(&sb->sb_features_compat, 0,
> sizeof(struct xfs_dsb) -
> offsetof(struct xfs_dsb, sb_features_compat)))
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
> } else {
> /* Check compat flags; all are set at mkfs time. */
> features_mask = cpu_to_be32(XFS_SB_FEAT_COMPAT_UNKNOWN);
> if ((sb->sb_features_compat & features_mask) !=
> (cpu_to_be32(mp->m_sb.sb_features_compat) & features_mask))
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> /* Check ro compat flags; all are set at mkfs time. */
> features_mask = cpu_to_be32(XFS_SB_FEAT_RO_COMPAT_UNKNOWN |
> @@ -301,7 +301,7 @@ xfs_scrub_superblock(
> if ((sb->sb_features_ro_compat & features_mask) !=
> (cpu_to_be32(mp->m_sb.sb_features_ro_compat) &
> features_mask))
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> /* Check incompat flags; all are set at mkfs time. */
> features_mask = cpu_to_be32(XFS_SB_FEAT_INCOMPAT_UNKNOWN |
> @@ -311,22 +311,22 @@ xfs_scrub_superblock(
> if ((sb->sb_features_incompat & features_mask) !=
> (cpu_to_be32(mp->m_sb.sb_features_incompat) &
> features_mask))
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> /* Check log incompat flags; all are set at mkfs time. */
> features_mask = cpu_to_be32(XFS_SB_FEAT_INCOMPAT_LOG_UNKNOWN);
> if ((sb->sb_features_log_incompat & features_mask) !=
> (cpu_to_be32(mp->m_sb.sb_features_log_incompat) &
> features_mask))
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> /* Don't care about sb_crc */
>
> if (sb->sb_spino_align != cpu_to_be32(mp->m_sb.sb_spino_align))
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> if (sb->sb_pquotino != cpu_to_be64(mp->m_sb.sb_pquotino))
> - xfs_scrub_block_set_preen(sc, bp);
> + xchk_block_set_preen(sc, bp);
>
> /* Don't care about sb_lsn */
> }
> @@ -334,15 +334,15 @@ xfs_scrub_superblock(
> if (xfs_sb_version_hasmetauuid(&mp->m_sb)) {
> /* The metadata UUID must be the same for all supers */
> if (!uuid_equal(&sb->sb_meta_uuid, &mp->m_sb.sb_meta_uuid))
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
> }
>
> /* Everything else must be zero. */
> if (memchr_inv(sb + 1, 0,
> BBTOB(bp->b_length) - sizeof(struct xfs_dsb)))
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
>
> - xfs_scrub_superblock_xref(sc, bp);
> + xchk_superblock_xref(sc, bp);
>
> return error;
> }
> @@ -351,7 +351,7 @@ xfs_scrub_superblock(
>
> /* Tally freespace record lengths. */
> STATIC int
> -xfs_scrub_agf_record_bno_lengths(
> +xchk_agf_record_bno_lengths(
> struct xfs_btree_cur *cur,
> struct xfs_alloc_rec_incore *rec,
> void *priv)
> @@ -364,7 +364,7 @@ xfs_scrub_agf_record_bno_lengths(
>
> /* Check agf_freeblks */
> static inline void
> -xfs_scrub_agf_xref_freeblks(
> +xchk_agf_xref_freeblks(
> struct xfs_scrub_context *sc)
> {
> struct xfs_agf *agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
> @@ -375,16 +375,16 @@ xfs_scrub_agf_xref_freeblks(
> return;
>
> error = xfs_alloc_query_all(sc->sa.bno_cur,
> - xfs_scrub_agf_record_bno_lengths, &blocks);
> - if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.bno_cur))
> + xchk_agf_record_bno_lengths, &blocks);
> + if (!xchk_should_check_xref(sc, &error, &sc->sa.bno_cur))
> return;
> if (blocks != be32_to_cpu(agf->agf_freeblks))
> - xfs_scrub_block_xref_set_corrupt(sc, sc->sa.agf_bp);
> + xchk_block_xref_set_corrupt(sc, sc->sa.agf_bp);
> }
>
> /* Cross reference the AGF with the cntbt (freespace by length btree) */
> static inline void
> -xfs_scrub_agf_xref_cntbt(
> +xchk_agf_xref_cntbt(
> struct xfs_scrub_context *sc)
> {
> struct xfs_agf *agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
> @@ -398,25 +398,25 @@ xfs_scrub_agf_xref_cntbt(
>
> /* Any freespace at all? */
> error = xfs_alloc_lookup_le(sc->sa.cnt_cur, 0, -1U, &have);
> - if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.cnt_cur))
> + if (!xchk_should_check_xref(sc, &error, &sc->sa.cnt_cur))
> return;
> if (!have) {
> if (agf->agf_freeblks != be32_to_cpu(0))
> - xfs_scrub_block_xref_set_corrupt(sc, sc->sa.agf_bp);
> + xchk_block_xref_set_corrupt(sc, sc->sa.agf_bp);
> return;
> }
>
> /* Check agf_longest */
> error = xfs_alloc_get_rec(sc->sa.cnt_cur, &agbno, &blocks, &have);
> - if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.cnt_cur))
> + if (!xchk_should_check_xref(sc, &error, &sc->sa.cnt_cur))
> return;
> if (!have || blocks != be32_to_cpu(agf->agf_longest))
> - xfs_scrub_block_xref_set_corrupt(sc, sc->sa.agf_bp);
> + xchk_block_xref_set_corrupt(sc, sc->sa.agf_bp);
> }
>
> /* Check the btree block counts in the AGF against the btrees. */
> STATIC void
> -xfs_scrub_agf_xref_btreeblks(
> +xchk_agf_xref_btreeblks(
> struct xfs_scrub_context *sc)
> {
> struct xfs_agf *agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
> @@ -428,11 +428,11 @@ xfs_scrub_agf_xref_btreeblks(
> /* Check agf_rmap_blocks; set up for agf_btreeblks check */
> if (sc->sa.rmap_cur) {
> error = xfs_btree_count_blocks(sc->sa.rmap_cur, &blocks);
> - if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.rmap_cur))
> + if (!xchk_should_check_xref(sc, &error, &sc->sa.rmap_cur))
> return;
> btreeblks = blocks - 1;
> if (blocks != be32_to_cpu(agf->agf_rmap_blocks))
> - xfs_scrub_block_xref_set_corrupt(sc, sc->sa.agf_bp);
> + xchk_block_xref_set_corrupt(sc, sc->sa.agf_bp);
> } else {
> btreeblks = 0;
> }
> @@ -447,22 +447,22 @@ xfs_scrub_agf_xref_btreeblks(
>
> /* Check agf_btreeblks */
> error = xfs_btree_count_blocks(sc->sa.bno_cur, &blocks);
> - if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.bno_cur))
> + if (!xchk_should_check_xref(sc, &error, &sc->sa.bno_cur))
> return;
> btreeblks += blocks - 1;
>
> error = xfs_btree_count_blocks(sc->sa.cnt_cur, &blocks);
> - if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.cnt_cur))
> + if (!xchk_should_check_xref(sc, &error, &sc->sa.cnt_cur))
> return;
> btreeblks += blocks - 1;
>
> if (btreeblks != be32_to_cpu(agf->agf_btreeblks))
> - xfs_scrub_block_xref_set_corrupt(sc, sc->sa.agf_bp);
> + xchk_block_xref_set_corrupt(sc, sc->sa.agf_bp);
> }
>
> /* Check agf_refcount_blocks against tree size */
> static inline void
> -xfs_scrub_agf_xref_refcblks(
> +xchk_agf_xref_refcblks(
> struct xfs_scrub_context *sc)
> {
> struct xfs_agf *agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
> @@ -473,15 +473,15 @@ xfs_scrub_agf_xref_refcblks(
> return;
>
> error = xfs_btree_count_blocks(sc->sa.refc_cur, &blocks);
> - if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.refc_cur))
> + if (!xchk_should_check_xref(sc, &error, &sc->sa.refc_cur))
> return;
> if (blocks != be32_to_cpu(agf->agf_refcount_blocks))
> - xfs_scrub_block_xref_set_corrupt(sc, sc->sa.agf_bp);
> + xchk_block_xref_set_corrupt(sc, sc->sa.agf_bp);
> }
>
> /* Cross-reference with the other btrees. */
> STATIC void
> -xfs_scrub_agf_xref(
> +xchk_agf_xref(
> struct xfs_scrub_context *sc)
> {
> struct xfs_owner_info oinfo;
> @@ -494,26 +494,26 @@ xfs_scrub_agf_xref(
>
> agbno = XFS_AGF_BLOCK(mp);
>
> - error = xfs_scrub_ag_btcur_init(sc, &sc->sa);
> + error = xchk_ag_btcur_init(sc, &sc->sa);
> if (error)
> return;
>
> - xfs_scrub_xref_is_used_space(sc, agbno, 1);
> - xfs_scrub_agf_xref_freeblks(sc);
> - xfs_scrub_agf_xref_cntbt(sc);
> - xfs_scrub_xref_is_not_inode_chunk(sc, agbno, 1);
> + xchk_xref_is_used_space(sc, agbno, 1);
> + xchk_agf_xref_freeblks(sc);
> + xchk_agf_xref_cntbt(sc);
> + xchk_xref_is_not_inode_chunk(sc, agbno, 1);
> xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_FS);
> - xfs_scrub_xref_is_owned_by(sc, agbno, 1, &oinfo);
> - xfs_scrub_agf_xref_btreeblks(sc);
> - xfs_scrub_xref_is_not_shared(sc, agbno, 1);
> - xfs_scrub_agf_xref_refcblks(sc);
> + xchk_xref_is_owned_by(sc, agbno, 1, &oinfo);
> + xchk_agf_xref_btreeblks(sc);
> + xchk_xref_is_not_shared(sc, agbno, 1);
> + xchk_agf_xref_refcblks(sc);
>
> /* scrub teardown will take care of sc->sa for us */
> }
>
> /* Scrub the AGF. */
> int
> -xfs_scrub_agf(
> +xchk_agf(
> struct xfs_scrub_context *sc)
> {
> struct xfs_mount *mp = sc->mp;
> @@ -529,54 +529,54 @@ xfs_scrub_agf(
> int error = 0;
>
> agno = sc->sa.agno = sc->sm->sm_agno;
> - error = xfs_scrub_ag_read_headers(sc, agno, &sc->sa.agi_bp,
> + error = xchk_ag_read_headers(sc, agno, &sc->sa.agi_bp,
> &sc->sa.agf_bp, &sc->sa.agfl_bp);
> - if (!xfs_scrub_process_error(sc, agno, XFS_AGF_BLOCK(sc->mp), &error))
> + if (!xchk_process_error(sc, agno, XFS_AGF_BLOCK(sc->mp), &error))
> goto out;
> - xfs_scrub_buffer_recheck(sc, sc->sa.agf_bp);
> + xchk_buffer_recheck(sc, sc->sa.agf_bp);
>
> agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
>
> /* Check the AG length */
> eoag = be32_to_cpu(agf->agf_length);
> if (eoag != xfs_ag_block_count(mp, agno))
> - xfs_scrub_block_set_corrupt(sc, sc->sa.agf_bp);
> + xchk_block_set_corrupt(sc, sc->sa.agf_bp);
>
> /* Check the AGF btree roots and levels */
> agbno = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]);
> if (!xfs_verify_agbno(mp, agno, agbno))
> - xfs_scrub_block_set_corrupt(sc, sc->sa.agf_bp);
> + xchk_block_set_corrupt(sc, sc->sa.agf_bp);
>
> agbno = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]);
> if (!xfs_verify_agbno(mp, agno, agbno))
> - xfs_scrub_block_set_corrupt(sc, sc->sa.agf_bp);
> + xchk_block_set_corrupt(sc, sc->sa.agf_bp);
>
> level = be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]);
> if (level <= 0 || level > XFS_BTREE_MAXLEVELS)
> - xfs_scrub_block_set_corrupt(sc, sc->sa.agf_bp);
> + xchk_block_set_corrupt(sc, sc->sa.agf_bp);
>
> level = be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]);
> if (level <= 0 || level > XFS_BTREE_MAXLEVELS)
> - xfs_scrub_block_set_corrupt(sc, sc->sa.agf_bp);
> + xchk_block_set_corrupt(sc, sc->sa.agf_bp);
>
> if (xfs_sb_version_hasrmapbt(&mp->m_sb)) {
> agbno = be32_to_cpu(agf->agf_roots[XFS_BTNUM_RMAP]);
> if (!xfs_verify_agbno(mp, agno, agbno))
> - xfs_scrub_block_set_corrupt(sc, sc->sa.agf_bp);
> + xchk_block_set_corrupt(sc, sc->sa.agf_bp);
>
> level = be32_to_cpu(agf->agf_levels[XFS_BTNUM_RMAP]);
> if (level <= 0 || level > XFS_BTREE_MAXLEVELS)
> - xfs_scrub_block_set_corrupt(sc, sc->sa.agf_bp);
> + xchk_block_set_corrupt(sc, sc->sa.agf_bp);
> }
>
> if (xfs_sb_version_hasreflink(&mp->m_sb)) {
> agbno = be32_to_cpu(agf->agf_refcount_root);
> if (!xfs_verify_agbno(mp, agno, agbno))
> - xfs_scrub_block_set_corrupt(sc, sc->sa.agf_bp);
> + xchk_block_set_corrupt(sc, sc->sa.agf_bp);
>
> level = be32_to_cpu(agf->agf_refcount_level);
> if (level <= 0 || level > XFS_BTREE_MAXLEVELS)
> - xfs_scrub_block_set_corrupt(sc, sc->sa.agf_bp);
> + xchk_block_set_corrupt(sc, sc->sa.agf_bp);
> }
>
> /* Check the AGFL counters */
> @@ -588,16 +588,16 @@ xfs_scrub_agf(
> else
> fl_count = xfs_agfl_size(mp) - agfl_first + agfl_last + 1;
> if (agfl_count != 0 && fl_count != agfl_count)
> - xfs_scrub_block_set_corrupt(sc, sc->sa.agf_bp);
> + xchk_block_set_corrupt(sc, sc->sa.agf_bp);
>
> - xfs_scrub_agf_xref(sc);
> + xchk_agf_xref(sc);
> out:
> return error;
> }
>
> /* AGFL */
>
> -struct xfs_scrub_agfl_info {
> +struct xchk_agfl_info {
> struct xfs_owner_info oinfo;
> unsigned int sz_entries;
> unsigned int nr_entries;
> @@ -607,7 +607,7 @@ struct xfs_scrub_agfl_info {
>
> /* Cross-reference with the other btrees. */
> STATIC void
> -xfs_scrub_agfl_block_xref(
> +xchk_agfl_block_xref(
> struct xfs_scrub_context *sc,
> xfs_agblock_t agbno,
> struct xfs_owner_info *oinfo)
> @@ -615,20 +615,20 @@ xfs_scrub_agfl_block_xref(
> if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
> return;
>
> - xfs_scrub_xref_is_used_space(sc, agbno, 1);
> - xfs_scrub_xref_is_not_inode_chunk(sc, agbno, 1);
> - xfs_scrub_xref_is_owned_by(sc, agbno, 1, oinfo);
> - xfs_scrub_xref_is_not_shared(sc, agbno, 1);
> + xchk_xref_is_used_space(sc, agbno, 1);
> + xchk_xref_is_not_inode_chunk(sc, agbno, 1);
> + xchk_xref_is_owned_by(sc, agbno, 1, oinfo);
> + xchk_xref_is_not_shared(sc, agbno, 1);
> }
>
> /* Scrub an AGFL block. */
> STATIC int
> -xfs_scrub_agfl_block(
> +xchk_agfl_block(
> struct xfs_mount *mp,
> xfs_agblock_t agbno,
> void *priv)
> {
> - struct xfs_scrub_agfl_info *sai = priv;
> + struct xchk_agfl_info *sai = priv;
> struct xfs_scrub_context *sc = sai->sc;
> xfs_agnumber_t agno = sc->sa.agno;
>
> @@ -636,9 +636,9 @@ xfs_scrub_agfl_block(
> sai->nr_entries < sai->sz_entries)
> sai->entries[sai->nr_entries++] = agbno;
> else
> - xfs_scrub_block_set_corrupt(sc, sc->sa.agfl_bp);
> + xchk_block_set_corrupt(sc, sc->sa.agfl_bp);
>
> - xfs_scrub_agfl_block_xref(sc, agbno, priv);
> + xchk_agfl_block_xref(sc, agbno, priv);
>
> if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
> return XFS_BTREE_QUERY_RANGE_ABORT;
> @@ -647,7 +647,7 @@ xfs_scrub_agfl_block(
> }
>
> static int
> -xfs_scrub_agblock_cmp(
> +xchk_agblock_cmp(
> const void *pa,
> const void *pb)
> {
> @@ -659,7 +659,7 @@ xfs_scrub_agblock_cmp(
>
> /* Cross-reference with the other btrees. */
> STATIC void
> -xfs_scrub_agfl_xref(
> +xchk_agfl_xref(
> struct xfs_scrub_context *sc)
> {
> struct xfs_owner_info oinfo;
> @@ -672,15 +672,15 @@ xfs_scrub_agfl_xref(
>
> agbno = XFS_AGFL_BLOCK(mp);
>
> - error = xfs_scrub_ag_btcur_init(sc, &sc->sa);
> + error = xchk_ag_btcur_init(sc, &sc->sa);
> if (error)
> return;
>
> - xfs_scrub_xref_is_used_space(sc, agbno, 1);
> - xfs_scrub_xref_is_not_inode_chunk(sc, agbno, 1);
> + xchk_xref_is_used_space(sc, agbno, 1);
> + xchk_xref_is_not_inode_chunk(sc, agbno, 1);
> xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_FS);
> - xfs_scrub_xref_is_owned_by(sc, agbno, 1, &oinfo);
> - xfs_scrub_xref_is_not_shared(sc, agbno, 1);
> + xchk_xref_is_owned_by(sc, agbno, 1, &oinfo);
> + xchk_xref_is_not_shared(sc, agbno, 1);
>
> /*
> * Scrub teardown will take care of sc->sa for us. Leave sc->sa
> @@ -690,10 +690,10 @@ xfs_scrub_agfl_xref(
>
> /* Scrub the AGFL. */
> int
> -xfs_scrub_agfl(
> +xchk_agfl(
> struct xfs_scrub_context *sc)
> {
> - struct xfs_scrub_agfl_info sai;
> + struct xchk_agfl_info sai;
> struct xfs_agf *agf;
> xfs_agnumber_t agno;
> unsigned int agflcount;
> @@ -701,15 +701,15 @@ xfs_scrub_agfl(
> int error;
>
> agno = sc->sa.agno = sc->sm->sm_agno;
> - error = xfs_scrub_ag_read_headers(sc, agno, &sc->sa.agi_bp,
> + error = xchk_ag_read_headers(sc, agno, &sc->sa.agi_bp,
> &sc->sa.agf_bp, &sc->sa.agfl_bp);
> - if (!xfs_scrub_process_error(sc, agno, XFS_AGFL_BLOCK(sc->mp), &error))
> + if (!xchk_process_error(sc, agno, XFS_AGFL_BLOCK(sc->mp), &error))
> goto out;
> if (!sc->sa.agf_bp)
> return -EFSCORRUPTED;
> - xfs_scrub_buffer_recheck(sc, sc->sa.agfl_bp);
> + xchk_buffer_recheck(sc, sc->sa.agfl_bp);
>
> - xfs_scrub_agfl_xref(sc);
> + xchk_agfl_xref(sc);
>
> if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
> goto out;
> @@ -718,7 +718,7 @@ xfs_scrub_agfl(
> agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
> agflcount = be32_to_cpu(agf->agf_flcount);
> if (agflcount > xfs_agfl_size(sc->mp)) {
> - xfs_scrub_block_set_corrupt(sc, sc->sa.agf_bp);
> + xchk_block_set_corrupt(sc, sc->sa.agf_bp);
> goto out;
> }
> memset(&sai, 0, sizeof(sai));
> @@ -734,7 +734,7 @@ xfs_scrub_agfl(
> /* Check the blocks in the AGFL. */
> xfs_rmap_ag_owner(&sai.oinfo, XFS_RMAP_OWN_AG);
> error = xfs_agfl_walk(sc->mp, XFS_BUF_TO_AGF(sc->sa.agf_bp),
> - sc->sa.agfl_bp, xfs_scrub_agfl_block, &sai);
> + sc->sa.agfl_bp, xchk_agfl_block, &sai);
> if (error == XFS_BTREE_QUERY_RANGE_ABORT) {
> error = 0;
> goto out_free;
> @@ -743,16 +743,16 @@ xfs_scrub_agfl(
> goto out_free;
>
> if (agflcount != sai.nr_entries) {
> - xfs_scrub_block_set_corrupt(sc, sc->sa.agf_bp);
> + xchk_block_set_corrupt(sc, sc->sa.agf_bp);
> goto out_free;
> }
>
> /* Sort entries, check for duplicates. */
> sort(sai.entries, sai.nr_entries, sizeof(sai.entries[0]),
> - xfs_scrub_agblock_cmp, NULL);
> + xchk_agblock_cmp, NULL);
> for (i = 1; i < sai.nr_entries; i++) {
> if (sai.entries[i] == sai.entries[i - 1]) {
> - xfs_scrub_block_set_corrupt(sc, sc->sa.agf_bp);
> + xchk_block_set_corrupt(sc, sc->sa.agf_bp);
> break;
> }
> }
> @@ -767,7 +767,7 @@ xfs_scrub_agfl(
>
> /* Check agi_count/agi_freecount */
> static inline void
> -xfs_scrub_agi_xref_icounts(
> +xchk_agi_xref_icounts(
> struct xfs_scrub_context *sc)
> {
> struct xfs_agi *agi = XFS_BUF_TO_AGI(sc->sa.agi_bp);
> @@ -779,16 +779,16 @@ xfs_scrub_agi_xref_icounts(
> return;
>
> error = xfs_ialloc_count_inodes(sc->sa.ino_cur, &icount, &freecount);
> - if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.ino_cur))
> + if (!xchk_should_check_xref(sc, &error, &sc->sa.ino_cur))
> return;
> if (be32_to_cpu(agi->agi_count) != icount ||
> be32_to_cpu(agi->agi_freecount) != freecount)
> - xfs_scrub_block_xref_set_corrupt(sc, sc->sa.agi_bp);
> + xchk_block_xref_set_corrupt(sc, sc->sa.agi_bp);
> }
>
> /* Cross-reference with the other btrees. */
> STATIC void
> -xfs_scrub_agi_xref(
> +xchk_agi_xref(
> struct xfs_scrub_context *sc)
> {
> struct xfs_owner_info oinfo;
> @@ -801,23 +801,23 @@ xfs_scrub_agi_xref(
>
> agbno = XFS_AGI_BLOCK(mp);
>
> - error = xfs_scrub_ag_btcur_init(sc, &sc->sa);
> + error = xchk_ag_btcur_init(sc, &sc->sa);
> if (error)
> return;
>
> - xfs_scrub_xref_is_used_space(sc, agbno, 1);
> - xfs_scrub_xref_is_not_inode_chunk(sc, agbno, 1);
> - xfs_scrub_agi_xref_icounts(sc);
> + xchk_xref_is_used_space(sc, agbno, 1);
> + xchk_xref_is_not_inode_chunk(sc, agbno, 1);
> + xchk_agi_xref_icounts(sc);
> xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_FS);
> - xfs_scrub_xref_is_owned_by(sc, agbno, 1, &oinfo);
> - xfs_scrub_xref_is_not_shared(sc, agbno, 1);
> + xchk_xref_is_owned_by(sc, agbno, 1, &oinfo);
> + xchk_xref_is_not_shared(sc, agbno, 1);
>
> /* scrub teardown will take care of sc->sa for us */
> }
>
> /* Scrub the AGI. */
> int
> -xfs_scrub_agi(
> +xchk_agi(
> struct xfs_scrub_context *sc)
> {
> struct xfs_mount *mp = sc->mp;
> @@ -834,36 +834,36 @@ xfs_scrub_agi(
> int error = 0;
>
> agno = sc->sa.agno = sc->sm->sm_agno;
> - error = xfs_scrub_ag_read_headers(sc, agno, &sc->sa.agi_bp,
> + error = xchk_ag_read_headers(sc, agno, &sc->sa.agi_bp,
> &sc->sa.agf_bp, &sc->sa.agfl_bp);
> - if (!xfs_scrub_process_error(sc, agno, XFS_AGI_BLOCK(sc->mp), &error))
> + if (!xchk_process_error(sc, agno, XFS_AGI_BLOCK(sc->mp), &error))
> goto out;
> - xfs_scrub_buffer_recheck(sc, sc->sa.agi_bp);
> + xchk_buffer_recheck(sc, sc->sa.agi_bp);
>
> agi = XFS_BUF_TO_AGI(sc->sa.agi_bp);
>
> /* Check the AG length */
> eoag = be32_to_cpu(agi->agi_length);
> if (eoag != xfs_ag_block_count(mp, agno))
> - xfs_scrub_block_set_corrupt(sc, sc->sa.agi_bp);
> + xchk_block_set_corrupt(sc, sc->sa.agi_bp);
>
> /* Check btree roots and levels */
> agbno = be32_to_cpu(agi->agi_root);
> if (!xfs_verify_agbno(mp, agno, agbno))
> - xfs_scrub_block_set_corrupt(sc, sc->sa.agi_bp);
> + xchk_block_set_corrupt(sc, sc->sa.agi_bp);
>
> level = be32_to_cpu(agi->agi_level);
> if (level <= 0 || level > XFS_BTREE_MAXLEVELS)
> - xfs_scrub_block_set_corrupt(sc, sc->sa.agi_bp);
> + xchk_block_set_corrupt(sc, sc->sa.agi_bp);
>
> if (xfs_sb_version_hasfinobt(&mp->m_sb)) {
> agbno = be32_to_cpu(agi->agi_free_root);
> if (!xfs_verify_agbno(mp, agno, agbno))
> - xfs_scrub_block_set_corrupt(sc, sc->sa.agi_bp);
> + xchk_block_set_corrupt(sc, sc->sa.agi_bp);
>
> level = be32_to_cpu(agi->agi_free_level);
> if (level <= 0 || level > XFS_BTREE_MAXLEVELS)
> - xfs_scrub_block_set_corrupt(sc, sc->sa.agi_bp);
> + xchk_block_set_corrupt(sc, sc->sa.agi_bp);
> }
>
> /* Check inode counters */
> @@ -871,16 +871,16 @@ xfs_scrub_agi(
> icount = be32_to_cpu(agi->agi_count);
> if (icount > last_agino - first_agino + 1 ||
> icount < be32_to_cpu(agi->agi_freecount))
> - xfs_scrub_block_set_corrupt(sc, sc->sa.agi_bp);
> + xchk_block_set_corrupt(sc, sc->sa.agi_bp);
>
> /* Check inode pointers */
> agino = be32_to_cpu(agi->agi_newino);
> if (agino != NULLAGINO && !xfs_verify_agino(mp, agno, agino))
> - xfs_scrub_block_set_corrupt(sc, sc->sa.agi_bp);
> + xchk_block_set_corrupt(sc, sc->sa.agi_bp);
>
> agino = be32_to_cpu(agi->agi_dirino);
> if (agino != NULLAGINO && !xfs_verify_agino(mp, agno, agino))
> - xfs_scrub_block_set_corrupt(sc, sc->sa.agi_bp);
> + xchk_block_set_corrupt(sc, sc->sa.agi_bp);
>
> /* Check unlinked inode buckets */
> for (i = 0; i < XFS_AGI_UNLINKED_BUCKETS; i++) {
> @@ -888,13 +888,13 @@ xfs_scrub_agi(
> if (agino == NULLAGINO)
> continue;
> if (!xfs_verify_agino(mp, agno, agino))
> - xfs_scrub_block_set_corrupt(sc, sc->sa.agi_bp);
> + xchk_block_set_corrupt(sc, sc->sa.agi_bp);
> }
>
> if (agi->agi_pad32 != cpu_to_be32(0))
> - xfs_scrub_block_set_corrupt(sc, sc->sa.agi_bp);
> + xchk_block_set_corrupt(sc, sc->sa.agi_bp);
>
> - xfs_scrub_agi_xref(sc);
> + xchk_agi_xref(sc);
> out:
> return error;
> }
> diff --git a/fs/xfs/scrub/alloc.c b/fs/xfs/scrub/alloc.c
> index 50e4f7fa06f0..1f6e3a6a1fdd 100644
> --- a/fs/xfs/scrub/alloc.c
> +++ b/fs/xfs/scrub/alloc.c
> @@ -28,11 +28,11 @@
> * Set us up to scrub free space btrees.
> */
> int
> -xfs_scrub_setup_ag_allocbt(
> +xchk_setup_ag_allocbt(
> struct xfs_scrub_context *sc,
> struct xfs_inode *ip)
> {
> - return xfs_scrub_setup_ag_btree(sc, ip, false);
> + return xchk_setup_ag_btree(sc, ip, false);
> }
>
> /* Free space btree scrubber. */
> @@ -41,7 +41,7 @@ xfs_scrub_setup_ag_allocbt(
> * bnobt/cntbt record, respectively.
> */
> STATIC void
> -xfs_scrub_allocbt_xref_other(
> +xchk_allocbt_xref_other(
> struct xfs_scrub_context *sc,
> xfs_agblock_t agbno,
> xfs_extlen_t len)
> @@ -56,32 +56,32 @@ xfs_scrub_allocbt_xref_other(
> pcur = &sc->sa.cnt_cur;
> else
> pcur = &sc->sa.bno_cur;
> - if (!*pcur || xfs_scrub_skip_xref(sc->sm))
> + if (!*pcur || xchk_skip_xref(sc->sm))
> return;
>
> error = xfs_alloc_lookup_le(*pcur, agbno, len, &has_otherrec);
> - if (!xfs_scrub_should_check_xref(sc, &error, pcur))
> + if (!xchk_should_check_xref(sc, &error, pcur))
> return;
> if (!has_otherrec) {
> - xfs_scrub_btree_xref_set_corrupt(sc, *pcur, 0);
> + xchk_btree_xref_set_corrupt(sc, *pcur, 0);
> return;
> }
>
> error = xfs_alloc_get_rec(*pcur, &fbno, &flen, &has_otherrec);
> - if (!xfs_scrub_should_check_xref(sc, &error, pcur))
> + if (!xchk_should_check_xref(sc, &error, pcur))
> return;
> if (!has_otherrec) {
> - xfs_scrub_btree_xref_set_corrupt(sc, *pcur, 0);
> + xchk_btree_xref_set_corrupt(sc, *pcur, 0);
> return;
> }
>
> if (fbno != agbno || flen != len)
> - xfs_scrub_btree_xref_set_corrupt(sc, *pcur, 0);
> + xchk_btree_xref_set_corrupt(sc, *pcur, 0);
> }
>
> /* Cross-reference with the other btrees. */
> STATIC void
> -xfs_scrub_allocbt_xref(
> +xchk_allocbt_xref(
> struct xfs_scrub_context *sc,
> xfs_agblock_t agbno,
> xfs_extlen_t len)
> @@ -89,16 +89,16 @@ xfs_scrub_allocbt_xref(
> if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
> return;
>
> - xfs_scrub_allocbt_xref_other(sc, agbno, len);
> - xfs_scrub_xref_is_not_inode_chunk(sc, agbno, len);
> - xfs_scrub_xref_has_no_owner(sc, agbno, len);
> - xfs_scrub_xref_is_not_shared(sc, agbno, len);
> + xchk_allocbt_xref_other(sc, agbno, len);
> + xchk_xref_is_not_inode_chunk(sc, agbno, len);
> + xchk_xref_has_no_owner(sc, agbno, len);
> + xchk_xref_is_not_shared(sc, agbno, len);
> }
>
> /* Scrub a bnobt/cntbt record. */
> STATIC int
> -xfs_scrub_allocbt_rec(
> - struct xfs_scrub_btree *bs,
> +xchk_allocbt_rec(
> + struct xchk_btree *bs,
> union xfs_btree_rec *rec)
> {
> struct xfs_mount *mp = bs->cur->bc_mp;
> @@ -113,16 +113,16 @@ xfs_scrub_allocbt_rec(
> if (bno + len <= bno ||
> !xfs_verify_agbno(mp, agno, bno) ||
> !xfs_verify_agbno(mp, agno, bno + len - 1))
> - xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
> + xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
>
> - xfs_scrub_allocbt_xref(bs->sc, bno, len);
> + xchk_allocbt_xref(bs->sc, bno, len);
>
> return error;
> }
>
> /* Scrub the freespace btrees for some AG. */
> STATIC int
> -xfs_scrub_allocbt(
> +xchk_allocbt(
> struct xfs_scrub_context *sc,
> xfs_btnum_t which)
> {
> @@ -131,26 +131,26 @@ xfs_scrub_allocbt(
>
> xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_AG);
> cur = which == XFS_BTNUM_BNO ? sc->sa.bno_cur : sc->sa.cnt_cur;
> - return xfs_scrub_btree(sc, cur, xfs_scrub_allocbt_rec, &oinfo, NULL);
> + return xchk_btree(sc, cur, xchk_allocbt_rec, &oinfo, NULL);
> }
>
> int
> -xfs_scrub_bnobt(
> +xchk_bnobt(
> struct xfs_scrub_context *sc)
> {
> - return xfs_scrub_allocbt(sc, XFS_BTNUM_BNO);
> + return xchk_allocbt(sc, XFS_BTNUM_BNO);
> }
>
> int
> -xfs_scrub_cntbt(
> +xchk_cntbt(
> struct xfs_scrub_context *sc)
> {
> - return xfs_scrub_allocbt(sc, XFS_BTNUM_CNT);
> + return xchk_allocbt(sc, XFS_BTNUM_CNT);
> }
>
> /* xref check that the extent is not free */
> void
> -xfs_scrub_xref_is_used_space(
> +xchk_xref_is_used_space(
> struct xfs_scrub_context *sc,
> xfs_agblock_t agbno,
> xfs_extlen_t len)
> @@ -158,12 +158,12 @@ xfs_scrub_xref_is_used_space(
> bool is_freesp;
> int error;
>
> - if (!sc->sa.bno_cur || xfs_scrub_skip_xref(sc->sm))
> + if (!sc->sa.bno_cur || xchk_skip_xref(sc->sm))
> return;
>
> error = xfs_alloc_has_record(sc->sa.bno_cur, agbno, len, &is_freesp);
> - if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.bno_cur))
> + if (!xchk_should_check_xref(sc, &error, &sc->sa.bno_cur))
> return;
> if (is_freesp)
> - xfs_scrub_btree_xref_set_corrupt(sc, sc->sa.bno_cur, 0);
> + xchk_btree_xref_set_corrupt(sc, sc->sa.bno_cur, 0);
> }
> diff --git a/fs/xfs/scrub/attr.c b/fs/xfs/scrub/attr.c
> index de51cf8a8516..0068bebddf3e 100644
> --- a/fs/xfs/scrub/attr.c
> +++ b/fs/xfs/scrub/attr.c
> @@ -32,7 +32,7 @@
>
> /* Set us up to scrub an inode's extended attributes. */
> int
> -xfs_scrub_setup_xattr(
> +xchk_setup_xattr(
> struct xfs_scrub_context *sc,
> struct xfs_inode *ip)
> {
> @@ -50,12 +50,12 @@ xfs_scrub_setup_xattr(
> if (!sc->buf)
> return -ENOMEM;
>
> - return xfs_scrub_setup_inode_contents(sc, ip, 0);
> + return xchk_setup_inode_contents(sc, ip, 0);
> }
>
> /* Extended Attributes */
>
> -struct xfs_scrub_xattr {
> +struct xchk_xattr {
> struct xfs_attr_list_context context;
> struct xfs_scrub_context *sc;
> };
> @@ -69,22 +69,22 @@ struct xfs_scrub_xattr {
> * or if we get more or less data than we expected.
> */
> static void
> -xfs_scrub_xattr_listent(
> +xchk_xattr_listent(
> struct xfs_attr_list_context *context,
> int flags,
> unsigned char *name,
> int namelen,
> int valuelen)
> {
> - struct xfs_scrub_xattr *sx;
> + struct xchk_xattr *sx;
> struct xfs_da_args args = { NULL };
> int error = 0;
>
> - sx = container_of(context, struct xfs_scrub_xattr, context);
> + sx = container_of(context, struct xchk_xattr, context);
>
> if (flags & XFS_ATTR_INCOMPLETE) {
> /* Incomplete attr key, just mark the inode for preening. */
> - xfs_scrub_ino_set_preen(sx->sc, context->dp->i_ino);
> + xchk_ino_set_preen(sx->sc, context->dp->i_ino);
> return;
> }
>
> @@ -106,11 +106,11 @@ xfs_scrub_xattr_listent(
> error = xfs_attr_get_ilocked(context->dp, &args);
> if (error == -EEXIST)
> error = 0;
> - if (!xfs_scrub_fblock_process_error(sx->sc, XFS_ATTR_FORK, args.blkno,
> + if (!xchk_fblock_process_error(sx->sc, XFS_ATTR_FORK, args.blkno,
> &error))
> goto fail_xref;
> if (args.valuelen != valuelen)
> - xfs_scrub_fblock_set_corrupt(sx->sc, XFS_ATTR_FORK,
> + xchk_fblock_set_corrupt(sx->sc, XFS_ATTR_FORK,
> args.blkno);
> fail_xref:
> if (sx->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
> @@ -126,7 +126,7 @@ xfs_scrub_xattr_listent(
> * the smallest address
> */
> STATIC bool
> -xfs_scrub_xattr_set_map(
> +xchk_xattr_set_map(
> struct xfs_scrub_context *sc,
> unsigned long *map,
> unsigned int start,
> @@ -154,7 +154,7 @@ xfs_scrub_xattr_set_map(
> * attr freemap has problems or points to used space.
> */
> STATIC bool
> -xfs_scrub_xattr_check_freemap(
> +xchk_xattr_check_freemap(
> struct xfs_scrub_context *sc,
> unsigned long *map,
> struct xfs_attr3_icleaf_hdr *leafhdr)
> @@ -168,7 +168,7 @@ xfs_scrub_xattr_check_freemap(
> freemap = (unsigned long *)sc->buf + BITS_TO_LONGS(mapsize);
> bitmap_zero(freemap, mapsize);
> for (i = 0; i < XFS_ATTR_LEAF_MAPSIZE; i++) {
> - if (!xfs_scrub_xattr_set_map(sc, freemap,
> + if (!xchk_xattr_set_map(sc, freemap,
> leafhdr->freemap[i].base,
> leafhdr->freemap[i].size))
> return false;
> @@ -184,8 +184,8 @@ xfs_scrub_xattr_check_freemap(
> * Returns the number of bytes used for the name/value data.
> */
> STATIC void
> -xfs_scrub_xattr_entry(
> - struct xfs_scrub_da_btree *ds,
> +xchk_xattr_entry(
> + struct xchk_da_btree *ds,
> int level,
> char *buf_end,
> struct xfs_attr_leafblock *leaf,
> @@ -204,17 +204,17 @@ xfs_scrub_xattr_entry(
> unsigned int namesize;
>
> if (ent->pad2 != 0)
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
>
> /* Hash values in order? */
> if (be32_to_cpu(ent->hashval) < *last_hashval)
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
> *last_hashval = be32_to_cpu(ent->hashval);
>
> nameidx = be16_to_cpu(ent->nameidx);
> if (nameidx < leafhdr->firstused ||
> nameidx >= mp->m_attr_geo->blksize) {
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
> return;
> }
>
> @@ -225,27 +225,27 @@ xfs_scrub_xattr_entry(
> be16_to_cpu(lentry->valuelen));
> name_end = (char *)lentry + namesize;
> if (lentry->namelen == 0)
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
> } else {
> rentry = xfs_attr3_leaf_name_remote(leaf, idx);
> namesize = xfs_attr_leaf_entsize_remote(rentry->namelen);
> name_end = (char *)rentry + namesize;
> if (rentry->namelen == 0 || rentry->valueblk == 0)
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
> }
> if (name_end > buf_end)
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
>
> - if (!xfs_scrub_xattr_set_map(ds->sc, usedmap, nameidx, namesize))
> - xfs_scrub_da_set_corrupt(ds, level);
> + if (!xchk_xattr_set_map(ds->sc, usedmap, nameidx, namesize))
> + xchk_da_set_corrupt(ds, level);
> if (!(ds->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT))
> *usedbytes += namesize;
> }
>
> /* Scrub an attribute leaf. */
> STATIC int
> -xfs_scrub_xattr_block(
> - struct xfs_scrub_da_btree *ds,
> +xchk_xattr_block(
> + struct xchk_da_btree *ds,
> int level)
> {
> struct xfs_attr3_icleaf_hdr leafhdr;
> @@ -275,10 +275,10 @@ xfs_scrub_xattr_block(
>
> if (leaf->hdr.pad1 != 0 || leaf->hdr.pad2 != 0 ||
> leaf->hdr.info.hdr.pad != 0)
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
> } else {
> if (leaf->hdr.pad1 != 0 || leaf->hdr.info.pad != 0)
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
> }
>
> /* Check the leaf header */
> @@ -286,44 +286,44 @@ xfs_scrub_xattr_block(
> hdrsize = xfs_attr3_leaf_hdr_size(leaf);
>
> if (leafhdr.usedbytes > mp->m_attr_geo->blksize)
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
> if (leafhdr.firstused > mp->m_attr_geo->blksize)
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
> if (leafhdr.firstused < hdrsize)
> - xfs_scrub_da_set_corrupt(ds, level);
> - if (!xfs_scrub_xattr_set_map(ds->sc, usedmap, 0, hdrsize))
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
> + if (!xchk_xattr_set_map(ds->sc, usedmap, 0, hdrsize))
> + xchk_da_set_corrupt(ds, level);
>
> if (ds->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
> goto out;
>
> entries = xfs_attr3_leaf_entryp(leaf);
> if ((char *)&entries[leafhdr.count] > (char *)leaf + leafhdr.firstused)
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
>
> buf_end = (char *)bp->b_addr + mp->m_attr_geo->blksize;
> for (i = 0, ent = entries; i < leafhdr.count; ent++, i++) {
> /* Mark the leaf entry itself. */
> off = (char *)ent - (char *)leaf;
> - if (!xfs_scrub_xattr_set_map(ds->sc, usedmap, off,
> + if (!xchk_xattr_set_map(ds->sc, usedmap, off,
> sizeof(xfs_attr_leaf_entry_t))) {
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
> goto out;
> }
>
> /* Check the entry and nameval. */
> - xfs_scrub_xattr_entry(ds, level, buf_end, leaf, &leafhdr,
> + xchk_xattr_entry(ds, level, buf_end, leaf, &leafhdr,
> usedmap, ent, i, &usedbytes, &last_hashval);
>
> if (ds->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
> goto out;
> }
>
> - if (!xfs_scrub_xattr_check_freemap(ds->sc, usedmap, &leafhdr))
> - xfs_scrub_da_set_corrupt(ds, level);
> + if (!xchk_xattr_check_freemap(ds->sc, usedmap, &leafhdr))
> + xchk_da_set_corrupt(ds, level);
>
> if (leafhdr.usedbytes != usedbytes)
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
>
> out:
> return 0;
> @@ -331,8 +331,8 @@ xfs_scrub_xattr_block(
>
> /* Scrub a attribute btree record. */
> STATIC int
> -xfs_scrub_xattr_rec(
> - struct xfs_scrub_da_btree *ds,
> +xchk_xattr_rec(
> + struct xchk_da_btree *ds,
> int level,
> void *rec)
> {
> @@ -352,14 +352,14 @@ xfs_scrub_xattr_rec(
> blk = &ds->state->path.blk[level];
>
> /* Check the whole block, if necessary. */
> - error = xfs_scrub_xattr_block(ds, level);
> + error = xchk_xattr_block(ds, level);
> if (error)
> goto out;
> if (ds->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
> goto out;
>
> /* Check the hash of the entry. */
> - error = xfs_scrub_da_btree_hash(ds, level, &ent->hashval);
> + error = xchk_da_btree_hash(ds, level, &ent->hashval);
> if (error)
> goto out;
>
> @@ -368,7 +368,7 @@ xfs_scrub_xattr_rec(
> hdrsize = xfs_attr3_leaf_hdr_size(bp->b_addr);
> nameidx = be16_to_cpu(ent->nameidx);
> if (nameidx < hdrsize || nameidx >= mp->m_attr_geo->blksize) {
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
> goto out;
> }
>
> @@ -377,12 +377,12 @@ xfs_scrub_xattr_rec(
> badflags = ~(XFS_ATTR_LOCAL | XFS_ATTR_ROOT | XFS_ATTR_SECURE |
> XFS_ATTR_INCOMPLETE);
> if ((ent->flags & badflags) != 0)
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
> if (ent->flags & XFS_ATTR_LOCAL) {
> lentry = (struct xfs_attr_leaf_name_local *)
> (((char *)bp->b_addr) + nameidx);
> if (lentry->namelen <= 0) {
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
> goto out;
> }
> calc_hash = xfs_da_hashname(lentry->nameval, lentry->namelen);
> @@ -390,13 +390,13 @@ xfs_scrub_xattr_rec(
> rentry = (struct xfs_attr_leaf_name_remote *)
> (((char *)bp->b_addr) + nameidx);
> if (rentry->namelen <= 0) {
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
> goto out;
> }
> calc_hash = xfs_da_hashname(rentry->name, rentry->namelen);
> }
> if (calc_hash != hash)
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
>
> out:
> return error;
> @@ -404,10 +404,10 @@ xfs_scrub_xattr_rec(
>
> /* Scrub the extended attribute metadata. */
> int
> -xfs_scrub_xattr(
> +xchk_xattr(
> struct xfs_scrub_context *sc)
> {
> - struct xfs_scrub_xattr sx;
> + struct xchk_xattr sx;
> struct attrlist_cursor_kern cursor = { 0 };
> xfs_dablk_t last_checked = -1U;
> int error = 0;
> @@ -417,7 +417,7 @@ xfs_scrub_xattr(
>
> memset(&sx, 0, sizeof(sx));
> /* Check attribute tree structure */
> - error = xfs_scrub_da_btree(sc, XFS_ATTR_FORK, xfs_scrub_xattr_rec,
> + error = xchk_da_btree(sc, XFS_ATTR_FORK, xchk_xattr_rec,
> &last_checked);
> if (error)
> goto out;
> @@ -429,7 +429,7 @@ xfs_scrub_xattr(
> sx.context.dp = sc->ip;
> sx.context.cursor = &cursor;
> sx.context.resynch = 1;
> - sx.context.put_listent = xfs_scrub_xattr_listent;
> + sx.context.put_listent = xchk_xattr_listent;
> sx.context.tp = sc->tp;
> sx.context.flags = ATTR_INCOMPLETE;
> sx.sc = sc;
> @@ -438,7 +438,7 @@ xfs_scrub_xattr(
> * Look up every xattr in this file by name.
> *
> * Use the backend implementation of xfs_attr_list to call
> - * xfs_scrub_xattr_listent on every attribute key in this inode.
> + * xchk_xattr_listent on every attribute key in this inode.
> * In other words, we use the same iterator/callback mechanism
> * that listattr uses to scrub extended attributes, though in our
> * _listent function, we check the value of the attribute.
> @@ -451,7 +451,7 @@ xfs_scrub_xattr(
> * locking order.
> */
> error = xfs_attr_list_int_ilocked(&sx.context);
> - if (!xfs_scrub_fblock_process_error(sc, XFS_ATTR_FORK, 0, &error))
> + if (!xchk_fblock_process_error(sc, XFS_ATTR_FORK, 0, &error))
> goto out;
> out:
> return error;
> diff --git a/fs/xfs/scrub/bmap.c b/fs/xfs/scrub/bmap.c
> index ebbfab173e97..19cfbd3910a2 100644
> --- a/fs/xfs/scrub/bmap.c
> +++ b/fs/xfs/scrub/bmap.c
> @@ -33,13 +33,13 @@
>
> /* Set us up with an inode's bmap. */
> int
> -xfs_scrub_setup_inode_bmap(
> +xchk_setup_inode_bmap(
> struct xfs_scrub_context *sc,
> struct xfs_inode *ip)
> {
> int error;
>
> - error = xfs_scrub_get_inode(sc, ip);
> + error = xchk_get_inode(sc, ip);
> if (error)
> goto out;
>
> @@ -60,7 +60,7 @@ xfs_scrub_setup_inode_bmap(
> }
>
> /* Got the inode, lock it and we're ready to go. */
> - error = xfs_scrub_trans_alloc(sc, 0);
> + error = xchk_trans_alloc(sc, 0);
> if (error)
> goto out;
> sc->ilock_flags |= XFS_ILOCK_EXCL;
> @@ -78,7 +78,7 @@ xfs_scrub_setup_inode_bmap(
> * is in btree format.
> */
>
> -struct xfs_scrub_bmap_info {
> +struct xchk_bmap_info {
> struct xfs_scrub_context *sc;
> xfs_fileoff_t lastoff;
> bool is_rt;
> @@ -88,8 +88,8 @@ struct xfs_scrub_bmap_info {
>
> /* Look for a corresponding rmap for this irec. */
> static inline bool
> -xfs_scrub_bmap_get_rmap(
> - struct xfs_scrub_bmap_info *info,
> +xchk_bmap_get_rmap(
> + struct xchk_bmap_info *info,
> struct xfs_bmbt_irec *irec,
> xfs_agblock_t agbno,
> uint64_t owner,
> @@ -120,7 +120,7 @@ xfs_scrub_bmap_get_rmap(
> if (info->is_shared) {
> error = xfs_rmap_lookup_le_range(info->sc->sa.rmap_cur, agbno,
> owner, offset, rflags, rmap, &has_rmap);
> - if (!xfs_scrub_should_check_xref(info->sc, &error,
> + if (!xchk_should_check_xref(info->sc, &error,
> &info->sc->sa.rmap_cur))
> return false;
> goto out;
> @@ -131,28 +131,28 @@ xfs_scrub_bmap_get_rmap(
> */
> error = xfs_rmap_lookup_le(info->sc->sa.rmap_cur, agbno, 0, owner,
> offset, rflags, &has_rmap);
> - if (!xfs_scrub_should_check_xref(info->sc, &error,
> + if (!xchk_should_check_xref(info->sc, &error,
> &info->sc->sa.rmap_cur))
> return false;
> if (!has_rmap)
> goto out;
>
> error = xfs_rmap_get_rec(info->sc->sa.rmap_cur, rmap, &has_rmap);
> - if (!xfs_scrub_should_check_xref(info->sc, &error,
> + if (!xchk_should_check_xref(info->sc, &error,
> &info->sc->sa.rmap_cur))
> return false;
>
> out:
> if (!has_rmap)
> - xfs_scrub_fblock_xref_set_corrupt(info->sc, info->whichfork,
> + xchk_fblock_xref_set_corrupt(info->sc, info->whichfork,
> irec->br_startoff);
> return has_rmap;
> }
>
> /* Make sure that we have rmapbt records for this extent. */
> STATIC void
> -xfs_scrub_bmap_xref_rmap(
> - struct xfs_scrub_bmap_info *info,
> +xchk_bmap_xref_rmap(
> + struct xchk_bmap_info *info,
> struct xfs_bmbt_irec *irec,
> xfs_agblock_t agbno)
> {
> @@ -160,7 +160,7 @@ xfs_scrub_bmap_xref_rmap(
> unsigned long long rmap_end;
> uint64_t owner;
>
> - if (!info->sc->sa.rmap_cur || xfs_scrub_skip_xref(info->sc->sm))
> + if (!info->sc->sa.rmap_cur || xchk_skip_xref(info->sc->sm))
> return;
>
> if (info->whichfork == XFS_COW_FORK)
> @@ -169,14 +169,14 @@ xfs_scrub_bmap_xref_rmap(
> owner = info->sc->ip->i_ino;
>
> /* Find the rmap record for this irec. */
> - if (!xfs_scrub_bmap_get_rmap(info, irec, agbno, owner, &rmap))
> + if (!xchk_bmap_get_rmap(info, irec, agbno, owner, &rmap))
> return;
>
> /* Check the rmap. */
> rmap_end = (unsigned long long)rmap.rm_startblock + rmap.rm_blockcount;
> if (rmap.rm_startblock > agbno ||
> agbno + irec->br_blockcount > rmap_end)
> - xfs_scrub_fblock_xref_set_corrupt(info->sc, info->whichfork,
> + xchk_fblock_xref_set_corrupt(info->sc, info->whichfork,
> irec->br_startoff);
>
> /*
> @@ -189,12 +189,12 @@ xfs_scrub_bmap_xref_rmap(
> rmap.rm_blockcount;
> if (rmap.rm_offset > irec->br_startoff ||
> irec->br_startoff + irec->br_blockcount > rmap_end)
> - xfs_scrub_fblock_xref_set_corrupt(info->sc,
> + xchk_fblock_xref_set_corrupt(info->sc,
> info->whichfork, irec->br_startoff);
> }
>
> if (rmap.rm_owner != owner)
> - xfs_scrub_fblock_xref_set_corrupt(info->sc, info->whichfork,
> + xchk_fblock_xref_set_corrupt(info->sc, info->whichfork,
> irec->br_startoff);
>
> /*
> @@ -207,22 +207,22 @@ xfs_scrub_bmap_xref_rmap(
> if (owner != XFS_RMAP_OWN_COW &&
> irec->br_state == XFS_EXT_UNWRITTEN &&
> !(rmap.rm_flags & XFS_RMAP_UNWRITTEN))
> - xfs_scrub_fblock_xref_set_corrupt(info->sc, info->whichfork,
> + xchk_fblock_xref_set_corrupt(info->sc, info->whichfork,
> irec->br_startoff);
>
> if (info->whichfork == XFS_ATTR_FORK &&
> !(rmap.rm_flags & XFS_RMAP_ATTR_FORK))
> - xfs_scrub_fblock_xref_set_corrupt(info->sc, info->whichfork,
> + xchk_fblock_xref_set_corrupt(info->sc, info->whichfork,
> irec->br_startoff);
> if (rmap.rm_flags & XFS_RMAP_BMBT_BLOCK)
> - xfs_scrub_fblock_xref_set_corrupt(info->sc, info->whichfork,
> + xchk_fblock_xref_set_corrupt(info->sc, info->whichfork,
> irec->br_startoff);
> }
>
> /* Cross-reference a single rtdev extent record. */
> STATIC void
> -xfs_scrub_bmap_rt_extent_xref(
> - struct xfs_scrub_bmap_info *info,
> +xchk_bmap_rt_extent_xref(
> + struct xchk_bmap_info *info,
> struct xfs_inode *ip,
> struct xfs_btree_cur *cur,
> struct xfs_bmbt_irec *irec)
> @@ -230,14 +230,14 @@ xfs_scrub_bmap_rt_extent_xref(
> if (info->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
> return;
>
> - xfs_scrub_xref_is_used_rt_space(info->sc, irec->br_startblock,
> + xchk_xref_is_used_rt_space(info->sc, irec->br_startblock,
> irec->br_blockcount);
> }
>
> /* Cross-reference a single datadev extent record. */
> STATIC void
> -xfs_scrub_bmap_extent_xref(
> - struct xfs_scrub_bmap_info *info,
> +xchk_bmap_extent_xref(
> + struct xchk_bmap_info *info,
> struct xfs_inode *ip,
> struct xfs_btree_cur *cur,
> struct xfs_bmbt_irec *irec)
> @@ -255,38 +255,38 @@ xfs_scrub_bmap_extent_xref(
> agbno = XFS_FSB_TO_AGBNO(mp, irec->br_startblock);
> len = irec->br_blockcount;
>
> - error = xfs_scrub_ag_init(info->sc, agno, &info->sc->sa);
> - if (!xfs_scrub_fblock_process_error(info->sc, info->whichfork,
> + error = xchk_ag_init(info->sc, agno, &info->sc->sa);
> + if (!xchk_fblock_process_error(info->sc, info->whichfork,
> irec->br_startoff, &error))
> return;
>
> - xfs_scrub_xref_is_used_space(info->sc, agbno, len);
> - xfs_scrub_xref_is_not_inode_chunk(info->sc, agbno, len);
> - xfs_scrub_bmap_xref_rmap(info, irec, agbno);
> + xchk_xref_is_used_space(info->sc, agbno, len);
> + xchk_xref_is_not_inode_chunk(info->sc, agbno, len);
> + xchk_bmap_xref_rmap(info, irec, agbno);
> switch (info->whichfork) {
> case XFS_DATA_FORK:
> if (xfs_is_reflink_inode(info->sc->ip))
> break;
> /* fall through */
> case XFS_ATTR_FORK:
> - xfs_scrub_xref_is_not_shared(info->sc, agbno,
> + xchk_xref_is_not_shared(info->sc, agbno,
> irec->br_blockcount);
> break;
> case XFS_COW_FORK:
> - xfs_scrub_xref_is_cow_staging(info->sc, agbno,
> + xchk_xref_is_cow_staging(info->sc, agbno,
> irec->br_blockcount);
> break;
> }
>
> - xfs_scrub_ag_free(info->sc, &info->sc->sa);
> + xchk_ag_free(info->sc, &info->sc->sa);
> }
>
> /* Scrub a single extent record. */
> STATIC int
> -xfs_scrub_bmap_extent(
> +xchk_bmap_extent(
> struct xfs_inode *ip,
> struct xfs_btree_cur *cur,
> - struct xfs_scrub_bmap_info *info,
> + struct xchk_bmap_info *info,
> struct xfs_bmbt_irec *irec)
> {
> struct xfs_mount *mp = info->sc->mp;
> @@ -302,12 +302,12 @@ xfs_scrub_bmap_extent(
> * from the incore list, for which there is no ordering check.
> */
> if (irec->br_startoff < info->lastoff)
> - xfs_scrub_fblock_set_corrupt(info->sc, info->whichfork,
> + xchk_fblock_set_corrupt(info->sc, info->whichfork,
> irec->br_startoff);
>
> /* There should never be a "hole" extent in either extent list. */
> if (irec->br_startblock == HOLESTARTBLOCK)
> - xfs_scrub_fblock_set_corrupt(info->sc, info->whichfork,
> + xchk_fblock_set_corrupt(info->sc, info->whichfork,
> irec->br_startoff);
>
> /*
> @@ -315,40 +315,40 @@ xfs_scrub_bmap_extent(
> * in-core extent scan, and we should never see these in the bmbt.
> */
> if (isnullstartblock(irec->br_startblock))
> - xfs_scrub_fblock_set_corrupt(info->sc, info->whichfork,
> + xchk_fblock_set_corrupt(info->sc, info->whichfork,
> irec->br_startoff);
>
> /* Make sure the extent points to a valid place. */
> if (irec->br_blockcount > MAXEXTLEN)
> - xfs_scrub_fblock_set_corrupt(info->sc, info->whichfork,
> + xchk_fblock_set_corrupt(info->sc, info->whichfork,
> irec->br_startoff);
> if (irec->br_startblock + irec->br_blockcount <= irec->br_startblock)
> - xfs_scrub_fblock_set_corrupt(info->sc, info->whichfork,
> + xchk_fblock_set_corrupt(info->sc, info->whichfork,
> irec->br_startoff);
> end = irec->br_startblock + irec->br_blockcount - 1;
> if (info->is_rt &&
> (!xfs_verify_rtbno(mp, irec->br_startblock) ||
> !xfs_verify_rtbno(mp, end)))
> - xfs_scrub_fblock_set_corrupt(info->sc, info->whichfork,
> + xchk_fblock_set_corrupt(info->sc, info->whichfork,
> irec->br_startoff);
> if (!info->is_rt &&
> (!xfs_verify_fsbno(mp, irec->br_startblock) ||
> !xfs_verify_fsbno(mp, end) ||
> XFS_FSB_TO_AGNO(mp, irec->br_startblock) !=
> XFS_FSB_TO_AGNO(mp, end)))
> - xfs_scrub_fblock_set_corrupt(info->sc, info->whichfork,
> + xchk_fblock_set_corrupt(info->sc, info->whichfork,
> irec->br_startoff);
>
> /* We don't allow unwritten extents on attr forks. */
> if (irec->br_state == XFS_EXT_UNWRITTEN &&
> info->whichfork == XFS_ATTR_FORK)
> - xfs_scrub_fblock_set_corrupt(info->sc, info->whichfork,
> + xchk_fblock_set_corrupt(info->sc, info->whichfork,
> irec->br_startoff);
>
> if (info->is_rt)
> - xfs_scrub_bmap_rt_extent_xref(info, ip, cur, irec);
> + xchk_bmap_rt_extent_xref(info, ip, cur, irec);
> else
> - xfs_scrub_bmap_extent_xref(info, ip, cur, irec);
> + xchk_bmap_extent_xref(info, ip, cur, irec);
>
> info->lastoff = irec->br_startoff + irec->br_blockcount;
> return error;
> @@ -356,12 +356,12 @@ xfs_scrub_bmap_extent(
>
> /* Scrub a bmbt record. */
> STATIC int
> -xfs_scrub_bmapbt_rec(
> - struct xfs_scrub_btree *bs,
> +xchk_bmapbt_rec(
> + struct xchk_btree *bs,
> union xfs_btree_rec *rec)
> {
> struct xfs_bmbt_irec irec;
> - struct xfs_scrub_bmap_info *info = bs->private;
> + struct xchk_bmap_info *info = bs->private;
> struct xfs_inode *ip = bs->cur->bc_private.b.ip;
> struct xfs_buf *bp = NULL;
> struct xfs_btree_block *block;
> @@ -378,22 +378,22 @@ xfs_scrub_bmapbt_rec(
> block = xfs_btree_get_block(bs->cur, i, &bp);
> owner = be64_to_cpu(block->bb_u.l.bb_owner);
> if (owner != ip->i_ino)
> - xfs_scrub_fblock_set_corrupt(bs->sc,
> + xchk_fblock_set_corrupt(bs->sc,
> info->whichfork, 0);
> }
> }
>
> /* Set up the in-core record and scrub it. */
> xfs_bmbt_disk_get_all(&rec->bmbt, &irec);
> - return xfs_scrub_bmap_extent(ip, bs->cur, info, &irec);
> + return xchk_bmap_extent(ip, bs->cur, info, &irec);
> }
>
> /* Scan the btree records. */
> STATIC int
> -xfs_scrub_bmap_btree(
> +xchk_bmap_btree(
> struct xfs_scrub_context *sc,
> int whichfork,
> - struct xfs_scrub_bmap_info *info)
> + struct xchk_bmap_info *info)
> {
> struct xfs_owner_info oinfo;
> struct xfs_mount *mp = sc->mp;
> @@ -403,12 +403,12 @@ xfs_scrub_bmap_btree(
>
> cur = xfs_bmbt_init_cursor(mp, sc->tp, ip, whichfork);
> xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, whichfork);
> - error = xfs_scrub_btree(sc, cur, xfs_scrub_bmapbt_rec, &oinfo, info);
> + error = xchk_btree(sc, cur, xchk_bmapbt_rec, &oinfo, info);
> xfs_btree_del_cursor(cur, error);
> return error;
> }
>
> -struct xfs_scrub_bmap_check_rmap_info {
> +struct xchk_bmap_check_rmap_info {
> struct xfs_scrub_context *sc;
> int whichfork;
> struct xfs_iext_cursor icur;
> @@ -416,13 +416,13 @@ struct xfs_scrub_bmap_check_rmap_info {
>
> /* Can we find bmaps that fit this rmap? */
> STATIC int
> -xfs_scrub_bmap_check_rmap(
> +xchk_bmap_check_rmap(
> struct xfs_btree_cur *cur,
> struct xfs_rmap_irec *rec,
> void *priv)
> {
> struct xfs_bmbt_irec irec;
> - struct xfs_scrub_bmap_check_rmap_info *sbcri = priv;
> + struct xchk_bmap_check_rmap_info *sbcri = priv;
> struct xfs_ifork *ifp;
> struct xfs_scrub_context *sc = sbcri->sc;
> bool have_map;
> @@ -439,14 +439,14 @@ xfs_scrub_bmap_check_rmap(
> /* Now look up the bmbt record. */
> ifp = XFS_IFORK_PTR(sc->ip, sbcri->whichfork);
> if (!ifp) {
> - xfs_scrub_fblock_set_corrupt(sc, sbcri->whichfork,
> + xchk_fblock_set_corrupt(sc, sbcri->whichfork,
> rec->rm_offset);
> goto out;
> }
> have_map = xfs_iext_lookup_extent(sc->ip, ifp, rec->rm_offset,
> &sbcri->icur, &irec);
> if (!have_map)
> - xfs_scrub_fblock_set_corrupt(sc, sbcri->whichfork,
> + xchk_fblock_set_corrupt(sc, sbcri->whichfork,
> rec->rm_offset);
> /*
> * bmap extent record lengths are constrained to 2^21 blocks in length
> @@ -457,14 +457,14 @@ xfs_scrub_bmap_check_rmap(
> */
> while (have_map) {
> if (irec.br_startoff != rec->rm_offset)
> - xfs_scrub_fblock_set_corrupt(sc, sbcri->whichfork,
> + xchk_fblock_set_corrupt(sc, sbcri->whichfork,
> rec->rm_offset);
> if (irec.br_startblock != XFS_AGB_TO_FSB(sc->mp,
> cur->bc_private.a.agno, rec->rm_startblock))
> - xfs_scrub_fblock_set_corrupt(sc, sbcri->whichfork,
> + xchk_fblock_set_corrupt(sc, sbcri->whichfork,
> rec->rm_offset);
> if (irec.br_blockcount > rec->rm_blockcount)
> - xfs_scrub_fblock_set_corrupt(sc, sbcri->whichfork,
> + xchk_fblock_set_corrupt(sc, sbcri->whichfork,
> rec->rm_offset);
> if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
> break;
> @@ -475,7 +475,7 @@ xfs_scrub_bmap_check_rmap(
> break;
> have_map = xfs_iext_next_extent(ifp, &sbcri->icur, &irec);
> if (!have_map)
> - xfs_scrub_fblock_set_corrupt(sc, sbcri->whichfork,
> + xchk_fblock_set_corrupt(sc, sbcri->whichfork,
> rec->rm_offset);
> }
>
> @@ -487,12 +487,12 @@ xfs_scrub_bmap_check_rmap(
>
> /* Make sure each rmap has a corresponding bmbt entry. */
> STATIC int
> -xfs_scrub_bmap_check_ag_rmaps(
> +xchk_bmap_check_ag_rmaps(
> struct xfs_scrub_context *sc,
> int whichfork,
> xfs_agnumber_t agno)
> {
> - struct xfs_scrub_bmap_check_rmap_info sbcri;
> + struct xchk_bmap_check_rmap_info sbcri;
> struct xfs_btree_cur *cur;
> struct xfs_buf *agf;
> int error;
> @@ -509,7 +509,7 @@ xfs_scrub_bmap_check_ag_rmaps(
>
> sbcri.sc = sc;
> sbcri.whichfork = whichfork;
> - error = xfs_rmap_query_all(cur, xfs_scrub_bmap_check_rmap, &sbcri);
> + error = xfs_rmap_query_all(cur, xchk_bmap_check_rmap, &sbcri);
> if (error == XFS_BTREE_QUERY_RANGE_ABORT)
> error = 0;
>
> @@ -521,7 +521,7 @@ xfs_scrub_bmap_check_ag_rmaps(
>
> /* Make sure each rmap has a corresponding bmbt entry. */
> STATIC int
> -xfs_scrub_bmap_check_rmaps(
> +xchk_bmap_check_rmaps(
> struct xfs_scrub_context *sc,
> int whichfork)
> {
> @@ -561,7 +561,7 @@ xfs_scrub_bmap_check_rmaps(
> return 0;
>
> for (agno = 0; agno < sc->mp->m_sb.sb_agcount; agno++) {
> - error = xfs_scrub_bmap_check_ag_rmaps(sc, whichfork, agno);
> + error = xchk_bmap_check_ag_rmaps(sc, whichfork, agno);
> if (error)
> return error;
> if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
> @@ -578,12 +578,12 @@ xfs_scrub_bmap_check_rmaps(
> * Then we unconditionally scan the incore extent cache.
> */
> STATIC int
> -xfs_scrub_bmap(
> +xchk_bmap(
> struct xfs_scrub_context *sc,
> int whichfork)
> {
> struct xfs_bmbt_irec irec;
> - struct xfs_scrub_bmap_info info = { NULL };
> + struct xchk_bmap_info info = { NULL };
> struct xfs_mount *mp = sc->mp;
> struct xfs_inode *ip = sc->ip;
> struct xfs_ifork *ifp;
> @@ -605,7 +605,7 @@ xfs_scrub_bmap(
> goto out;
> /* No CoW forks on non-reflink inodes/filesystems. */
> if (!xfs_is_reflink_inode(ip)) {
> - xfs_scrub_ino_set_corrupt(sc, sc->ip->i_ino);
> + xchk_ino_set_corrupt(sc, sc->ip->i_ino);
> goto out;
> }
> break;
> @@ -614,7 +614,7 @@ xfs_scrub_bmap(
> goto out_check_rmap;
> if (!xfs_sb_version_hasattr(&mp->m_sb) &&
> !xfs_sb_version_hasattr2(&mp->m_sb))
> - xfs_scrub_ino_set_corrupt(sc, sc->ip->i_ino);
> + xchk_ino_set_corrupt(sc, sc->ip->i_ino);
> break;
> default:
> ASSERT(whichfork == XFS_DATA_FORK);
> @@ -630,22 +630,22 @@ xfs_scrub_bmap(
> goto out;
> case XFS_DINODE_FMT_EXTENTS:
> if (!(ifp->if_flags & XFS_IFEXTENTS)) {
> - xfs_scrub_fblock_set_corrupt(sc, whichfork, 0);
> + xchk_fblock_set_corrupt(sc, whichfork, 0);
> goto out;
> }
> break;
> case XFS_DINODE_FMT_BTREE:
> if (whichfork == XFS_COW_FORK) {
> - xfs_scrub_fblock_set_corrupt(sc, whichfork, 0);
> + xchk_fblock_set_corrupt(sc, whichfork, 0);
> goto out;
> }
>
> - error = xfs_scrub_bmap_btree(sc, whichfork, &info);
> + error = xchk_bmap_btree(sc, whichfork, &info);
> if (error)
> goto out;
> break;
> default:
> - xfs_scrub_fblock_set_corrupt(sc, whichfork, 0);
> + xchk_fblock_set_corrupt(sc, whichfork, 0);
> goto out;
> }
>
> @@ -655,37 +655,37 @@ xfs_scrub_bmap(
> /* Now try to scrub the in-memory extent list. */
> if (!(ifp->if_flags & XFS_IFEXTENTS)) {
> error = xfs_iread_extents(sc->tp, ip, whichfork);
> - if (!xfs_scrub_fblock_process_error(sc, whichfork, 0, &error))
> + if (!xchk_fblock_process_error(sc, whichfork, 0, &error))
> goto out;
> }
>
> /* Find the offset of the last extent in the mapping. */
> error = xfs_bmap_last_offset(ip, &endoff, whichfork);
> - if (!xfs_scrub_fblock_process_error(sc, whichfork, 0, &error))
> + if (!xchk_fblock_process_error(sc, whichfork, 0, &error))
> goto out;
>
> /* Scrub extent records. */
> info.lastoff = 0;
> ifp = XFS_IFORK_PTR(ip, whichfork);
> for_each_xfs_iext(ifp, &icur, &irec) {
> - if (xfs_scrub_should_terminate(sc, &error) ||
> + if (xchk_should_terminate(sc, &error) ||
> (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT))
> break;
> if (isnullstartblock(irec.br_startblock))
> continue;
> if (irec.br_startoff >= endoff) {
> - xfs_scrub_fblock_set_corrupt(sc, whichfork,
> + xchk_fblock_set_corrupt(sc, whichfork,
> irec.br_startoff);
> goto out;
> }
> - error = xfs_scrub_bmap_extent(ip, NULL, &info, &irec);
> + error = xchk_bmap_extent(ip, NULL, &info, &irec);
> if (error)
> goto out;
> }
>
> out_check_rmap:
> - error = xfs_scrub_bmap_check_rmaps(sc, whichfork);
> - if (!xfs_scrub_fblock_xref_process_error(sc, whichfork, 0, &error))
> + error = xchk_bmap_check_rmaps(sc, whichfork);
> + if (!xchk_fblock_xref_process_error(sc, whichfork, 0, &error))
> goto out;
> out:
> return error;
> @@ -693,27 +693,27 @@ xfs_scrub_bmap(
>
> /* Scrub an inode's data fork. */
> int
> -xfs_scrub_bmap_data(
> +xchk_bmap_data(
> struct xfs_scrub_context *sc)
> {
> - return xfs_scrub_bmap(sc, XFS_DATA_FORK);
> + return xchk_bmap(sc, XFS_DATA_FORK);
> }
>
> /* Scrub an inode's attr fork. */
> int
> -xfs_scrub_bmap_attr(
> +xchk_bmap_attr(
> struct xfs_scrub_context *sc)
> {
> - return xfs_scrub_bmap(sc, XFS_ATTR_FORK);
> + return xchk_bmap(sc, XFS_ATTR_FORK);
> }
>
> /* Scrub an inode's CoW fork. */
> int
> -xfs_scrub_bmap_cow(
> +xchk_bmap_cow(
> struct xfs_scrub_context *sc)
> {
> if (!xfs_is_reflink_inode(sc->ip))
> return -ENOENT;
>
> - return xfs_scrub_bmap(sc, XFS_COW_FORK);
> + return xchk_bmap(sc, XFS_COW_FORK);
> }
> diff --git a/fs/xfs/scrub/btree.c b/fs/xfs/scrub/btree.c
> index 5b472045f036..30fe9a147959 100644
> --- a/fs/xfs/scrub/btree.c
> +++ b/fs/xfs/scrub/btree.c
> @@ -29,7 +29,7 @@
> * operational errors in common.c.
> */
> static bool
> -__xfs_scrub_btree_process_error(
> +__xchk_btree_process_error(
> struct xfs_scrub_context *sc,
> struct xfs_btree_cur *cur,
> int level,
> @@ -43,7 +43,7 @@ __xfs_scrub_btree_process_error(
> switch (*error) {
> case -EDEADLOCK:
> /* Used to restart an op with deadlock avoidance. */
> - trace_xfs_scrub_deadlock_retry(sc->ip, sc->sm, *error);
> + trace_xchk_deadlock_retry(sc->ip, sc->sm, *error);
> break;
> case -EFSBADCRC:
> case -EFSCORRUPTED:
> @@ -53,10 +53,10 @@ __xfs_scrub_btree_process_error(
> /* fall through */
> default:
> if (cur->bc_flags & XFS_BTREE_ROOT_IN_INODE)
> - trace_xfs_scrub_ifork_btree_op_error(sc, cur, level,
> + trace_xchk_ifork_btree_op_error(sc, cur, level,
> *error, ret_ip);
> else
> - trace_xfs_scrub_btree_op_error(sc, cur, level,
> + trace_xchk_btree_op_error(sc, cur, level,
> *error, ret_ip);
> break;
> }
> @@ -64,30 +64,30 @@ __xfs_scrub_btree_process_error(
> }
>
> bool
> -xfs_scrub_btree_process_error(
> +xchk_btree_process_error(
> struct xfs_scrub_context *sc,
> struct xfs_btree_cur *cur,
> int level,
> int *error)
> {
> - return __xfs_scrub_btree_process_error(sc, cur, level, error,
> + return __xchk_btree_process_error(sc, cur, level, error,
> XFS_SCRUB_OFLAG_CORRUPT, __return_address);
> }
>
> bool
> -xfs_scrub_btree_xref_process_error(
> +xchk_btree_xref_process_error(
> struct xfs_scrub_context *sc,
> struct xfs_btree_cur *cur,
> int level,
> int *error)
> {
> - return __xfs_scrub_btree_process_error(sc, cur, level, error,
> + return __xchk_btree_process_error(sc, cur, level, error,
> XFS_SCRUB_OFLAG_XFAIL, __return_address);
> }
>
> /* Record btree block corruption. */
> static void
> -__xfs_scrub_btree_set_corrupt(
> +__xchk_btree_set_corrupt(
> struct xfs_scrub_context *sc,
> struct xfs_btree_cur *cur,
> int level,
> @@ -97,30 +97,30 @@ __xfs_scrub_btree_set_corrupt(
> sc->sm->sm_flags |= errflag;
>
> if (cur->bc_flags & XFS_BTREE_ROOT_IN_INODE)
> - trace_xfs_scrub_ifork_btree_error(sc, cur, level,
> + trace_xchk_ifork_btree_error(sc, cur, level,
> ret_ip);
> else
> - trace_xfs_scrub_btree_error(sc, cur, level,
> + trace_xchk_btree_error(sc, cur, level,
> ret_ip);
> }
>
> void
> -xfs_scrub_btree_set_corrupt(
> +xchk_btree_set_corrupt(
> struct xfs_scrub_context *sc,
> struct xfs_btree_cur *cur,
> int level)
> {
> - __xfs_scrub_btree_set_corrupt(sc, cur, level, XFS_SCRUB_OFLAG_CORRUPT,
> + __xchk_btree_set_corrupt(sc, cur, level, XFS_SCRUB_OFLAG_CORRUPT,
> __return_address);
> }
>
> void
> -xfs_scrub_btree_xref_set_corrupt(
> +xchk_btree_xref_set_corrupt(
> struct xfs_scrub_context *sc,
> struct xfs_btree_cur *cur,
> int level)
> {
> - __xfs_scrub_btree_set_corrupt(sc, cur, level, XFS_SCRUB_OFLAG_XCORRUPT,
> + __xchk_btree_set_corrupt(sc, cur, level, XFS_SCRUB_OFLAG_XCORRUPT,
> __return_address);
> }
>
> @@ -129,8 +129,8 @@ xfs_scrub_btree_xref_set_corrupt(
> * keys.
> */
> STATIC void
> -xfs_scrub_btree_rec(
> - struct xfs_scrub_btree *bs)
> +xchk_btree_rec(
> + struct xchk_btree *bs)
> {
> struct xfs_btree_cur *cur = bs->cur;
> union xfs_btree_rec *rec;
> @@ -144,11 +144,11 @@ xfs_scrub_btree_rec(
> block = xfs_btree_get_block(cur, 0, &bp);
> rec = xfs_btree_rec_addr(cur, cur->bc_ptrs[0], block);
>
> - trace_xfs_scrub_btree_rec(bs->sc, cur, 0);
> + trace_xchk_btree_rec(bs->sc, cur, 0);
>
> /* If this isn't the first record, are they in order? */
> if (!bs->firstrec && !cur->bc_ops->recs_inorder(cur, &bs->lastrec, rec))
> - xfs_scrub_btree_set_corrupt(bs->sc, cur, 0);
> + xchk_btree_set_corrupt(bs->sc, cur, 0);
> bs->firstrec = false;
> memcpy(&bs->lastrec, rec, cur->bc_ops->rec_len);
>
> @@ -160,7 +160,7 @@ xfs_scrub_btree_rec(
> keyblock = xfs_btree_get_block(cur, 1, &bp);
> keyp = xfs_btree_key_addr(cur, cur->bc_ptrs[1], keyblock);
> if (cur->bc_ops->diff_two_keys(cur, &key, keyp) < 0)
> - xfs_scrub_btree_set_corrupt(bs->sc, cur, 1);
> + xchk_btree_set_corrupt(bs->sc, cur, 1);
>
> if (!(cur->bc_flags & XFS_BTREE_OVERLAPPING))
> return;
> @@ -169,7 +169,7 @@ xfs_scrub_btree_rec(
> cur->bc_ops->init_high_key_from_rec(&hkey, rec);
> keyp = xfs_btree_high_key_addr(cur, cur->bc_ptrs[1], keyblock);
> if (cur->bc_ops->diff_two_keys(cur, keyp, &hkey) < 0)
> - xfs_scrub_btree_set_corrupt(bs->sc, cur, 1);
> + xchk_btree_set_corrupt(bs->sc, cur, 1);
> }
>
> /*
> @@ -177,8 +177,8 @@ xfs_scrub_btree_rec(
> * keys.
> */
> STATIC void
> -xfs_scrub_btree_key(
> - struct xfs_scrub_btree *bs,
> +xchk_btree_key(
> + struct xchk_btree *bs,
> int level)
> {
> struct xfs_btree_cur *cur = bs->cur;
> @@ -191,12 +191,12 @@ xfs_scrub_btree_key(
> block = xfs_btree_get_block(cur, level, &bp);
> key = xfs_btree_key_addr(cur, cur->bc_ptrs[level], block);
>
> - trace_xfs_scrub_btree_key(bs->sc, cur, level);
> + trace_xchk_btree_key(bs->sc, cur, level);
>
> /* If this isn't the first key, are they in order? */
> if (!bs->firstkey[level] &&
> !cur->bc_ops->keys_inorder(cur, &bs->lastkey[level], key))
> - xfs_scrub_btree_set_corrupt(bs->sc, cur, level);
> + xchk_btree_set_corrupt(bs->sc, cur, level);
> bs->firstkey[level] = false;
> memcpy(&bs->lastkey[level], key, cur->bc_ops->key_len);
>
> @@ -207,7 +207,7 @@ xfs_scrub_btree_key(
> keyblock = xfs_btree_get_block(cur, level + 1, &bp);
> keyp = xfs_btree_key_addr(cur, cur->bc_ptrs[level + 1], keyblock);
> if (cur->bc_ops->diff_two_keys(cur, key, keyp) < 0)
> - xfs_scrub_btree_set_corrupt(bs->sc, cur, level);
> + xchk_btree_set_corrupt(bs->sc, cur, level);
>
> if (!(cur->bc_flags & XFS_BTREE_OVERLAPPING))
> return;
> @@ -216,7 +216,7 @@ xfs_scrub_btree_key(
> key = xfs_btree_high_key_addr(cur, cur->bc_ptrs[level], block);
> keyp = xfs_btree_high_key_addr(cur, cur->bc_ptrs[level + 1], keyblock);
> if (cur->bc_ops->diff_two_keys(cur, keyp, key) < 0)
> - xfs_scrub_btree_set_corrupt(bs->sc, cur, level);
> + xchk_btree_set_corrupt(bs->sc, cur, level);
> }
>
> /*
> @@ -224,8 +224,8 @@ xfs_scrub_btree_key(
> * Callers do not need to set the corrupt flag.
> */
> static bool
> -xfs_scrub_btree_ptr_ok(
> - struct xfs_scrub_btree *bs,
> +xchk_btree_ptr_ok(
> + struct xchk_btree *bs,
> int level,
> union xfs_btree_ptr *ptr)
> {
> @@ -242,15 +242,15 @@ xfs_scrub_btree_ptr_ok(
> else
> res = xfs_btree_check_sptr(bs->cur, be32_to_cpu(ptr->s), level);
> if (!res)
> - xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, level);
> + xchk_btree_set_corrupt(bs->sc, bs->cur, level);
>
> return res;
> }
>
> /* Check that a btree block's sibling matches what we expect it. */
> STATIC int
> -xfs_scrub_btree_block_check_sibling(
> - struct xfs_scrub_btree *bs,
> +xchk_btree_block_check_sibling(
> + struct xchk_btree *bs,
> int level,
> int direction,
> union xfs_btree_ptr *sibling)
> @@ -264,7 +264,7 @@ xfs_scrub_btree_block_check_sibling(
> int error;
>
> error = xfs_btree_dup_cursor(cur, &ncur);
> - if (!xfs_scrub_btree_process_error(bs->sc, cur, level + 1, &error) ||
> + if (!xchk_btree_process_error(bs->sc, cur, level + 1, &error) ||
> !ncur)
> return error;
>
> @@ -278,7 +278,7 @@ xfs_scrub_btree_block_check_sibling(
> else
> error = xfs_btree_decrement(ncur, level + 1, &success);
> if (error == 0 && success)
> - xfs_scrub_btree_set_corrupt(bs->sc, cur, level);
> + xchk_btree_set_corrupt(bs->sc, cur, level);
> error = 0;
> goto out;
> }
> @@ -288,23 +288,23 @@ xfs_scrub_btree_block_check_sibling(
> error = xfs_btree_increment(ncur, level + 1, &success);
> else
> error = xfs_btree_decrement(ncur, level + 1, &success);
> - if (!xfs_scrub_btree_process_error(bs->sc, cur, level + 1, &error))
> + if (!xchk_btree_process_error(bs->sc, cur, level + 1, &error))
> goto out;
> if (!success) {
> - xfs_scrub_btree_set_corrupt(bs->sc, cur, level + 1);
> + xchk_btree_set_corrupt(bs->sc, cur, level + 1);
> goto out;
> }
>
> /* Compare upper level pointer to sibling pointer. */
> pblock = xfs_btree_get_block(ncur, level + 1, &pbp);
> pp = xfs_btree_ptr_addr(ncur, ncur->bc_ptrs[level + 1], pblock);
> - if (!xfs_scrub_btree_ptr_ok(bs, level + 1, pp))
> + if (!xchk_btree_ptr_ok(bs, level + 1, pp))
> goto out;
> if (pbp)
> - xfs_scrub_buffer_recheck(bs->sc, pbp);
> + xchk_buffer_recheck(bs->sc, pbp);
>
> if (xfs_btree_diff_two_ptrs(cur, pp, sibling))
> - xfs_scrub_btree_set_corrupt(bs->sc, cur, level);
> + xchk_btree_set_corrupt(bs->sc, cur, level);
> out:
> xfs_btree_del_cursor(ncur, XFS_BTREE_ERROR);
> return error;
> @@ -312,8 +312,8 @@ xfs_scrub_btree_block_check_sibling(
>
> /* Check the siblings of a btree block. */
> STATIC int
> -xfs_scrub_btree_block_check_siblings(
> - struct xfs_scrub_btree *bs,
> +xchk_btree_block_check_siblings(
> + struct xchk_btree *bs,
> struct xfs_btree_block *block)
> {
> struct xfs_btree_cur *cur = bs->cur;
> @@ -330,7 +330,7 @@ xfs_scrub_btree_block_check_siblings(
> if (level == cur->bc_nlevels - 1) {
> if (!xfs_btree_ptr_is_null(cur, &leftsib) ||
> !xfs_btree_ptr_is_null(cur, &rightsib))
> - xfs_scrub_btree_set_corrupt(bs->sc, cur, level);
> + xchk_btree_set_corrupt(bs->sc, cur, level);
> goto out;
> }
>
> @@ -339,10 +339,10 @@ xfs_scrub_btree_block_check_siblings(
> * parent level pointers?
> * (These function absorbs error codes for us.)
> */
> - error = xfs_scrub_btree_block_check_sibling(bs, level, -1, &leftsib);
> + error = xchk_btree_block_check_sibling(bs, level, -1, &leftsib);
> if (error)
> return error;
> - error = xfs_scrub_btree_block_check_sibling(bs, level, 1, &rightsib);
> + error = xchk_btree_block_check_sibling(bs, level, 1, &rightsib);
> if (error)
> return error;
> out:
> @@ -360,8 +360,8 @@ struct check_owner {
> * an rmap record for it.
> */
> STATIC int
> -xfs_scrub_btree_check_block_owner(
> - struct xfs_scrub_btree *bs,
> +xchk_btree_check_block_owner(
> + struct xchk_btree *bs,
> int level,
> xfs_daddr_t daddr)
> {
> @@ -380,13 +380,13 @@ xfs_scrub_btree_check_block_owner(
>
> init_sa = bs->cur->bc_flags & XFS_BTREE_LONG_PTRS;
> if (init_sa) {
> - error = xfs_scrub_ag_init(bs->sc, agno, &bs->sc->sa);
> - if (!xfs_scrub_btree_xref_process_error(bs->sc, bs->cur,
> + error = xchk_ag_init(bs->sc, agno, &bs->sc->sa);
> + if (!xchk_btree_xref_process_error(bs->sc, bs->cur,
> level, &error))
> return error;
> }
>
> - xfs_scrub_xref_is_used_space(bs->sc, agbno, 1);
> + xchk_xref_is_used_space(bs->sc, agbno, 1);
> /*
> * The bnobt scrubber aliases bs->cur to bs->sc->sa.bno_cur, so we
> * have to nullify it (to shut down further block owner checks) if
> @@ -395,20 +395,20 @@ xfs_scrub_btree_check_block_owner(
> if (!bs->sc->sa.bno_cur && btnum == XFS_BTNUM_BNO)
> bs->cur = NULL;
>
> - xfs_scrub_xref_is_owned_by(bs->sc, agbno, 1, bs->oinfo);
> + xchk_xref_is_owned_by(bs->sc, agbno, 1, bs->oinfo);
> if (!bs->sc->sa.rmap_cur && btnum == XFS_BTNUM_RMAP)
> bs->cur = NULL;
>
> if (init_sa)
> - xfs_scrub_ag_free(bs->sc, &bs->sc->sa);
> + xchk_ag_free(bs->sc, &bs->sc->sa);
>
> return error;
> }
>
> /* Check the owner of a btree block. */
> STATIC int
> -xfs_scrub_btree_check_owner(
> - struct xfs_scrub_btree *bs,
> +xchk_btree_check_owner(
> + struct xchk_btree *bs,
> int level,
> struct xfs_buf *bp)
> {
> @@ -437,7 +437,7 @@ xfs_scrub_btree_check_owner(
> return 0;
> }
>
> - return xfs_scrub_btree_check_block_owner(bs, level, XFS_BUF_ADDR(bp));
> + return xchk_btree_check_block_owner(bs, level, XFS_BUF_ADDR(bp));
> }
>
> /*
> @@ -445,8 +445,8 @@ xfs_scrub_btree_check_owner(
> * special blocks that don't require that.
> */
> STATIC void
> -xfs_scrub_btree_check_minrecs(
> - struct xfs_scrub_btree *bs,
> +xchk_btree_check_minrecs(
> + struct xchk_btree *bs,
> int level,
> struct xfs_btree_block *block)
> {
> @@ -475,7 +475,7 @@ xfs_scrub_btree_check_minrecs(
> if (level >= ok_level)
> return;
>
> - xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, level);
> + xchk_btree_set_corrupt(bs->sc, bs->cur, level);
> }
>
> /*
> @@ -483,8 +483,8 @@ xfs_scrub_btree_check_minrecs(
> * and buffer pointers (if applicable) if they're ok to use.
> */
> STATIC int
> -xfs_scrub_btree_get_block(
> - struct xfs_scrub_btree *bs,
> +xchk_btree_get_block(
> + struct xchk_btree *bs,
> int level,
> union xfs_btree_ptr *pp,
> struct xfs_btree_block **pblock,
> @@ -497,7 +497,7 @@ xfs_scrub_btree_get_block(
> *pbp = NULL;
>
> error = xfs_btree_lookup_get_block(bs->cur, level, pp, pblock);
> - if (!xfs_scrub_btree_process_error(bs->sc, bs->cur, level, &error) ||
> + if (!xchk_btree_process_error(bs->sc, bs->cur, level, &error) ||
> !*pblock)
> return error;
>
> @@ -509,19 +509,19 @@ xfs_scrub_btree_get_block(
> failed_at = __xfs_btree_check_sblock(bs->cur, *pblock,
> level, *pbp);
> if (failed_at) {
> - xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, level);
> + xchk_btree_set_corrupt(bs->sc, bs->cur, level);
> return 0;
> }
> if (*pbp)
> - xfs_scrub_buffer_recheck(bs->sc, *pbp);
> + xchk_buffer_recheck(bs->sc, *pbp);
>
> - xfs_scrub_btree_check_minrecs(bs, level, *pblock);
> + xchk_btree_check_minrecs(bs, level, *pblock);
>
> /*
> * Check the block's owner; this function absorbs error codes
> * for us.
> */
> - error = xfs_scrub_btree_check_owner(bs, level, *pbp);
> + error = xchk_btree_check_owner(bs, level, *pbp);
> if (error)
> return error;
>
> @@ -529,7 +529,7 @@ xfs_scrub_btree_get_block(
> * Check the block's siblings; this function absorbs error codes
> * for us.
> */
> - return xfs_scrub_btree_block_check_siblings(bs, *pblock);
> + return xchk_btree_block_check_siblings(bs, *pblock);
> }
>
> /*
> @@ -537,8 +537,8 @@ xfs_scrub_btree_get_block(
> * in the parent block.
> */
> STATIC void
> -xfs_scrub_btree_block_keys(
> - struct xfs_scrub_btree *bs,
> +xchk_btree_block_keys(
> + struct xchk_btree *bs,
> int level,
> struct xfs_btree_block *block)
> {
> @@ -562,7 +562,7 @@ xfs_scrub_btree_block_keys(
> parent_block);
>
> if (cur->bc_ops->diff_two_keys(cur, &block_keys, parent_keys) != 0)
> - xfs_scrub_btree_set_corrupt(bs->sc, cur, 1);
> + xchk_btree_set_corrupt(bs->sc, cur, 1);
>
> if (!(cur->bc_flags & XFS_BTREE_OVERLAPPING))
> return;
> @@ -573,7 +573,7 @@ xfs_scrub_btree_block_keys(
> parent_block);
>
> if (cur->bc_ops->diff_two_keys(cur, high_bk, high_pk) != 0)
> - xfs_scrub_btree_set_corrupt(bs->sc, cur, 1);
> + xchk_btree_set_corrupt(bs->sc, cur, 1);
> }
>
> /*
> @@ -582,14 +582,14 @@ xfs_scrub_btree_block_keys(
> * so that the caller can verify individual records.
> */
> int
> -xfs_scrub_btree(
> +xchk_btree(
> struct xfs_scrub_context *sc,
> struct xfs_btree_cur *cur,
> - xfs_scrub_btree_rec_fn scrub_fn,
> + xchk_btree_rec_fn scrub_fn,
> struct xfs_owner_info *oinfo,
> void *private)
> {
> - struct xfs_scrub_btree bs = { NULL };
> + struct xchk_btree bs = { NULL };
> union xfs_btree_ptr ptr;
> union xfs_btree_ptr *pp;
> union xfs_btree_rec *recp;
> @@ -614,7 +614,7 @@ xfs_scrub_btree(
>
> /* Don't try to check a tree with a height we can't handle. */
> if (cur->bc_nlevels > XFS_BTREE_MAXLEVELS) {
> - xfs_scrub_btree_set_corrupt(sc, cur, 0);
> + xchk_btree_set_corrupt(sc, cur, 0);
> goto out;
> }
>
> @@ -624,9 +624,9 @@ xfs_scrub_btree(
> */
> level = cur->bc_nlevels - 1;
> cur->bc_ops->init_ptr_from_cur(cur, &ptr);
> - if (!xfs_scrub_btree_ptr_ok(&bs, cur->bc_nlevels, &ptr))
> + if (!xchk_btree_ptr_ok(&bs, cur->bc_nlevels, &ptr))
> goto out;
> - error = xfs_scrub_btree_get_block(&bs, level, &ptr, &block, &bp);
> + error = xchk_btree_get_block(&bs, level, &ptr, &block, &bp);
> if (error || !block)
> goto out;
>
> @@ -639,7 +639,7 @@ xfs_scrub_btree(
> /* End of leaf, pop back towards the root. */
> if (cur->bc_ptrs[level] >
> be16_to_cpu(block->bb_numrecs)) {
> - xfs_scrub_btree_block_keys(&bs, level, block);
> + xchk_btree_block_keys(&bs, level, block);
> if (level < cur->bc_nlevels - 1)
> cur->bc_ptrs[level + 1]++;
> level++;
> @@ -647,14 +647,14 @@ xfs_scrub_btree(
> }
>
> /* Records in order for scrub? */
> - xfs_scrub_btree_rec(&bs);
> + xchk_btree_rec(&bs);
>
> /* Call out to the record checker. */
> recp = xfs_btree_rec_addr(cur, cur->bc_ptrs[0], block);
> error = bs.scrub_rec(&bs, recp);
> if (error)
> break;
> - if (xfs_scrub_should_terminate(sc, &error) ||
> + if (xchk_should_terminate(sc, &error) ||
> (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT))
> break;
>
> @@ -664,7 +664,7 @@ xfs_scrub_btree(
>
> /* End of node, pop back towards the root. */
> if (cur->bc_ptrs[level] > be16_to_cpu(block->bb_numrecs)) {
> - xfs_scrub_btree_block_keys(&bs, level, block);
> + xchk_btree_block_keys(&bs, level, block);
> if (level < cur->bc_nlevels - 1)
> cur->bc_ptrs[level + 1]++;
> level++;
> @@ -672,16 +672,16 @@ xfs_scrub_btree(
> }
>
> /* Keys in order for scrub? */
> - xfs_scrub_btree_key(&bs, level);
> + xchk_btree_key(&bs, level);
>
> /* Drill another level deeper. */
> pp = xfs_btree_ptr_addr(cur, cur->bc_ptrs[level], block);
> - if (!xfs_scrub_btree_ptr_ok(&bs, level, pp)) {
> + if (!xchk_btree_ptr_ok(&bs, level, pp)) {
> cur->bc_ptrs[level]++;
> continue;
> }
> level--;
> - error = xfs_scrub_btree_get_block(&bs, level, pp, &block, &bp);
> + error = xchk_btree_get_block(&bs, level, pp, &block, &bp);
> if (error || !block)
> goto out;
>
> @@ -692,7 +692,7 @@ xfs_scrub_btree(
> /* Process deferred owner checks on btree blocks. */
> list_for_each_entry_safe(co, n, &bs.to_check, list) {
> if (!error && bs.cur)
> - error = xfs_scrub_btree_check_block_owner(&bs,
> + error = xchk_btree_check_block_owner(&bs,
> co->level, co->daddr);
> list_del(&co->list);
> kmem_free(co);
> diff --git a/fs/xfs/scrub/btree.h b/fs/xfs/scrub/btree.h
> index 956627500f2c..598ac04a6c3e 100644
> --- a/fs/xfs/scrub/btree.h
> +++ b/fs/xfs/scrub/btree.h
> @@ -9,32 +9,32 @@
> /* btree scrub */
>
> /* Check for btree operation errors. */
> -bool xfs_scrub_btree_process_error(struct xfs_scrub_context *sc,
> +bool xchk_btree_process_error(struct xfs_scrub_context *sc,
> struct xfs_btree_cur *cur, int level, int *error);
>
> /* Check for btree xref operation errors. */
> -bool xfs_scrub_btree_xref_process_error(struct xfs_scrub_context *sc,
> +bool xchk_btree_xref_process_error(struct xfs_scrub_context *sc,
> struct xfs_btree_cur *cur, int level,
> int *error);
>
> /* Check for btree corruption. */
> -void xfs_scrub_btree_set_corrupt(struct xfs_scrub_context *sc,
> +void xchk_btree_set_corrupt(struct xfs_scrub_context *sc,
> struct xfs_btree_cur *cur, int level);
>
> /* Check for btree xref discrepancies. */
> -void xfs_scrub_btree_xref_set_corrupt(struct xfs_scrub_context *sc,
> +void xchk_btree_xref_set_corrupt(struct xfs_scrub_context *sc,
> struct xfs_btree_cur *cur, int level);
>
> -struct xfs_scrub_btree;
> -typedef int (*xfs_scrub_btree_rec_fn)(
> - struct xfs_scrub_btree *bs,
> +struct xchk_btree;
> +typedef int (*xchk_btree_rec_fn)(
> + struct xchk_btree *bs,
> union xfs_btree_rec *rec);
>
> -struct xfs_scrub_btree {
> +struct xchk_btree {
> /* caller-provided scrub state */
> struct xfs_scrub_context *sc;
> struct xfs_btree_cur *cur;
> - xfs_scrub_btree_rec_fn scrub_rec;
> + xchk_btree_rec_fn scrub_rec;
> struct xfs_owner_info *oinfo;
> void *private;
>
> @@ -45,8 +45,8 @@ struct xfs_scrub_btree {
> bool firstkey[XFS_BTREE_MAXLEVELS];
> struct list_head to_check;
> };
> -int xfs_scrub_btree(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur,
> - xfs_scrub_btree_rec_fn scrub_fn,
> +int xchk_btree(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur,
> + xchk_btree_rec_fn scrub_fn,
> struct xfs_owner_info *oinfo, void *private);
>
> #endif /* __XFS_SCRUB_BTREE_H__ */
> diff --git a/fs/xfs/scrub/common.c b/fs/xfs/scrub/common.c
> index 70e70c69f83f..a4004a06f482 100644
> --- a/fs/xfs/scrub/common.c
> +++ b/fs/xfs/scrub/common.c
> @@ -68,7 +68,7 @@
>
> /* Check for operational errors. */
> static bool
> -__xfs_scrub_process_error(
> +__xchk_process_error(
> struct xfs_scrub_context *sc,
> xfs_agnumber_t agno,
> xfs_agblock_t bno,
> @@ -81,7 +81,7 @@ __xfs_scrub_process_error(
> return true;
> case -EDEADLOCK:
> /* Used to restart an op with deadlock avoidance. */
> - trace_xfs_scrub_deadlock_retry(sc->ip, sc->sm, *error);
> + trace_xchk_deadlock_retry(sc->ip, sc->sm, *error);
> break;
> case -EFSBADCRC:
> case -EFSCORRUPTED:
> @@ -90,7 +90,7 @@ __xfs_scrub_process_error(
> *error = 0;
> /* fall through */
> default:
> - trace_xfs_scrub_op_error(sc, agno, bno, *error,
> + trace_xchk_op_error(sc, agno, bno, *error,
> ret_ip);
> break;
> }
> @@ -98,30 +98,30 @@ __xfs_scrub_process_error(
> }
>
> bool
> -xfs_scrub_process_error(
> +xchk_process_error(
> struct xfs_scrub_context *sc,
> xfs_agnumber_t agno,
> xfs_agblock_t bno,
> int *error)
> {
> - return __xfs_scrub_process_error(sc, agno, bno, error,
> + return __xchk_process_error(sc, agno, bno, error,
> XFS_SCRUB_OFLAG_CORRUPT, __return_address);
> }
>
> bool
> -xfs_scrub_xref_process_error(
> +xchk_xref_process_error(
> struct xfs_scrub_context *sc,
> xfs_agnumber_t agno,
> xfs_agblock_t bno,
> int *error)
> {
> - return __xfs_scrub_process_error(sc, agno, bno, error,
> + return __xchk_process_error(sc, agno, bno, error,
> XFS_SCRUB_OFLAG_XFAIL, __return_address);
> }
>
> /* Check for operational errors for a file offset. */
> static bool
> -__xfs_scrub_fblock_process_error(
> +__xchk_fblock_process_error(
> struct xfs_scrub_context *sc,
> int whichfork,
> xfs_fileoff_t offset,
> @@ -134,7 +134,7 @@ __xfs_scrub_fblock_process_error(
> return true;
> case -EDEADLOCK:
> /* Used to restart an op with deadlock avoidance. */
> - trace_xfs_scrub_deadlock_retry(sc->ip, sc->sm, *error);
> + trace_xchk_deadlock_retry(sc->ip, sc->sm, *error);
> break;
> case -EFSBADCRC:
> case -EFSCORRUPTED:
> @@ -143,7 +143,7 @@ __xfs_scrub_fblock_process_error(
> *error = 0;
> /* fall through */
> default:
> - trace_xfs_scrub_file_op_error(sc, whichfork, offset, *error,
> + trace_xchk_file_op_error(sc, whichfork, offset, *error,
> ret_ip);
> break;
> }
> @@ -151,24 +151,24 @@ __xfs_scrub_fblock_process_error(
> }
>
> bool
> -xfs_scrub_fblock_process_error(
> +xchk_fblock_process_error(
> struct xfs_scrub_context *sc,
> int whichfork,
> xfs_fileoff_t offset,
> int *error)
> {
> - return __xfs_scrub_fblock_process_error(sc, whichfork, offset, error,
> + return __xchk_fblock_process_error(sc, whichfork, offset, error,
> XFS_SCRUB_OFLAG_CORRUPT, __return_address);
> }
>
> bool
> -xfs_scrub_fblock_xref_process_error(
> +xchk_fblock_xref_process_error(
> struct xfs_scrub_context *sc,
> int whichfork,
> xfs_fileoff_t offset,
> int *error)
> {
> - return __xfs_scrub_fblock_process_error(sc, whichfork, offset, error,
> + return __xchk_fblock_process_error(sc, whichfork, offset, error,
> XFS_SCRUB_OFLAG_XFAIL, __return_address);
> }
>
> @@ -186,12 +186,12 @@ xfs_scrub_fblock_xref_process_error(
>
> /* Record a block which could be optimized. */
> void
> -xfs_scrub_block_set_preen(
> +xchk_block_set_preen(
> struct xfs_scrub_context *sc,
> struct xfs_buf *bp)
> {
> sc->sm->sm_flags |= XFS_SCRUB_OFLAG_PREEN;
> - trace_xfs_scrub_block_preen(sc, bp->b_bn, __return_address);
> + trace_xchk_block_preen(sc, bp->b_bn, __return_address);
> }
>
> /*
> @@ -200,32 +200,32 @@ xfs_scrub_block_set_preen(
> * the block location of the inode record itself.
> */
> void
> -xfs_scrub_ino_set_preen(
> +xchk_ino_set_preen(
> struct xfs_scrub_context *sc,
> xfs_ino_t ino)
> {
> sc->sm->sm_flags |= XFS_SCRUB_OFLAG_PREEN;
> - trace_xfs_scrub_ino_preen(sc, ino, __return_address);
> + trace_xchk_ino_preen(sc, ino, __return_address);
> }
>
> /* Record a corrupt block. */
> void
> -xfs_scrub_block_set_corrupt(
> +xchk_block_set_corrupt(
> struct xfs_scrub_context *sc,
> struct xfs_buf *bp)
> {
> sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT;
> - trace_xfs_scrub_block_error(sc, bp->b_bn, __return_address);
> + trace_xchk_block_error(sc, bp->b_bn, __return_address);
> }
>
> /* Record a corruption while cross-referencing. */
> void
> -xfs_scrub_block_xref_set_corrupt(
> +xchk_block_xref_set_corrupt(
> struct xfs_scrub_context *sc,
> struct xfs_buf *bp)
> {
> sc->sm->sm_flags |= XFS_SCRUB_OFLAG_XCORRUPT;
> - trace_xfs_scrub_block_error(sc, bp->b_bn, __return_address);
> + trace_xchk_block_error(sc, bp->b_bn, __return_address);
> }
>
> /*
> @@ -234,44 +234,44 @@ xfs_scrub_block_xref_set_corrupt(
> * inode record itself.
> */
> void
> -xfs_scrub_ino_set_corrupt(
> +xchk_ino_set_corrupt(
> struct xfs_scrub_context *sc,
> xfs_ino_t ino)
> {
> sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT;
> - trace_xfs_scrub_ino_error(sc, ino, __return_address);
> + trace_xchk_ino_error(sc, ino, __return_address);
> }
>
> /* Record a corruption while cross-referencing with an inode. */
> void
> -xfs_scrub_ino_xref_set_corrupt(
> +xchk_ino_xref_set_corrupt(
> struct xfs_scrub_context *sc,
> xfs_ino_t ino)
> {
> sc->sm->sm_flags |= XFS_SCRUB_OFLAG_XCORRUPT;
> - trace_xfs_scrub_ino_error(sc, ino, __return_address);
> + trace_xchk_ino_error(sc, ino, __return_address);
> }
>
> /* Record corruption in a block indexed by a file fork. */
> void
> -xfs_scrub_fblock_set_corrupt(
> +xchk_fblock_set_corrupt(
> struct xfs_scrub_context *sc,
> int whichfork,
> xfs_fileoff_t offset)
> {
> sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT;
> - trace_xfs_scrub_fblock_error(sc, whichfork, offset, __return_address);
> + trace_xchk_fblock_error(sc, whichfork, offset, __return_address);
> }
>
> /* Record a corruption while cross-referencing a fork block. */
> void
> -xfs_scrub_fblock_xref_set_corrupt(
> +xchk_fblock_xref_set_corrupt(
> struct xfs_scrub_context *sc,
> int whichfork,
> xfs_fileoff_t offset)
> {
> sc->sm->sm_flags |= XFS_SCRUB_OFLAG_XCORRUPT;
> - trace_xfs_scrub_fblock_error(sc, whichfork, offset, __return_address);
> + trace_xchk_fblock_error(sc, whichfork, offset, __return_address);
> }
>
> /*
> @@ -279,32 +279,32 @@ xfs_scrub_fblock_xref_set_corrupt(
> * incorrect.
> */
> void
> -xfs_scrub_ino_set_warning(
> +xchk_ino_set_warning(
> struct xfs_scrub_context *sc,
> xfs_ino_t ino)
> {
> sc->sm->sm_flags |= XFS_SCRUB_OFLAG_WARNING;
> - trace_xfs_scrub_ino_warning(sc, ino, __return_address);
> + trace_xchk_ino_warning(sc, ino, __return_address);
> }
>
> /* Warn about a block indexed by a file fork that needs review. */
> void
> -xfs_scrub_fblock_set_warning(
> +xchk_fblock_set_warning(
> struct xfs_scrub_context *sc,
> int whichfork,
> xfs_fileoff_t offset)
> {
> sc->sm->sm_flags |= XFS_SCRUB_OFLAG_WARNING;
> - trace_xfs_scrub_fblock_warning(sc, whichfork, offset, __return_address);
> + trace_xchk_fblock_warning(sc, whichfork, offset, __return_address);
> }
>
> /* Signal an incomplete scrub. */
> void
> -xfs_scrub_set_incomplete(
> +xchk_set_incomplete(
> struct xfs_scrub_context *sc)
> {
> sc->sm->sm_flags |= XFS_SCRUB_OFLAG_INCOMPLETE;
> - trace_xfs_scrub_incomplete(sc, __return_address);
> + trace_xchk_incomplete(sc, __return_address);
> }
>
> /*
> @@ -312,18 +312,18 @@ xfs_scrub_set_incomplete(
> * at least according to the reverse mapping data.
> */
>
> -struct xfs_scrub_rmap_ownedby_info {
> +struct xchk_rmap_ownedby_info {
> struct xfs_owner_info *oinfo;
> xfs_filblks_t *blocks;
> };
>
> STATIC int
> -xfs_scrub_count_rmap_ownedby_irec(
> +xchk_count_rmap_ownedby_irec(
> struct xfs_btree_cur *cur,
> struct xfs_rmap_irec *rec,
> void *priv)
> {
> - struct xfs_scrub_rmap_ownedby_info *sroi = priv;
> + struct xchk_rmap_ownedby_info *sroi = priv;
> bool irec_attr;
> bool oinfo_attr;
>
> @@ -344,19 +344,19 @@ xfs_scrub_count_rmap_ownedby_irec(
> * The caller should pass us an rmapbt cursor.
> */
> int
> -xfs_scrub_count_rmap_ownedby_ag(
> +xchk_count_rmap_ownedby_ag(
> struct xfs_scrub_context *sc,
> struct xfs_btree_cur *cur,
> struct xfs_owner_info *oinfo,
> xfs_filblks_t *blocks)
> {
> - struct xfs_scrub_rmap_ownedby_info sroi;
> + struct xchk_rmap_ownedby_info sroi;
>
> sroi.oinfo = oinfo;
> *blocks = 0;
> sroi.blocks = blocks;
>
> - return xfs_rmap_query_all(cur, xfs_scrub_count_rmap_ownedby_irec,
> + return xfs_rmap_query_all(cur, xchk_count_rmap_ownedby_irec,
> &sroi);
> }
>
> @@ -392,12 +392,12 @@ want_ag_read_header_failure(
> /*
> * Grab all the headers for an AG.
> *
> - * The headers should be released by xfs_scrub_ag_free, but as a fail
> + * The headers should be released by xchk_ag_free, but as a fail
> * safe we attach all the buffers we grab to the scrub transaction so
> * they'll all be freed when we cancel it.
> */
> int
> -xfs_scrub_ag_read_headers(
> +xchk_ag_read_headers(
> struct xfs_scrub_context *sc,
> xfs_agnumber_t agno,
> struct xfs_buf **agi,
> @@ -425,8 +425,8 @@ xfs_scrub_ag_read_headers(
>
> /* Release all the AG btree cursors. */
> void
> -xfs_scrub_ag_btcur_free(
> - struct xfs_scrub_ag *sa)
> +xchk_ag_btcur_free(
> + struct xchk_ag *sa)
> {
> if (sa->refc_cur)
> xfs_btree_del_cursor(sa->refc_cur, XFS_BTREE_ERROR);
> @@ -451,9 +451,9 @@ xfs_scrub_ag_btcur_free(
>
> /* Initialize all the btree cursors for an AG. */
> int
> -xfs_scrub_ag_btcur_init(
> +xchk_ag_btcur_init(
> struct xfs_scrub_context *sc,
> - struct xfs_scrub_ag *sa)
> + struct xchk_ag *sa)
> {
> struct xfs_mount *mp = sc->mp;
> xfs_agnumber_t agno = sa->agno;
> @@ -511,11 +511,11 @@ xfs_scrub_ag_btcur_init(
>
> /* Release the AG header context and btree cursors. */
> void
> -xfs_scrub_ag_free(
> +xchk_ag_free(
> struct xfs_scrub_context *sc,
> - struct xfs_scrub_ag *sa)
> + struct xchk_ag *sa)
> {
> - xfs_scrub_ag_btcur_free(sa);
> + xchk_ag_btcur_free(sa);
> if (sa->agfl_bp) {
> xfs_trans_brelse(sc->tp, sa->agfl_bp);
> sa->agfl_bp = NULL;
> @@ -543,30 +543,30 @@ xfs_scrub_ag_free(
> * transaction ourselves.
> */
> int
> -xfs_scrub_ag_init(
> +xchk_ag_init(
> struct xfs_scrub_context *sc,
> xfs_agnumber_t agno,
> - struct xfs_scrub_ag *sa)
> + struct xchk_ag *sa)
> {
> int error;
>
> sa->agno = agno;
> - error = xfs_scrub_ag_read_headers(sc, agno, &sa->agi_bp,
> + error = xchk_ag_read_headers(sc, agno, &sa->agi_bp,
> &sa->agf_bp, &sa->agfl_bp);
> if (error)
> return error;
>
> - return xfs_scrub_ag_btcur_init(sc, sa);
> + return xchk_ag_btcur_init(sc, sa);
> }
>
> /*
> * Grab the per-ag structure if we haven't already gotten it. Teardown of the
> - * xfs_scrub_ag will release it for us.
> + * xchk_ag will release it for us.
> */
> void
> -xfs_scrub_perag_get(
> +xchk_perag_get(
> struct xfs_mount *mp,
> - struct xfs_scrub_ag *sa)
> + struct xchk_ag *sa)
> {
> if (!sa->pag)
> sa->pag = xfs_perag_get(mp, sa->agno);
> @@ -585,7 +585,7 @@ xfs_scrub_perag_get(
> * the metadata object.
> */
> int
> -xfs_scrub_trans_alloc(
> +xchk_trans_alloc(
> struct xfs_scrub_context *sc,
> uint resblks)
> {
> @@ -598,19 +598,19 @@ xfs_scrub_trans_alloc(
>
> /* Set us up with a transaction and an empty context. */
> int
> -xfs_scrub_setup_fs(
> +xchk_setup_fs(
> struct xfs_scrub_context *sc,
> struct xfs_inode *ip)
> {
> uint resblks;
>
> resblks = xfs_repair_calc_ag_resblks(sc);
> - return xfs_scrub_trans_alloc(sc, resblks);
> + return xchk_trans_alloc(sc, resblks);
> }
>
> /* Set us up with AG headers and btree cursors. */
> int
> -xfs_scrub_setup_ag_btree(
> +xchk_setup_ag_btree(
> struct xfs_scrub_context *sc,
> struct xfs_inode *ip,
> bool force_log)
> @@ -625,21 +625,21 @@ xfs_scrub_setup_ag_btree(
> * document why they need to do so.
> */
> if (force_log) {
> - error = xfs_scrub_checkpoint_log(mp);
> + error = xchk_checkpoint_log(mp);
> if (error)
> return error;
> }
>
> - error = xfs_scrub_setup_fs(sc, ip);
> + error = xchk_setup_fs(sc, ip);
> if (error)
> return error;
>
> - return xfs_scrub_ag_init(sc, sc->sm->sm_agno, &sc->sa);
> + return xchk_ag_init(sc, sc->sm->sm_agno, &sc->sa);
> }
>
> /* Push everything out of the log onto disk. */
> int
> -xfs_scrub_checkpoint_log(
> +xchk_checkpoint_log(
> struct xfs_mount *mp)
> {
> int error;
> @@ -657,7 +657,7 @@ xfs_scrub_checkpoint_log(
> * The inode is not locked.
> */
> int
> -xfs_scrub_get_inode(
> +xchk_get_inode(
> struct xfs_scrub_context *sc,
> struct xfs_inode *ip_in)
> {
> @@ -704,7 +704,7 @@ xfs_scrub_get_inode(
> error = -EFSCORRUPTED;
> /* fall through */
> default:
> - trace_xfs_scrub_op_error(sc,
> + trace_xchk_op_error(sc,
> XFS_INO_TO_AGNO(mp, sc->sm->sm_ino),
> XFS_INO_TO_AGBNO(mp, sc->sm->sm_ino),
> error, __return_address);
> @@ -721,21 +721,21 @@ xfs_scrub_get_inode(
>
> /* Set us up to scrub a file's contents. */
> int
> -xfs_scrub_setup_inode_contents(
> +xchk_setup_inode_contents(
> struct xfs_scrub_context *sc,
> struct xfs_inode *ip,
> unsigned int resblks)
> {
> int error;
>
> - error = xfs_scrub_get_inode(sc, ip);
> + error = xchk_get_inode(sc, ip);
> if (error)
> return error;
>
> /* Got the inode, lock it and we're ready to go. */
> sc->ilock_flags = XFS_IOLOCK_EXCL | XFS_MMAPLOCK_EXCL;
> xfs_ilock(sc->ip, sc->ilock_flags);
> - error = xfs_scrub_trans_alloc(sc, resblks);
> + error = xchk_trans_alloc(sc, resblks);
> if (error)
> goto out;
> sc->ilock_flags |= XFS_ILOCK_EXCL;
> @@ -752,13 +752,13 @@ xfs_scrub_setup_inode_contents(
> * the cursor and skip the check.
> */
> bool
> -xfs_scrub_should_check_xref(
> +xchk_should_check_xref(
> struct xfs_scrub_context *sc,
> int *error,
> struct xfs_btree_cur **curpp)
> {
> /* No point in xref if we already know we're corrupt. */
> - if (xfs_scrub_skip_xref(sc->sm))
> + if (xchk_skip_xref(sc->sm))
> return false;
>
> if (*error == 0)
> @@ -775,7 +775,7 @@ xfs_scrub_should_check_xref(
> }
>
> sc->sm->sm_flags |= XFS_SCRUB_OFLAG_XFAIL;
> - trace_xfs_scrub_xref_error(sc, *error, __return_address);
> + trace_xchk_xref_error(sc, *error, __return_address);
>
> /*
> * Errors encountered during cross-referencing with another
> @@ -787,25 +787,25 @@ xfs_scrub_should_check_xref(
>
> /* Run the structure verifiers on in-memory buffers to detect bad memory. */
> void
> -xfs_scrub_buffer_recheck(
> +xchk_buffer_recheck(
> struct xfs_scrub_context *sc,
> struct xfs_buf *bp)
> {
> xfs_failaddr_t fa;
>
> if (bp->b_ops == NULL) {
> - xfs_scrub_block_set_corrupt(sc, bp);
> + xchk_block_set_corrupt(sc, bp);
> return;
> }
> if (bp->b_ops->verify_struct == NULL) {
> - xfs_scrub_set_incomplete(sc);
> + xchk_set_incomplete(sc);
> return;
> }
> fa = bp->b_ops->verify_struct(bp);
> if (!fa)
> return;
> sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT;
> - trace_xfs_scrub_block_error(sc, bp->b_bn, fa);
> + trace_xchk_block_error(sc, bp->b_bn, fa);
> }
>
> /*
> @@ -813,7 +813,7 @@ xfs_scrub_buffer_recheck(
> * pointed to by sc->ip and the ILOCK must be held.
> */
> int
> -xfs_scrub_metadata_inode_forks(
> +xchk_metadata_inode_forks(
> struct xfs_scrub_context *sc)
> {
> __u32 smtype;
> @@ -825,26 +825,26 @@ xfs_scrub_metadata_inode_forks(
>
> /* Metadata inodes don't live on the rt device. */
> if (sc->ip->i_d.di_flags & XFS_DIFLAG_REALTIME) {
> - xfs_scrub_ino_set_corrupt(sc, sc->ip->i_ino);
> + xchk_ino_set_corrupt(sc, sc->ip->i_ino);
> return 0;
> }
>
> /* They should never participate in reflink. */
> if (xfs_is_reflink_inode(sc->ip)) {
> - xfs_scrub_ino_set_corrupt(sc, sc->ip->i_ino);
> + xchk_ino_set_corrupt(sc, sc->ip->i_ino);
> return 0;
> }
>
> /* They also should never have extended attributes. */
> if (xfs_inode_hasattr(sc->ip)) {
> - xfs_scrub_ino_set_corrupt(sc, sc->ip->i_ino);
> + xchk_ino_set_corrupt(sc, sc->ip->i_ino);
> return 0;
> }
>
> /* Invoke the data fork scrubber. */
> smtype = sc->sm->sm_type;
> sc->sm->sm_type = XFS_SCRUB_TYPE_BMBTD;
> - error = xfs_scrub_bmap_data(sc);
> + error = xchk_bmap_data(sc);
> sc->sm->sm_type = smtype;
> if (error || (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT))
> return error;
> @@ -853,11 +853,11 @@ xfs_scrub_metadata_inode_forks(
> if (xfs_sb_version_hasreflink(&sc->mp->m_sb)) {
> error = xfs_reflink_inode_has_shared_extents(sc->tp, sc->ip,
> &shared);
> - if (!xfs_scrub_fblock_process_error(sc, XFS_DATA_FORK, 0,
> + if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, 0,
> &error))
> return error;
> if (shared)
> - xfs_scrub_ino_set_corrupt(sc, sc->ip->i_ino);
> + xchk_ino_set_corrupt(sc, sc->ip->i_ino);
> }
>
> return error;
> @@ -871,7 +871,7 @@ xfs_scrub_metadata_inode_forks(
> * we can't.
> */
> int
> -xfs_scrub_ilock_inverted(
> +xchk_ilock_inverted(
> struct xfs_inode *ip,
> uint lock_mode)
> {
> diff --git a/fs/xfs/scrub/common.h b/fs/xfs/scrub/common.h
> index 2172bd5361e2..5881cb2ecc26 100644
> --- a/fs/xfs/scrub/common.h
> +++ b/fs/xfs/scrub/common.h
> @@ -12,7 +12,7 @@
> * Note that we're careful not to make any judgements about *error.
> */
> static inline bool
> -xfs_scrub_should_terminate(
> +xchk_should_terminate(
> struct xfs_scrub_context *sc,
> int *error)
> {
> @@ -24,121 +24,121 @@ xfs_scrub_should_terminate(
> return false;
> }
>
> -int xfs_scrub_trans_alloc(struct xfs_scrub_context *sc, uint resblks);
> -bool xfs_scrub_process_error(struct xfs_scrub_context *sc, xfs_agnumber_t agno,
> +int xchk_trans_alloc(struct xfs_scrub_context *sc, uint resblks);
> +bool xchk_process_error(struct xfs_scrub_context *sc, xfs_agnumber_t agno,
> xfs_agblock_t bno, int *error);
> -bool xfs_scrub_fblock_process_error(struct xfs_scrub_context *sc, int whichfork,
> +bool xchk_fblock_process_error(struct xfs_scrub_context *sc, int whichfork,
> xfs_fileoff_t offset, int *error);
>
> -bool xfs_scrub_xref_process_error(struct xfs_scrub_context *sc,
> +bool xchk_xref_process_error(struct xfs_scrub_context *sc,
> xfs_agnumber_t agno, xfs_agblock_t bno, int *error);
> -bool xfs_scrub_fblock_xref_process_error(struct xfs_scrub_context *sc,
> +bool xchk_fblock_xref_process_error(struct xfs_scrub_context *sc,
> int whichfork, xfs_fileoff_t offset, int *error);
>
> -void xfs_scrub_block_set_preen(struct xfs_scrub_context *sc,
> +void xchk_block_set_preen(struct xfs_scrub_context *sc,
> struct xfs_buf *bp);
> -void xfs_scrub_ino_set_preen(struct xfs_scrub_context *sc, xfs_ino_t ino);
> +void xchk_ino_set_preen(struct xfs_scrub_context *sc, xfs_ino_t ino);
>
> -void xfs_scrub_block_set_corrupt(struct xfs_scrub_context *sc,
> +void xchk_block_set_corrupt(struct xfs_scrub_context *sc,
> struct xfs_buf *bp);
> -void xfs_scrub_ino_set_corrupt(struct xfs_scrub_context *sc, xfs_ino_t ino);
> -void xfs_scrub_fblock_set_corrupt(struct xfs_scrub_context *sc, int whichfork,
> +void xchk_ino_set_corrupt(struct xfs_scrub_context *sc, xfs_ino_t ino);
> +void xchk_fblock_set_corrupt(struct xfs_scrub_context *sc, int whichfork,
> xfs_fileoff_t offset);
>
> -void xfs_scrub_block_xref_set_corrupt(struct xfs_scrub_context *sc,
> +void xchk_block_xref_set_corrupt(struct xfs_scrub_context *sc,
> struct xfs_buf *bp);
> -void xfs_scrub_ino_xref_set_corrupt(struct xfs_scrub_context *sc,
> +void xchk_ino_xref_set_corrupt(struct xfs_scrub_context *sc,
> xfs_ino_t ino);
> -void xfs_scrub_fblock_xref_set_corrupt(struct xfs_scrub_context *sc,
> +void xchk_fblock_xref_set_corrupt(struct xfs_scrub_context *sc,
> int whichfork, xfs_fileoff_t offset);
>
> -void xfs_scrub_ino_set_warning(struct xfs_scrub_context *sc, xfs_ino_t ino);
> -void xfs_scrub_fblock_set_warning(struct xfs_scrub_context *sc, int whichfork,
> +void xchk_ino_set_warning(struct xfs_scrub_context *sc, xfs_ino_t ino);
> +void xchk_fblock_set_warning(struct xfs_scrub_context *sc, int whichfork,
> xfs_fileoff_t offset);
>
> -void xfs_scrub_set_incomplete(struct xfs_scrub_context *sc);
> -int xfs_scrub_checkpoint_log(struct xfs_mount *mp);
> +void xchk_set_incomplete(struct xfs_scrub_context *sc);
> +int xchk_checkpoint_log(struct xfs_mount *mp);
>
> /* Are we set up for a cross-referencing check? */
> -bool xfs_scrub_should_check_xref(struct xfs_scrub_context *sc, int *error,
> +bool xchk_should_check_xref(struct xfs_scrub_context *sc, int *error,
> struct xfs_btree_cur **curpp);
>
> /* Setup functions */
> -int xfs_scrub_setup_fs(struct xfs_scrub_context *sc, struct xfs_inode *ip);
> -int xfs_scrub_setup_ag_allocbt(struct xfs_scrub_context *sc,
> +int xchk_setup_fs(struct xfs_scrub_context *sc, struct xfs_inode *ip);
> +int xchk_setup_ag_allocbt(struct xfs_scrub_context *sc,
> struct xfs_inode *ip);
> -int xfs_scrub_setup_ag_iallocbt(struct xfs_scrub_context *sc,
> +int xchk_setup_ag_iallocbt(struct xfs_scrub_context *sc,
> struct xfs_inode *ip);
> -int xfs_scrub_setup_ag_rmapbt(struct xfs_scrub_context *sc,
> +int xchk_setup_ag_rmapbt(struct xfs_scrub_context *sc,
> struct xfs_inode *ip);
> -int xfs_scrub_setup_ag_refcountbt(struct xfs_scrub_context *sc,
> +int xchk_setup_ag_refcountbt(struct xfs_scrub_context *sc,
> struct xfs_inode *ip);
> -int xfs_scrub_setup_inode(struct xfs_scrub_context *sc,
> +int xchk_setup_inode(struct xfs_scrub_context *sc,
> struct xfs_inode *ip);
> -int xfs_scrub_setup_inode_bmap(struct xfs_scrub_context *sc,
> +int xchk_setup_inode_bmap(struct xfs_scrub_context *sc,
> struct xfs_inode *ip);
> -int xfs_scrub_setup_inode_bmap_data(struct xfs_scrub_context *sc,
> +int xchk_setup_inode_bmap_data(struct xfs_scrub_context *sc,
> struct xfs_inode *ip);
> -int xfs_scrub_setup_directory(struct xfs_scrub_context *sc,
> +int xchk_setup_directory(struct xfs_scrub_context *sc,
> struct xfs_inode *ip);
> -int xfs_scrub_setup_xattr(struct xfs_scrub_context *sc,
> +int xchk_setup_xattr(struct xfs_scrub_context *sc,
> struct xfs_inode *ip);
> -int xfs_scrub_setup_symlink(struct xfs_scrub_context *sc,
> +int xchk_setup_symlink(struct xfs_scrub_context *sc,
> struct xfs_inode *ip);
> -int xfs_scrub_setup_parent(struct xfs_scrub_context *sc,
> +int xchk_setup_parent(struct xfs_scrub_context *sc,
> struct xfs_inode *ip);
> #ifdef CONFIG_XFS_RT
> -int xfs_scrub_setup_rt(struct xfs_scrub_context *sc, struct xfs_inode *ip);
> +int xchk_setup_rt(struct xfs_scrub_context *sc, struct xfs_inode *ip);
> #else
> static inline int
> -xfs_scrub_setup_rt(struct xfs_scrub_context *sc, struct xfs_inode *ip)
> +xchk_setup_rt(struct xfs_scrub_context *sc, struct xfs_inode *ip)
> {
> return -ENOENT;
> }
> #endif
> #ifdef CONFIG_XFS_QUOTA
> -int xfs_scrub_setup_quota(struct xfs_scrub_context *sc, struct xfs_inode *ip);
> +int xchk_setup_quota(struct xfs_scrub_context *sc, struct xfs_inode *ip);
> #else
> static inline int
> -xfs_scrub_setup_quota(struct xfs_scrub_context *sc, struct xfs_inode *ip)
> +xchk_setup_quota(struct xfs_scrub_context *sc, struct xfs_inode *ip)
> {
> return -ENOENT;
> }
> #endif
>
> -void xfs_scrub_ag_free(struct xfs_scrub_context *sc, struct xfs_scrub_ag *sa);
> -int xfs_scrub_ag_init(struct xfs_scrub_context *sc, xfs_agnumber_t agno,
> - struct xfs_scrub_ag *sa);
> -void xfs_scrub_perag_get(struct xfs_mount *mp, struct xfs_scrub_ag *sa);
> -int xfs_scrub_ag_read_headers(struct xfs_scrub_context *sc, xfs_agnumber_t agno,
> +void xchk_ag_free(struct xfs_scrub_context *sc, struct xchk_ag *sa);
> +int xchk_ag_init(struct xfs_scrub_context *sc, xfs_agnumber_t agno,
> + struct xchk_ag *sa);
> +void xchk_perag_get(struct xfs_mount *mp, struct xchk_ag *sa);
> +int xchk_ag_read_headers(struct xfs_scrub_context *sc, xfs_agnumber_t agno,
> struct xfs_buf **agi, struct xfs_buf **agf,
> struct xfs_buf **agfl);
> -void xfs_scrub_ag_btcur_free(struct xfs_scrub_ag *sa);
> -int xfs_scrub_ag_btcur_init(struct xfs_scrub_context *sc,
> - struct xfs_scrub_ag *sa);
> -int xfs_scrub_count_rmap_ownedby_ag(struct xfs_scrub_context *sc,
> +void xchk_ag_btcur_free(struct xchk_ag *sa);
> +int xchk_ag_btcur_init(struct xfs_scrub_context *sc,
> + struct xchk_ag *sa);
> +int xchk_count_rmap_ownedby_ag(struct xfs_scrub_context *sc,
> struct xfs_btree_cur *cur,
> struct xfs_owner_info *oinfo,
> xfs_filblks_t *blocks);
>
> -int xfs_scrub_setup_ag_btree(struct xfs_scrub_context *sc,
> +int xchk_setup_ag_btree(struct xfs_scrub_context *sc,
> struct xfs_inode *ip, bool force_log);
> -int xfs_scrub_get_inode(struct xfs_scrub_context *sc, struct xfs_inode *ip_in);
> -int xfs_scrub_setup_inode_contents(struct xfs_scrub_context *sc,
> +int xchk_get_inode(struct xfs_scrub_context *sc, struct xfs_inode *ip_in);
> +int xchk_setup_inode_contents(struct xfs_scrub_context *sc,
> struct xfs_inode *ip, unsigned int resblks);
> -void xfs_scrub_buffer_recheck(struct xfs_scrub_context *sc, struct xfs_buf *bp);
> +void xchk_buffer_recheck(struct xfs_scrub_context *sc, struct xfs_buf *bp);
>
> /*
> * Don't bother cross-referencing if we already found corruption or cross
> * referencing discrepancies.
> */
> -static inline bool xfs_scrub_skip_xref(struct xfs_scrub_metadata *sm)
> +static inline bool xchk_skip_xref(struct xfs_scrub_metadata *sm)
> {
> return sm->sm_flags & (XFS_SCRUB_OFLAG_CORRUPT |
> XFS_SCRUB_OFLAG_XCORRUPT);
> }
>
> -int xfs_scrub_metadata_inode_forks(struct xfs_scrub_context *sc);
> -int xfs_scrub_ilock_inverted(struct xfs_inode *ip, uint lock_mode);
> +int xchk_metadata_inode_forks(struct xfs_scrub_context *sc);
> +int xchk_ilock_inverted(struct xfs_inode *ip, uint lock_mode);
>
> #endif /* __XFS_SCRUB_COMMON_H__ */
> diff --git a/fs/xfs/scrub/dabtree.c b/fs/xfs/scrub/dabtree.c
> index d700c4d4d4ef..fee80f6ddfd7 100644
> --- a/fs/xfs/scrub/dabtree.c
> +++ b/fs/xfs/scrub/dabtree.c
> @@ -35,8 +35,8 @@
> * operational errors in common.c.
> */
> bool
> -xfs_scrub_da_process_error(
> - struct xfs_scrub_da_btree *ds,
> +xchk_da_process_error(
> + struct xchk_da_btree *ds,
> int level,
> int *error)
> {
> @@ -48,7 +48,7 @@ xfs_scrub_da_process_error(
> switch (*error) {
> case -EDEADLOCK:
> /* Used to restart an op with deadlock avoidance. */
> - trace_xfs_scrub_deadlock_retry(sc->ip, sc->sm, *error);
> + trace_xchk_deadlock_retry(sc->ip, sc->sm, *error);
> break;
> case -EFSBADCRC:
> case -EFSCORRUPTED:
> @@ -57,7 +57,7 @@ xfs_scrub_da_process_error(
> *error = 0;
> /* fall through */
> default:
> - trace_xfs_scrub_file_op_error(sc, ds->dargs.whichfork,
> + trace_xchk_file_op_error(sc, ds->dargs.whichfork,
> xfs_dir2_da_to_db(ds->dargs.geo,
> ds->state->path.blk[level].blkno),
> *error, __return_address);
> @@ -71,15 +71,15 @@ xfs_scrub_da_process_error(
> * operational errors in common.c.
> */
> void
> -xfs_scrub_da_set_corrupt(
> - struct xfs_scrub_da_btree *ds,
> +xchk_da_set_corrupt(
> + struct xchk_da_btree *ds,
> int level)
> {
> struct xfs_scrub_context *sc = ds->sc;
>
> sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT;
>
> - trace_xfs_scrub_fblock_error(sc, ds->dargs.whichfork,
> + trace_xchk_fblock_error(sc, ds->dargs.whichfork,
> xfs_dir2_da_to_db(ds->dargs.geo,
> ds->state->path.blk[level].blkno),
> __return_address);
> @@ -87,8 +87,8 @@ xfs_scrub_da_set_corrupt(
>
> /* Find an entry at a certain level in a da btree. */
> STATIC void *
> -xfs_scrub_da_btree_entry(
> - struct xfs_scrub_da_btree *ds,
> +xchk_da_btree_entry(
> + struct xchk_da_btree *ds,
> int level,
> int rec)
> {
> @@ -123,8 +123,8 @@ xfs_scrub_da_btree_entry(
>
> /* Scrub a da btree hash (key). */
> int
> -xfs_scrub_da_btree_hash(
> - struct xfs_scrub_da_btree *ds,
> +xchk_da_btree_hash(
> + struct xchk_da_btree *ds,
> int level,
> __be32 *hashp)
> {
> @@ -136,7 +136,7 @@ xfs_scrub_da_btree_hash(
> /* Is this hash in order? */
> hash = be32_to_cpu(*hashp);
> if (hash < ds->hashes[level])
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
> ds->hashes[level] = hash;
>
> if (level == 0)
> @@ -144,10 +144,10 @@ xfs_scrub_da_btree_hash(
>
> /* Is this hash no larger than the parent hash? */
> blks = ds->state->path.blk;
> - entry = xfs_scrub_da_btree_entry(ds, level - 1, blks[level - 1].index);
> + entry = xchk_da_btree_entry(ds, level - 1, blks[level - 1].index);
> parent_hash = be32_to_cpu(entry->hashval);
> if (parent_hash < hash)
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
>
> return 0;
> }
> @@ -157,13 +157,13 @@ xfs_scrub_da_btree_hash(
> * pointer.
> */
> STATIC bool
> -xfs_scrub_da_btree_ptr_ok(
> - struct xfs_scrub_da_btree *ds,
> +xchk_da_btree_ptr_ok(
> + struct xchk_da_btree *ds,
> int level,
> xfs_dablk_t blkno)
> {
> if (blkno < ds->lowest || (ds->highest != 0 && blkno >= ds->highest)) {
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
> return false;
> }
>
> @@ -176,7 +176,7 @@ xfs_scrub_da_btree_ptr_ok(
> * leaf1, we must multiplex the verifiers.
> */
> static void
> -xfs_scrub_da_btree_read_verify(
> +xchk_da_btree_read_verify(
> struct xfs_buf *bp)
> {
> struct xfs_da_blkinfo *info = bp->b_addr;
> @@ -198,7 +198,7 @@ xfs_scrub_da_btree_read_verify(
> }
> }
> static void
> -xfs_scrub_da_btree_write_verify(
> +xchk_da_btree_write_verify(
> struct xfs_buf *bp)
> {
> struct xfs_da_blkinfo *info = bp->b_addr;
> @@ -220,7 +220,7 @@ xfs_scrub_da_btree_write_verify(
> }
> }
> static void *
> -xfs_scrub_da_btree_verify(
> +xchk_da_btree_verify(
> struct xfs_buf *bp)
> {
> struct xfs_da_blkinfo *info = bp->b_addr;
> @@ -236,17 +236,17 @@ xfs_scrub_da_btree_verify(
> }
> }
>
> -static const struct xfs_buf_ops xfs_scrub_da_btree_buf_ops = {
> - .name = "xfs_scrub_da_btree",
> - .verify_read = xfs_scrub_da_btree_read_verify,
> - .verify_write = xfs_scrub_da_btree_write_verify,
> - .verify_struct = xfs_scrub_da_btree_verify,
> +static const struct xfs_buf_ops xchk_da_btree_buf_ops = {
> + .name = "xchk_da_btree",
> + .verify_read = xchk_da_btree_read_verify,
> + .verify_write = xchk_da_btree_write_verify,
> + .verify_struct = xchk_da_btree_verify,
> };
>
> /* Check a block's sibling. */
> STATIC int
> -xfs_scrub_da_btree_block_check_sibling(
> - struct xfs_scrub_da_btree *ds,
> +xchk_da_btree_block_check_sibling(
> + struct xchk_da_btree *ds,
> int level,
> int direction,
> xfs_dablk_t sibling)
> @@ -265,7 +265,7 @@ xfs_scrub_da_btree_block_check_sibling(
> error = xfs_da3_path_shift(ds->state, &ds->state->altpath,
> direction, false, &retval);
> if (error == 0 && retval == 0)
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
> error = 0;
> goto out;
> }
> @@ -273,19 +273,19 @@ xfs_scrub_da_btree_block_check_sibling(
> /* Move the alternate cursor one block in the direction given. */
> error = xfs_da3_path_shift(ds->state, &ds->state->altpath,
> direction, false, &retval);
> - if (!xfs_scrub_da_process_error(ds, level, &error))
> + if (!xchk_da_process_error(ds, level, &error))
> return error;
> if (retval) {
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
> return error;
> }
> if (ds->state->altpath.blk[level].bp)
> - xfs_scrub_buffer_recheck(ds->sc,
> + xchk_buffer_recheck(ds->sc,
> ds->state->altpath.blk[level].bp);
>
> /* Compare upper level pointer to sibling pointer. */
> if (ds->state->altpath.blk[level].blkno != sibling)
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
> xfs_trans_brelse(ds->dargs.trans, ds->state->altpath.blk[level].bp);
> out:
> return error;
> @@ -293,8 +293,8 @@ xfs_scrub_da_btree_block_check_sibling(
>
> /* Check a block's sibling pointers. */
> STATIC int
> -xfs_scrub_da_btree_block_check_siblings(
> - struct xfs_scrub_da_btree *ds,
> +xchk_da_btree_block_check_siblings(
> + struct xchk_da_btree *ds,
> int level,
> struct xfs_da_blkinfo *hdr)
> {
> @@ -308,7 +308,7 @@ xfs_scrub_da_btree_block_check_siblings(
> /* Top level blocks should not have sibling pointers. */
> if (level == 0) {
> if (forw != 0 || back != 0)
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
> return 0;
> }
>
> @@ -316,10 +316,10 @@ xfs_scrub_da_btree_block_check_siblings(
> * Check back (left) and forw (right) pointers. These functions
> * absorb error codes for us.
> */
> - error = xfs_scrub_da_btree_block_check_sibling(ds, level, 0, back);
> + error = xchk_da_btree_block_check_sibling(ds, level, 0, back);
> if (error)
> goto out;
> - error = xfs_scrub_da_btree_block_check_sibling(ds, level, 1, forw);
> + error = xchk_da_btree_block_check_sibling(ds, level, 1, forw);
>
> out:
> memset(&ds->state->altpath, 0, sizeof(ds->state->altpath));
> @@ -328,8 +328,8 @@ xfs_scrub_da_btree_block_check_siblings(
>
> /* Load a dir/attribute block from a btree. */
> STATIC int
> -xfs_scrub_da_btree_block(
> - struct xfs_scrub_da_btree *ds,
> +xchk_da_btree_block(
> + struct xchk_da_btree *ds,
> int level,
> xfs_dablk_t blkno)
> {
> @@ -355,17 +355,17 @@ xfs_scrub_da_btree_block(
>
> /* Check the pointer. */
> blk->blkno = blkno;
> - if (!xfs_scrub_da_btree_ptr_ok(ds, level, blkno))
> + if (!xchk_da_btree_ptr_ok(ds, level, blkno))
> goto out_nobuf;
>
> /* Read the buffer. */
> error = xfs_da_read_buf(dargs->trans, dargs->dp, blk->blkno, -2,
> &blk->bp, dargs->whichfork,
> - &xfs_scrub_da_btree_buf_ops);
> - if (!xfs_scrub_da_process_error(ds, level, &error))
> + &xchk_da_btree_buf_ops);
> + if (!xchk_da_process_error(ds, level, &error))
> goto out_nobuf;
> if (blk->bp)
> - xfs_scrub_buffer_recheck(ds->sc, blk->bp);
> + xchk_buffer_recheck(ds->sc, blk->bp);
>
> /*
> * We didn't find a dir btree root block, which means that
> @@ -378,7 +378,7 @@ xfs_scrub_da_btree_block(
>
> /* It's /not/ ok for attr trees not to have a da btree. */
> if (blk->bp == NULL) {
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
> goto out_nobuf;
> }
>
> @@ -388,17 +388,17 @@ xfs_scrub_da_btree_block(
>
> /* We only started zeroing the header on v5 filesystems. */
> if (xfs_sb_version_hascrc(&ds->sc->mp->m_sb) && hdr3->hdr.pad)
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
>
> /* Check the owner. */
> if (xfs_sb_version_hascrc(&ip->i_mount->m_sb)) {
> owner = be64_to_cpu(hdr3->owner);
> if (owner != ip->i_ino)
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
> }
>
> /* Check the siblings. */
> - error = xfs_scrub_da_btree_block_check_siblings(ds, level, &hdr3->hdr);
> + error = xchk_da_btree_block_check_siblings(ds, level, &hdr3->hdr);
> if (error)
> goto out;
>
> @@ -411,7 +411,7 @@ xfs_scrub_da_btree_block(
> blk->magic = XFS_ATTR_LEAF_MAGIC;
> blk->hashval = xfs_attr_leaf_lasthash(blk->bp, pmaxrecs);
> if (ds->tree_level != 0)
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
> break;
> case XFS_DIR2_LEAFN_MAGIC:
> case XFS_DIR3_LEAFN_MAGIC:
> @@ -420,7 +420,7 @@ xfs_scrub_da_btree_block(
> blk->magic = XFS_DIR2_LEAFN_MAGIC;
> blk->hashval = xfs_dir2_leaf_lasthash(ip, blk->bp, pmaxrecs);
> if (ds->tree_level != 0)
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
> break;
> case XFS_DIR2_LEAF1_MAGIC:
> case XFS_DIR3_LEAF1_MAGIC:
> @@ -429,7 +429,7 @@ xfs_scrub_da_btree_block(
> blk->magic = XFS_DIR2_LEAF1_MAGIC;
> blk->hashval = xfs_dir2_leaf_lasthash(ip, blk->bp, pmaxrecs);
> if (ds->tree_level != 0)
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
> break;
> case XFS_DA_NODE_MAGIC:
> case XFS_DA3_NODE_MAGIC:
> @@ -443,13 +443,13 @@ xfs_scrub_da_btree_block(
> blk->hashval = be32_to_cpu(btree[*pmaxrecs - 1].hashval);
> if (level == 0) {
> if (nodehdr.level >= XFS_DA_NODE_MAXDEPTH) {
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
> goto out_freebp;
> }
> ds->tree_level = nodehdr.level;
> } else {
> if (ds->tree_level != nodehdr.level) {
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
> goto out_freebp;
> }
> }
> @@ -457,7 +457,7 @@ xfs_scrub_da_btree_block(
> /* XXX: Check hdr3.pad32 once we know how to fix it. */
> break;
> default:
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
> goto out_freebp;
> }
>
> @@ -473,13 +473,13 @@ xfs_scrub_da_btree_block(
>
> /* Visit all nodes and leaves of a da btree. */
> int
> -xfs_scrub_da_btree(
> +xchk_da_btree(
> struct xfs_scrub_context *sc,
> int whichfork,
> - xfs_scrub_da_btree_rec_fn scrub_fn,
> + xchk_da_btree_rec_fn scrub_fn,
> void *private)
> {
> - struct xfs_scrub_da_btree ds = {};
> + struct xchk_da_btree ds = {};
> struct xfs_mount *mp = sc->mp;
> struct xfs_da_state_blk *blks;
> struct xfs_da_node_entry *key;
> @@ -517,7 +517,7 @@ xfs_scrub_da_btree(
>
> /* Find the root of the da tree, if present. */
> blks = ds.state->path.blk;
> - error = xfs_scrub_da_btree_block(&ds, level, blkno);
> + error = xchk_da_btree_block(&ds, level, blkno);
> if (error)
> goto out_state;
> /*
> @@ -542,12 +542,12 @@ xfs_scrub_da_btree(
> }
>
> /* Dispatch record scrubbing. */
> - rec = xfs_scrub_da_btree_entry(&ds, level,
> + rec = xchk_da_btree_entry(&ds, level,
> blks[level].index);
> error = scrub_fn(&ds, level, rec);
> if (error)
> break;
> - if (xfs_scrub_should_terminate(sc, &error) ||
> + if (xchk_should_terminate(sc, &error) ||
> (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT))
> break;
>
> @@ -566,8 +566,8 @@ xfs_scrub_da_btree(
> }
>
> /* Hashes in order for scrub? */
> - key = xfs_scrub_da_btree_entry(&ds, level, blks[level].index);
> - error = xfs_scrub_da_btree_hash(&ds, level, &key->hashval);
> + key = xchk_da_btree_entry(&ds, level, blks[level].index);
> + error = xchk_da_btree_hash(&ds, level, &key->hashval);
> if (error)
> goto out;
>
> @@ -575,7 +575,7 @@ xfs_scrub_da_btree(
> blkno = be32_to_cpu(key->before);
> level++;
> ds.tree_level--;
> - error = xfs_scrub_da_btree_block(&ds, level, blkno);
> + error = xchk_da_btree_block(&ds, level, blkno);
> if (error)
> goto out;
> if (blks[level].bp == NULL)
> diff --git a/fs/xfs/scrub/dabtree.h b/fs/xfs/scrub/dabtree.h
> index 365f9f0019e6..80e4af0e2589 100644
> --- a/fs/xfs/scrub/dabtree.h
> +++ b/fs/xfs/scrub/dabtree.h
> @@ -8,7 +8,7 @@
>
> /* dir/attr btree */
>
> -struct xfs_scrub_da_btree {
> +struct xchk_da_btree {
> struct xfs_da_args dargs;
> xfs_dahash_t hashes[XFS_DA_NODE_MAXDEPTH];
> int maxrecs[XFS_DA_NODE_MAXDEPTH];
> @@ -28,18 +28,18 @@ struct xfs_scrub_da_btree {
> int tree_level;
> };
>
> -typedef int (*xfs_scrub_da_btree_rec_fn)(struct xfs_scrub_da_btree *ds,
> +typedef int (*xchk_da_btree_rec_fn)(struct xchk_da_btree *ds,
> int level, void *rec);
>
> /* Check for da btree operation errors. */
> -bool xfs_scrub_da_process_error(struct xfs_scrub_da_btree *ds, int level, int *error);
> +bool xchk_da_process_error(struct xchk_da_btree *ds, int level, int *error);
>
> /* Check for da btree corruption. */
> -void xfs_scrub_da_set_corrupt(struct xfs_scrub_da_btree *ds, int level);
> +void xchk_da_set_corrupt(struct xchk_da_btree *ds, int level);
>
> -int xfs_scrub_da_btree_hash(struct xfs_scrub_da_btree *ds, int level,
> +int xchk_da_btree_hash(struct xchk_da_btree *ds, int level,
> __be32 *hashp);
> -int xfs_scrub_da_btree(struct xfs_scrub_context *sc, int whichfork,
> - xfs_scrub_da_btree_rec_fn scrub_fn, void *private);
> +int xchk_da_btree(struct xfs_scrub_context *sc, int whichfork,
> + xchk_da_btree_rec_fn scrub_fn, void *private);
>
> #endif /* __XFS_SCRUB_DABTREE_H__ */
> diff --git a/fs/xfs/scrub/dir.c b/fs/xfs/scrub/dir.c
> index 86324775fc9b..2ac07bb73478 100644
> --- a/fs/xfs/scrub/dir.c
> +++ b/fs/xfs/scrub/dir.c
> @@ -31,18 +31,18 @@
>
> /* Set us up to scrub directories. */
> int
> -xfs_scrub_setup_directory(
> +xchk_setup_directory(
> struct xfs_scrub_context *sc,
> struct xfs_inode *ip)
> {
> - return xfs_scrub_setup_inode_contents(sc, ip, 0);
> + return xchk_setup_inode_contents(sc, ip, 0);
> }
>
> /* Directories */
>
> /* Scrub a directory entry. */
>
> -struct xfs_scrub_dir_ctx {
> +struct xchk_dir_ctx {
> /* VFS fill-directory iterator */
> struct dir_context dir_iter;
>
> @@ -51,8 +51,8 @@ struct xfs_scrub_dir_ctx {
>
> /* Check that an inode's mode matches a given DT_ type. */
> STATIC int
> -xfs_scrub_dir_check_ftype(
> - struct xfs_scrub_dir_ctx *sdc,
> +xchk_dir_check_ftype(
> + struct xchk_dir_ctx *sdc,
> xfs_fileoff_t offset,
> xfs_ino_t inum,
> int dtype)
> @@ -64,7 +64,7 @@ xfs_scrub_dir_check_ftype(
>
> if (!xfs_sb_version_hasftype(&mp->m_sb)) {
> if (dtype != DT_UNKNOWN && dtype != DT_DIR)
> - xfs_scrub_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK,
> + xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK,
> offset);
> goto out;
> }
> @@ -78,7 +78,7 @@ xfs_scrub_dir_check_ftype(
> * inodes can trigger immediate inactive cleanup of the inode.
> */
> error = xfs_iget(mp, sdc->sc->tp, inum, 0, 0, &ip);
> - if (!xfs_scrub_fblock_xref_process_error(sdc->sc, XFS_DATA_FORK, offset,
> + if (!xchk_fblock_xref_process_error(sdc->sc, XFS_DATA_FORK, offset,
> &error))
> goto out;
>
> @@ -86,7 +86,7 @@ xfs_scrub_dir_check_ftype(
> ino_dtype = xfs_dir3_get_dtype(mp,
> xfs_mode_to_ftype(VFS_I(ip)->i_mode));
> if (ino_dtype != dtype)
> - xfs_scrub_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK, offset);
> + xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK, offset);
> iput(VFS_I(ip));
> out:
> return error;
> @@ -101,7 +101,7 @@ xfs_scrub_dir_check_ftype(
> * we can look up this filename. Finally, we check the ftype.
> */
> STATIC int
> -xfs_scrub_dir_actor(
> +xchk_dir_actor(
> struct dir_context *dir_iter,
> const char *name,
> int namelen,
> @@ -111,13 +111,13 @@ xfs_scrub_dir_actor(
> {
> struct xfs_mount *mp;
> struct xfs_inode *ip;
> - struct xfs_scrub_dir_ctx *sdc;
> + struct xchk_dir_ctx *sdc;
> struct xfs_name xname;
> xfs_ino_t lookup_ino;
> xfs_dablk_t offset;
> int error = 0;
>
> - sdc = container_of(dir_iter, struct xfs_scrub_dir_ctx, dir_iter);
> + sdc = container_of(dir_iter, struct xchk_dir_ctx, dir_iter);
> ip = sdc->sc->ip;
> mp = ip->i_mount;
> offset = xfs_dir2_db_to_da(mp->m_dir_geo,
> @@ -125,17 +125,17 @@ xfs_scrub_dir_actor(
>
> /* Does this inode number make sense? */
> if (!xfs_verify_dir_ino(mp, ino)) {
> - xfs_scrub_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK, offset);
> + xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK, offset);
> goto out;
> }
>
> if (!strncmp(".", name, namelen)) {
> /* If this is "." then check that the inum matches the dir. */
> if (xfs_sb_version_hasftype(&mp->m_sb) && type != DT_DIR)
> - xfs_scrub_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK,
> + xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK,
> offset);
> if (ino != ip->i_ino)
> - xfs_scrub_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK,
> + xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK,
> offset);
> } else if (!strncmp("..", name, namelen)) {
> /*
> @@ -143,10 +143,10 @@ xfs_scrub_dir_actor(
> * matches this dir.
> */
> if (xfs_sb_version_hasftype(&mp->m_sb) && type != DT_DIR)
> - xfs_scrub_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK,
> + xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK,
> offset);
> if (ip->i_ino == mp->m_sb.sb_rootino && ino != ip->i_ino)
> - xfs_scrub_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK,
> + xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK,
> offset);
> }
>
> @@ -156,23 +156,23 @@ xfs_scrub_dir_actor(
> xname.type = XFS_DIR3_FT_UNKNOWN;
>
> error = xfs_dir_lookup(sdc->sc->tp, ip, &xname, &lookup_ino, NULL);
> - if (!xfs_scrub_fblock_process_error(sdc->sc, XFS_DATA_FORK, offset,
> + if (!xchk_fblock_process_error(sdc->sc, XFS_DATA_FORK, offset,
> &error))
> goto out;
> if (lookup_ino != ino) {
> - xfs_scrub_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK, offset);
> + xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK, offset);
> goto out;
> }
>
> /* Verify the file type. This function absorbs error codes. */
> - error = xfs_scrub_dir_check_ftype(sdc, offset, lookup_ino, type);
> + error = xchk_dir_check_ftype(sdc, offset, lookup_ino, type);
> if (error)
> goto out;
> out:
> /*
> * A negative error code returned here is supposed to cause the
> * dir_emit caller (xfs_readdir) to abort the directory iteration
> - * and return zero to xfs_scrub_directory.
> + * and return zero to xchk_directory.
> */
> if (error == 0 && sdc->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
> return -EFSCORRUPTED;
> @@ -181,8 +181,8 @@ xfs_scrub_dir_actor(
>
> /* Scrub a directory btree record. */
> STATIC int
> -xfs_scrub_dir_rec(
> - struct xfs_scrub_da_btree *ds,
> +xchk_dir_rec(
> + struct xchk_da_btree *ds,
> int level,
> void *rec)
> {
> @@ -203,7 +203,7 @@ xfs_scrub_dir_rec(
> int error;
>
> /* Check the hash of the entry. */
> - error = xfs_scrub_da_btree_hash(ds, level, &ent->hashval);
> + error = xchk_da_btree_hash(ds, level, &ent->hashval);
> if (error)
> goto out;
>
> @@ -218,18 +218,18 @@ xfs_scrub_dir_rec(
> rec_bno = xfs_dir2_db_to_da(mp->m_dir_geo, db);
>
> if (rec_bno >= mp->m_dir_geo->leafblk) {
> - xfs_scrub_da_set_corrupt(ds, level);
> + xchk_da_set_corrupt(ds, level);
> goto out;
> }
> error = xfs_dir3_data_read(ds->dargs.trans, dp, rec_bno, -2, &bp);
> - if (!xfs_scrub_fblock_process_error(ds->sc, XFS_DATA_FORK, rec_bno,
> + if (!xchk_fblock_process_error(ds->sc, XFS_DATA_FORK, rec_bno,
> &error))
> goto out;
> if (!bp) {
> - xfs_scrub_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno);
> + xchk_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno);
> goto out;
> }
> - xfs_scrub_buffer_recheck(ds->sc, bp);
> + xchk_buffer_recheck(ds->sc, bp);
>
> if (ds->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
> goto out_relse;
> @@ -240,7 +240,7 @@ xfs_scrub_dir_rec(
> p = (char *)mp->m_dir_inode_ops->data_entry_p(bp->b_addr);
> endp = xfs_dir3_data_endp(mp->m_dir_geo, bp->b_addr);
> if (!endp) {
> - xfs_scrub_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno);
> + xchk_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno);
> goto out_relse;
> }
> while (p < endp) {
> @@ -258,7 +258,7 @@ xfs_scrub_dir_rec(
> p += mp->m_dir_inode_ops->data_entsize(dep->namelen);
> }
> if (p >= endp) {
> - xfs_scrub_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno);
> + xchk_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno);
> goto out_relse;
> }
>
> @@ -267,14 +267,14 @@ xfs_scrub_dir_rec(
> hash = be32_to_cpu(ent->hashval);
> tag = be16_to_cpup(dp->d_ops->data_entry_tag_p(dent));
> if (!xfs_verify_dir_ino(mp, ino) || tag != off)
> - xfs_scrub_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno);
> + xchk_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno);
> if (dent->namelen == 0) {
> - xfs_scrub_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno);
> + xchk_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno);
> goto out_relse;
> }
> calc_hash = xfs_da_hashname(dent->name, dent->namelen);
> if (calc_hash != hash)
> - xfs_scrub_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno);
> + xchk_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno);
>
> out_relse:
> xfs_trans_brelse(ds->dargs.trans, bp);
> @@ -288,7 +288,7 @@ xfs_scrub_dir_rec(
> * shortest, and that there aren't any bogus entries.
> */
> STATIC void
> -xfs_scrub_directory_check_free_entry(
> +xchk_directory_check_free_entry(
> struct xfs_scrub_context *sc,
> xfs_dablk_t lblk,
> struct xfs_dir2_data_free *bf,
> @@ -308,12 +308,12 @@ xfs_scrub_directory_check_free_entry(
> return;
>
> /* Unused entry should be in the bestfrees but wasn't found. */
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> }
>
> /* Check free space info in a directory data block. */
> STATIC int
> -xfs_scrub_directory_data_bestfree(
> +xchk_directory_data_bestfree(
> struct xfs_scrub_context *sc,
> xfs_dablk_t lblk,
> bool is_block)
> @@ -339,15 +339,15 @@ xfs_scrub_directory_data_bestfree(
> if (is_block) {
> /* dir block format */
> if (lblk != XFS_B_TO_FSBT(mp, XFS_DIR2_DATA_OFFSET))
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> error = xfs_dir3_block_read(sc->tp, sc->ip, &bp);
> } else {
> /* dir data format */
> error = xfs_dir3_data_read(sc->tp, sc->ip, lblk, -1, &bp);
> }
> - if (!xfs_scrub_fblock_process_error(sc, XFS_DATA_FORK, lblk, &error))
> + if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, lblk, &error))
> goto out;
> - xfs_scrub_buffer_recheck(sc, bp);
> + xchk_buffer_recheck(sc, bp);
>
> /* XXX: Check xfs_dir3_data_hdr.pad is zero once we start setting it. */
>
> @@ -362,7 +362,7 @@ xfs_scrub_directory_data_bestfree(
> if (offset == 0)
> continue;
> if (offset >= mp->m_dir_geo->blksize) {
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> goto out_buf;
> }
> dup = (struct xfs_dir2_data_unused *)(bp->b_addr + offset);
> @@ -372,13 +372,13 @@ xfs_scrub_directory_data_bestfree(
> if (dup->freetag != cpu_to_be16(XFS_DIR2_DATA_FREE_TAG) ||
> be16_to_cpu(dup->length) != be16_to_cpu(dfp->length) ||
> tag != ((char *)dup - (char *)bp->b_addr)) {
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> goto out_buf;
> }
>
> /* bestfree records should be ordered largest to smallest */
> if (smallest_bestfree < be16_to_cpu(dfp->length)) {
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> goto out_buf;
> }
>
> @@ -400,7 +400,7 @@ xfs_scrub_directory_data_bestfree(
> dep = (struct xfs_dir2_data_entry *)ptr;
> newlen = d_ops->data_entsize(dep->namelen);
> if (newlen <= 0) {
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK,
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK,
> lblk);
> goto out_buf;
> }
> @@ -411,7 +411,7 @@ xfs_scrub_directory_data_bestfree(
> /* Spot check this free entry */
> tag = be16_to_cpu(*xfs_dir2_data_unused_tag_p(dup));
> if (tag != ((char *)dup - (char *)bp->b_addr)) {
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> goto out_buf;
> }
>
> @@ -419,14 +419,14 @@ xfs_scrub_directory_data_bestfree(
> * Either this entry is a bestfree or it's smaller than
> * any of the bestfrees.
> */
> - xfs_scrub_directory_check_free_entry(sc, lblk, bf, dup);
> + xchk_directory_check_free_entry(sc, lblk, bf, dup);
> if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
> goto out_buf;
>
> /* Move on. */
> newlen = be16_to_cpu(dup->length);
> if (newlen <= 0) {
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> goto out_buf;
> }
> ptr += newlen;
> @@ -436,11 +436,11 @@ xfs_scrub_directory_data_bestfree(
>
> /* We're required to fill all the space. */
> if (ptr != endptr)
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
>
> /* Did we see at least as many free slots as there are bestfrees? */
> if (nr_frees < nr_bestfrees)
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> out_buf:
> xfs_trans_brelse(sc->tp, bp);
> out:
> @@ -454,7 +454,7 @@ xfs_scrub_directory_data_bestfree(
> * array is in order.
> */
> STATIC void
> -xfs_scrub_directory_check_freesp(
> +xchk_directory_check_freesp(
> struct xfs_scrub_context *sc,
> xfs_dablk_t lblk,
> struct xfs_buf *dbp,
> @@ -465,15 +465,15 @@ xfs_scrub_directory_check_freesp(
> dfp = sc->ip->d_ops->data_bestfree_p(dbp->b_addr);
>
> if (len != be16_to_cpu(dfp->length))
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
>
> if (len > 0 && be16_to_cpu(dfp->offset) == 0)
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> }
>
> /* Check free space info in a directory leaf1 block. */
> STATIC int
> -xfs_scrub_directory_leaf1_bestfree(
> +xchk_directory_leaf1_bestfree(
> struct xfs_scrub_context *sc,
> struct xfs_da_args *args,
> xfs_dablk_t lblk)
> @@ -497,9 +497,9 @@ xfs_scrub_directory_leaf1_bestfree(
>
> /* Read the free space block. */
> error = xfs_dir3_leaf_read(sc->tp, sc->ip, lblk, -1, &bp);
> - if (!xfs_scrub_fblock_process_error(sc, XFS_DATA_FORK, lblk, &error))
> + if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, lblk, &error))
> goto out;
> - xfs_scrub_buffer_recheck(sc, bp);
> + xchk_buffer_recheck(sc, bp);
>
> leaf = bp->b_addr;
> d_ops->leaf_hdr_from_disk(&leafhdr, leaf);
> @@ -512,7 +512,7 @@ xfs_scrub_directory_leaf1_bestfree(
> struct xfs_dir3_leaf_hdr *hdr3 = bp->b_addr;
>
> if (hdr3->pad != cpu_to_be32(0))
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> }
>
> /*
> @@ -520,19 +520,19 @@ xfs_scrub_directory_leaf1_bestfree(
> * blocks that can fit under i_size.
> */
> if (bestcount != xfs_dir2_byte_to_db(geo, sc->ip->i_d.di_size)) {
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> goto out;
> }
>
> /* Is the leaf count even remotely sane? */
> if (leafhdr.count > d_ops->leaf_max_ents(geo)) {
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> goto out;
> }
>
> /* Leaves and bests don't overlap in leaf format. */
> if ((char *)&ents[leafhdr.count] > (char *)bestp) {
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> goto out;
> }
>
> @@ -540,13 +540,13 @@ xfs_scrub_directory_leaf1_bestfree(
> for (i = 0; i < leafhdr.count; i++) {
> hash = be32_to_cpu(ents[i].hashval);
> if (i > 0 && lasthash > hash)
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> lasthash = hash;
> if (ents[i].address == cpu_to_be32(XFS_DIR2_NULL_DATAPTR))
> stale++;
> }
> if (leafhdr.stale != stale)
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
> goto out;
>
> @@ -557,10 +557,10 @@ xfs_scrub_directory_leaf1_bestfree(
> continue;
> error = xfs_dir3_data_read(sc->tp, sc->ip,
> i * args->geo->fsbcount, -1, &dbp);
> - if (!xfs_scrub_fblock_process_error(sc, XFS_DATA_FORK, lblk,
> + if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, lblk,
> &error))
> break;
> - xfs_scrub_directory_check_freesp(sc, lblk, dbp, best);
> + xchk_directory_check_freesp(sc, lblk, dbp, best);
> xfs_trans_brelse(sc->tp, dbp);
> if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
> goto out;
> @@ -571,7 +571,7 @@ xfs_scrub_directory_leaf1_bestfree(
>
> /* Check free space info in a directory freespace block. */
> STATIC int
> -xfs_scrub_directory_free_bestfree(
> +xchk_directory_free_bestfree(
> struct xfs_scrub_context *sc,
> struct xfs_da_args *args,
> xfs_dablk_t lblk)
> @@ -587,15 +587,15 @@ xfs_scrub_directory_free_bestfree(
>
> /* Read the free space block */
> error = xfs_dir2_free_read(sc->tp, sc->ip, lblk, &bp);
> - if (!xfs_scrub_fblock_process_error(sc, XFS_DATA_FORK, lblk, &error))
> + if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, lblk, &error))
> goto out;
> - xfs_scrub_buffer_recheck(sc, bp);
> + xchk_buffer_recheck(sc, bp);
>
> if (xfs_sb_version_hascrc(&sc->mp->m_sb)) {
> struct xfs_dir3_free_hdr *hdr3 = bp->b_addr;
>
> if (hdr3->pad != cpu_to_be32(0))
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> }
>
> /* Check all the entries. */
> @@ -610,22 +610,22 @@ xfs_scrub_directory_free_bestfree(
> error = xfs_dir3_data_read(sc->tp, sc->ip,
> (freehdr.firstdb + i) * args->geo->fsbcount,
> -1, &dbp);
> - if (!xfs_scrub_fblock_process_error(sc, XFS_DATA_FORK, lblk,
> + if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, lblk,
> &error))
> break;
> - xfs_scrub_directory_check_freesp(sc, lblk, dbp, best);
> + xchk_directory_check_freesp(sc, lblk, dbp, best);
> xfs_trans_brelse(sc->tp, dbp);
> }
>
> if (freehdr.nused + stale != freehdr.nvalid)
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> out:
> return error;
> }
>
> /* Check free space information in directories. */
> STATIC int
> -xfs_scrub_directory_blocks(
> +xchk_directory_blocks(
> struct xfs_scrub_context *sc)
> {
> struct xfs_bmbt_irec got;
> @@ -656,7 +656,7 @@ xfs_scrub_directory_blocks(
> args.geo = mp->m_dir_geo;
> args.trans = sc->tp;
> error = xfs_dir2_isblock(&args, &is_block);
> - if (!xfs_scrub_fblock_process_error(sc, XFS_DATA_FORK, lblk, &error))
> + if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, lblk, &error))
> goto out;
>
> /* Iterate all the data extents in the directory... */
> @@ -666,7 +666,7 @@ xfs_scrub_directory_blocks(
> if (is_block &&
> (got.br_startoff > 0 ||
> got.br_blockcount != args.geo->fsbcount)) {
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK,
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK,
> got.br_startoff);
> break;
> }
> @@ -690,7 +690,7 @@ xfs_scrub_directory_blocks(
> args.geo->fsbcount);
> lblk < got.br_startoff + got.br_blockcount;
> lblk += args.geo->fsbcount) {
> - error = xfs_scrub_directory_data_bestfree(sc, lblk,
> + error = xchk_directory_data_bestfree(sc, lblk,
> is_block);
> if (error)
> goto out;
> @@ -709,10 +709,10 @@ xfs_scrub_directory_blocks(
> got.br_blockcount == args.geo->fsbcount &&
> !xfs_iext_next_extent(ifp, &icur, &got)) {
> if (is_block) {
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> goto out;
> }
> - error = xfs_scrub_directory_leaf1_bestfree(sc, &args,
> + error = xchk_directory_leaf1_bestfree(sc, &args,
> leaf_lblk);
> if (error)
> goto out;
> @@ -731,11 +731,11 @@ xfs_scrub_directory_blocks(
> */
> lblk = got.br_startoff;
> if (lblk & ~0xFFFFFFFFULL) {
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> goto out;
> }
> if (is_block) {
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
> goto out;
> }
>
> @@ -754,7 +754,7 @@ xfs_scrub_directory_blocks(
> args.geo->fsbcount);
> lblk < got.br_startoff + got.br_blockcount;
> lblk += args.geo->fsbcount) {
> - error = xfs_scrub_directory_free_bestfree(sc, &args,
> + error = xchk_directory_free_bestfree(sc, &args,
> lblk);
> if (error)
> goto out;
> @@ -769,11 +769,11 @@ xfs_scrub_directory_blocks(
>
> /* Scrub a whole directory. */
> int
> -xfs_scrub_directory(
> +xchk_directory(
> struct xfs_scrub_context *sc)
> {
> - struct xfs_scrub_dir_ctx sdc = {
> - .dir_iter.actor = xfs_scrub_dir_actor,
> + struct xchk_dir_ctx sdc = {
> + .dir_iter.actor = xchk_dir_actor,
> .dir_iter.pos = 0,
> .sc = sc,
> };
> @@ -786,12 +786,12 @@ xfs_scrub_directory(
>
> /* Plausible size? */
> if (sc->ip->i_d.di_size < xfs_dir2_sf_hdr_size(0)) {
> - xfs_scrub_ino_set_corrupt(sc, sc->ip->i_ino);
> + xchk_ino_set_corrupt(sc, sc->ip->i_ino);
> goto out;
> }
>
> /* Check directory tree structure */
> - error = xfs_scrub_da_btree(sc, XFS_DATA_FORK, xfs_scrub_dir_rec, NULL);
> + error = xchk_da_btree(sc, XFS_DATA_FORK, xchk_dir_rec, NULL);
> if (error)
> return error;
>
> @@ -799,7 +799,7 @@ xfs_scrub_directory(
> return error;
>
> /* Check the freespace. */
> - error = xfs_scrub_directory_blocks(sc);
> + error = xchk_directory_blocks(sc);
> if (error)
> return error;
>
> @@ -816,7 +816,7 @@ xfs_scrub_directory(
> /*
> * Look up every name in this directory by hash.
> *
> - * Use the xfs_readdir function to call xfs_scrub_dir_actor on
> + * Use the xfs_readdir function to call xchk_dir_actor on
> * every directory entry in this directory. In _actor, we check
> * the name, inode number, and ftype (if applicable) of the
> * entry. xfs_readdir uses the VFS filldir functions to provide
> @@ -834,7 +834,7 @@ xfs_scrub_directory(
> xfs_iunlock(sc->ip, XFS_ILOCK_EXCL);
> while (true) {
> error = xfs_readdir(sc->tp, sc->ip, &sdc.dir_iter, bufsize);
> - if (!xfs_scrub_fblock_process_error(sc, XFS_DATA_FORK, 0,
> + if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, 0,
> &error))
> goto out;
> if (oldpos == sdc.dir_iter.pos)
> diff --git a/fs/xfs/scrub/ialloc.c b/fs/xfs/scrub/ialloc.c
> index 13d43d108574..69d652b7299c 100644
> --- a/fs/xfs/scrub/ialloc.c
> +++ b/fs/xfs/scrub/ialloc.c
> @@ -35,11 +35,11 @@
> * try again after forcing logged inode cores out to disk.
> */
> int
> -xfs_scrub_setup_ag_iallocbt(
> +xchk_setup_ag_iallocbt(
> struct xfs_scrub_context *sc,
> struct xfs_inode *ip)
> {
> - return xfs_scrub_setup_ag_btree(sc, ip, sc->try_harder);
> + return xchk_setup_ag_btree(sc, ip, sc->try_harder);
> }
>
> /* Inode btree scrubber. */
> @@ -50,7 +50,7 @@ xfs_scrub_setup_ag_iallocbt(
> * we have a record or not depending on freecount.
> */
> static inline void
> -xfs_scrub_iallocbt_chunk_xref_other(
> +xchk_iallocbt_chunk_xref_other(
> struct xfs_scrub_context *sc,
> struct xfs_inobt_rec_incore *irec,
> xfs_agino_t agino)
> @@ -66,16 +66,16 @@ xfs_scrub_iallocbt_chunk_xref_other(
> if (!(*pcur))
> return;
> error = xfs_ialloc_has_inode_record(*pcur, agino, agino, &has_irec);
> - if (!xfs_scrub_should_check_xref(sc, &error, pcur))
> + if (!xchk_should_check_xref(sc, &error, pcur))
> return;
> if (((irec->ir_freecount > 0 && !has_irec) ||
> (irec->ir_freecount == 0 && has_irec)))
> - xfs_scrub_btree_xref_set_corrupt(sc, *pcur, 0);
> + xchk_btree_xref_set_corrupt(sc, *pcur, 0);
> }
>
> /* Cross-reference with the other btrees. */
> STATIC void
> -xfs_scrub_iallocbt_chunk_xref(
> +xchk_iallocbt_chunk_xref(
> struct xfs_scrub_context *sc,
> struct xfs_inobt_rec_incore *irec,
> xfs_agino_t agino,
> @@ -87,17 +87,17 @@ xfs_scrub_iallocbt_chunk_xref(
> if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
> return;
>
> - xfs_scrub_xref_is_used_space(sc, agbno, len);
> - xfs_scrub_iallocbt_chunk_xref_other(sc, irec, agino);
> + xchk_xref_is_used_space(sc, agbno, len);
> + xchk_iallocbt_chunk_xref_other(sc, irec, agino);
> xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_INODES);
> - xfs_scrub_xref_is_owned_by(sc, agbno, len, &oinfo);
> - xfs_scrub_xref_is_not_shared(sc, agbno, len);
> + xchk_xref_is_owned_by(sc, agbno, len, &oinfo);
> + xchk_xref_is_not_shared(sc, agbno, len);
> }
>
> /* Is this chunk worth checking? */
> STATIC bool
> -xfs_scrub_iallocbt_chunk(
> - struct xfs_scrub_btree *bs,
> +xchk_iallocbt_chunk(
> + struct xchk_btree *bs,
> struct xfs_inobt_rec_incore *irec,
> xfs_agino_t agino,
> xfs_extlen_t len)
> @@ -110,16 +110,16 @@ xfs_scrub_iallocbt_chunk(
> if (bno + len <= bno ||
> !xfs_verify_agbno(mp, agno, bno) ||
> !xfs_verify_agbno(mp, agno, bno + len - 1))
> - xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
> + xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
>
> - xfs_scrub_iallocbt_chunk_xref(bs->sc, irec, agino, bno, len);
> + xchk_iallocbt_chunk_xref(bs->sc, irec, agino, bno, len);
>
> return true;
> }
>
> /* Count the number of free inodes. */
> static unsigned int
> -xfs_scrub_iallocbt_freecount(
> +xchk_iallocbt_freecount(
> xfs_inofree_t freemask)
> {
> BUILD_BUG_ON(sizeof(freemask) != sizeof(__u64));
> @@ -128,8 +128,8 @@ xfs_scrub_iallocbt_freecount(
>
> /* Check a particular inode with ir_free. */
> STATIC int
> -xfs_scrub_iallocbt_check_cluster_freemask(
> - struct xfs_scrub_btree *bs,
> +xchk_iallocbt_check_cluster_freemask(
> + struct xchk_btree *bs,
> xfs_ino_t fsino,
> xfs_agino_t chunkino,
> xfs_agino_t clusterino,
> @@ -143,14 +143,14 @@ xfs_scrub_iallocbt_check_cluster_freemask(
> bool inuse;
> int error = 0;
>
> - if (xfs_scrub_should_terminate(bs->sc, &error))
> + if (xchk_should_terminate(bs->sc, &error))
> return error;
>
> dip = xfs_buf_offset(bp, clusterino * mp->m_sb.sb_inodesize);
> if (be16_to_cpu(dip->di_magic) != XFS_DINODE_MAGIC ||
> (dip->di_version >= 3 &&
> be64_to_cpu(dip->di_ino) != fsino + clusterino)) {
> - xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
> + xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
> goto out;
> }
>
> @@ -175,15 +175,15 @@ xfs_scrub_iallocbt_check_cluster_freemask(
> freemask_ok = inode_is_free ^ inuse;
> }
> if (!freemask_ok)
> - xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
> + xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
> out:
> return 0;
> }
>
> /* Make sure the free mask is consistent with what the inodes think. */
> STATIC int
> -xfs_scrub_iallocbt_check_freemask(
> - struct xfs_scrub_btree *bs,
> +xchk_iallocbt_check_freemask(
> + struct xchk_btree *bs,
> struct xfs_inobt_rec_incore *irec)
> {
> struct xfs_owner_info oinfo;
> @@ -223,18 +223,18 @@ xfs_scrub_iallocbt_check_freemask(
> /* The whole cluster must be a hole or not a hole. */
> ir_holemask = (irec->ir_holemask & holemask);
> if (ir_holemask != holemask && ir_holemask != 0) {
> - xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
> + xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
> continue;
> }
>
> /* If any part of this is a hole, skip it. */
> if (ir_holemask) {
> - xfs_scrub_xref_is_not_owned_by(bs->sc, agbno,
> + xchk_xref_is_not_owned_by(bs->sc, agbno,
> blks_per_cluster, &oinfo);
> continue;
> }
>
> - xfs_scrub_xref_is_owned_by(bs->sc, agbno, blks_per_cluster,
> + xchk_xref_is_owned_by(bs->sc, agbno, blks_per_cluster,
> &oinfo);
>
> /* Grab the inode cluster buffer. */
> @@ -245,13 +245,13 @@ xfs_scrub_iallocbt_check_freemask(
>
> error = xfs_imap_to_bp(mp, bs->cur->bc_tp, &imap,
> &dip, &bp, 0, 0);
> - if (!xfs_scrub_btree_xref_process_error(bs->sc, bs->cur, 0,
> + if (!xchk_btree_xref_process_error(bs->sc, bs->cur, 0,
> &error))
> continue;
>
> /* Which inodes are free? */
> for (clusterino = 0; clusterino < nr_inodes; clusterino++) {
> - error = xfs_scrub_iallocbt_check_cluster_freemask(bs,
> + error = xchk_iallocbt_check_cluster_freemask(bs,
> fsino, chunkino, clusterino, irec, bp);
> if (error) {
> xfs_trans_brelse(bs->cur->bc_tp, bp);
> @@ -267,8 +267,8 @@ xfs_scrub_iallocbt_check_freemask(
>
> /* Scrub an inobt/finobt record. */
> STATIC int
> -xfs_scrub_iallocbt_rec(
> - struct xfs_scrub_btree *bs,
> +xchk_iallocbt_rec(
> + struct xchk_btree *bs,
> union xfs_btree_rec *rec)
> {
> struct xfs_mount *mp = bs->cur->bc_mp;
> @@ -289,18 +289,18 @@ xfs_scrub_iallocbt_rec(
>
> if (irec.ir_count > XFS_INODES_PER_CHUNK ||
> irec.ir_freecount > XFS_INODES_PER_CHUNK)
> - xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
> + xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
>
> real_freecount = irec.ir_freecount +
> (XFS_INODES_PER_CHUNK - irec.ir_count);
> - if (real_freecount != xfs_scrub_iallocbt_freecount(irec.ir_free))
> - xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
> + if (real_freecount != xchk_iallocbt_freecount(irec.ir_free))
> + xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
>
> agino = irec.ir_startino;
> /* Record has to be properly aligned within the AG. */
> if (!xfs_verify_agino(mp, agno, agino) ||
> !xfs_verify_agino(mp, agno, agino + XFS_INODES_PER_CHUNK - 1)) {
> - xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
> + xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
> goto out;
> }
>
> @@ -308,7 +308,7 @@ xfs_scrub_iallocbt_rec(
> agbno = XFS_AGINO_TO_AGBNO(mp, irec.ir_startino);
> if ((agbno & (xfs_ialloc_cluster_alignment(mp) - 1)) ||
> (agbno & (xfs_icluster_size_fsb(mp) - 1)))
> - xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
> + xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
>
> *inode_blocks += XFS_B_TO_FSB(mp,
> irec.ir_count * mp->m_sb.sb_inodesize);
> @@ -318,9 +318,9 @@ xfs_scrub_iallocbt_rec(
> len = XFS_B_TO_FSB(mp,
> XFS_INODES_PER_CHUNK * mp->m_sb.sb_inodesize);
> if (irec.ir_count != XFS_INODES_PER_CHUNK)
> - xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
> + xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
>
> - if (!xfs_scrub_iallocbt_chunk(bs, &irec, agino, len))
> + if (!xchk_iallocbt_chunk(bs, &irec, agino, len))
> goto out;
> goto check_freemask;
> }
> @@ -333,12 +333,12 @@ xfs_scrub_iallocbt_rec(
> holes = ~xfs_inobt_irec_to_allocmask(&irec);
> if ((holes & irec.ir_free) != holes ||
> irec.ir_freecount > irec.ir_count)
> - xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
> + xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
>
> for (i = 0; i < XFS_INOBT_HOLEMASK_BITS; i++) {
> if (holemask & 1)
> holecount += XFS_INODES_PER_HOLEMASK_BIT;
> - else if (!xfs_scrub_iallocbt_chunk(bs, &irec, agino, len))
> + else if (!xchk_iallocbt_chunk(bs, &irec, agino, len))
> break;
> holemask >>= 1;
> agino += XFS_INODES_PER_HOLEMASK_BIT;
> @@ -346,10 +346,10 @@ xfs_scrub_iallocbt_rec(
>
> if (holecount > XFS_INODES_PER_CHUNK ||
> holecount + irec.ir_count != XFS_INODES_PER_CHUNK)
> - xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
> + xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
>
> check_freemask:
> - error = xfs_scrub_iallocbt_check_freemask(bs, &irec);
> + error = xchk_iallocbt_check_freemask(bs, &irec);
> if (error)
> goto out;
>
> @@ -362,7 +362,7 @@ xfs_scrub_iallocbt_rec(
> * Don't bother if we're missing btree cursors, as we're already corrupt.
> */
> STATIC void
> -xfs_scrub_iallocbt_xref_rmap_btreeblks(
> +xchk_iallocbt_xref_rmap_btreeblks(
> struct xfs_scrub_context *sc,
> int which)
> {
> @@ -374,27 +374,27 @@ xfs_scrub_iallocbt_xref_rmap_btreeblks(
>
> if (!sc->sa.ino_cur || !sc->sa.rmap_cur ||
> (xfs_sb_version_hasfinobt(&sc->mp->m_sb) && !sc->sa.fino_cur) ||
> - xfs_scrub_skip_xref(sc->sm))
> + xchk_skip_xref(sc->sm))
> return;
>
> /* Check that we saw as many inobt blocks as the rmap says. */
> error = xfs_btree_count_blocks(sc->sa.ino_cur, &inobt_blocks);
> - if (!xfs_scrub_process_error(sc, 0, 0, &error))
> + if (!xchk_process_error(sc, 0, 0, &error))
> return;
>
> if (sc->sa.fino_cur) {
> error = xfs_btree_count_blocks(sc->sa.fino_cur, &finobt_blocks);
> - if (!xfs_scrub_process_error(sc, 0, 0, &error))
> + if (!xchk_process_error(sc, 0, 0, &error))
> return;
> }
>
> xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_INOBT);
> - error = xfs_scrub_count_rmap_ownedby_ag(sc, sc->sa.rmap_cur, &oinfo,
> + error = xchk_count_rmap_ownedby_ag(sc, sc->sa.rmap_cur, &oinfo,
> &blocks);
> - if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.rmap_cur))
> + if (!xchk_should_check_xref(sc, &error, &sc->sa.rmap_cur))
> return;
> if (blocks != inobt_blocks + finobt_blocks)
> - xfs_scrub_btree_set_corrupt(sc, sc->sa.ino_cur, 0);
> + xchk_btree_set_corrupt(sc, sc->sa.ino_cur, 0);
> }
>
> /*
> @@ -402,7 +402,7 @@ xfs_scrub_iallocbt_xref_rmap_btreeblks(
> * the rmap says are owned by inodes.
> */
> STATIC void
> -xfs_scrub_iallocbt_xref_rmap_inodes(
> +xchk_iallocbt_xref_rmap_inodes(
> struct xfs_scrub_context *sc,
> int which,
> xfs_filblks_t inode_blocks)
> @@ -411,22 +411,22 @@ xfs_scrub_iallocbt_xref_rmap_inodes(
> xfs_filblks_t blocks;
> int error;
>
> - if (!sc->sa.rmap_cur || xfs_scrub_skip_xref(sc->sm))
> + if (!sc->sa.rmap_cur || xchk_skip_xref(sc->sm))
> return;
>
> /* Check that we saw as many inode blocks as the rmap knows about. */
> xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_INODES);
> - error = xfs_scrub_count_rmap_ownedby_ag(sc, sc->sa.rmap_cur, &oinfo,
> + error = xchk_count_rmap_ownedby_ag(sc, sc->sa.rmap_cur, &oinfo,
> &blocks);
> - if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.rmap_cur))
> + if (!xchk_should_check_xref(sc, &error, &sc->sa.rmap_cur))
> return;
> if (blocks != inode_blocks)
> - xfs_scrub_btree_xref_set_corrupt(sc, sc->sa.rmap_cur, 0);
> + xchk_btree_xref_set_corrupt(sc, sc->sa.rmap_cur, 0);
> }
>
> /* Scrub the inode btrees for some AG. */
> STATIC int
> -xfs_scrub_iallocbt(
> +xchk_iallocbt(
> struct xfs_scrub_context *sc,
> xfs_btnum_t which)
> {
> @@ -437,12 +437,12 @@ xfs_scrub_iallocbt(
>
> xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_INOBT);
> cur = which == XFS_BTNUM_INO ? sc->sa.ino_cur : sc->sa.fino_cur;
> - error = xfs_scrub_btree(sc, cur, xfs_scrub_iallocbt_rec, &oinfo,
> + error = xchk_btree(sc, cur, xchk_iallocbt_rec, &oinfo,
> &inode_blocks);
> if (error)
> return error;
>
> - xfs_scrub_iallocbt_xref_rmap_btreeblks(sc, which);
> + xchk_iallocbt_xref_rmap_btreeblks(sc, which);
>
> /*
> * If we're scrubbing the inode btree, inode_blocks is the number of
> @@ -452,28 +452,28 @@ xfs_scrub_iallocbt(
> * to inode chunks with free inodes.
> */
> if (which == XFS_BTNUM_INO)
> - xfs_scrub_iallocbt_xref_rmap_inodes(sc, which, inode_blocks);
> + xchk_iallocbt_xref_rmap_inodes(sc, which, inode_blocks);
>
> return error;
> }
>
> int
> -xfs_scrub_inobt(
> +xchk_inobt(
> struct xfs_scrub_context *sc)
> {
> - return xfs_scrub_iallocbt(sc, XFS_BTNUM_INO);
> + return xchk_iallocbt(sc, XFS_BTNUM_INO);
> }
>
> int
> -xfs_scrub_finobt(
> +xchk_finobt(
> struct xfs_scrub_context *sc)
> {
> - return xfs_scrub_iallocbt(sc, XFS_BTNUM_FINO);
> + return xchk_iallocbt(sc, XFS_BTNUM_FINO);
> }
>
> /* See if an inode btree has (or doesn't have) an inode chunk record. */
> static inline void
> -xfs_scrub_xref_inode_check(
> +xchk_xref_inode_check(
> struct xfs_scrub_context *sc,
> xfs_agblock_t agbno,
> xfs_extlen_t len,
> @@ -483,33 +483,33 @@ xfs_scrub_xref_inode_check(
> bool has_inodes;
> int error;
>
> - if (!(*icur) || xfs_scrub_skip_xref(sc->sm))
> + if (!(*icur) || xchk_skip_xref(sc->sm))
> return;
>
> error = xfs_ialloc_has_inodes_at_extent(*icur, agbno, len, &has_inodes);
> - if (!xfs_scrub_should_check_xref(sc, &error, icur))
> + if (!xchk_should_check_xref(sc, &error, icur))
> return;
> if (has_inodes != should_have_inodes)
> - xfs_scrub_btree_xref_set_corrupt(sc, *icur, 0);
> + xchk_btree_xref_set_corrupt(sc, *icur, 0);
> }
>
> /* xref check that the extent is not covered by inodes */
> void
> -xfs_scrub_xref_is_not_inode_chunk(
> +xchk_xref_is_not_inode_chunk(
> struct xfs_scrub_context *sc,
> xfs_agblock_t agbno,
> xfs_extlen_t len)
> {
> - xfs_scrub_xref_inode_check(sc, agbno, len, &sc->sa.ino_cur, false);
> - xfs_scrub_xref_inode_check(sc, agbno, len, &sc->sa.fino_cur, false);
> + xchk_xref_inode_check(sc, agbno, len, &sc->sa.ino_cur, false);
> + xchk_xref_inode_check(sc, agbno, len, &sc->sa.fino_cur, false);
> }
>
> /* xref check that the extent is covered by inodes */
> void
> -xfs_scrub_xref_is_inode_chunk(
> +xchk_xref_is_inode_chunk(
> struct xfs_scrub_context *sc,
> xfs_agblock_t agbno,
> xfs_extlen_t len)
> {
> - xfs_scrub_xref_inode_check(sc, agbno, len, &sc->sa.ino_cur, true);
> + xchk_xref_inode_check(sc, agbno, len, &sc->sa.ino_cur, true);
> }
> diff --git a/fs/xfs/scrub/inode.c b/fs/xfs/scrub/inode.c
> index 7a6208505980..d85fbec39e52 100644
> --- a/fs/xfs/scrub/inode.c
> +++ b/fs/xfs/scrub/inode.c
> @@ -37,7 +37,7 @@
> * the goal.
> */
> int
> -xfs_scrub_setup_inode(
> +xchk_setup_inode(
> struct xfs_scrub_context *sc,
> struct xfs_inode *ip)
> {
> @@ -47,13 +47,13 @@ xfs_scrub_setup_inode(
> * Try to get the inode. If the verifiers fail, we try again
> * in raw mode.
> */
> - error = xfs_scrub_get_inode(sc, ip);
> + error = xchk_get_inode(sc, ip);
> switch (error) {
> case 0:
> break;
> case -EFSCORRUPTED:
> case -EFSBADCRC:
> - return xfs_scrub_trans_alloc(sc, 0);
> + return xchk_trans_alloc(sc, 0);
> default:
> return error;
> }
> @@ -61,7 +61,7 @@ xfs_scrub_setup_inode(
> /* Got the inode, lock it and we're ready to go. */
> sc->ilock_flags = XFS_IOLOCK_EXCL | XFS_MMAPLOCK_EXCL;
> xfs_ilock(sc->ip, sc->ilock_flags);
> - error = xfs_scrub_trans_alloc(sc, 0);
> + error = xchk_trans_alloc(sc, 0);
> if (error)
> goto out;
> sc->ilock_flags |= XFS_ILOCK_EXCL;
> @@ -76,7 +76,7 @@ xfs_scrub_setup_inode(
>
> /* Validate di_extsize hint. */
> STATIC void
> -xfs_scrub_inode_extsize(
> +xchk_inode_extsize(
> struct xfs_scrub_context *sc,
> struct xfs_dinode *dip,
> xfs_ino_t ino,
> @@ -88,7 +88,7 @@ xfs_scrub_inode_extsize(
> fa = xfs_inode_validate_extsize(sc->mp, be32_to_cpu(dip->di_extsize),
> mode, flags);
> if (fa)
> - xfs_scrub_ino_set_corrupt(sc, ino);
> + xchk_ino_set_corrupt(sc, ino);
> }
>
> /*
> @@ -98,7 +98,7 @@ xfs_scrub_inode_extsize(
> * These functions must be kept in sync with each other.
> */
> STATIC void
> -xfs_scrub_inode_cowextsize(
> +xchk_inode_cowextsize(
> struct xfs_scrub_context *sc,
> struct xfs_dinode *dip,
> xfs_ino_t ino,
> @@ -112,12 +112,12 @@ xfs_scrub_inode_cowextsize(
> be32_to_cpu(dip->di_cowextsize), mode, flags,
> flags2);
> if (fa)
> - xfs_scrub_ino_set_corrupt(sc, ino);
> + xchk_ino_set_corrupt(sc, ino);
> }
>
> /* Make sure the di_flags make sense for the inode. */
> STATIC void
> -xfs_scrub_inode_flags(
> +xchk_inode_flags(
> struct xfs_scrub_context *sc,
> struct xfs_dinode *dip,
> xfs_ino_t ino,
> @@ -157,12 +157,12 @@ xfs_scrub_inode_flags(
>
> return;
> bad:
> - xfs_scrub_ino_set_corrupt(sc, ino);
> + xchk_ino_set_corrupt(sc, ino);
> }
>
> /* Make sure the di_flags2 make sense for the inode. */
> STATIC void
> -xfs_scrub_inode_flags2(
> +xchk_inode_flags2(
> struct xfs_scrub_context *sc,
> struct xfs_dinode *dip,
> xfs_ino_t ino,
> @@ -200,12 +200,12 @@ xfs_scrub_inode_flags2(
>
> return;
> bad:
> - xfs_scrub_ino_set_corrupt(sc, ino);
> + xchk_ino_set_corrupt(sc, ino);
> }
>
> /* Scrub all the ondisk inode fields. */
> STATIC void
> -xfs_scrub_dinode(
> +xchk_dinode(
> struct xfs_scrub_context *sc,
> struct xfs_dinode *dip,
> xfs_ino_t ino)
> @@ -237,7 +237,7 @@ xfs_scrub_dinode(
> /* mode is recognized */
> break;
> default:
> - xfs_scrub_ino_set_corrupt(sc, ino);
> + xchk_ino_set_corrupt(sc, ino);
> break;
> }
>
> @@ -248,22 +248,22 @@ xfs_scrub_dinode(
> * We autoconvert v1 inodes into v2 inodes on writeout,
> * so just mark this inode for preening.
> */
> - xfs_scrub_ino_set_preen(sc, ino);
> + xchk_ino_set_preen(sc, ino);
> break;
> case 2:
> case 3:
> if (dip->di_onlink != 0)
> - xfs_scrub_ino_set_corrupt(sc, ino);
> + xchk_ino_set_corrupt(sc, ino);
>
> if (dip->di_mode == 0 && sc->ip)
> - xfs_scrub_ino_set_corrupt(sc, ino);
> + xchk_ino_set_corrupt(sc, ino);
>
> if (dip->di_projid_hi != 0 &&
> !xfs_sb_version_hasprojid32bit(&mp->m_sb))
> - xfs_scrub_ino_set_corrupt(sc, ino);
> + xchk_ino_set_corrupt(sc, ino);
> break;
> default:
> - xfs_scrub_ino_set_corrupt(sc, ino);
> + xchk_ino_set_corrupt(sc, ino);
> return;
> }
>
> @@ -273,40 +273,40 @@ xfs_scrub_dinode(
> */
> if (dip->di_uid == cpu_to_be32(-1U) ||
> dip->di_gid == cpu_to_be32(-1U))
> - xfs_scrub_ino_set_warning(sc, ino);
> + xchk_ino_set_warning(sc, ino);
>
> /* di_format */
> switch (dip->di_format) {
> case XFS_DINODE_FMT_DEV:
> if (!S_ISCHR(mode) && !S_ISBLK(mode) &&
> !S_ISFIFO(mode) && !S_ISSOCK(mode))
> - xfs_scrub_ino_set_corrupt(sc, ino);
> + xchk_ino_set_corrupt(sc, ino);
> break;
> case XFS_DINODE_FMT_LOCAL:
> if (!S_ISDIR(mode) && !S_ISLNK(mode))
> - xfs_scrub_ino_set_corrupt(sc, ino);
> + xchk_ino_set_corrupt(sc, ino);
> break;
> case XFS_DINODE_FMT_EXTENTS:
> if (!S_ISREG(mode) && !S_ISDIR(mode) && !S_ISLNK(mode))
> - xfs_scrub_ino_set_corrupt(sc, ino);
> + xchk_ino_set_corrupt(sc, ino);
> break;
> case XFS_DINODE_FMT_BTREE:
> if (!S_ISREG(mode) && !S_ISDIR(mode))
> - xfs_scrub_ino_set_corrupt(sc, ino);
> + xchk_ino_set_corrupt(sc, ino);
> break;
> case XFS_DINODE_FMT_UUID:
> default:
> - xfs_scrub_ino_set_corrupt(sc, ino);
> + xchk_ino_set_corrupt(sc, ino);
> break;
> }
>
> /* di_[amc]time.nsec */
> if (be32_to_cpu(dip->di_atime.t_nsec) >= NSEC_PER_SEC)
> - xfs_scrub_ino_set_corrupt(sc, ino);
> + xchk_ino_set_corrupt(sc, ino);
> if (be32_to_cpu(dip->di_mtime.t_nsec) >= NSEC_PER_SEC)
> - xfs_scrub_ino_set_corrupt(sc, ino);
> + xchk_ino_set_corrupt(sc, ino);
> if (be32_to_cpu(dip->di_ctime.t_nsec) >= NSEC_PER_SEC)
> - xfs_scrub_ino_set_corrupt(sc, ino);
> + xchk_ino_set_corrupt(sc, ino);
>
> /*
> * di_size. xfs_dinode_verify checks for things that screw up
> @@ -315,19 +315,19 @@ xfs_scrub_dinode(
> */
> isize = be64_to_cpu(dip->di_size);
> if (isize & (1ULL << 63))
> - xfs_scrub_ino_set_corrupt(sc, ino);
> + xchk_ino_set_corrupt(sc, ino);
>
> /* Devices, fifos, and sockets must have zero size */
> if (!S_ISDIR(mode) && !S_ISREG(mode) && !S_ISLNK(mode) && isize != 0)
> - xfs_scrub_ino_set_corrupt(sc, ino);
> + xchk_ino_set_corrupt(sc, ino);
>
> /* Directories can't be larger than the data section size (32G) */
> if (S_ISDIR(mode) && (isize == 0 || isize >= XFS_DIR2_SPACE_SIZE))
> - xfs_scrub_ino_set_corrupt(sc, ino);
> + xchk_ino_set_corrupt(sc, ino);
>
> /* Symlinks can't be larger than SYMLINK_MAXLEN */
> if (S_ISLNK(mode) && (isize == 0 || isize >= XFS_SYMLINK_MAXLEN))
> - xfs_scrub_ino_set_corrupt(sc, ino);
> + xchk_ino_set_corrupt(sc, ino);
>
> /*
> * Warn if the running kernel can't handle the kinds of offsets
> @@ -336,7 +336,7 @@ xfs_scrub_dinode(
> * overly large offsets, flag the inode for admin review.
> */
> if (isize >= mp->m_super->s_maxbytes)
> - xfs_scrub_ino_set_warning(sc, ino);
> + xchk_ino_set_warning(sc, ino);
>
> /* di_nblocks */
> if (flags2 & XFS_DIFLAG2_REFLINK) {
> @@ -351,15 +351,15 @@ xfs_scrub_dinode(
> */
> if (be64_to_cpu(dip->di_nblocks) >=
> mp->m_sb.sb_dblocks + mp->m_sb.sb_rblocks)
> - xfs_scrub_ino_set_corrupt(sc, ino);
> + xchk_ino_set_corrupt(sc, ino);
> } else {
> if (be64_to_cpu(dip->di_nblocks) >= mp->m_sb.sb_dblocks)
> - xfs_scrub_ino_set_corrupt(sc, ino);
> + xchk_ino_set_corrupt(sc, ino);
> }
>
> - xfs_scrub_inode_flags(sc, dip, ino, mode, flags);
> + xchk_inode_flags(sc, dip, ino, mode, flags);
>
> - xfs_scrub_inode_extsize(sc, dip, ino, mode, flags);
> + xchk_inode_extsize(sc, dip, ino, mode, flags);
>
> /* di_nextents */
> nextents = be32_to_cpu(dip->di_nextents);
> @@ -367,31 +367,31 @@ xfs_scrub_dinode(
> switch (dip->di_format) {
> case XFS_DINODE_FMT_EXTENTS:
> if (nextents > fork_recs)
> - xfs_scrub_ino_set_corrupt(sc, ino);
> + xchk_ino_set_corrupt(sc, ino);
> break;
> case XFS_DINODE_FMT_BTREE:
> if (nextents <= fork_recs)
> - xfs_scrub_ino_set_corrupt(sc, ino);
> + xchk_ino_set_corrupt(sc, ino);
> break;
> default:
> if (nextents != 0)
> - xfs_scrub_ino_set_corrupt(sc, ino);
> + xchk_ino_set_corrupt(sc, ino);
> break;
> }
>
> /* di_forkoff */
> if (XFS_DFORK_APTR(dip) >= (char *)dip + mp->m_sb.sb_inodesize)
> - xfs_scrub_ino_set_corrupt(sc, ino);
> + xchk_ino_set_corrupt(sc, ino);
> if (dip->di_anextents != 0 && dip->di_forkoff == 0)
> - xfs_scrub_ino_set_corrupt(sc, ino);
> + xchk_ino_set_corrupt(sc, ino);
> if (dip->di_forkoff == 0 && dip->di_aformat != XFS_DINODE_FMT_EXTENTS)
> - xfs_scrub_ino_set_corrupt(sc, ino);
> + xchk_ino_set_corrupt(sc, ino);
>
> /* di_aformat */
> if (dip->di_aformat != XFS_DINODE_FMT_LOCAL &&
> dip->di_aformat != XFS_DINODE_FMT_EXTENTS &&
> dip->di_aformat != XFS_DINODE_FMT_BTREE)
> - xfs_scrub_ino_set_corrupt(sc, ino);
> + xchk_ino_set_corrupt(sc, ino);
>
> /* di_anextents */
> nextents = be16_to_cpu(dip->di_anextents);
> @@ -399,22 +399,22 @@ xfs_scrub_dinode(
> switch (dip->di_aformat) {
> case XFS_DINODE_FMT_EXTENTS:
> if (nextents > fork_recs)
> - xfs_scrub_ino_set_corrupt(sc, ino);
> + xchk_ino_set_corrupt(sc, ino);
> break;
> case XFS_DINODE_FMT_BTREE:
> if (nextents <= fork_recs)
> - xfs_scrub_ino_set_corrupt(sc, ino);
> + xchk_ino_set_corrupt(sc, ino);
> break;
> default:
> if (nextents != 0)
> - xfs_scrub_ino_set_corrupt(sc, ino);
> + xchk_ino_set_corrupt(sc, ino);
> }
>
> if (dip->di_version >= 3) {
> if (be32_to_cpu(dip->di_crtime.t_nsec) >= NSEC_PER_SEC)
> - xfs_scrub_ino_set_corrupt(sc, ino);
> - xfs_scrub_inode_flags2(sc, dip, ino, mode, flags, flags2);
> - xfs_scrub_inode_cowextsize(sc, dip, ino, mode, flags,
> + xchk_ino_set_corrupt(sc, ino);
> + xchk_inode_flags2(sc, dip, ino, mode, flags, flags2);
> + xchk_inode_cowextsize(sc, dip, ino, mode, flags,
> flags2);
> }
> }
> @@ -425,7 +425,7 @@ xfs_scrub_dinode(
> * IGET_UNTRUSTED, which checks the inobt for us.
> */
> static void
> -xfs_scrub_inode_xref_finobt(
> +xchk_inode_xref_finobt(
> struct xfs_scrub_context *sc,
> xfs_ino_t ino)
> {
> @@ -434,7 +434,7 @@ xfs_scrub_inode_xref_finobt(
> int has_record;
> int error;
>
> - if (!sc->sa.fino_cur || xfs_scrub_skip_xref(sc->sm))
> + if (!sc->sa.fino_cur || xchk_skip_xref(sc->sm))
> return;
>
> agino = XFS_INO_TO_AGINO(sc->mp, ino);
> @@ -445,12 +445,12 @@ xfs_scrub_inode_xref_finobt(
> */
> error = xfs_inobt_lookup(sc->sa.fino_cur, agino, XFS_LOOKUP_LE,
> &has_record);
> - if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.fino_cur) ||
> + if (!xchk_should_check_xref(sc, &error, &sc->sa.fino_cur) ||
> !has_record)
> return;
>
> error = xfs_inobt_get_rec(sc->sa.fino_cur, &rec, &has_record);
> - if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.fino_cur) ||
> + if (!xchk_should_check_xref(sc, &error, &sc->sa.fino_cur) ||
> !has_record)
> return;
>
> @@ -463,12 +463,12 @@ xfs_scrub_inode_xref_finobt(
> return;
>
> if (rec.ir_free & XFS_INOBT_MASK(agino - rec.ir_startino))
> - xfs_scrub_btree_xref_set_corrupt(sc, sc->sa.fino_cur, 0);
> + xchk_btree_xref_set_corrupt(sc, sc->sa.fino_cur, 0);
> }
>
> /* Cross reference the inode fields with the forks. */
> STATIC void
> -xfs_scrub_inode_xref_bmap(
> +xchk_inode_xref_bmap(
> struct xfs_scrub_context *sc,
> struct xfs_dinode *dip)
> {
> @@ -477,32 +477,32 @@ xfs_scrub_inode_xref_bmap(
> xfs_filblks_t acount;
> int error;
>
> - if (xfs_scrub_skip_xref(sc->sm))
> + if (xchk_skip_xref(sc->sm))
> return;
>
> /* Walk all the extents to check nextents/naextents/nblocks. */
> error = xfs_bmap_count_blocks(sc->tp, sc->ip, XFS_DATA_FORK,
> &nextents, &count);
> - if (!xfs_scrub_should_check_xref(sc, &error, NULL))
> + if (!xchk_should_check_xref(sc, &error, NULL))
> return;
> if (nextents < be32_to_cpu(dip->di_nextents))
> - xfs_scrub_ino_xref_set_corrupt(sc, sc->ip->i_ino);
> + xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino);
>
> error = xfs_bmap_count_blocks(sc->tp, sc->ip, XFS_ATTR_FORK,
> &nextents, &acount);
> - if (!xfs_scrub_should_check_xref(sc, &error, NULL))
> + if (!xchk_should_check_xref(sc, &error, NULL))
> return;
> if (nextents != be16_to_cpu(dip->di_anextents))
> - xfs_scrub_ino_xref_set_corrupt(sc, sc->ip->i_ino);
> + xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino);
>
> /* Check nblocks against the inode. */
> if (count + acount != be64_to_cpu(dip->di_nblocks))
> - xfs_scrub_ino_xref_set_corrupt(sc, sc->ip->i_ino);
> + xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino);
> }
>
> /* Cross-reference with the other btrees. */
> STATIC void
> -xfs_scrub_inode_xref(
> +xchk_inode_xref(
> struct xfs_scrub_context *sc,
> xfs_ino_t ino,
> struct xfs_dinode *dip)
> @@ -518,18 +518,18 @@ xfs_scrub_inode_xref(
> agno = XFS_INO_TO_AGNO(sc->mp, ino);
> agbno = XFS_INO_TO_AGBNO(sc->mp, ino);
>
> - error = xfs_scrub_ag_init(sc, agno, &sc->sa);
> - if (!xfs_scrub_xref_process_error(sc, agno, agbno, &error))
> + error = xchk_ag_init(sc, agno, &sc->sa);
> + if (!xchk_xref_process_error(sc, agno, agbno, &error))
> return;
>
> - xfs_scrub_xref_is_used_space(sc, agbno, 1);
> - xfs_scrub_inode_xref_finobt(sc, ino);
> + xchk_xref_is_used_space(sc, agbno, 1);
> + xchk_inode_xref_finobt(sc, ino);
> xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_INODES);
> - xfs_scrub_xref_is_owned_by(sc, agbno, 1, &oinfo);
> - xfs_scrub_xref_is_not_shared(sc, agbno, 1);
> - xfs_scrub_inode_xref_bmap(sc, dip);
> + xchk_xref_is_owned_by(sc, agbno, 1, &oinfo);
> + xchk_xref_is_not_shared(sc, agbno, 1);
> + xchk_inode_xref_bmap(sc, dip);
>
> - xfs_scrub_ag_free(sc, &sc->sa);
> + xchk_ag_free(sc, &sc->sa);
> }
>
> /*
> @@ -539,7 +539,7 @@ xfs_scrub_inode_xref(
> * reflink filesystem.
> */
> static void
> -xfs_scrub_inode_check_reflink_iflag(
> +xchk_inode_check_reflink_iflag(
> struct xfs_scrub_context *sc,
> xfs_ino_t ino)
> {
> @@ -552,18 +552,18 @@ xfs_scrub_inode_check_reflink_iflag(
>
> error = xfs_reflink_inode_has_shared_extents(sc->tp, sc->ip,
> &has_shared);
> - if (!xfs_scrub_xref_process_error(sc, XFS_INO_TO_AGNO(mp, ino),
> + if (!xchk_xref_process_error(sc, XFS_INO_TO_AGNO(mp, ino),
> XFS_INO_TO_AGBNO(mp, ino), &error))
> return;
> if (xfs_is_reflink_inode(sc->ip) && !has_shared)
> - xfs_scrub_ino_set_preen(sc, ino);
> + xchk_ino_set_preen(sc, ino);
> else if (!xfs_is_reflink_inode(sc->ip) && has_shared)
> - xfs_scrub_ino_set_corrupt(sc, ino);
> + xchk_ino_set_corrupt(sc, ino);
> }
>
> /* Scrub an inode. */
> int
> -xfs_scrub_inode(
> +xchk_inode(
> struct xfs_scrub_context *sc)
> {
> struct xfs_dinode di;
> @@ -575,13 +575,13 @@ xfs_scrub_inode(
> * and a NULL inode, so flag the corruption error and return.
> */
> if (!sc->ip) {
> - xfs_scrub_ino_set_corrupt(sc, sc->sm->sm_ino);
> + xchk_ino_set_corrupt(sc, sc->sm->sm_ino);
> return 0;
> }
>
> /* Scrub the inode core. */
> xfs_inode_to_disk(sc->ip, &di, 0);
> - xfs_scrub_dinode(sc, &di, sc->ip->i_ino);
> + xchk_dinode(sc, &di, sc->ip->i_ino);
> if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
> goto out;
>
> @@ -591,9 +591,9 @@ xfs_scrub_inode(
> * we scrubbed the dinode.
> */
> if (S_ISREG(VFS_I(sc->ip)->i_mode))
> - xfs_scrub_inode_check_reflink_iflag(sc, sc->ip->i_ino);
> + xchk_inode_check_reflink_iflag(sc, sc->ip->i_ino);
>
> - xfs_scrub_inode_xref(sc, sc->ip->i_ino, &di);
> + xchk_inode_xref(sc, sc->ip->i_ino, &di);
> out:
> return error;
> }
> diff --git a/fs/xfs/scrub/parent.c b/fs/xfs/scrub/parent.c
> index e2bda58c32f0..0a78d8411f23 100644
> --- a/fs/xfs/scrub/parent.c
> +++ b/fs/xfs/scrub/parent.c
> @@ -27,18 +27,18 @@
>
> /* Set us up to scrub parents. */
> int
> -xfs_scrub_setup_parent(
> +xchk_setup_parent(
> struct xfs_scrub_context *sc,
> struct xfs_inode *ip)
> {
> - return xfs_scrub_setup_inode_contents(sc, ip, 0);
> + return xchk_setup_inode_contents(sc, ip, 0);
> }
>
> /* Parent pointers */
>
> /* Look for an entry in a parent pointing to this inode. */
>
> -struct xfs_scrub_parent_ctx {
> +struct xchk_parent_ctx {
> struct dir_context dc;
> xfs_ino_t ino;
> xfs_nlink_t nlink;
> @@ -46,7 +46,7 @@ struct xfs_scrub_parent_ctx {
>
> /* Look for a single entry in a directory pointing to an inode. */
> STATIC int
> -xfs_scrub_parent_actor(
> +xchk_parent_actor(
> struct dir_context *dc,
> const char *name,
> int namelen,
> @@ -54,9 +54,9 @@ xfs_scrub_parent_actor(
> u64 ino,
> unsigned type)
> {
> - struct xfs_scrub_parent_ctx *spc;
> + struct xchk_parent_ctx *spc;
>
> - spc = container_of(dc, struct xfs_scrub_parent_ctx, dc);
> + spc = container_of(dc, struct xchk_parent_ctx, dc);
> if (spc->ino == ino)
> spc->nlink++;
> return 0;
> @@ -64,13 +64,13 @@ xfs_scrub_parent_actor(
>
> /* Count the number of dentries in the parent dir that point to this inode. */
> STATIC int
> -xfs_scrub_parent_count_parent_dentries(
> +xchk_parent_count_parent_dentries(
> struct xfs_scrub_context *sc,
> struct xfs_inode *parent,
> xfs_nlink_t *nlink)
> {
> - struct xfs_scrub_parent_ctx spc = {
> - .dc.actor = xfs_scrub_parent_actor,
> + struct xchk_parent_ctx spc = {
> + .dc.actor = xchk_parent_actor,
> .dc.pos = 0,
> .ino = sc->ip->i_ino,
> .nlink = 0,
> @@ -120,7 +120,7 @@ xfs_scrub_parent_count_parent_dentries(
> * entry pointing back to the inode being scrubbed.
> */
> STATIC int
> -xfs_scrub_parent_validate(
> +xchk_parent_validate(
> struct xfs_scrub_context *sc,
> xfs_ino_t dnum,
> bool *try_again)
> @@ -138,7 +138,7 @@ xfs_scrub_parent_validate(
>
> /* '..' must not point to ourselves. */
> if (sc->ip->i_ino == dnum) {
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
> goto out;
> }
>
> @@ -165,13 +165,13 @@ xfs_scrub_parent_validate(
> error = xfs_iget(mp, sc->tp, dnum, XFS_IGET_UNTRUSTED, 0, &dp);
> if (error == -EINVAL) {
> error = -EFSCORRUPTED;
> - xfs_scrub_fblock_process_error(sc, XFS_DATA_FORK, 0, &error);
> + xchk_fblock_process_error(sc, XFS_DATA_FORK, 0, &error);
> goto out;
> }
> - if (!xfs_scrub_fblock_xref_process_error(sc, XFS_DATA_FORK, 0, &error))
> + if (!xchk_fblock_xref_process_error(sc, XFS_DATA_FORK, 0, &error))
> goto out;
> if (dp == sc->ip || !S_ISDIR(VFS_I(dp)->i_mode)) {
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
> goto out_rele;
> }
>
> @@ -183,12 +183,12 @@ xfs_scrub_parent_validate(
> * the child inodes.
> */
> if (xfs_ilock_nowait(dp, XFS_IOLOCK_SHARED)) {
> - error = xfs_scrub_parent_count_parent_dentries(sc, dp, &nlink);
> - if (!xfs_scrub_fblock_xref_process_error(sc, XFS_DATA_FORK, 0,
> + error = xchk_parent_count_parent_dentries(sc, dp, &nlink);
> + if (!xchk_fblock_xref_process_error(sc, XFS_DATA_FORK, 0,
> &error))
> goto out_unlock;
> if (nlink != expected_nlink)
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
> goto out_unlock;
> }
>
> @@ -200,18 +200,18 @@ xfs_scrub_parent_validate(
> */
> xfs_iunlock(sc->ip, sc->ilock_flags);
> sc->ilock_flags = 0;
> - error = xfs_scrub_ilock_inverted(dp, XFS_IOLOCK_SHARED);
> + error = xchk_ilock_inverted(dp, XFS_IOLOCK_SHARED);
> if (error)
> goto out_rele;
>
> /* Go looking for our dentry. */
> - error = xfs_scrub_parent_count_parent_dentries(sc, dp, &nlink);
> - if (!xfs_scrub_fblock_xref_process_error(sc, XFS_DATA_FORK, 0, &error))
> + error = xchk_parent_count_parent_dentries(sc, dp, &nlink);
> + if (!xchk_fblock_xref_process_error(sc, XFS_DATA_FORK, 0, &error))
> goto out_unlock;
>
> /* Drop the parent lock, relock this inode. */
> xfs_iunlock(dp, XFS_IOLOCK_SHARED);
> - error = xfs_scrub_ilock_inverted(sc->ip, XFS_IOLOCK_EXCL);
> + error = xchk_ilock_inverted(sc->ip, XFS_IOLOCK_EXCL);
> if (error)
> goto out_rele;
> sc->ilock_flags = XFS_IOLOCK_EXCL;
> @@ -225,7 +225,7 @@ xfs_scrub_parent_validate(
>
> /* Look up '..' to see if the inode changed. */
> error = xfs_dir_lookup(sc->tp, sc->ip, &xfs_name_dotdot, &dnum, NULL);
> - if (!xfs_scrub_fblock_process_error(sc, XFS_DATA_FORK, 0, &error))
> + if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, 0, &error))
> goto out_rele;
>
> /* Drat, parent changed. Try again! */
> @@ -241,7 +241,7 @@ xfs_scrub_parent_validate(
> * for us in the parent.
> */
> if (nlink != expected_nlink)
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
> return error;
>
> out_unlock:
> @@ -254,7 +254,7 @@ xfs_scrub_parent_validate(
>
> /* Scrub a parent pointer. */
> int
> -xfs_scrub_parent(
> +xchk_parent(
> struct xfs_scrub_context *sc)
> {
> struct xfs_mount *mp = sc->mp;
> @@ -272,7 +272,7 @@ xfs_scrub_parent(
>
> /* We're not a special inode, are we? */
> if (!xfs_verify_dir_ino(mp, sc->ip->i_ino)) {
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
> goto out;
> }
>
> @@ -288,10 +288,10 @@ xfs_scrub_parent(
>
> /* Look up '..' */
> error = xfs_dir_lookup(sc->tp, sc->ip, &xfs_name_dotdot, &dnum, NULL);
> - if (!xfs_scrub_fblock_process_error(sc, XFS_DATA_FORK, 0, &error))
> + if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, 0, &error))
> goto out;
> if (!xfs_verify_dir_ino(mp, dnum)) {
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
> goto out;
> }
>
> @@ -299,12 +299,12 @@ xfs_scrub_parent(
> if (sc->ip == mp->m_rootip) {
> if (sc->ip->i_ino != mp->m_sb.sb_rootino ||
> sc->ip->i_ino != dnum)
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
> goto out;
> }
>
> do {
> - error = xfs_scrub_parent_validate(sc, dnum, &try_again);
> + error = xchk_parent_validate(sc, dnum, &try_again);
> if (error)
> goto out;
> } while (try_again && ++tries < 20);
> @@ -314,7 +314,7 @@ xfs_scrub_parent(
> * incomplete. Userspace can decide if it wants to try again.
> */
> if (try_again && tries == 20)
> - xfs_scrub_set_incomplete(sc);
> + xchk_set_incomplete(sc);
> out:
> /*
> * If we failed to lock the parent inode even after a retry, just mark
> @@ -322,7 +322,7 @@ xfs_scrub_parent(
> */
> if (sc->try_harder && error == -EDEADLOCK) {
> error = 0;
> - xfs_scrub_set_incomplete(sc);
> + xchk_set_incomplete(sc);
> }
> return error;
> }
> diff --git a/fs/xfs/scrub/quota.c b/fs/xfs/scrub/quota.c
> index 6ff906aa0a3b..d1b52dd7efcd 100644
> --- a/fs/xfs/scrub/quota.c
> +++ b/fs/xfs/scrub/quota.c
> @@ -30,7 +30,7 @@
>
> /* Convert a scrub type code to a DQ flag, or return 0 if error. */
> static inline uint
> -xfs_scrub_quota_to_dqtype(
> +xchk_quota_to_dqtype(
> struct xfs_scrub_context *sc)
> {
> switch (sc->sm->sm_type) {
> @@ -47,7 +47,7 @@ xfs_scrub_quota_to_dqtype(
>
> /* Set us up to scrub a quota. */
> int
> -xfs_scrub_setup_quota(
> +xchk_setup_quota(
> struct xfs_scrub_context *sc,
> struct xfs_inode *ip)
> {
> @@ -57,14 +57,14 @@ xfs_scrub_setup_quota(
> if (!XFS_IS_QUOTA_RUNNING(sc->mp) || !XFS_IS_QUOTA_ON(sc->mp))
> return -ENOENT;
>
> - dqtype = xfs_scrub_quota_to_dqtype(sc);
> + dqtype = xchk_quota_to_dqtype(sc);
> if (dqtype == 0)
> return -EINVAL;
> sc->has_quotaofflock = true;
> mutex_lock(&sc->mp->m_quotainfo->qi_quotaofflock);
> if (!xfs_this_quota_on(sc->mp, dqtype))
> return -ENOENT;
> - error = xfs_scrub_setup_fs(sc, ip);
> + error = xchk_setup_fs(sc, ip);
> if (error)
> return error;
> sc->ip = xfs_quota_inode(sc->mp, dqtype);
> @@ -75,19 +75,19 @@ xfs_scrub_setup_quota(
>
> /* Quotas. */
>
> -struct xfs_scrub_quota_info {
> +struct xchk_quota_info {
> struct xfs_scrub_context *sc;
> xfs_dqid_t last_id;
> };
>
> /* Scrub the fields in an individual quota item. */
> STATIC int
> -xfs_scrub_quota_item(
> +xchk_quota_item(
> struct xfs_dquot *dq,
> uint dqtype,
> void *priv)
> {
> - struct xfs_scrub_quota_info *sqi = priv;
> + struct xchk_quota_info *sqi = priv;
> struct xfs_scrub_context *sc = sqi->sc;
> struct xfs_mount *mp = sc->mp;
> struct xfs_disk_dquot *d = &dq->q_core;
> @@ -111,16 +111,16 @@ xfs_scrub_quota_item(
> */
> offset = id / qi->qi_dqperchunk;
> if (id && id <= sqi->last_id)
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
>
> sqi->last_id = id;
>
> /* Did we get the dquot type we wanted? */
> if (dqtype != (d->d_flags & XFS_DQ_ALLTYPES))
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
>
> if (d->d_pad0 != cpu_to_be32(0) || d->d_pad != cpu_to_be16(0))
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
>
> /* Check the limits. */
> bhard = be64_to_cpu(d->d_blk_hardlimit);
> @@ -140,19 +140,19 @@ xfs_scrub_quota_item(
> * the hard limit.
> */
> if (bhard > mp->m_sb.sb_dblocks)
> - xfs_scrub_fblock_set_warning(sc, XFS_DATA_FORK, offset);
> + xchk_fblock_set_warning(sc, XFS_DATA_FORK, offset);
> if (bsoft > bhard)
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
>
> if (ihard > mp->m_maxicount)
> - xfs_scrub_fblock_set_warning(sc, XFS_DATA_FORK, offset);
> + xchk_fblock_set_warning(sc, XFS_DATA_FORK, offset);
> if (isoft > ihard)
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
>
> if (rhard > mp->m_sb.sb_rblocks)
> - xfs_scrub_fblock_set_warning(sc, XFS_DATA_FORK, offset);
> + xchk_fblock_set_warning(sc, XFS_DATA_FORK, offset);
> if (rsoft > rhard)
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
>
> /* Check the resource counts. */
> bcount = be64_to_cpu(d->d_bcount);
> @@ -167,15 +167,15 @@ xfs_scrub_quota_item(
> */
> if (xfs_sb_version_hasreflink(&mp->m_sb)) {
> if (mp->m_sb.sb_dblocks < bcount)
> - xfs_scrub_fblock_set_warning(sc, XFS_DATA_FORK,
> + xchk_fblock_set_warning(sc, XFS_DATA_FORK,
> offset);
> } else {
> if (mp->m_sb.sb_dblocks < bcount)
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK,
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK,
> offset);
> }
> if (icount > fs_icount || rcount > mp->m_sb.sb_rblocks)
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
>
> /*
> * We can violate the hard limits if the admin suddenly sets a
> @@ -183,18 +183,18 @@ xfs_scrub_quota_item(
> * admin review.
> */
> if (id != 0 && bhard != 0 && bcount > bhard)
> - xfs_scrub_fblock_set_warning(sc, XFS_DATA_FORK, offset);
> + xchk_fblock_set_warning(sc, XFS_DATA_FORK, offset);
> if (id != 0 && ihard != 0 && icount > ihard)
> - xfs_scrub_fblock_set_warning(sc, XFS_DATA_FORK, offset);
> + xchk_fblock_set_warning(sc, XFS_DATA_FORK, offset);
> if (id != 0 && rhard != 0 && rcount > rhard)
> - xfs_scrub_fblock_set_warning(sc, XFS_DATA_FORK, offset);
> + xchk_fblock_set_warning(sc, XFS_DATA_FORK, offset);
>
> return 0;
> }
>
> /* Check the quota's data fork. */
> STATIC int
> -xfs_scrub_quota_data_fork(
> +xchk_quota_data_fork(
> struct xfs_scrub_context *sc)
> {
> struct xfs_bmbt_irec irec = { 0 };
> @@ -205,7 +205,7 @@ xfs_scrub_quota_data_fork(
> int error = 0;
>
> /* Invoke the fork scrubber. */
> - error = xfs_scrub_metadata_inode_forks(sc);
> + error = xchk_metadata_inode_forks(sc);
> if (error || (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT))
> return error;
>
> @@ -213,7 +213,7 @@ xfs_scrub_quota_data_fork(
> max_dqid_off = ((xfs_dqid_t)-1) / qi->qi_dqperchunk;
> ifp = XFS_IFORK_PTR(sc->ip, XFS_DATA_FORK);
> for_each_xfs_iext(ifp, &icur, &irec) {
> - if (xfs_scrub_should_terminate(sc, &error))
> + if (xchk_should_terminate(sc, &error))
> break;
> /*
> * delalloc extents or blocks mapped above the highest
> @@ -222,7 +222,7 @@ xfs_scrub_quota_data_fork(
> if (isnullstartblock(irec.br_startblock) ||
> irec.br_startoff > max_dqid_off ||
> irec.br_startoff + irec.br_blockcount - 1 > max_dqid_off) {
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK,
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK,
> irec.br_startoff);
> break;
> }
> @@ -233,19 +233,19 @@ xfs_scrub_quota_data_fork(
>
> /* Scrub all of a quota type's items. */
> int
> -xfs_scrub_quota(
> +xchk_quota(
> struct xfs_scrub_context *sc)
> {
> - struct xfs_scrub_quota_info sqi;
> + struct xchk_quota_info sqi;
> struct xfs_mount *mp = sc->mp;
> struct xfs_quotainfo *qi = mp->m_quotainfo;
> uint dqtype;
> int error = 0;
>
> - dqtype = xfs_scrub_quota_to_dqtype(sc);
> + dqtype = xchk_quota_to_dqtype(sc);
>
> /* Look for problem extents. */
> - error = xfs_scrub_quota_data_fork(sc);
> + error = xchk_quota_data_fork(sc);
> if (error)
> goto out;
> if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
> @@ -260,10 +260,10 @@ xfs_scrub_quota(
> sc->ilock_flags = 0;
> sqi.sc = sc;
> sqi.last_id = 0;
> - error = xfs_qm_dqiterate(mp, dqtype, xfs_scrub_quota_item, &sqi);
> + error = xfs_qm_dqiterate(mp, dqtype, xchk_quota_item, &sqi);
> sc->ilock_flags = XFS_ILOCK_EXCL;
> xfs_ilock(sc->ip, sc->ilock_flags);
> - if (!xfs_scrub_fblock_process_error(sc, XFS_DATA_FORK,
> + if (!xchk_fblock_process_error(sc, XFS_DATA_FORK,
> sqi.last_id * qi->qi_dqperchunk, &error))
> goto out;
>
> diff --git a/fs/xfs/scrub/refcount.c b/fs/xfs/scrub/refcount.c
> index 607a9faa8ecc..274febc49b23 100644
> --- a/fs/xfs/scrub/refcount.c
> +++ b/fs/xfs/scrub/refcount.c
> @@ -28,11 +28,11 @@
> * Set us up to scrub reference count btrees.
> */
> int
> -xfs_scrub_setup_ag_refcountbt(
> +xchk_setup_ag_refcountbt(
> struct xfs_scrub_context *sc,
> struct xfs_inode *ip)
> {
> - return xfs_scrub_setup_ag_btree(sc, ip, false);
> + return xchk_setup_ag_btree(sc, ip, false);
> }
>
> /* Reference count btree scrubber. */
> @@ -73,12 +73,12 @@ xfs_scrub_setup_ag_refcountbt(
> * If the refcount is correct, all the check conditions in the algorithm
> * should always hold true. If not, the refcount is incorrect.
> */
> -struct xfs_scrub_refcnt_frag {
> +struct xchk_refcnt_frag {
> struct list_head list;
> struct xfs_rmap_irec rm;
> };
>
> -struct xfs_scrub_refcnt_check {
> +struct xchk_refcnt_check {
> struct xfs_scrub_context *sc;
> struct list_head fragments;
>
> @@ -99,18 +99,18 @@ struct xfs_scrub_refcnt_check {
> * fragments as the refcountbt says we should have.
> */
> STATIC int
> -xfs_scrub_refcountbt_rmap_check(
> +xchk_refcountbt_rmap_check(
> struct xfs_btree_cur *cur,
> struct xfs_rmap_irec *rec,
> void *priv)
> {
> - struct xfs_scrub_refcnt_check *refchk = priv;
> - struct xfs_scrub_refcnt_frag *frag;
> + struct xchk_refcnt_check *refchk = priv;
> + struct xchk_refcnt_frag *frag;
> xfs_agblock_t rm_last;
> xfs_agblock_t rc_last;
> int error = 0;
>
> - if (xfs_scrub_should_terminate(refchk->sc, &error))
> + if (xchk_should_terminate(refchk->sc, &error))
> return error;
>
> rm_last = rec->rm_startblock + rec->rm_blockcount - 1;
> @@ -118,7 +118,7 @@ xfs_scrub_refcountbt_rmap_check(
>
> /* Confirm that a single-owner refc extent is a CoW stage. */
> if (refchk->refcount == 1 && rec->rm_owner != XFS_RMAP_OWN_COW) {
> - xfs_scrub_btree_xref_set_corrupt(refchk->sc, cur, 0);
> + xchk_btree_xref_set_corrupt(refchk->sc, cur, 0);
> return 0;
> }
>
> @@ -135,7 +135,7 @@ xfs_scrub_refcountbt_rmap_check(
> * is healthy each rmap_irec we see will be in agbno order
> * so we don't need insertion sort here.
> */
> - frag = kmem_alloc(sizeof(struct xfs_scrub_refcnt_frag),
> + frag = kmem_alloc(sizeof(struct xchk_refcnt_frag),
> KM_MAYFAIL);
> if (!frag)
> return -ENOMEM;
> @@ -154,12 +154,12 @@ xfs_scrub_refcountbt_rmap_check(
> * we have a refcountbt error.
> */
> STATIC void
> -xfs_scrub_refcountbt_process_rmap_fragments(
> - struct xfs_scrub_refcnt_check *refchk)
> +xchk_refcountbt_process_rmap_fragments(
> + struct xchk_refcnt_check *refchk)
> {
> struct list_head worklist;
> - struct xfs_scrub_refcnt_frag *frag;
> - struct xfs_scrub_refcnt_frag *n;
> + struct xchk_refcnt_frag *frag;
> + struct xchk_refcnt_frag *n;
> xfs_agblock_t bno;
> xfs_agblock_t rbno;
> xfs_agblock_t next_rbno;
> @@ -277,13 +277,13 @@ xfs_scrub_refcountbt_process_rmap_fragments(
>
> /* Use the rmap entries covering this extent to verify the refcount. */
> STATIC void
> -xfs_scrub_refcountbt_xref_rmap(
> +xchk_refcountbt_xref_rmap(
> struct xfs_scrub_context *sc,
> xfs_agblock_t bno,
> xfs_extlen_t len,
> xfs_nlink_t refcount)
> {
> - struct xfs_scrub_refcnt_check refchk = {
> + struct xchk_refcnt_check refchk = {
> .sc = sc,
> .bno = bno,
> .len = len,
> @@ -292,11 +292,11 @@ xfs_scrub_refcountbt_xref_rmap(
> };
> struct xfs_rmap_irec low;
> struct xfs_rmap_irec high;
> - struct xfs_scrub_refcnt_frag *frag;
> - struct xfs_scrub_refcnt_frag *n;
> + struct xchk_refcnt_frag *frag;
> + struct xchk_refcnt_frag *n;
> int error;
>
> - if (!sc->sa.rmap_cur || xfs_scrub_skip_xref(sc->sm))
> + if (!sc->sa.rmap_cur || xchk_skip_xref(sc->sm))
> return;
>
> /* Cross-reference with the rmapbt to confirm the refcount. */
> @@ -307,13 +307,13 @@ xfs_scrub_refcountbt_xref_rmap(
>
> INIT_LIST_HEAD(&refchk.fragments);
> error = xfs_rmap_query_range(sc->sa.rmap_cur, &low, &high,
> - &xfs_scrub_refcountbt_rmap_check, &refchk);
> - if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.rmap_cur))
> + &xchk_refcountbt_rmap_check, &refchk);
> + if (!xchk_should_check_xref(sc, &error, &sc->sa.rmap_cur))
> goto out_free;
>
> - xfs_scrub_refcountbt_process_rmap_fragments(&refchk);
> + xchk_refcountbt_process_rmap_fragments(&refchk);
> if (refcount != refchk.seen)
> - xfs_scrub_btree_xref_set_corrupt(sc, sc->sa.rmap_cur, 0);
> + xchk_btree_xref_set_corrupt(sc, sc->sa.rmap_cur, 0);
>
> out_free:
> list_for_each_entry_safe(frag, n, &refchk.fragments, list) {
> @@ -324,7 +324,7 @@ xfs_scrub_refcountbt_xref_rmap(
>
> /* Cross-reference with the other btrees. */
> STATIC void
> -xfs_scrub_refcountbt_xref(
> +xchk_refcountbt_xref(
> struct xfs_scrub_context *sc,
> xfs_agblock_t agbno,
> xfs_extlen_t len,
> @@ -333,15 +333,15 @@ xfs_scrub_refcountbt_xref(
> if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
> return;
>
> - xfs_scrub_xref_is_used_space(sc, agbno, len);
> - xfs_scrub_xref_is_not_inode_chunk(sc, agbno, len);
> - xfs_scrub_refcountbt_xref_rmap(sc, agbno, len, refcount);
> + xchk_xref_is_used_space(sc, agbno, len);
> + xchk_xref_is_not_inode_chunk(sc, agbno, len);
> + xchk_refcountbt_xref_rmap(sc, agbno, len, refcount);
> }
>
> /* Scrub a refcountbt record. */
> STATIC int
> -xfs_scrub_refcountbt_rec(
> - struct xfs_scrub_btree *bs,
> +xchk_refcountbt_rec(
> + struct xchk_btree *bs,
> union xfs_btree_rec *rec)
> {
> struct xfs_mount *mp = bs->cur->bc_mp;
> @@ -360,7 +360,7 @@ xfs_scrub_refcountbt_rec(
> /* Only CoW records can have refcount == 1. */
> has_cowflag = (bno & XFS_REFC_COW_START);
> if ((refcount == 1 && !has_cowflag) || (refcount != 1 && has_cowflag))
> - xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
> + xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
> if (has_cowflag)
> (*cow_blocks) += len;
>
> @@ -369,19 +369,19 @@ xfs_scrub_refcountbt_rec(
> if (bno + len <= bno ||
> !xfs_verify_agbno(mp, agno, bno) ||
> !xfs_verify_agbno(mp, agno, bno + len - 1))
> - xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
> + xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
>
> if (refcount == 0)
> - xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
> + xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
>
> - xfs_scrub_refcountbt_xref(bs->sc, bno, len, refcount);
> + xchk_refcountbt_xref(bs->sc, bno, len, refcount);
>
> return error;
> }
>
> /* Make sure we have as many refc blocks as the rmap says. */
> STATIC void
> -xfs_scrub_refcount_xref_rmap(
> +xchk_refcount_xref_rmap(
> struct xfs_scrub_context *sc,
> struct xfs_owner_info *oinfo,
> xfs_filblks_t cow_blocks)
> @@ -390,33 +390,33 @@ xfs_scrub_refcount_xref_rmap(
> xfs_filblks_t blocks;
> int error;
>
> - if (!sc->sa.rmap_cur || xfs_scrub_skip_xref(sc->sm))
> + if (!sc->sa.rmap_cur || xchk_skip_xref(sc->sm))
> return;
>
> /* Check that we saw as many refcbt blocks as the rmap knows about. */
> error = xfs_btree_count_blocks(sc->sa.refc_cur, &refcbt_blocks);
> - if (!xfs_scrub_btree_process_error(sc, sc->sa.refc_cur, 0, &error))
> + if (!xchk_btree_process_error(sc, sc->sa.refc_cur, 0, &error))
> return;
> - error = xfs_scrub_count_rmap_ownedby_ag(sc, sc->sa.rmap_cur, oinfo,
> + error = xchk_count_rmap_ownedby_ag(sc, sc->sa.rmap_cur, oinfo,
> &blocks);
> - if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.rmap_cur))
> + if (!xchk_should_check_xref(sc, &error, &sc->sa.rmap_cur))
> return;
> if (blocks != refcbt_blocks)
> - xfs_scrub_btree_xref_set_corrupt(sc, sc->sa.rmap_cur, 0);
> + xchk_btree_xref_set_corrupt(sc, sc->sa.rmap_cur, 0);
>
> /* Check that we saw as many cow blocks as the rmap knows about. */
> xfs_rmap_ag_owner(oinfo, XFS_RMAP_OWN_COW);
> - error = xfs_scrub_count_rmap_ownedby_ag(sc, sc->sa.rmap_cur, oinfo,
> + error = xchk_count_rmap_ownedby_ag(sc, sc->sa.rmap_cur, oinfo,
> &blocks);
> - if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.rmap_cur))
> + if (!xchk_should_check_xref(sc, &error, &sc->sa.rmap_cur))
> return;
> if (blocks != cow_blocks)
> - xfs_scrub_btree_xref_set_corrupt(sc, sc->sa.rmap_cur, 0);
> + xchk_btree_xref_set_corrupt(sc, sc->sa.rmap_cur, 0);
> }
>
> /* Scrub the refcount btree for some AG. */
> int
> -xfs_scrub_refcountbt(
> +xchk_refcountbt(
> struct xfs_scrub_context *sc)
> {
> struct xfs_owner_info oinfo;
> @@ -424,19 +424,19 @@ xfs_scrub_refcountbt(
> int error;
>
> xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_REFC);
> - error = xfs_scrub_btree(sc, sc->sa.refc_cur, xfs_scrub_refcountbt_rec,
> + error = xchk_btree(sc, sc->sa.refc_cur, xchk_refcountbt_rec,
> &oinfo, &cow_blocks);
> if (error)
> return error;
>
> - xfs_scrub_refcount_xref_rmap(sc, &oinfo, cow_blocks);
> + xchk_refcount_xref_rmap(sc, &oinfo, cow_blocks);
>
> return 0;
> }
>
> /* xref check that a cow staging extent is marked in the refcountbt. */
> void
> -xfs_scrub_xref_is_cow_staging(
> +xchk_xref_is_cow_staging(
> struct xfs_scrub_context *sc,
> xfs_agblock_t agbno,
> xfs_extlen_t len)
> @@ -446,35 +446,35 @@ xfs_scrub_xref_is_cow_staging(
> int has_refcount;
> int error;
>
> - if (!sc->sa.refc_cur || xfs_scrub_skip_xref(sc->sm))
> + if (!sc->sa.refc_cur || xchk_skip_xref(sc->sm))
> return;
>
> /* Find the CoW staging extent. */
> error = xfs_refcount_lookup_le(sc->sa.refc_cur,
> agbno + XFS_REFC_COW_START, &has_refcount);
> - if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.refc_cur))
> + if (!xchk_should_check_xref(sc, &error, &sc->sa.refc_cur))
> return;
> if (!has_refcount) {
> - xfs_scrub_btree_xref_set_corrupt(sc, sc->sa.refc_cur, 0);
> + xchk_btree_xref_set_corrupt(sc, sc->sa.refc_cur, 0);
> return;
> }
>
> error = xfs_refcount_get_rec(sc->sa.refc_cur, &rc, &has_refcount);
> - if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.refc_cur))
> + if (!xchk_should_check_xref(sc, &error, &sc->sa.refc_cur))
> return;
> if (!has_refcount) {
> - xfs_scrub_btree_xref_set_corrupt(sc, sc->sa.refc_cur, 0);
> + xchk_btree_xref_set_corrupt(sc, sc->sa.refc_cur, 0);
> return;
> }
>
> /* CoW flag must be set, refcount must be 1. */
> has_cowflag = (rc.rc_startblock & XFS_REFC_COW_START);
> if (!has_cowflag || rc.rc_refcount != 1)
> - xfs_scrub_btree_xref_set_corrupt(sc, sc->sa.refc_cur, 0);
> + xchk_btree_xref_set_corrupt(sc, sc->sa.refc_cur, 0);
>
> /* Must be at least as long as what was passed in */
> if (rc.rc_blockcount < len)
> - xfs_scrub_btree_xref_set_corrupt(sc, sc->sa.refc_cur, 0);
> + xchk_btree_xref_set_corrupt(sc, sc->sa.refc_cur, 0);
> }
>
> /*
> @@ -482,7 +482,7 @@ xfs_scrub_xref_is_cow_staging(
> * can have multiple owners.
> */
> void
> -xfs_scrub_xref_is_not_shared(
> +xchk_xref_is_not_shared(
> struct xfs_scrub_context *sc,
> xfs_agblock_t agbno,
> xfs_extlen_t len)
> @@ -490,12 +490,12 @@ xfs_scrub_xref_is_not_shared(
> bool shared;
> int error;
>
> - if (!sc->sa.refc_cur || xfs_scrub_skip_xref(sc->sm))
> + if (!sc->sa.refc_cur || xchk_skip_xref(sc->sm))
> return;
>
> error = xfs_refcount_has_record(sc->sa.refc_cur, agbno, len, &shared);
> - if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.refc_cur))
> + if (!xchk_should_check_xref(sc, &error, &sc->sa.refc_cur))
> return;
> if (shared)
> - xfs_scrub_btree_xref_set_corrupt(sc, sc->sa.refc_cur, 0);
> + xchk_btree_xref_set_corrupt(sc, sc->sa.refc_cur, 0);
> }
> diff --git a/fs/xfs/scrub/repair.c b/fs/xfs/scrub/repair.c
> index ea39e2bdc96a..5eccd89c64a8 100644
> --- a/fs/xfs/scrub/repair.c
> +++ b/fs/xfs/scrub/repair.c
> @@ -50,7 +50,7 @@ xfs_repair_attempt(
>
> trace_xfs_repair_attempt(ip, sc->sm, error);
>
> - xfs_scrub_ag_btcur_free(&sc->sa);
> + xchk_ag_btcur_free(&sc->sa);
>
> /* Repair whatever's broken. */
> ASSERT(sc->ops->repair);
> @@ -110,7 +110,7 @@ xfs_repair_probe(
> {
> int error = 0;
>
> - if (xfs_scrub_should_terminate(sc, &error))
> + if (xchk_should_terminate(sc, &error))
> return error;
>
> return 0;
> diff --git a/fs/xfs/scrub/rmap.c b/fs/xfs/scrub/rmap.c
> index c6d763236ba7..4b75fc2f31f3 100644
> --- a/fs/xfs/scrub/rmap.c
> +++ b/fs/xfs/scrub/rmap.c
> @@ -29,18 +29,18 @@
> * Set us up to scrub reverse mapping btrees.
> */
> int
> -xfs_scrub_setup_ag_rmapbt(
> +xchk_setup_ag_rmapbt(
> struct xfs_scrub_context *sc,
> struct xfs_inode *ip)
> {
> - return xfs_scrub_setup_ag_btree(sc, ip, false);
> + return xchk_setup_ag_btree(sc, ip, false);
> }
>
> /* Reverse-mapping scrubber. */
>
> /* Cross-reference a rmap against the refcount btree. */
> STATIC void
> -xfs_scrub_rmapbt_xref_refc(
> +xchk_rmapbt_xref_refc(
> struct xfs_scrub_context *sc,
> struct xfs_rmap_irec *irec)
> {
> @@ -52,7 +52,7 @@ xfs_scrub_rmapbt_xref_refc(
> bool is_unwritten;
> int error;
>
> - if (!sc->sa.refc_cur || xfs_scrub_skip_xref(sc->sm))
> + if (!sc->sa.refc_cur || xchk_skip_xref(sc->sm))
> return;
>
> non_inode = XFS_RMAP_NON_INODE_OWNER(irec->rm_owner);
> @@ -63,15 +63,15 @@ xfs_scrub_rmapbt_xref_refc(
> /* If this is shared, must be a data fork extent. */
> error = xfs_refcount_find_shared(sc->sa.refc_cur, irec->rm_startblock,
> irec->rm_blockcount, &fbno, &flen, false);
> - if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.refc_cur))
> + if (!xchk_should_check_xref(sc, &error, &sc->sa.refc_cur))
> return;
> if (flen != 0 && (non_inode || is_attr || is_bmbt || is_unwritten))
> - xfs_scrub_btree_xref_set_corrupt(sc, sc->sa.refc_cur, 0);
> + xchk_btree_xref_set_corrupt(sc, sc->sa.refc_cur, 0);
> }
>
> /* Cross-reference with the other btrees. */
> STATIC void
> -xfs_scrub_rmapbt_xref(
> +xchk_rmapbt_xref(
> struct xfs_scrub_context *sc,
> struct xfs_rmap_irec *irec)
> {
> @@ -81,22 +81,22 @@ xfs_scrub_rmapbt_xref(
> if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
> return;
>
> - xfs_scrub_xref_is_used_space(sc, agbno, len);
> + xchk_xref_is_used_space(sc, agbno, len);
> if (irec->rm_owner == XFS_RMAP_OWN_INODES)
> - xfs_scrub_xref_is_inode_chunk(sc, agbno, len);
> + xchk_xref_is_inode_chunk(sc, agbno, len);
> else
> - xfs_scrub_xref_is_not_inode_chunk(sc, agbno, len);
> + xchk_xref_is_not_inode_chunk(sc, agbno, len);
> if (irec->rm_owner == XFS_RMAP_OWN_COW)
> - xfs_scrub_xref_is_cow_staging(sc, irec->rm_startblock,
> + xchk_xref_is_cow_staging(sc, irec->rm_startblock,
> irec->rm_blockcount);
> else
> - xfs_scrub_rmapbt_xref_refc(sc, irec);
> + xchk_rmapbt_xref_refc(sc, irec);
> }
>
> /* Scrub an rmapbt record. */
> STATIC int
> -xfs_scrub_rmapbt_rec(
> - struct xfs_scrub_btree *bs,
> +xchk_rmapbt_rec(
> + struct xchk_btree *bs,
> union xfs_btree_rec *rec)
> {
> struct xfs_mount *mp = bs->cur->bc_mp;
> @@ -109,12 +109,12 @@ xfs_scrub_rmapbt_rec(
> int error;
>
> error = xfs_rmap_btrec_to_irec(rec, &irec);
> - if (!xfs_scrub_btree_process_error(bs->sc, bs->cur, 0, &error))
> + if (!xchk_btree_process_error(bs->sc, bs->cur, 0, &error))
> goto out;
>
> /* Check extent. */
> if (irec.rm_startblock + irec.rm_blockcount <= irec.rm_startblock)
> - xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
> + xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
>
> if (irec.rm_owner == XFS_RMAP_OWN_FS) {
> /*
> @@ -124,7 +124,7 @@ xfs_scrub_rmapbt_rec(
> */
> if (irec.rm_startblock != 0 ||
> irec.rm_blockcount != XFS_AGFL_BLOCK(mp) + 1)
> - xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
> + xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
> } else {
> /*
> * Otherwise we must point somewhere past the static metadata
> @@ -133,7 +133,7 @@ xfs_scrub_rmapbt_rec(
> if (!xfs_verify_agbno(mp, agno, irec.rm_startblock) ||
> !xfs_verify_agbno(mp, agno, irec.rm_startblock +
> irec.rm_blockcount - 1))
> - xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
> + xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
> }
>
> /* Check flags. */
> @@ -143,47 +143,47 @@ xfs_scrub_rmapbt_rec(
> is_unwritten = irec.rm_flags & XFS_RMAP_UNWRITTEN;
>
> if (is_bmbt && irec.rm_offset != 0)
> - xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
> + xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
>
> if (non_inode && irec.rm_offset != 0)
> - xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
> + xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
>
> if (is_unwritten && (is_bmbt || non_inode || is_attr))
> - xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
> + xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
>
> if (non_inode && (is_bmbt || is_unwritten || is_attr))
> - xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
> + xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
>
> if (!non_inode) {
> if (!xfs_verify_ino(mp, irec.rm_owner))
> - xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
> + xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
> } else {
> /* Non-inode owner within the magic values? */
> if (irec.rm_owner <= XFS_RMAP_OWN_MIN ||
> irec.rm_owner > XFS_RMAP_OWN_FS)
> - xfs_scrub_btree_set_corrupt(bs->sc, bs->cur, 0);
> + xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
> }
>
> - xfs_scrub_rmapbt_xref(bs->sc, &irec);
> + xchk_rmapbt_xref(bs->sc, &irec);
> out:
> return error;
> }
>
> /* Scrub the rmap btree for some AG. */
> int
> -xfs_scrub_rmapbt(
> +xchk_rmapbt(
> struct xfs_scrub_context *sc)
> {
> struct xfs_owner_info oinfo;
>
> xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_AG);
> - return xfs_scrub_btree(sc, sc->sa.rmap_cur, xfs_scrub_rmapbt_rec,
> + return xchk_btree(sc, sc->sa.rmap_cur, xchk_rmapbt_rec,
> &oinfo, NULL);
> }
>
> /* xref check that the extent is owned by a given owner */
> static inline void
> -xfs_scrub_xref_check_owner(
> +xchk_xref_check_owner(
> struct xfs_scrub_context *sc,
> xfs_agblock_t bno,
> xfs_extlen_t len,
> @@ -193,42 +193,42 @@ xfs_scrub_xref_check_owner(
> bool has_rmap;
> int error;
>
> - if (!sc->sa.rmap_cur || xfs_scrub_skip_xref(sc->sm))
> + if (!sc->sa.rmap_cur || xchk_skip_xref(sc->sm))
> return;
>
> error = xfs_rmap_record_exists(sc->sa.rmap_cur, bno, len, oinfo,
> &has_rmap);
> - if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.rmap_cur))
> + if (!xchk_should_check_xref(sc, &error, &sc->sa.rmap_cur))
> return;
> if (has_rmap != should_have_rmap)
> - xfs_scrub_btree_xref_set_corrupt(sc, sc->sa.rmap_cur, 0);
> + xchk_btree_xref_set_corrupt(sc, sc->sa.rmap_cur, 0);
> }
>
> /* xref check that the extent is owned by a given owner */
> void
> -xfs_scrub_xref_is_owned_by(
> +xchk_xref_is_owned_by(
> struct xfs_scrub_context *sc,
> xfs_agblock_t bno,
> xfs_extlen_t len,
> struct xfs_owner_info *oinfo)
> {
> - xfs_scrub_xref_check_owner(sc, bno, len, oinfo, true);
> + xchk_xref_check_owner(sc, bno, len, oinfo, true);
> }
>
> /* xref check that the extent is not owned by a given owner */
> void
> -xfs_scrub_xref_is_not_owned_by(
> +xchk_xref_is_not_owned_by(
> struct xfs_scrub_context *sc,
> xfs_agblock_t bno,
> xfs_extlen_t len,
> struct xfs_owner_info *oinfo)
> {
> - xfs_scrub_xref_check_owner(sc, bno, len, oinfo, false);
> + xchk_xref_check_owner(sc, bno, len, oinfo, false);
> }
>
> /* xref check that the extent has no reverse mapping at all */
> void
> -xfs_scrub_xref_has_no_owner(
> +xchk_xref_has_no_owner(
> struct xfs_scrub_context *sc,
> xfs_agblock_t bno,
> xfs_extlen_t len)
> @@ -236,12 +236,12 @@ xfs_scrub_xref_has_no_owner(
> bool has_rmap;
> int error;
>
> - if (!sc->sa.rmap_cur || xfs_scrub_skip_xref(sc->sm))
> + if (!sc->sa.rmap_cur || xchk_skip_xref(sc->sm))
> return;
>
> error = xfs_rmap_has_record(sc->sa.rmap_cur, bno, len, &has_rmap);
> - if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.rmap_cur))
> + if (!xchk_should_check_xref(sc, &error, &sc->sa.rmap_cur))
> return;
> if (has_rmap)
> - xfs_scrub_btree_xref_set_corrupt(sc, sc->sa.rmap_cur, 0);
> + xchk_btree_xref_set_corrupt(sc, sc->sa.rmap_cur, 0);
> }
> diff --git a/fs/xfs/scrub/rtbitmap.c b/fs/xfs/scrub/rtbitmap.c
> index 1f86e02a07ca..3f0fc83562ae 100644
> --- a/fs/xfs/scrub/rtbitmap.c
> +++ b/fs/xfs/scrub/rtbitmap.c
> @@ -25,13 +25,13 @@
>
> /* Set us up with the realtime metadata locked. */
> int
> -xfs_scrub_setup_rt(
> +xchk_setup_rt(
> struct xfs_scrub_context *sc,
> struct xfs_inode *ip)
> {
> int error;
>
> - error = xfs_scrub_setup_fs(sc, ip);
> + error = xchk_setup_fs(sc, ip);
> if (error)
> return error;
>
> @@ -46,7 +46,7 @@ xfs_scrub_setup_rt(
>
> /* Scrub a free extent record from the realtime bitmap. */
> STATIC int
> -xfs_scrub_rtbitmap_rec(
> +xchk_rtbitmap_rec(
> struct xfs_trans *tp,
> struct xfs_rtalloc_rec *rec,
> void *priv)
> @@ -61,24 +61,24 @@ xfs_scrub_rtbitmap_rec(
> if (startblock + blockcount <= startblock ||
> !xfs_verify_rtbno(sc->mp, startblock) ||
> !xfs_verify_rtbno(sc->mp, startblock + blockcount - 1))
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
> return 0;
> }
>
> /* Scrub the realtime bitmap. */
> int
> -xfs_scrub_rtbitmap(
> +xchk_rtbitmap(
> struct xfs_scrub_context *sc)
> {
> int error;
>
> /* Invoke the fork scrubber. */
> - error = xfs_scrub_metadata_inode_forks(sc);
> + error = xchk_metadata_inode_forks(sc);
> if (error || (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT))
> return error;
>
> - error = xfs_rtalloc_query_all(sc->tp, xfs_scrub_rtbitmap_rec, sc);
> - if (!xfs_scrub_fblock_process_error(sc, XFS_DATA_FORK, 0, &error))
> + error = xfs_rtalloc_query_all(sc->tp, xchk_rtbitmap_rec, sc);
> + if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, 0, &error))
> goto out;
>
> out:
> @@ -87,7 +87,7 @@ xfs_scrub_rtbitmap(
>
> /* Scrub the realtime summary. */
> int
> -xfs_scrub_rtsummary(
> +xchk_rtsummary(
> struct xfs_scrub_context *sc)
> {
> struct xfs_inode *rsumip = sc->mp->m_rsumip;
> @@ -107,12 +107,12 @@ xfs_scrub_rtsummary(
> xfs_ilock(sc->ip, sc->ilock_flags);
>
> /* Invoke the fork scrubber. */
> - error = xfs_scrub_metadata_inode_forks(sc);
> + error = xchk_metadata_inode_forks(sc);
> if (error || (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT))
> goto out;
>
> /* XXX: implement this some day */
> - xfs_scrub_set_incomplete(sc);
> + xchk_set_incomplete(sc);
> out:
> /* Switch back to the rtbitmap inode and lock flags. */
> xfs_iunlock(sc->ip, sc->ilock_flags);
> @@ -124,7 +124,7 @@ xfs_scrub_rtsummary(
>
> /* xref check that the extent is not free in the rtbitmap */
> void
> -xfs_scrub_xref_is_used_rt_space(
> +xchk_xref_is_used_rt_space(
> struct xfs_scrub_context *sc,
> xfs_rtblock_t fsbno,
> xfs_extlen_t len)
> @@ -135,7 +135,7 @@ xfs_scrub_xref_is_used_rt_space(
> bool is_free;
> int error;
>
> - if (xfs_scrub_skip_xref(sc->sm))
> + if (xchk_skip_xref(sc->sm))
> return;
>
> startext = fsbno;
> @@ -147,10 +147,10 @@ xfs_scrub_xref_is_used_rt_space(
> xfs_ilock(sc->mp->m_rbmip, XFS_ILOCK_SHARED | XFS_ILOCK_RTBITMAP);
> error = xfs_rtalloc_extent_is_free(sc->mp, sc->tp, startext, extcount,
> &is_free);
> - if (!xfs_scrub_should_check_xref(sc, &error, NULL))
> + if (!xchk_should_check_xref(sc, &error, NULL))
> goto out_unlock;
> if (is_free)
> - xfs_scrub_ino_xref_set_corrupt(sc, sc->mp->m_rbmip->i_ino);
> + xchk_ino_xref_set_corrupt(sc, sc->mp->m_rbmip->i_ino);
> out_unlock:
> xfs_iunlock(sc->mp->m_rbmip, XFS_ILOCK_SHARED | XFS_ILOCK_RTBITMAP);
> }
> diff --git a/fs/xfs/scrub/scrub.c b/fs/xfs/scrub/scrub.c
> index 58ae76b3a421..ead97ab91a3c 100644
> --- a/fs/xfs/scrub/scrub.c
> +++ b/fs/xfs/scrub/scrub.c
> @@ -131,6 +131,12 @@
> * optimize the structure so that the rebuild knows what to do. The
> * second check evaluates the completeness of the repair; that is what
> * is reported to userspace.
> + *
> + * A quick note on symbol prefixes:
> + * - "xfs_" are general XFS symbols.
> + * - "xchk_" are symbols related to metadata checking.
> + * - "xrep_" are symbols related to metadata repair.
> + * - "xfs_scrub_" are symbols that tie online fsck to the rest of XFS.
> */
>
> /*
> @@ -144,12 +150,12 @@
> * supported by the running kernel.
> */
> static int
> -xfs_scrub_probe(
> +xchk_probe(
> struct xfs_scrub_context *sc)
> {
> int error = 0;
>
> - if (xfs_scrub_should_terminate(sc, &error))
> + if (xchk_should_terminate(sc, &error))
> return error;
>
> return 0;
> @@ -159,12 +165,12 @@ xfs_scrub_probe(
>
> /* Free all the resources and finish the transactions. */
> STATIC int
> -xfs_scrub_teardown(
> +xchk_teardown(
> struct xfs_scrub_context *sc,
> struct xfs_inode *ip_in,
> int error)
> {
> - xfs_scrub_ag_free(sc, &sc->sa);
> + xchk_ag_free(sc, &sc->sa);
> if (sc->tp) {
> if (error == 0 && (sc->sm->sm_flags & XFS_SCRUB_IFLAG_REPAIR))
> error = xfs_trans_commit(sc->tp);
> @@ -191,165 +197,165 @@ xfs_scrub_teardown(
>
> /* Scrubbing dispatch. */
>
> -static const struct xfs_scrub_meta_ops meta_scrub_ops[] = {
> +static const struct xchk_meta_ops meta_scrub_ops[] = {
> [XFS_SCRUB_TYPE_PROBE] = { /* ioctl presence test */
> .type = ST_NONE,
> - .setup = xfs_scrub_setup_fs,
> - .scrub = xfs_scrub_probe,
> + .setup = xchk_setup_fs,
> + .scrub = xchk_probe,
> .repair = xfs_repair_probe,
> },
> [XFS_SCRUB_TYPE_SB] = { /* superblock */
> .type = ST_PERAG,
> - .setup = xfs_scrub_setup_fs,
> - .scrub = xfs_scrub_superblock,
> + .setup = xchk_setup_fs,
> + .scrub = xchk_superblock,
> .repair = xfs_repair_superblock,
> },
> [XFS_SCRUB_TYPE_AGF] = { /* agf */
> .type = ST_PERAG,
> - .setup = xfs_scrub_setup_fs,
> - .scrub = xfs_scrub_agf,
> + .setup = xchk_setup_fs,
> + .scrub = xchk_agf,
> .repair = xfs_repair_notsupported,
> },
> [XFS_SCRUB_TYPE_AGFL]= { /* agfl */
> .type = ST_PERAG,
> - .setup = xfs_scrub_setup_fs,
> - .scrub = xfs_scrub_agfl,
> + .setup = xchk_setup_fs,
> + .scrub = xchk_agfl,
> .repair = xfs_repair_notsupported,
> },
> [XFS_SCRUB_TYPE_AGI] = { /* agi */
> .type = ST_PERAG,
> - .setup = xfs_scrub_setup_fs,
> - .scrub = xfs_scrub_agi,
> + .setup = xchk_setup_fs,
> + .scrub = xchk_agi,
> .repair = xfs_repair_notsupported,
> },
> [XFS_SCRUB_TYPE_BNOBT] = { /* bnobt */
> .type = ST_PERAG,
> - .setup = xfs_scrub_setup_ag_allocbt,
> - .scrub = xfs_scrub_bnobt,
> + .setup = xchk_setup_ag_allocbt,
> + .scrub = xchk_bnobt,
> .repair = xfs_repair_notsupported,
> },
> [XFS_SCRUB_TYPE_CNTBT] = { /* cntbt */
> .type = ST_PERAG,
> - .setup = xfs_scrub_setup_ag_allocbt,
> - .scrub = xfs_scrub_cntbt,
> + .setup = xchk_setup_ag_allocbt,
> + .scrub = xchk_cntbt,
> .repair = xfs_repair_notsupported,
> },
> [XFS_SCRUB_TYPE_INOBT] = { /* inobt */
> .type = ST_PERAG,
> - .setup = xfs_scrub_setup_ag_iallocbt,
> - .scrub = xfs_scrub_inobt,
> + .setup = xchk_setup_ag_iallocbt,
> + .scrub = xchk_inobt,
> .repair = xfs_repair_notsupported,
> },
> [XFS_SCRUB_TYPE_FINOBT] = { /* finobt */
> .type = ST_PERAG,
> - .setup = xfs_scrub_setup_ag_iallocbt,
> - .scrub = xfs_scrub_finobt,
> + .setup = xchk_setup_ag_iallocbt,
> + .scrub = xchk_finobt,
> .has = xfs_sb_version_hasfinobt,
> .repair = xfs_repair_notsupported,
> },
> [XFS_SCRUB_TYPE_RMAPBT] = { /* rmapbt */
> .type = ST_PERAG,
> - .setup = xfs_scrub_setup_ag_rmapbt,
> - .scrub = xfs_scrub_rmapbt,
> + .setup = xchk_setup_ag_rmapbt,
> + .scrub = xchk_rmapbt,
> .has = xfs_sb_version_hasrmapbt,
> .repair = xfs_repair_notsupported,
> },
> [XFS_SCRUB_TYPE_REFCNTBT] = { /* refcountbt */
> .type = ST_PERAG,
> - .setup = xfs_scrub_setup_ag_refcountbt,
> - .scrub = xfs_scrub_refcountbt,
> + .setup = xchk_setup_ag_refcountbt,
> + .scrub = xchk_refcountbt,
> .has = xfs_sb_version_hasreflink,
> .repair = xfs_repair_notsupported,
> },
> [XFS_SCRUB_TYPE_INODE] = { /* inode record */
> .type = ST_INODE,
> - .setup = xfs_scrub_setup_inode,
> - .scrub = xfs_scrub_inode,
> + .setup = xchk_setup_inode,
> + .scrub = xchk_inode,
> .repair = xfs_repair_notsupported,
> },
> [XFS_SCRUB_TYPE_BMBTD] = { /* inode data fork */
> .type = ST_INODE,
> - .setup = xfs_scrub_setup_inode_bmap,
> - .scrub = xfs_scrub_bmap_data,
> + .setup = xchk_setup_inode_bmap,
> + .scrub = xchk_bmap_data,
> .repair = xfs_repair_notsupported,
> },
> [XFS_SCRUB_TYPE_BMBTA] = { /* inode attr fork */
> .type = ST_INODE,
> - .setup = xfs_scrub_setup_inode_bmap,
> - .scrub = xfs_scrub_bmap_attr,
> + .setup = xchk_setup_inode_bmap,
> + .scrub = xchk_bmap_attr,
> .repair = xfs_repair_notsupported,
> },
> [XFS_SCRUB_TYPE_BMBTC] = { /* inode CoW fork */
> .type = ST_INODE,
> - .setup = xfs_scrub_setup_inode_bmap,
> - .scrub = xfs_scrub_bmap_cow,
> + .setup = xchk_setup_inode_bmap,
> + .scrub = xchk_bmap_cow,
> .repair = xfs_repair_notsupported,
> },
> [XFS_SCRUB_TYPE_DIR] = { /* directory */
> .type = ST_INODE,
> - .setup = xfs_scrub_setup_directory,
> - .scrub = xfs_scrub_directory,
> + .setup = xchk_setup_directory,
> + .scrub = xchk_directory,
> .repair = xfs_repair_notsupported,
> },
> [XFS_SCRUB_TYPE_XATTR] = { /* extended attributes */
> .type = ST_INODE,
> - .setup = xfs_scrub_setup_xattr,
> - .scrub = xfs_scrub_xattr,
> + .setup = xchk_setup_xattr,
> + .scrub = xchk_xattr,
> .repair = xfs_repair_notsupported,
> },
> [XFS_SCRUB_TYPE_SYMLINK] = { /* symbolic link */
> .type = ST_INODE,
> - .setup = xfs_scrub_setup_symlink,
> - .scrub = xfs_scrub_symlink,
> + .setup = xchk_setup_symlink,
> + .scrub = xchk_symlink,
> .repair = xfs_repair_notsupported,
> },
> [XFS_SCRUB_TYPE_PARENT] = { /* parent pointers */
> .type = ST_INODE,
> - .setup = xfs_scrub_setup_parent,
> - .scrub = xfs_scrub_parent,
> + .setup = xchk_setup_parent,
> + .scrub = xchk_parent,
> .repair = xfs_repair_notsupported,
> },
> [XFS_SCRUB_TYPE_RTBITMAP] = { /* realtime bitmap */
> .type = ST_FS,
> - .setup = xfs_scrub_setup_rt,
> - .scrub = xfs_scrub_rtbitmap,
> + .setup = xchk_setup_rt,
> + .scrub = xchk_rtbitmap,
> .has = xfs_sb_version_hasrealtime,
> .repair = xfs_repair_notsupported,
> },
> [XFS_SCRUB_TYPE_RTSUM] = { /* realtime summary */
> .type = ST_FS,
> - .setup = xfs_scrub_setup_rt,
> - .scrub = xfs_scrub_rtsummary,
> + .setup = xchk_setup_rt,
> + .scrub = xchk_rtsummary,
> .has = xfs_sb_version_hasrealtime,
> .repair = xfs_repair_notsupported,
> },
> [XFS_SCRUB_TYPE_UQUOTA] = { /* user quota */
> .type = ST_FS,
> - .setup = xfs_scrub_setup_quota,
> - .scrub = xfs_scrub_quota,
> + .setup = xchk_setup_quota,
> + .scrub = xchk_quota,
> .repair = xfs_repair_notsupported,
> },
> [XFS_SCRUB_TYPE_GQUOTA] = { /* group quota */
> .type = ST_FS,
> - .setup = xfs_scrub_setup_quota,
> - .scrub = xfs_scrub_quota,
> + .setup = xchk_setup_quota,
> + .scrub = xchk_quota,
> .repair = xfs_repair_notsupported,
> },
> [XFS_SCRUB_TYPE_PQUOTA] = { /* project quota */
> .type = ST_FS,
> - .setup = xfs_scrub_setup_quota,
> - .scrub = xfs_scrub_quota,
> + .setup = xchk_setup_quota,
> + .scrub = xchk_quota,
> .repair = xfs_repair_notsupported,
> },
> };
>
> /* This isn't a stable feature, warn once per day. */
> static inline void
> -xfs_scrub_experimental_warning(
> +xchk_experimental_warning(
> struct xfs_mount *mp)
> {
> static struct ratelimit_state scrub_warning = RATELIMIT_STATE_INIT(
> - "xfs_scrub_warning", 86400 * HZ, 1);
> + "xchk_warning", 86400 * HZ, 1);
> ratelimit_set_flags(&scrub_warning, RATELIMIT_MSG_ON_RELEASE);
>
> if (__ratelimit(&scrub_warning))
> @@ -358,12 +364,12 @@ xfs_scrub_experimental_warning(
> }
>
> static int
> -xfs_scrub_validate_inputs(
> +xchk_validate_inputs(
> struct xfs_mount *mp,
> struct xfs_scrub_metadata *sm)
> {
> int error;
> - const struct xfs_scrub_meta_ops *ops;
> + const struct xchk_meta_ops *ops;
>
> error = -EINVAL;
> /* Check our inputs. */
> @@ -441,7 +447,7 @@ xfs_scrub_validate_inputs(
> }
>
> #ifdef CONFIG_XFS_ONLINE_REPAIR
> -static inline void xfs_scrub_postmortem(struct xfs_scrub_context *sc)
> +static inline void xchk_postmortem(struct xfs_scrub_context *sc)
> {
> /*
> * Userspace asked us to repair something, we repaired it, rescanned
> @@ -454,7 +460,7 @@ static inline void xfs_scrub_postmortem(struct xfs_scrub_context *sc)
> xfs_repair_failure(sc->mp);
> }
> #else
> -static inline void xfs_scrub_postmortem(struct xfs_scrub_context *sc)
> +static inline void xchk_postmortem(struct xfs_scrub_context *sc)
> {
> /*
> * Userspace asked us to scrub something, it's broken, and we have no
> @@ -480,9 +486,9 @@ xfs_scrub_metadata(
> int error = 0;
>
> BUILD_BUG_ON(sizeof(meta_scrub_ops) !=
> - (sizeof(struct xfs_scrub_meta_ops) * XFS_SCRUB_TYPE_NR));
> + (sizeof(struct xchk_meta_ops) * XFS_SCRUB_TYPE_NR));
>
> - trace_xfs_scrub_start(ip, sm, error);
> + trace_xchk_start(ip, sm, error);
>
> /* Forbidden if we are shut down or mounted norecovery. */
> error = -ESHUTDOWN;
> @@ -492,11 +498,11 @@ xfs_scrub_metadata(
> if (mp->m_flags & XFS_MOUNT_NORECOVERY)
> goto out;
>
> - error = xfs_scrub_validate_inputs(mp, sm);
> + error = xchk_validate_inputs(mp, sm);
> if (error)
> goto out;
>
> - xfs_scrub_experimental_warning(mp);
> + xchk_experimental_warning(mp);
>
> retry_op:
> /* Set up for the operation. */
> @@ -518,7 +524,7 @@ xfs_scrub_metadata(
> * Tear down everything we hold, then set up again with
> * preparation for worst-case scenarios.
> */
> - error = xfs_scrub_teardown(&sc, ip, 0);
> + error = xchk_teardown(&sc, ip, 0);
> if (error)
> goto out;
> try_harder = true;
> @@ -553,7 +559,7 @@ xfs_scrub_metadata(
> if (error == -EAGAIN) {
> if (sc.try_harder)
> try_harder = true;
> - error = xfs_scrub_teardown(&sc, ip, 0);
> + error = xchk_teardown(&sc, ip, 0);
> if (error) {
> xfs_repair_failure(mp);
> goto out;
> @@ -563,11 +569,11 @@ xfs_scrub_metadata(
> }
>
> out_nofix:
> - xfs_scrub_postmortem(&sc);
> + xchk_postmortem(&sc);
> out_teardown:
> - error = xfs_scrub_teardown(&sc, ip, error);
> + error = xchk_teardown(&sc, ip, error);
> out:
> - trace_xfs_scrub_done(ip, sm, error);
> + trace_xchk_done(ip, sm, error);
> if (error == -EFSCORRUPTED || error == -EFSBADCRC) {
> sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT;
> error = 0;
> diff --git a/fs/xfs/scrub/scrub.h b/fs/xfs/scrub/scrub.h
> index b295edd5fc0e..0f59a47c4bb0 100644
> --- a/fs/xfs/scrub/scrub.h
> +++ b/fs/xfs/scrub/scrub.h
> @@ -9,14 +9,14 @@
> struct xfs_scrub_context;
>
> /* Type info and names for the scrub types. */
> -enum xfs_scrub_type {
> +enum xchk_type {
> ST_NONE = 1, /* disabled */
> ST_PERAG, /* per-AG metadata */
> ST_FS, /* per-FS metadata */
> ST_INODE, /* per-inode metadata */
> };
>
> -struct xfs_scrub_meta_ops {
> +struct xchk_meta_ops {
> /* Acquire whatever resources are needed for the operation. */
> int (*setup)(struct xfs_scrub_context *,
> struct xfs_inode *);
> @@ -31,11 +31,11 @@ struct xfs_scrub_meta_ops {
> bool (*has)(struct xfs_sb *);
>
> /* type describing required/allowed inputs */
> - enum xfs_scrub_type type;
> + enum xchk_type type;
> };
>
> /* Buffer pointers and btree cursors for an entire AG. */
> -struct xfs_scrub_ag {
> +struct xchk_ag {
> xfs_agnumber_t agno;
> struct xfs_perag *pag;
>
> @@ -57,7 +57,7 @@ struct xfs_scrub_context {
> /* General scrub state. */
> struct xfs_mount *mp;
> struct xfs_scrub_metadata *sm;
> - const struct xfs_scrub_meta_ops *ops;
> + const struct xchk_meta_ops *ops;
> struct xfs_trans *tp;
> struct xfs_inode *ip;
> void *buf;
> @@ -66,78 +66,78 @@ struct xfs_scrub_context {
> bool has_quotaofflock;
>
> /* State tracking for single-AG operations. */
> - struct xfs_scrub_ag sa;
> + struct xchk_ag sa;
> };
>
> /* Metadata scrubbers */
> -int xfs_scrub_tester(struct xfs_scrub_context *sc);
> -int xfs_scrub_superblock(struct xfs_scrub_context *sc);
> -int xfs_scrub_agf(struct xfs_scrub_context *sc);
> -int xfs_scrub_agfl(struct xfs_scrub_context *sc);
> -int xfs_scrub_agi(struct xfs_scrub_context *sc);
> -int xfs_scrub_bnobt(struct xfs_scrub_context *sc);
> -int xfs_scrub_cntbt(struct xfs_scrub_context *sc);
> -int xfs_scrub_inobt(struct xfs_scrub_context *sc);
> -int xfs_scrub_finobt(struct xfs_scrub_context *sc);
> -int xfs_scrub_rmapbt(struct xfs_scrub_context *sc);
> -int xfs_scrub_refcountbt(struct xfs_scrub_context *sc);
> -int xfs_scrub_inode(struct xfs_scrub_context *sc);
> -int xfs_scrub_bmap_data(struct xfs_scrub_context *sc);
> -int xfs_scrub_bmap_attr(struct xfs_scrub_context *sc);
> -int xfs_scrub_bmap_cow(struct xfs_scrub_context *sc);
> -int xfs_scrub_directory(struct xfs_scrub_context *sc);
> -int xfs_scrub_xattr(struct xfs_scrub_context *sc);
> -int xfs_scrub_symlink(struct xfs_scrub_context *sc);
> -int xfs_scrub_parent(struct xfs_scrub_context *sc);
> +int xchk_tester(struct xfs_scrub_context *sc);
> +int xchk_superblock(struct xfs_scrub_context *sc);
> +int xchk_agf(struct xfs_scrub_context *sc);
> +int xchk_agfl(struct xfs_scrub_context *sc);
> +int xchk_agi(struct xfs_scrub_context *sc);
> +int xchk_bnobt(struct xfs_scrub_context *sc);
> +int xchk_cntbt(struct xfs_scrub_context *sc);
> +int xchk_inobt(struct xfs_scrub_context *sc);
> +int xchk_finobt(struct xfs_scrub_context *sc);
> +int xchk_rmapbt(struct xfs_scrub_context *sc);
> +int xchk_refcountbt(struct xfs_scrub_context *sc);
> +int xchk_inode(struct xfs_scrub_context *sc);
> +int xchk_bmap_data(struct xfs_scrub_context *sc);
> +int xchk_bmap_attr(struct xfs_scrub_context *sc);
> +int xchk_bmap_cow(struct xfs_scrub_context *sc);
> +int xchk_directory(struct xfs_scrub_context *sc);
> +int xchk_xattr(struct xfs_scrub_context *sc);
> +int xchk_symlink(struct xfs_scrub_context *sc);
> +int xchk_parent(struct xfs_scrub_context *sc);
> #ifdef CONFIG_XFS_RT
> -int xfs_scrub_rtbitmap(struct xfs_scrub_context *sc);
> -int xfs_scrub_rtsummary(struct xfs_scrub_context *sc);
> +int xchk_rtbitmap(struct xfs_scrub_context *sc);
> +int xchk_rtsummary(struct xfs_scrub_context *sc);
> #else
> static inline int
> -xfs_scrub_rtbitmap(struct xfs_scrub_context *sc)
> +xchk_rtbitmap(struct xfs_scrub_context *sc)
> {
> return -ENOENT;
> }
> static inline int
> -xfs_scrub_rtsummary(struct xfs_scrub_context *sc)
> +xchk_rtsummary(struct xfs_scrub_context *sc)
> {
> return -ENOENT;
> }
> #endif
> #ifdef CONFIG_XFS_QUOTA
> -int xfs_scrub_quota(struct xfs_scrub_context *sc);
> +int xchk_quota(struct xfs_scrub_context *sc);
> #else
> static inline int
> -xfs_scrub_quota(struct xfs_scrub_context *sc)
> +xchk_quota(struct xfs_scrub_context *sc)
> {
> return -ENOENT;
> }
> #endif
>
> /* cross-referencing helpers */
> -void xfs_scrub_xref_is_used_space(struct xfs_scrub_context *sc,
> +void xchk_xref_is_used_space(struct xfs_scrub_context *sc,
> xfs_agblock_t agbno, xfs_extlen_t len);
> -void xfs_scrub_xref_is_not_inode_chunk(struct xfs_scrub_context *sc,
> +void xchk_xref_is_not_inode_chunk(struct xfs_scrub_context *sc,
> xfs_agblock_t agbno, xfs_extlen_t len);
> -void xfs_scrub_xref_is_inode_chunk(struct xfs_scrub_context *sc,
> +void xchk_xref_is_inode_chunk(struct xfs_scrub_context *sc,
> xfs_agblock_t agbno, xfs_extlen_t len);
> -void xfs_scrub_xref_is_owned_by(struct xfs_scrub_context *sc,
> +void xchk_xref_is_owned_by(struct xfs_scrub_context *sc,
> xfs_agblock_t agbno, xfs_extlen_t len,
> struct xfs_owner_info *oinfo);
> -void xfs_scrub_xref_is_not_owned_by(struct xfs_scrub_context *sc,
> +void xchk_xref_is_not_owned_by(struct xfs_scrub_context *sc,
> xfs_agblock_t agbno, xfs_extlen_t len,
> struct xfs_owner_info *oinfo);
> -void xfs_scrub_xref_has_no_owner(struct xfs_scrub_context *sc,
> +void xchk_xref_has_no_owner(struct xfs_scrub_context *sc,
> xfs_agblock_t agbno, xfs_extlen_t len);
> -void xfs_scrub_xref_is_cow_staging(struct xfs_scrub_context *sc,
> +void xchk_xref_is_cow_staging(struct xfs_scrub_context *sc,
> xfs_agblock_t bno, xfs_extlen_t len);
> -void xfs_scrub_xref_is_not_shared(struct xfs_scrub_context *sc,
> +void xchk_xref_is_not_shared(struct xfs_scrub_context *sc,
> xfs_agblock_t bno, xfs_extlen_t len);
> #ifdef CONFIG_XFS_RT
> -void xfs_scrub_xref_is_used_rt_space(struct xfs_scrub_context *sc,
> +void xchk_xref_is_used_rt_space(struct xfs_scrub_context *sc,
> xfs_rtblock_t rtbno, xfs_extlen_t len);
> #else
> -# define xfs_scrub_xref_is_used_rt_space(sc, rtbno, len) do { } while (0)
> +# define xchk_xref_is_used_rt_space(sc, rtbno, len) do { } while (0)
> #endif
>
> #endif /* __XFS_SCRUB_SCRUB_H__ */
> diff --git a/fs/xfs/scrub/symlink.c b/fs/xfs/scrub/symlink.c
> index 570a89812116..e2a288e34337 100644
> --- a/fs/xfs/scrub/symlink.c
> +++ b/fs/xfs/scrub/symlink.c
> @@ -25,7 +25,7 @@
>
> /* Set us up to scrub a symbolic link. */
> int
> -xfs_scrub_setup_symlink(
> +xchk_setup_symlink(
> struct xfs_scrub_context *sc,
> struct xfs_inode *ip)
> {
> @@ -34,13 +34,13 @@ xfs_scrub_setup_symlink(
> if (!sc->buf)
> return -ENOMEM;
>
> - return xfs_scrub_setup_inode_contents(sc, ip, 0);
> + return xchk_setup_inode_contents(sc, ip, 0);
> }
>
> /* Symbolic links. */
>
> int
> -xfs_scrub_symlink(
> +xchk_symlink(
> struct xfs_scrub_context *sc)
> {
> struct xfs_inode *ip = sc->ip;
> @@ -55,7 +55,7 @@ xfs_scrub_symlink(
>
> /* Plausible size? */
> if (len > XFS_SYMLINK_MAXLEN || len <= 0) {
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
> goto out;
> }
>
> @@ -63,16 +63,16 @@ xfs_scrub_symlink(
> if (ifp->if_flags & XFS_IFINLINE) {
> if (len > XFS_IFORK_DSIZE(ip) ||
> len > strnlen(ifp->if_u1.if_data, XFS_IFORK_DSIZE(ip)))
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
> goto out;
> }
>
> /* Remote symlink; must read the contents. */
> error = xfs_readlink_bmap_ilocked(sc->ip, sc->buf);
> - if (!xfs_scrub_fblock_process_error(sc, XFS_DATA_FORK, 0, &error))
> + if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, 0, &error))
> goto out;
> if (strnlen(sc->buf, XFS_SYMLINK_MAXLEN) < len)
> - xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
> + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
> out:
> return error;
> }
> diff --git a/fs/xfs/scrub/trace.c b/fs/xfs/scrub/trace.c
> index 7c76d8b5cb05..1ef1202a1e45 100644
> --- a/fs/xfs/scrub/trace.c
> +++ b/fs/xfs/scrub/trace.c
> @@ -22,7 +22,7 @@
>
> /* Figure out which block the btree cursor was pointing to. */
> static inline xfs_fsblock_t
> -xfs_scrub_btree_cur_fsbno(
> +xchk_btree_cur_fsbno(
> struct xfs_btree_cur *cur,
> int level)
> {
> diff --git a/fs/xfs/scrub/trace.h b/fs/xfs/scrub/trace.h
> index cec3e5ece5a1..11967d3942ac 100644
> --- a/fs/xfs/scrub/trace.h
> +++ b/fs/xfs/scrub/trace.h
> @@ -12,7 +12,7 @@
> #include <linux/tracepoint.h>
> #include "xfs_bit.h"
>
> -DECLARE_EVENT_CLASS(xfs_scrub_class,
> +DECLARE_EVENT_CLASS(xchk_class,
> TP_PROTO(struct xfs_inode *ip, struct xfs_scrub_metadata *sm,
> int error),
> TP_ARGS(ip, sm, error),
> @@ -47,18 +47,18 @@ DECLARE_EVENT_CLASS(xfs_scrub_class,
> __entry->error)
> )
> #define DEFINE_SCRUB_EVENT(name) \
> -DEFINE_EVENT(xfs_scrub_class, name, \
> +DEFINE_EVENT(xchk_class, name, \
> TP_PROTO(struct xfs_inode *ip, struct xfs_scrub_metadata *sm, \
> int error), \
> TP_ARGS(ip, sm, error))
>
> -DEFINE_SCRUB_EVENT(xfs_scrub_start);
> -DEFINE_SCRUB_EVENT(xfs_scrub_done);
> -DEFINE_SCRUB_EVENT(xfs_scrub_deadlock_retry);
> +DEFINE_SCRUB_EVENT(xchk_start);
> +DEFINE_SCRUB_EVENT(xchk_done);
> +DEFINE_SCRUB_EVENT(xchk_deadlock_retry);
> DEFINE_SCRUB_EVENT(xfs_repair_attempt);
> DEFINE_SCRUB_EVENT(xfs_repair_done);
>
> -TRACE_EVENT(xfs_scrub_op_error,
> +TRACE_EVENT(xchk_op_error,
> TP_PROTO(struct xfs_scrub_context *sc, xfs_agnumber_t agno,
> xfs_agblock_t bno, int error, void *ret_ip),
> TP_ARGS(sc, agno, bno, error, ret_ip),
> @@ -87,7 +87,7 @@ TRACE_EVENT(xfs_scrub_op_error,
> __entry->ret_ip)
> );
>
> -TRACE_EVENT(xfs_scrub_file_op_error,
> +TRACE_EVENT(xchk_file_op_error,
> TP_PROTO(struct xfs_scrub_context *sc, int whichfork,
> xfs_fileoff_t offset, int error, void *ret_ip),
> TP_ARGS(sc, whichfork, offset, error, ret_ip),
> @@ -119,7 +119,7 @@ TRACE_EVENT(xfs_scrub_file_op_error,
> __entry->ret_ip)
> );
>
> -DECLARE_EVENT_CLASS(xfs_scrub_block_error_class,
> +DECLARE_EVENT_CLASS(xchk_block_error_class,
> TP_PROTO(struct xfs_scrub_context *sc, xfs_daddr_t daddr, void *ret_ip),
> TP_ARGS(sc, daddr, ret_ip),
> TP_STRUCT__entry(
> @@ -153,15 +153,15 @@ DECLARE_EVENT_CLASS(xfs_scrub_block_error_class,
> )
>
> #define DEFINE_SCRUB_BLOCK_ERROR_EVENT(name) \
> -DEFINE_EVENT(xfs_scrub_block_error_class, name, \
> +DEFINE_EVENT(xchk_block_error_class, name, \
> TP_PROTO(struct xfs_scrub_context *sc, xfs_daddr_t daddr, \
> void *ret_ip), \
> TP_ARGS(sc, daddr, ret_ip))
>
> -DEFINE_SCRUB_BLOCK_ERROR_EVENT(xfs_scrub_block_error);
> -DEFINE_SCRUB_BLOCK_ERROR_EVENT(xfs_scrub_block_preen);
> +DEFINE_SCRUB_BLOCK_ERROR_EVENT(xchk_block_error);
> +DEFINE_SCRUB_BLOCK_ERROR_EVENT(xchk_block_preen);
>
> -DECLARE_EVENT_CLASS(xfs_scrub_ino_error_class,
> +DECLARE_EVENT_CLASS(xchk_ino_error_class,
> TP_PROTO(struct xfs_scrub_context *sc, xfs_ino_t ino, void *ret_ip),
> TP_ARGS(sc, ino, ret_ip),
> TP_STRUCT__entry(
> @@ -184,16 +184,16 @@ DECLARE_EVENT_CLASS(xfs_scrub_ino_error_class,
> )
>
> #define DEFINE_SCRUB_INO_ERROR_EVENT(name) \
> -DEFINE_EVENT(xfs_scrub_ino_error_class, name, \
> +DEFINE_EVENT(xchk_ino_error_class, name, \
> TP_PROTO(struct xfs_scrub_context *sc, xfs_ino_t ino, \
> void *ret_ip), \
> TP_ARGS(sc, ino, ret_ip))
>
> -DEFINE_SCRUB_INO_ERROR_EVENT(xfs_scrub_ino_error);
> -DEFINE_SCRUB_INO_ERROR_EVENT(xfs_scrub_ino_preen);
> -DEFINE_SCRUB_INO_ERROR_EVENT(xfs_scrub_ino_warning);
> +DEFINE_SCRUB_INO_ERROR_EVENT(xchk_ino_error);
> +DEFINE_SCRUB_INO_ERROR_EVENT(xchk_ino_preen);
> +DEFINE_SCRUB_INO_ERROR_EVENT(xchk_ino_warning);
>
> -DECLARE_EVENT_CLASS(xfs_scrub_fblock_error_class,
> +DECLARE_EVENT_CLASS(xchk_fblock_error_class,
> TP_PROTO(struct xfs_scrub_context *sc, int whichfork,
> xfs_fileoff_t offset, void *ret_ip),
> TP_ARGS(sc, whichfork, offset, ret_ip),
> @@ -223,15 +223,15 @@ DECLARE_EVENT_CLASS(xfs_scrub_fblock_error_class,
> );
>
> #define DEFINE_SCRUB_FBLOCK_ERROR_EVENT(name) \
> -DEFINE_EVENT(xfs_scrub_fblock_error_class, name, \
> +DEFINE_EVENT(xchk_fblock_error_class, name, \
> TP_PROTO(struct xfs_scrub_context *sc, int whichfork, \
> xfs_fileoff_t offset, void *ret_ip), \
> TP_ARGS(sc, whichfork, offset, ret_ip))
>
> -DEFINE_SCRUB_FBLOCK_ERROR_EVENT(xfs_scrub_fblock_error);
> -DEFINE_SCRUB_FBLOCK_ERROR_EVENT(xfs_scrub_fblock_warning);
> +DEFINE_SCRUB_FBLOCK_ERROR_EVENT(xchk_fblock_error);
> +DEFINE_SCRUB_FBLOCK_ERROR_EVENT(xchk_fblock_warning);
>
> -TRACE_EVENT(xfs_scrub_incomplete,
> +TRACE_EVENT(xchk_incomplete,
> TP_PROTO(struct xfs_scrub_context *sc, void *ret_ip),
> TP_ARGS(sc, ret_ip),
> TP_STRUCT__entry(
> @@ -250,7 +250,7 @@ TRACE_EVENT(xfs_scrub_incomplete,
> __entry->ret_ip)
> );
>
> -TRACE_EVENT(xfs_scrub_btree_op_error,
> +TRACE_EVENT(xchk_btree_op_error,
> TP_PROTO(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur,
> int level, int error, void *ret_ip),
> TP_ARGS(sc, cur, level, error, ret_ip),
> @@ -266,7 +266,7 @@ TRACE_EVENT(xfs_scrub_btree_op_error,
> __field(void *, ret_ip)
> ),
> TP_fast_assign(
> - xfs_fsblock_t fsbno = xfs_scrub_btree_cur_fsbno(cur, level);
> + xfs_fsblock_t fsbno = xchk_btree_cur_fsbno(cur, level);
>
> __entry->dev = sc->mp->m_super->s_dev;
> __entry->type = sc->sm->sm_type;
> @@ -290,7 +290,7 @@ TRACE_EVENT(xfs_scrub_btree_op_error,
> __entry->ret_ip)
> );
>
> -TRACE_EVENT(xfs_scrub_ifork_btree_op_error,
> +TRACE_EVENT(xchk_ifork_btree_op_error,
> TP_PROTO(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur,
> int level, int error, void *ret_ip),
> TP_ARGS(sc, cur, level, error, ret_ip),
> @@ -308,7 +308,7 @@ TRACE_EVENT(xfs_scrub_ifork_btree_op_error,
> __field(void *, ret_ip)
> ),
> TP_fast_assign(
> - xfs_fsblock_t fsbno = xfs_scrub_btree_cur_fsbno(cur, level);
> + xfs_fsblock_t fsbno = xchk_btree_cur_fsbno(cur, level);
> __entry->dev = sc->mp->m_super->s_dev;
> __entry->ino = sc->ip->i_ino;
> __entry->whichfork = cur->bc_private.b.whichfork;
> @@ -335,7 +335,7 @@ TRACE_EVENT(xfs_scrub_ifork_btree_op_error,
> __entry->ret_ip)
> );
>
> -TRACE_EVENT(xfs_scrub_btree_error,
> +TRACE_EVENT(xchk_btree_error,
> TP_PROTO(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur,
> int level, void *ret_ip),
> TP_ARGS(sc, cur, level, ret_ip),
> @@ -350,7 +350,7 @@ TRACE_EVENT(xfs_scrub_btree_error,
> __field(void *, ret_ip)
> ),
> TP_fast_assign(
> - xfs_fsblock_t fsbno = xfs_scrub_btree_cur_fsbno(cur, level);
> + xfs_fsblock_t fsbno = xchk_btree_cur_fsbno(cur, level);
> __entry->dev = sc->mp->m_super->s_dev;
> __entry->type = sc->sm->sm_type;
> __entry->btnum = cur->bc_btnum;
> @@ -371,7 +371,7 @@ TRACE_EVENT(xfs_scrub_btree_error,
> __entry->ret_ip)
> );
>
> -TRACE_EVENT(xfs_scrub_ifork_btree_error,
> +TRACE_EVENT(xchk_ifork_btree_error,
> TP_PROTO(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur,
> int level, void *ret_ip),
> TP_ARGS(sc, cur, level, ret_ip),
> @@ -388,7 +388,7 @@ TRACE_EVENT(xfs_scrub_ifork_btree_error,
> __field(void *, ret_ip)
> ),
> TP_fast_assign(
> - xfs_fsblock_t fsbno = xfs_scrub_btree_cur_fsbno(cur, level);
> + xfs_fsblock_t fsbno = xchk_btree_cur_fsbno(cur, level);
> __entry->dev = sc->mp->m_super->s_dev;
> __entry->ino = sc->ip->i_ino;
> __entry->whichfork = cur->bc_private.b.whichfork;
> @@ -413,7 +413,7 @@ TRACE_EVENT(xfs_scrub_ifork_btree_error,
> __entry->ret_ip)
> );
>
> -DECLARE_EVENT_CLASS(xfs_scrub_sbtree_class,
> +DECLARE_EVENT_CLASS(xchk_sbtree_class,
> TP_PROTO(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur,
> int level),
> TP_ARGS(sc, cur, level),
> @@ -428,7 +428,7 @@ DECLARE_EVENT_CLASS(xfs_scrub_sbtree_class,
> __field(int, ptr)
> ),
> TP_fast_assign(
> - xfs_fsblock_t fsbno = xfs_scrub_btree_cur_fsbno(cur, level);
> + xfs_fsblock_t fsbno = xchk_btree_cur_fsbno(cur, level);
>
> __entry->dev = sc->mp->m_super->s_dev;
> __entry->type = sc->sm->sm_type;
> @@ -450,15 +450,15 @@ DECLARE_EVENT_CLASS(xfs_scrub_sbtree_class,
> __entry->ptr)
> )
> #define DEFINE_SCRUB_SBTREE_EVENT(name) \
> -DEFINE_EVENT(xfs_scrub_sbtree_class, name, \
> +DEFINE_EVENT(xchk_sbtree_class, name, \
> TP_PROTO(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur, \
> int level), \
> TP_ARGS(sc, cur, level))
>
> -DEFINE_SCRUB_SBTREE_EVENT(xfs_scrub_btree_rec);
> -DEFINE_SCRUB_SBTREE_EVENT(xfs_scrub_btree_key);
> +DEFINE_SCRUB_SBTREE_EVENT(xchk_btree_rec);
> +DEFINE_SCRUB_SBTREE_EVENT(xchk_btree_key);
>
> -TRACE_EVENT(xfs_scrub_xref_error,
> +TRACE_EVENT(xchk_xref_error,
> TP_PROTO(struct xfs_scrub_context *sc, int error, void *ret_ip),
> TP_ARGS(sc, error, ret_ip),
> TP_STRUCT__entry(
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 6/8] xfs: shorten xfs_repair_ prefix to xrep_
2018-07-18 15:51 ` [PATCH 6/8] xfs: shorten xfs_repair_ prefix to xrep_ Darrick J. Wong
@ 2018-07-19 12:59 ` Brian Foster
0 siblings, 0 replies; 30+ messages in thread
From: Brian Foster @ 2018-07-19 12:59 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: linux-xfs
On Wed, Jul 18, 2018 at 08:51:58AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Shorten all the metadata repair xfs_repair_* symbols to xrep_.
> Whitespace damage will be fixed by a subsequent patch. There are no
> functional changes.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
Reviewed-by: Brian Foster <bfoster@redhat.com>
> fs/xfs/scrub/agheader_repair.c | 2
> fs/xfs/scrub/common.c | 2
> fs/xfs/scrub/repair.c | 164 ++++++++++++++++++++--------------------
> fs/xfs/scrub/repair.h | 74 +++++++++---------
> fs/xfs/scrub/scrub.c | 54 +++++++------
> fs/xfs/scrub/trace.h | 40 +++++-----
> 6 files changed, 168 insertions(+), 168 deletions(-)
>
>
> diff --git a/fs/xfs/scrub/agheader_repair.c b/fs/xfs/scrub/agheader_repair.c
> index 117eedac53df..631940f3ca4d 100644
> --- a/fs/xfs/scrub/agheader_repair.c
> +++ b/fs/xfs/scrub/agheader_repair.c
> @@ -28,7 +28,7 @@
>
> /* Repair the superblock. */
> int
> -xfs_repair_superblock(
> +xrep_superblock(
> struct xfs_scrub_context *sc)
> {
> struct xfs_mount *mp = sc->mp;
> diff --git a/fs/xfs/scrub/common.c b/fs/xfs/scrub/common.c
> index a4004a06f482..fa1c16063d17 100644
> --- a/fs/xfs/scrub/common.c
> +++ b/fs/xfs/scrub/common.c
> @@ -604,7 +604,7 @@ xchk_setup_fs(
> {
> uint resblks;
>
> - resblks = xfs_repair_calc_ag_resblks(sc);
> + resblks = xrep_calc_ag_resblks(sc);
> return xchk_trans_alloc(sc, resblks);
> }
>
> diff --git a/fs/xfs/scrub/repair.c b/fs/xfs/scrub/repair.c
> index 5eccd89c64a8..7e6a56a5f59d 100644
> --- a/fs/xfs/scrub/repair.c
> +++ b/fs/xfs/scrub/repair.c
> @@ -41,21 +41,21 @@
> * and will set *fixed to true if it thinks it repaired anything.
> */
> int
> -xfs_repair_attempt(
> +xrep_attempt(
> struct xfs_inode *ip,
> struct xfs_scrub_context *sc,
> bool *fixed)
> {
> int error = 0;
>
> - trace_xfs_repair_attempt(ip, sc->sm, error);
> + trace_xrep_attempt(ip, sc->sm, error);
>
> xchk_ag_btcur_free(&sc->sa);
>
> /* Repair whatever's broken. */
> ASSERT(sc->ops->repair);
> error = sc->ops->repair(sc);
> - trace_xfs_repair_done(ip, sc->sm, error);
> + trace_xrep_done(ip, sc->sm, error);
> switch (error) {
> case 0:
> /*
> @@ -93,7 +93,7 @@ xfs_repair_attempt(
> * structure to track rate limiting information.
> */
> void
> -xfs_repair_failure(
> +xrep_failure(
> struct xfs_mount *mp)
> {
> xfs_alert_ratelimited(mp,
> @@ -105,7 +105,7 @@ xfs_repair_failure(
> * given mountpoint.
> */
> int
> -xfs_repair_probe(
> +xrep_probe(
> struct xfs_scrub_context *sc)
> {
> int error = 0;
> @@ -121,7 +121,7 @@ xfs_repair_probe(
> * the btree cursors.
> */
> int
> -xfs_repair_roll_ag_trans(
> +xrep_roll_ag_trans(
> struct xfs_scrub_context *sc)
> {
> int error;
> @@ -162,7 +162,7 @@ xfs_repair_roll_ag_trans(
> * in AG reservations) to construct a whole btree.
> */
> bool
> -xfs_repair_ag_has_space(
> +xrep_ag_has_space(
> struct xfs_perag *pag,
> xfs_extlen_t nr_blocks,
> enum xfs_ag_resv_type type)
> @@ -178,7 +178,7 @@ xfs_repair_ag_has_space(
> * any type of per-AG btree.
> */
> xfs_extlen_t
> -xfs_repair_calc_ag_resblks(
> +xrep_calc_ag_resblks(
> struct xfs_scrub_context *sc)
> {
> struct xfs_mount *mp = sc->mp;
> @@ -231,7 +231,7 @@ xfs_repair_calc_ag_resblks(
> }
> xfs_perag_put(pag);
>
> - trace_xfs_repair_calc_ag_resblks(mp, sm->sm_agno, icount, aglen,
> + trace_xrep_calc_ag_resblks(mp, sm->sm_agno, icount, aglen,
> freelen, usedlen);
>
> /*
> @@ -270,7 +270,7 @@ xfs_repair_calc_ag_resblks(
> rmapbt_sz = 0;
> }
>
> - trace_xfs_repair_calc_ag_resblks_btsize(mp, sm->sm_agno, bnobt_sz,
> + trace_xrep_calc_ag_resblks_btsize(mp, sm->sm_agno, bnobt_sz,
> inobt_sz, rmapbt_sz, refcbt_sz);
>
> return max(max(bnobt_sz, inobt_sz), max(rmapbt_sz, refcbt_sz));
> @@ -278,7 +278,7 @@ xfs_repair_calc_ag_resblks(
>
> /* Allocate a block in an AG. */
> int
> -xfs_repair_alloc_ag_block(
> +xrep_alloc_ag_block(
> struct xfs_scrub_context *sc,
> struct xfs_owner_info *oinfo,
> xfs_fsblock_t *fsbno,
> @@ -329,7 +329,7 @@ xfs_repair_alloc_ag_block(
>
> /* Initialize a new AG btree root block with zero entries. */
> int
> -xfs_repair_init_btblock(
> +xrep_init_btblock(
> struct xfs_scrub_context *sc,
> xfs_fsblock_t fsb,
> struct xfs_buf **bpp,
> @@ -340,7 +340,7 @@ xfs_repair_init_btblock(
> struct xfs_mount *mp = sc->mp;
> struct xfs_buf *bp;
>
> - trace_xfs_repair_init_btblock(mp, XFS_FSB_TO_AGNO(mp, fsb),
> + trace_xrep_init_btblock(mp, XFS_FSB_TO_AGNO(mp, fsb),
> XFS_FSB_TO_AGBNO(mp, fsb), btnum);
>
> ASSERT(XFS_FSB_TO_AGNO(mp, fsb) == sc->sa.agno);
> @@ -384,19 +384,19 @@ xfs_repair_init_btblock(
>
> /* Collect a dead btree extent for later disposal. */
> int
> -xfs_repair_collect_btree_extent(
> +xrep_collect_btree_extent(
> struct xfs_scrub_context *sc,
> - struct xfs_repair_extent_list *exlist,
> + struct xrep_extent_list *exlist,
> xfs_fsblock_t fsbno,
> xfs_extlen_t len)
> {
> - struct xfs_repair_extent *rex;
> + struct xrep_extent *rex;
>
> - trace_xfs_repair_collect_btree_extent(sc->mp,
> + trace_xrep_collect_btree_extent(sc->mp,
> XFS_FSB_TO_AGNO(sc->mp, fsbno),
> XFS_FSB_TO_AGBNO(sc->mp, fsbno), len);
>
> - rex = kmem_alloc(sizeof(struct xfs_repair_extent), KM_MAYFAIL);
> + rex = kmem_alloc(sizeof(struct xrep_extent), KM_MAYFAIL);
> if (!rex)
> return -ENOMEM;
>
> @@ -414,14 +414,14 @@ xfs_repair_collect_btree_extent(
> * Therefore, free all the memory associated with the list so we can die.
> */
> void
> -xfs_repair_cancel_btree_extents(
> +xrep_cancel_btree_extents(
> struct xfs_scrub_context *sc,
> - struct xfs_repair_extent_list *exlist)
> + struct xrep_extent_list *exlist)
> {
> - struct xfs_repair_extent *rex;
> - struct xfs_repair_extent *n;
> + struct xrep_extent *rex;
> + struct xrep_extent *n;
>
> - for_each_xfs_repair_extent_safe(rex, n, exlist) {
> + for_each_xrep_extent_safe(rex, n, exlist) {
> list_del(&rex->list);
> kmem_free(rex);
> }
> @@ -429,16 +429,16 @@ xfs_repair_cancel_btree_extents(
>
> /* Compare two btree extents. */
> static int
> -xfs_repair_btree_extent_cmp(
> +xrep_btree_extent_cmp(
> void *priv,
> struct list_head *a,
> struct list_head *b)
> {
> - struct xfs_repair_extent *ap;
> - struct xfs_repair_extent *bp;
> + struct xrep_extent *ap;
> + struct xrep_extent *bp;
>
> - ap = container_of(a, struct xfs_repair_extent, list);
> - bp = container_of(b, struct xfs_repair_extent, list);
> + ap = container_of(a, struct xrep_extent, list);
> + bp = container_of(b, struct xrep_extent, list);
>
> if (ap->fsbno > bp->fsbno)
> return 1;
> @@ -462,15 +462,15 @@ xfs_repair_btree_extent_cmp(
> #define LEFT_ALIGNED (1 << 0)
> #define RIGHT_ALIGNED (1 << 1)
> int
> -xfs_repair_subtract_extents(
> +xrep_subtract_extents(
> struct xfs_scrub_context *sc,
> - struct xfs_repair_extent_list *exlist,
> - struct xfs_repair_extent_list *sublist)
> + struct xrep_extent_list *exlist,
> + struct xrep_extent_list *sublist)
> {
> struct list_head *lp;
> - struct xfs_repair_extent *ex;
> - struct xfs_repair_extent *newex;
> - struct xfs_repair_extent *subex;
> + struct xrep_extent *ex;
> + struct xrep_extent *newex;
> + struct xrep_extent *subex;
> xfs_fsblock_t sub_fsb;
> xfs_extlen_t sub_len;
> int state;
> @@ -480,8 +480,8 @@ xfs_repair_subtract_extents(
> return 0;
> ASSERT(!list_empty(&sublist->list));
>
> - list_sort(NULL, &exlist->list, xfs_repair_btree_extent_cmp);
> - list_sort(NULL, &sublist->list, xfs_repair_btree_extent_cmp);
> + list_sort(NULL, &exlist->list, xrep_btree_extent_cmp);
> + list_sort(NULL, &sublist->list, xrep_btree_extent_cmp);
>
> /*
> * Now that we've sorted both lists, we iterate exlist once, rolling
> @@ -491,11 +491,11 @@ xfs_repair_subtract_extents(
> * list traversal is similar to merge sort, but we're deleting
> * instead. In this manner we avoid O(n^2) operations.
> */
> - subex = list_first_entry(&sublist->list, struct xfs_repair_extent,
> + subex = list_first_entry(&sublist->list, struct xrep_extent,
> list);
> lp = exlist->list.next;
> while (lp != &exlist->list) {
> - ex = list_entry(lp, struct xfs_repair_extent, list);
> + ex = list_entry(lp, struct xrep_extent, list);
>
> /*
> * Advance subex and/or ex until we find a pair that
> @@ -548,7 +548,7 @@ xfs_repair_subtract_extents(
> * Deleting from the middle: add the new right extent
> * and then shrink the left extent.
> */
> - newex = kmem_alloc(sizeof(struct xfs_repair_extent),
> + newex = kmem_alloc(sizeof(struct xrep_extent),
> KM_MAYFAIL);
> if (!newex) {
> error = -ENOMEM;
> @@ -619,12 +619,12 @@ xfs_repair_subtract_extents(
> * is not intended for use with file data repairs; we have bunmapi for that.
> */
> int
> -xfs_repair_invalidate_blocks(
> +xrep_invalidate_blocks(
> struct xfs_scrub_context *sc,
> - struct xfs_repair_extent_list *exlist)
> + struct xrep_extent_list *exlist)
> {
> - struct xfs_repair_extent *rex;
> - struct xfs_repair_extent *n;
> + struct xrep_extent *rex;
> + struct xrep_extent *n;
> struct xfs_buf *bp;
> xfs_fsblock_t fsbno;
> xfs_agblock_t i;
> @@ -637,7 +637,7 @@ xfs_repair_invalidate_blocks(
> * because we never own those; and if we can't TRYLOCK the buffer we
> * assume it's owned by someone else.
> */
> - for_each_xfs_repair_extent_safe(rex, n, exlist) {
> + for_each_xrep_extent_safe(rex, n, exlist) {
> for (fsbno = rex->fsbno, i = rex->len; i > 0; fsbno++, i--) {
> /* Skip AG headers and post-EOFS blocks */
> if (!xfs_verify_fsbno(sc->mp, fsbno))
> @@ -657,7 +657,7 @@ xfs_repair_invalidate_blocks(
>
> /* Ensure the freelist is the correct size. */
> int
> -xfs_repair_fix_freelist(
> +xrep_fix_freelist(
> struct xfs_scrub_context *sc,
> bool can_shrink)
> {
> @@ -677,7 +677,7 @@ xfs_repair_fix_freelist(
> * Put a block back on the AGFL.
> */
> STATIC int
> -xfs_repair_put_freelist(
> +xrep_put_freelist(
> struct xfs_scrub_context *sc,
> xfs_agblock_t agbno)
> {
> @@ -685,7 +685,7 @@ xfs_repair_put_freelist(
> int error;
>
> /* Make sure there's space on the freelist. */
> - error = xfs_repair_fix_freelist(sc, true);
> + error = xrep_fix_freelist(sc, true);
> if (error)
> return error;
>
> @@ -713,7 +713,7 @@ xfs_repair_put_freelist(
>
> /* Dispose of a single metadata block. */
> STATIC int
> -xfs_repair_dispose_btree_block(
> +xrep_dispose_btree_block(
> struct xfs_scrub_context *sc,
> xfs_fsblock_t fsbno,
> struct xfs_owner_info *oinfo,
> @@ -767,7 +767,7 @@ xfs_repair_dispose_btree_block(
> if (has_other_rmap)
> error = xfs_rmap_free(sc->tp, agf_bp, agno, agbno, 1, oinfo);
> else if (resv == XFS_AG_RESV_AGFL)
> - error = xfs_repair_put_freelist(sc, agbno);
> + error = xrep_put_freelist(sc, agbno);
> else
> error = xfs_free_extent(sc->tp, fsbno, 1, oinfo, resv);
> if (agf_bp != sc->sa.agf_bp)
> @@ -777,7 +777,7 @@ xfs_repair_dispose_btree_block(
>
> if (sc->ip)
> return xfs_trans_roll_inode(&sc->tp, sc->ip);
> - return xfs_repair_roll_ag_trans(sc);
> + return xrep_roll_ag_trans(sc);
>
> out_free:
> if (agf_bp != sc->sa.agf_bp)
> @@ -787,29 +787,29 @@ xfs_repair_dispose_btree_block(
>
> /* Dispose of btree blocks from an old per-AG btree. */
> int
> -xfs_repair_reap_btree_extents(
> +xrep_reap_btree_extents(
> struct xfs_scrub_context *sc,
> - struct xfs_repair_extent_list *exlist,
> + struct xrep_extent_list *exlist,
> struct xfs_owner_info *oinfo,
> enum xfs_ag_resv_type type)
> {
> - struct xfs_repair_extent *rex;
> - struct xfs_repair_extent *n;
> + struct xrep_extent *rex;
> + struct xrep_extent *n;
> int error = 0;
>
> ASSERT(xfs_sb_version_hasrmapbt(&sc->mp->m_sb));
>
> /* Dispose of every block from the old btree. */
> - for_each_xfs_repair_extent_safe(rex, n, exlist) {
> + for_each_xrep_extent_safe(rex, n, exlist) {
> ASSERT(sc->ip != NULL ||
> XFS_FSB_TO_AGNO(sc->mp, rex->fsbno) == sc->sa.agno);
>
> - trace_xfs_repair_dispose_btree_extent(sc->mp,
> + trace_xrep_dispose_btree_extent(sc->mp,
> XFS_FSB_TO_AGNO(sc->mp, rex->fsbno),
> XFS_FSB_TO_AGBNO(sc->mp, rex->fsbno), rex->len);
>
> for (; rex->len > 0; rex->len--, rex->fsbno++) {
> - error = xfs_repair_dispose_btree_block(sc, rex->fsbno,
> + error = xrep_dispose_btree_block(sc, rex->fsbno,
> oinfo, type);
> if (error)
> goto out;
> @@ -819,7 +819,7 @@ xfs_repair_reap_btree_extents(
> }
>
> out:
> - xfs_repair_cancel_btree_extents(sc, exlist);
> + xrep_cancel_btree_extents(sc, exlist);
> return error;
> }
>
> @@ -831,12 +831,12 @@ xfs_repair_reap_btree_extents(
> * btree roots. This is not guaranteed to work if the AG is heavily damaged
> * or the rmap data are corrupt.
> *
> - * Callers of xfs_repair_find_ag_btree_roots must lock the AGF and AGFL
> + * Callers of xrep_find_ag_btree_roots must lock the AGF and AGFL
> * buffers if the AGF is being rebuilt; or the AGF and AGI buffers if the
> * AGI is being rebuilt. It must maintain these locks until it's safe for
> * other threads to change the btrees' shapes. The caller provides
> * information about the btrees to look for by passing in an array of
> - * xfs_repair_find_ag_btree with the (rmap owner, buf_ops, magic) fields set.
> + * xrep_find_ag_btree with the (rmap owner, buf_ops, magic) fields set.
> * The (root, height) fields will be set on return if anything is found. The
> * last element of the array should have a NULL buf_ops to mark the end of the
> * array.
> @@ -850,16 +850,16 @@ xfs_repair_reap_btree_extents(
> * should be the roots.
> */
>
> -struct xfs_repair_findroot {
> +struct xrep_findroot {
> struct xfs_scrub_context *sc;
> struct xfs_buf *agfl_bp;
> struct xfs_agf *agf;
> - struct xfs_repair_find_ag_btree *btree_info;
> + struct xrep_find_ag_btree *btree_info;
> };
>
> /* See if our block is in the AGFL. */
> STATIC int
> -xfs_repair_findroot_agfl_walk(
> +xrep_findroot_agfl_walk(
> struct xfs_mount *mp,
> xfs_agblock_t bno,
> void *priv)
> @@ -871,9 +871,9 @@ xfs_repair_findroot_agfl_walk(
>
> /* Does this block match the btree information passed in? */
> STATIC int
> -xfs_repair_findroot_block(
> - struct xfs_repair_findroot *ri,
> - struct xfs_repair_find_ag_btree *fab,
> +xrep_findroot_block(
> + struct xrep_findroot *ri,
> + struct xrep_find_ag_btree *fab,
> uint64_t owner,
> xfs_agblock_t agbno,
> bool *found_it)
> @@ -894,7 +894,7 @@ xfs_repair_findroot_block(
> */
> if (owner == XFS_RMAP_OWN_AG) {
> error = xfs_agfl_walk(mp, ri->agf, ri->agfl_bp,
> - xfs_repair_findroot_agfl_walk, &agbno);
> + xrep_findroot_agfl_walk, &agbno);
> if (error == XFS_BTREE_QUERY_RANGE_ABORT)
> return 0;
> if (error)
> @@ -932,7 +932,7 @@ xfs_repair_findroot_block(
> fab->height = xfs_btree_get_level(btblock) + 1;
> *found_it = true;
>
> - trace_xfs_repair_findroot_block(mp, ri->sc->sa.agno, agbno,
> + trace_xrep_findroot_block(mp, ri->sc->sa.agno, agbno,
> be32_to_cpu(btblock->bb_magic), fab->height - 1);
> out:
> xfs_trans_brelse(ri->sc->tp, bp);
> @@ -944,13 +944,13 @@ xfs_repair_findroot_block(
> * looking for?
> */
> STATIC int
> -xfs_repair_findroot_rmap(
> +xrep_findroot_rmap(
> struct xfs_btree_cur *cur,
> struct xfs_rmap_irec *rec,
> void *priv)
> {
> - struct xfs_repair_findroot *ri = priv;
> - struct xfs_repair_find_ag_btree *fab;
> + struct xrep_findroot *ri = priv;
> + struct xrep_find_ag_btree *fab;
> xfs_agblock_t b;
> bool found_it;
> int error = 0;
> @@ -965,7 +965,7 @@ xfs_repair_findroot_rmap(
> for (fab = ri->btree_info; fab->buf_ops; fab++) {
> if (rec->rm_owner != fab->rmap_owner)
> continue;
> - error = xfs_repair_findroot_block(ri, fab,
> + error = xrep_findroot_block(ri, fab,
> rec->rm_owner, rec->rm_startblock + b,
> &found_it);
> if (error)
> @@ -980,15 +980,15 @@ xfs_repair_findroot_rmap(
>
> /* Find the roots of the per-AG btrees described in btree_info. */
> int
> -xfs_repair_find_ag_btree_roots(
> +xrep_find_ag_btree_roots(
> struct xfs_scrub_context *sc,
> struct xfs_buf *agf_bp,
> - struct xfs_repair_find_ag_btree *btree_info,
> + struct xrep_find_ag_btree *btree_info,
> struct xfs_buf *agfl_bp)
> {
> struct xfs_mount *mp = sc->mp;
> - struct xfs_repair_findroot ri;
> - struct xfs_repair_find_ag_btree *fab;
> + struct xrep_findroot ri;
> + struct xrep_find_ag_btree *fab;
> struct xfs_btree_cur *cur;
> int error;
>
> @@ -1007,7 +1007,7 @@ xfs_repair_find_ag_btree_roots(
> }
>
> cur = xfs_rmapbt_init_cursor(mp, sc->tp, agf_bp, sc->sa.agno);
> - error = xfs_rmap_query_all(cur, xfs_repair_findroot_rmap, &ri);
> + error = xfs_rmap_query_all(cur, xrep_findroot_rmap, &ri);
> xfs_btree_del_cursor(cur, error);
>
> return error;
> @@ -1015,7 +1015,7 @@ xfs_repair_find_ag_btree_roots(
>
> /* Force a quotacheck the next time we mount. */
> void
> -xfs_repair_force_quotacheck(
> +xrep_force_quotacheck(
> struct xfs_scrub_context *sc,
> uint dqtype)
> {
> @@ -1043,7 +1043,7 @@ xfs_repair_force_quotacheck(
> * repair corruptions in the quota metadata.
> */
> int
> -xfs_repair_ino_dqattach(
> +xrep_ino_dqattach(
> struct xfs_scrub_context *sc)
> {
> int error;
> @@ -1057,11 +1057,11 @@ xfs_repair_ino_dqattach(
> "inode %llu repair encountered quota error %d, quotacheck forced.",
> (unsigned long long)sc->ip->i_ino, error);
> if (XFS_IS_UQUOTA_ON(sc->mp) && !sc->ip->i_udquot)
> - xfs_repair_force_quotacheck(sc, XFS_DQ_USER);
> + xrep_force_quotacheck(sc, XFS_DQ_USER);
> if (XFS_IS_GQUOTA_ON(sc->mp) && !sc->ip->i_gdquot)
> - xfs_repair_force_quotacheck(sc, XFS_DQ_GROUP);
> + xrep_force_quotacheck(sc, XFS_DQ_GROUP);
> if (XFS_IS_PQUOTA_ON(sc->mp) && !sc->ip->i_pdquot)
> - xfs_repair_force_quotacheck(sc, XFS_DQ_PROJ);
> + xrep_force_quotacheck(sc, XFS_DQ_PROJ);
> /* fall through */
> case -ESRCH:
> error = 0;
> diff --git a/fs/xfs/scrub/repair.h b/fs/xfs/scrub/repair.h
> index ef47826b6725..60d81294797b 100644
> --- a/fs/xfs/scrub/repair.h
> +++ b/fs/xfs/scrub/repair.h
> @@ -6,7 +6,7 @@
> #ifndef __XFS_SCRUB_REPAIR_H__
> #define __XFS_SCRUB_REPAIR_H__
>
> -static inline int xfs_repair_notsupported(struct xfs_scrub_context *sc)
> +static inline int xrep_notsupported(struct xfs_scrub_context *sc)
> {
> return -EOPNOTSUPP;
> }
> @@ -15,55 +15,55 @@ static inline int xfs_repair_notsupported(struct xfs_scrub_context *sc)
>
> /* Repair helpers */
>
> -int xfs_repair_attempt(struct xfs_inode *ip, struct xfs_scrub_context *sc,
> +int xrep_attempt(struct xfs_inode *ip, struct xfs_scrub_context *sc,
> bool *fixed);
> -void xfs_repair_failure(struct xfs_mount *mp);
> -int xfs_repair_roll_ag_trans(struct xfs_scrub_context *sc);
> -bool xfs_repair_ag_has_space(struct xfs_perag *pag, xfs_extlen_t nr_blocks,
> +void xrep_failure(struct xfs_mount *mp);
> +int xrep_roll_ag_trans(struct xfs_scrub_context *sc);
> +bool xrep_ag_has_space(struct xfs_perag *pag, xfs_extlen_t nr_blocks,
> enum xfs_ag_resv_type type);
> -xfs_extlen_t xfs_repair_calc_ag_resblks(struct xfs_scrub_context *sc);
> -int xfs_repair_alloc_ag_block(struct xfs_scrub_context *sc,
> +xfs_extlen_t xrep_calc_ag_resblks(struct xfs_scrub_context *sc);
> +int xrep_alloc_ag_block(struct xfs_scrub_context *sc,
> struct xfs_owner_info *oinfo, xfs_fsblock_t *fsbno,
> enum xfs_ag_resv_type resv);
> -int xfs_repair_init_btblock(struct xfs_scrub_context *sc, xfs_fsblock_t fsb,
> +int xrep_init_btblock(struct xfs_scrub_context *sc, xfs_fsblock_t fsb,
> struct xfs_buf **bpp, xfs_btnum_t btnum,
> const struct xfs_buf_ops *ops);
>
> -struct xfs_repair_extent {
> +struct xrep_extent {
> struct list_head list;
> xfs_fsblock_t fsbno;
> xfs_extlen_t len;
> };
>
> -struct xfs_repair_extent_list {
> +struct xrep_extent_list {
> struct list_head list;
> };
>
> static inline void
> -xfs_repair_init_extent_list(
> - struct xfs_repair_extent_list *exlist)
> +xrep_init_extent_list(
> + struct xrep_extent_list *exlist)
> {
> INIT_LIST_HEAD(&exlist->list);
> }
>
> -#define for_each_xfs_repair_extent_safe(rbe, n, exlist) \
> +#define for_each_xrep_extent_safe(rbe, n, exlist) \
> list_for_each_entry_safe((rbe), (n), &(exlist)->list, list)
> -int xfs_repair_collect_btree_extent(struct xfs_scrub_context *sc,
> - struct xfs_repair_extent_list *btlist, xfs_fsblock_t fsbno,
> +int xrep_collect_btree_extent(struct xfs_scrub_context *sc,
> + struct xrep_extent_list *btlist, xfs_fsblock_t fsbno,
> xfs_extlen_t len);
> -void xfs_repair_cancel_btree_extents(struct xfs_scrub_context *sc,
> - struct xfs_repair_extent_list *btlist);
> -int xfs_repair_subtract_extents(struct xfs_scrub_context *sc,
> - struct xfs_repair_extent_list *exlist,
> - struct xfs_repair_extent_list *sublist);
> -int xfs_repair_fix_freelist(struct xfs_scrub_context *sc, bool can_shrink);
> -int xfs_repair_invalidate_blocks(struct xfs_scrub_context *sc,
> - struct xfs_repair_extent_list *btlist);
> -int xfs_repair_reap_btree_extents(struct xfs_scrub_context *sc,
> - struct xfs_repair_extent_list *exlist,
> +void xrep_cancel_btree_extents(struct xfs_scrub_context *sc,
> + struct xrep_extent_list *btlist);
> +int xrep_subtract_extents(struct xfs_scrub_context *sc,
> + struct xrep_extent_list *exlist,
> + struct xrep_extent_list *sublist);
> +int xrep_fix_freelist(struct xfs_scrub_context *sc, bool can_shrink);
> +int xrep_invalidate_blocks(struct xfs_scrub_context *sc,
> + struct xrep_extent_list *btlist);
> +int xrep_reap_btree_extents(struct xfs_scrub_context *sc,
> + struct xrep_extent_list *exlist,
> struct xfs_owner_info *oinfo, enum xfs_ag_resv_type type);
>
> -struct xfs_repair_find_ag_btree {
> +struct xrep_find_ag_btree {
> /* in: rmap owner of the btree we're looking for */
> uint64_t rmap_owner;
>
> @@ -78,21 +78,21 @@ struct xfs_repair_find_ag_btree {
> unsigned int height;
> };
>
> -int xfs_repair_find_ag_btree_roots(struct xfs_scrub_context *sc,
> +int xrep_find_ag_btree_roots(struct xfs_scrub_context *sc,
> struct xfs_buf *agf_bp,
> - struct xfs_repair_find_ag_btree *btree_info,
> + struct xrep_find_ag_btree *btree_info,
> struct xfs_buf *agfl_bp);
> -void xfs_repair_force_quotacheck(struct xfs_scrub_context *sc, uint dqtype);
> -int xfs_repair_ino_dqattach(struct xfs_scrub_context *sc);
> +void xrep_force_quotacheck(struct xfs_scrub_context *sc, uint dqtype);
> +int xrep_ino_dqattach(struct xfs_scrub_context *sc);
>
> /* Metadata repairers */
>
> -int xfs_repair_probe(struct xfs_scrub_context *sc);
> -int xfs_repair_superblock(struct xfs_scrub_context *sc);
> +int xrep_probe(struct xfs_scrub_context *sc);
> +int xrep_superblock(struct xfs_scrub_context *sc);
>
> #else
>
> -static inline int xfs_repair_attempt(
> +static inline int xrep_attempt(
> struct xfs_inode *ip,
> struct xfs_scrub_context *sc,
> bool *fixed)
> @@ -100,18 +100,18 @@ static inline int xfs_repair_attempt(
> return -EOPNOTSUPP;
> }
>
> -static inline void xfs_repair_failure(struct xfs_mount *mp) {}
> +static inline void xrep_failure(struct xfs_mount *mp) {}
>
> static inline xfs_extlen_t
> -xfs_repair_calc_ag_resblks(
> +xrep_calc_ag_resblks(
> struct xfs_scrub_context *sc)
> {
> ASSERT(!(sc->sm->sm_flags & XFS_SCRUB_IFLAG_REPAIR));
> return 0;
> }
>
> -#define xfs_repair_probe xfs_repair_notsupported
> -#define xfs_repair_superblock xfs_repair_notsupported
> +#define xrep_probe xrep_notsupported
> +#define xrep_superblock xrep_notsupported
>
> #endif /* CONFIG_XFS_ONLINE_REPAIR */
>
> diff --git a/fs/xfs/scrub/scrub.c b/fs/xfs/scrub/scrub.c
> index ead97ab91a3c..a6efede6e430 100644
> --- a/fs/xfs/scrub/scrub.c
> +++ b/fs/xfs/scrub/scrub.c
> @@ -202,150 +202,150 @@ static const struct xchk_meta_ops meta_scrub_ops[] = {
> .type = ST_NONE,
> .setup = xchk_setup_fs,
> .scrub = xchk_probe,
> - .repair = xfs_repair_probe,
> + .repair = xrep_probe,
> },
> [XFS_SCRUB_TYPE_SB] = { /* superblock */
> .type = ST_PERAG,
> .setup = xchk_setup_fs,
> .scrub = xchk_superblock,
> - .repair = xfs_repair_superblock,
> + .repair = xrep_superblock,
> },
> [XFS_SCRUB_TYPE_AGF] = { /* agf */
> .type = ST_PERAG,
> .setup = xchk_setup_fs,
> .scrub = xchk_agf,
> - .repair = xfs_repair_notsupported,
> + .repair = xrep_notsupported,
> },
> [XFS_SCRUB_TYPE_AGFL]= { /* agfl */
> .type = ST_PERAG,
> .setup = xchk_setup_fs,
> .scrub = xchk_agfl,
> - .repair = xfs_repair_notsupported,
> + .repair = xrep_notsupported,
> },
> [XFS_SCRUB_TYPE_AGI] = { /* agi */
> .type = ST_PERAG,
> .setup = xchk_setup_fs,
> .scrub = xchk_agi,
> - .repair = xfs_repair_notsupported,
> + .repair = xrep_notsupported,
> },
> [XFS_SCRUB_TYPE_BNOBT] = { /* bnobt */
> .type = ST_PERAG,
> .setup = xchk_setup_ag_allocbt,
> .scrub = xchk_bnobt,
> - .repair = xfs_repair_notsupported,
> + .repair = xrep_notsupported,
> },
> [XFS_SCRUB_TYPE_CNTBT] = { /* cntbt */
> .type = ST_PERAG,
> .setup = xchk_setup_ag_allocbt,
> .scrub = xchk_cntbt,
> - .repair = xfs_repair_notsupported,
> + .repair = xrep_notsupported,
> },
> [XFS_SCRUB_TYPE_INOBT] = { /* inobt */
> .type = ST_PERAG,
> .setup = xchk_setup_ag_iallocbt,
> .scrub = xchk_inobt,
> - .repair = xfs_repair_notsupported,
> + .repair = xrep_notsupported,
> },
> [XFS_SCRUB_TYPE_FINOBT] = { /* finobt */
> .type = ST_PERAG,
> .setup = xchk_setup_ag_iallocbt,
> .scrub = xchk_finobt,
> .has = xfs_sb_version_hasfinobt,
> - .repair = xfs_repair_notsupported,
> + .repair = xrep_notsupported,
> },
> [XFS_SCRUB_TYPE_RMAPBT] = { /* rmapbt */
> .type = ST_PERAG,
> .setup = xchk_setup_ag_rmapbt,
> .scrub = xchk_rmapbt,
> .has = xfs_sb_version_hasrmapbt,
> - .repair = xfs_repair_notsupported,
> + .repair = xrep_notsupported,
> },
> [XFS_SCRUB_TYPE_REFCNTBT] = { /* refcountbt */
> .type = ST_PERAG,
> .setup = xchk_setup_ag_refcountbt,
> .scrub = xchk_refcountbt,
> .has = xfs_sb_version_hasreflink,
> - .repair = xfs_repair_notsupported,
> + .repair = xrep_notsupported,
> },
> [XFS_SCRUB_TYPE_INODE] = { /* inode record */
> .type = ST_INODE,
> .setup = xchk_setup_inode,
> .scrub = xchk_inode,
> - .repair = xfs_repair_notsupported,
> + .repair = xrep_notsupported,
> },
> [XFS_SCRUB_TYPE_BMBTD] = { /* inode data fork */
> .type = ST_INODE,
> .setup = xchk_setup_inode_bmap,
> .scrub = xchk_bmap_data,
> - .repair = xfs_repair_notsupported,
> + .repair = xrep_notsupported,
> },
> [XFS_SCRUB_TYPE_BMBTA] = { /* inode attr fork */
> .type = ST_INODE,
> .setup = xchk_setup_inode_bmap,
> .scrub = xchk_bmap_attr,
> - .repair = xfs_repair_notsupported,
> + .repair = xrep_notsupported,
> },
> [XFS_SCRUB_TYPE_BMBTC] = { /* inode CoW fork */
> .type = ST_INODE,
> .setup = xchk_setup_inode_bmap,
> .scrub = xchk_bmap_cow,
> - .repair = xfs_repair_notsupported,
> + .repair = xrep_notsupported,
> },
> [XFS_SCRUB_TYPE_DIR] = { /* directory */
> .type = ST_INODE,
> .setup = xchk_setup_directory,
> .scrub = xchk_directory,
> - .repair = xfs_repair_notsupported,
> + .repair = xrep_notsupported,
> },
> [XFS_SCRUB_TYPE_XATTR] = { /* extended attributes */
> .type = ST_INODE,
> .setup = xchk_setup_xattr,
> .scrub = xchk_xattr,
> - .repair = xfs_repair_notsupported,
> + .repair = xrep_notsupported,
> },
> [XFS_SCRUB_TYPE_SYMLINK] = { /* symbolic link */
> .type = ST_INODE,
> .setup = xchk_setup_symlink,
> .scrub = xchk_symlink,
> - .repair = xfs_repair_notsupported,
> + .repair = xrep_notsupported,
> },
> [XFS_SCRUB_TYPE_PARENT] = { /* parent pointers */
> .type = ST_INODE,
> .setup = xchk_setup_parent,
> .scrub = xchk_parent,
> - .repair = xfs_repair_notsupported,
> + .repair = xrep_notsupported,
> },
> [XFS_SCRUB_TYPE_RTBITMAP] = { /* realtime bitmap */
> .type = ST_FS,
> .setup = xchk_setup_rt,
> .scrub = xchk_rtbitmap,
> .has = xfs_sb_version_hasrealtime,
> - .repair = xfs_repair_notsupported,
> + .repair = xrep_notsupported,
> },
> [XFS_SCRUB_TYPE_RTSUM] = { /* realtime summary */
> .type = ST_FS,
> .setup = xchk_setup_rt,
> .scrub = xchk_rtsummary,
> .has = xfs_sb_version_hasrealtime,
> - .repair = xfs_repair_notsupported,
> + .repair = xrep_notsupported,
> },
> [XFS_SCRUB_TYPE_UQUOTA] = { /* user quota */
> .type = ST_FS,
> .setup = xchk_setup_quota,
> .scrub = xchk_quota,
> - .repair = xfs_repair_notsupported,
> + .repair = xrep_notsupported,
> },
> [XFS_SCRUB_TYPE_GQUOTA] = { /* group quota */
> .type = ST_FS,
> .setup = xchk_setup_quota,
> .scrub = xchk_quota,
> - .repair = xfs_repair_notsupported,
> + .repair = xrep_notsupported,
> },
> [XFS_SCRUB_TYPE_PQUOTA] = { /* project quota */
> .type = ST_FS,
> .setup = xchk_setup_quota,
> .scrub = xchk_quota,
> - .repair = xfs_repair_notsupported,
> + .repair = xrep_notsupported,
> },
> };
>
> @@ -457,7 +457,7 @@ static inline void xchk_postmortem(struct xfs_scrub_context *sc)
> if ((sc->sm->sm_flags & XFS_SCRUB_IFLAG_REPAIR) &&
> (sc->sm->sm_flags & (XFS_SCRUB_OFLAG_CORRUPT |
> XFS_SCRUB_OFLAG_XCORRUPT)))
> - xfs_repair_failure(sc->mp);
> + xrep_failure(sc->mp);
> }
> #else
> static inline void xchk_postmortem(struct xfs_scrub_context *sc)
> @@ -555,13 +555,13 @@ xfs_scrub_metadata(
> * If it's broken, userspace wants us to fix it, and we haven't
> * already tried to fix it, then attempt a repair.
> */
> - error = xfs_repair_attempt(ip, &sc, &already_fixed);
> + error = xrep_attempt(ip, &sc, &already_fixed);
> if (error == -EAGAIN) {
> if (sc.try_harder)
> try_harder = true;
> error = xchk_teardown(&sc, ip, 0);
> if (error) {
> - xfs_repair_failure(mp);
> + xrep_failure(mp);
> goto out;
> }
> goto retry_op;
> diff --git a/fs/xfs/scrub/trace.h b/fs/xfs/scrub/trace.h
> index 11967d3942ac..96f3edda3e91 100644
> --- a/fs/xfs/scrub/trace.h
> +++ b/fs/xfs/scrub/trace.h
> @@ -55,8 +55,8 @@ DEFINE_EVENT(xchk_class, name, \
> DEFINE_SCRUB_EVENT(xchk_start);
> DEFINE_SCRUB_EVENT(xchk_done);
> DEFINE_SCRUB_EVENT(xchk_deadlock_retry);
> -DEFINE_SCRUB_EVENT(xfs_repair_attempt);
> -DEFINE_SCRUB_EVENT(xfs_repair_done);
> +DEFINE_SCRUB_EVENT(xrep_attempt);
> +DEFINE_SCRUB_EVENT(xrep_done);
>
> TRACE_EVENT(xchk_op_error,
> TP_PROTO(struct xfs_scrub_context *sc, xfs_agnumber_t agno,
> @@ -483,7 +483,7 @@ TRACE_EVENT(xchk_xref_error,
> /* repair tracepoints */
> #if IS_ENABLED(CONFIG_XFS_ONLINE_REPAIR)
>
> -DECLARE_EVENT_CLASS(xfs_repair_extent_class,
> +DECLARE_EVENT_CLASS(xrep_extent_class,
> TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
> xfs_agblock_t agbno, xfs_extlen_t len),
> TP_ARGS(mp, agno, agbno, len),
> @@ -506,15 +506,15 @@ DECLARE_EVENT_CLASS(xfs_repair_extent_class,
> __entry->len)
> );
> #define DEFINE_REPAIR_EXTENT_EVENT(name) \
> -DEFINE_EVENT(xfs_repair_extent_class, name, \
> +DEFINE_EVENT(xrep_extent_class, name, \
> TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
> xfs_agblock_t agbno, xfs_extlen_t len), \
> TP_ARGS(mp, agno, agbno, len))
> -DEFINE_REPAIR_EXTENT_EVENT(xfs_repair_dispose_btree_extent);
> -DEFINE_REPAIR_EXTENT_EVENT(xfs_repair_collect_btree_extent);
> -DEFINE_REPAIR_EXTENT_EVENT(xfs_repair_agfl_insert);
> +DEFINE_REPAIR_EXTENT_EVENT(xrep_dispose_btree_extent);
> +DEFINE_REPAIR_EXTENT_EVENT(xrep_collect_btree_extent);
> +DEFINE_REPAIR_EXTENT_EVENT(xrep_agfl_insert);
>
> -DECLARE_EVENT_CLASS(xfs_repair_rmap_class,
> +DECLARE_EVENT_CLASS(xrep_rmap_class,
> TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
> xfs_agblock_t agbno, xfs_extlen_t len,
> uint64_t owner, uint64_t offset, unsigned int flags),
> @@ -547,17 +547,17 @@ DECLARE_EVENT_CLASS(xfs_repair_rmap_class,
> __entry->flags)
> );
> #define DEFINE_REPAIR_RMAP_EVENT(name) \
> -DEFINE_EVENT(xfs_repair_rmap_class, name, \
> +DEFINE_EVENT(xrep_rmap_class, name, \
> TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
> xfs_agblock_t agbno, xfs_extlen_t len, \
> uint64_t owner, uint64_t offset, unsigned int flags), \
> TP_ARGS(mp, agno, agbno, len, owner, offset, flags))
> -DEFINE_REPAIR_RMAP_EVENT(xfs_repair_alloc_extent_fn);
> -DEFINE_REPAIR_RMAP_EVENT(xfs_repair_ialloc_extent_fn);
> -DEFINE_REPAIR_RMAP_EVENT(xfs_repair_rmap_extent_fn);
> -DEFINE_REPAIR_RMAP_EVENT(xfs_repair_bmap_extent_fn);
> +DEFINE_REPAIR_RMAP_EVENT(xrep_alloc_extent_fn);
> +DEFINE_REPAIR_RMAP_EVENT(xrep_ialloc_extent_fn);
> +DEFINE_REPAIR_RMAP_EVENT(xrep_rmap_extent_fn);
> +DEFINE_REPAIR_RMAP_EVENT(xrep_bmap_extent_fn);
>
> -TRACE_EVENT(xfs_repair_refcount_extent_fn,
> +TRACE_EVENT(xrep_refcount_extent_fn,
> TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
> struct xfs_refcount_irec *irec),
> TP_ARGS(mp, agno, irec),
> @@ -583,7 +583,7 @@ TRACE_EVENT(xfs_repair_refcount_extent_fn,
> __entry->refcount)
> )
>
> -TRACE_EVENT(xfs_repair_init_btblock,
> +TRACE_EVENT(xrep_init_btblock,
> TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
> xfs_btnum_t btnum),
> TP_ARGS(mp, agno, agbno, btnum),
> @@ -605,7 +605,7 @@ TRACE_EVENT(xfs_repair_init_btblock,
> __entry->agbno,
> __entry->btnum)
> )
> -TRACE_EVENT(xfs_repair_findroot_block,
> +TRACE_EVENT(xrep_findroot_block,
> TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
> uint32_t magic, uint16_t level),
> TP_ARGS(mp, agno, agbno, magic, level),
> @@ -630,7 +630,7 @@ TRACE_EVENT(xfs_repair_findroot_block,
> __entry->magic,
> __entry->level)
> )
> -TRACE_EVENT(xfs_repair_calc_ag_resblks,
> +TRACE_EVENT(xrep_calc_ag_resblks,
> TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
> xfs_agino_t icount, xfs_agblock_t aglen, xfs_agblock_t freelen,
> xfs_agblock_t usedlen),
> @@ -659,7 +659,7 @@ TRACE_EVENT(xfs_repair_calc_ag_resblks,
> __entry->freelen,
> __entry->usedlen)
> )
> -TRACE_EVENT(xfs_repair_calc_ag_resblks_btsize,
> +TRACE_EVENT(xrep_calc_ag_resblks_btsize,
> TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
> xfs_agblock_t bnobt_sz, xfs_agblock_t inobt_sz,
> xfs_agblock_t rmapbt_sz, xfs_agblock_t refcbt_sz),
> @@ -688,7 +688,7 @@ TRACE_EVENT(xfs_repair_calc_ag_resblks_btsize,
> __entry->rmapbt_sz,
> __entry->refcbt_sz)
> )
> -TRACE_EVENT(xfs_repair_reset_counters,
> +TRACE_EVENT(xrep_reset_counters,
> TP_PROTO(struct xfs_mount *mp),
> TP_ARGS(mp),
> TP_STRUCT__entry(
> @@ -701,7 +701,7 @@ TRACE_EVENT(xfs_repair_reset_counters,
> MAJOR(__entry->dev), MINOR(__entry->dev))
> )
>
> -TRACE_EVENT(xfs_repair_ialloc_insert,
> +TRACE_EVENT(xrep_ialloc_insert,
> TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
> xfs_agino_t startino, uint16_t holemask, uint8_t count,
> uint8_t freecount, uint64_t freemask),
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 7/8] xfs: shorten struct xfs_scrub_context to struct xfs_scrub
2018-07-18 15:52 ` [PATCH 7/8] xfs: shorten struct xfs_scrub_context to struct xfs_scrub Darrick J. Wong
@ 2018-07-19 12:59 ` Brian Foster
0 siblings, 0 replies; 30+ messages in thread
From: Brian Foster @ 2018-07-19 12:59 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: linux-xfs
On Wed, Jul 18, 2018 at 08:52:05AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Shorten the name of the online fsck context structure. Whitespace
> damage will be fixed by a subsequent patch. There are no functional
> changes.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
> fs/xfs/scrub/agheader.c | 32 +++++++--------
> fs/xfs/scrub/agheader_repair.c | 2 -
> fs/xfs/scrub/alloc.c | 14 +++---
> fs/xfs/scrub/attr.c | 10 ++---
> fs/xfs/scrub/bmap.c | 22 +++++-----
> fs/xfs/scrub/btree.c | 14 +++---
> fs/xfs/scrub/btree.h | 12 +++--
> fs/xfs/scrub/common.c | 62 ++++++++++++++--------------
> fs/xfs/scrub/common.h | 88 ++++++++++++++++++++--------------------
> fs/xfs/scrub/dabtree.c | 6 +--
> fs/xfs/scrub/dabtree.h | 4 +-
> fs/xfs/scrub/dir.c | 18 ++++----
> fs/xfs/scrub/ialloc.c | 22 +++++-----
> fs/xfs/scrub/inode.c | 22 +++++-----
> fs/xfs/scrub/parent.c | 8 ++--
> fs/xfs/scrub/quota.c | 12 +++--
> fs/xfs/scrub/refcount.c | 16 ++++---
> fs/xfs/scrub/repair.c | 36 ++++++++--------
> fs/xfs/scrub/repair.h | 38 +++++++++--------
> fs/xfs/scrub/rmap.c | 16 ++++---
> fs/xfs/scrub/rtbitmap.c | 10 ++---
> fs/xfs/scrub/scrub.c | 10 ++---
> fs/xfs/scrub/scrub.h | 78 ++++++++++++++++++-----------------
> fs/xfs/scrub/symlink.c | 4 +-
> fs/xfs/scrub/trace.h | 32 +++++++--------
> 25 files changed, 294 insertions(+), 294 deletions(-)
>
>
> diff --git a/fs/xfs/scrub/agheader.c b/fs/xfs/scrub/agheader.c
> index c0625ec16d63..14ba4189ae8f 100644
> --- a/fs/xfs/scrub/agheader.c
> +++ b/fs/xfs/scrub/agheader.c
> @@ -29,7 +29,7 @@
> /* Cross-reference with the other btrees. */
> STATIC void
> xchk_superblock_xref(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
Assuming the indents are fixed up in the next patch:
Reviewed-by: Brian Foster <bfoster@redhat.com>
> struct xfs_buf *bp)
> {
> struct xfs_owner_info oinfo;
> @@ -66,7 +66,7 @@ xchk_superblock_xref(
> */
> int
> xchk_superblock(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> struct xfs_mount *mp = sc->mp;
> struct xfs_buf *bp;
> @@ -365,7 +365,7 @@ xchk_agf_record_bno_lengths(
> /* Check agf_freeblks */
> static inline void
> xchk_agf_xref_freeblks(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> struct xfs_agf *agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
> xfs_extlen_t blocks = 0;
> @@ -385,7 +385,7 @@ xchk_agf_xref_freeblks(
> /* Cross reference the AGF with the cntbt (freespace by length btree) */
> static inline void
> xchk_agf_xref_cntbt(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> struct xfs_agf *agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
> xfs_agblock_t agbno;
> @@ -417,7 +417,7 @@ xchk_agf_xref_cntbt(
> /* Check the btree block counts in the AGF against the btrees. */
> STATIC void
> xchk_agf_xref_btreeblks(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> struct xfs_agf *agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
> struct xfs_mount *mp = sc->mp;
> @@ -463,7 +463,7 @@ xchk_agf_xref_btreeblks(
> /* Check agf_refcount_blocks against tree size */
> static inline void
> xchk_agf_xref_refcblks(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> struct xfs_agf *agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
> xfs_agblock_t blocks;
> @@ -482,7 +482,7 @@ xchk_agf_xref_refcblks(
> /* Cross-reference with the other btrees. */
> STATIC void
> xchk_agf_xref(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> struct xfs_owner_info oinfo;
> struct xfs_mount *mp = sc->mp;
> @@ -514,7 +514,7 @@ xchk_agf_xref(
> /* Scrub the AGF. */
> int
> xchk_agf(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> struct xfs_mount *mp = sc->mp;
> struct xfs_agf *agf;
> @@ -602,13 +602,13 @@ struct xchk_agfl_info {
> unsigned int sz_entries;
> unsigned int nr_entries;
> xfs_agblock_t *entries;
> - struct xfs_scrub_context *sc;
> + struct xfs_scrub *sc;
> };
>
> /* Cross-reference with the other btrees. */
> STATIC void
> xchk_agfl_block_xref(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_agblock_t agbno,
> struct xfs_owner_info *oinfo)
> {
> @@ -629,7 +629,7 @@ xchk_agfl_block(
> void *priv)
> {
> struct xchk_agfl_info *sai = priv;
> - struct xfs_scrub_context *sc = sai->sc;
> + struct xfs_scrub *sc = sai->sc;
> xfs_agnumber_t agno = sc->sa.agno;
>
> if (xfs_verify_agbno(mp, agno, agbno) &&
> @@ -660,7 +660,7 @@ xchk_agblock_cmp(
> /* Cross-reference with the other btrees. */
> STATIC void
> xchk_agfl_xref(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> struct xfs_owner_info oinfo;
> struct xfs_mount *mp = sc->mp;
> @@ -691,7 +691,7 @@ xchk_agfl_xref(
> /* Scrub the AGFL. */
> int
> xchk_agfl(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> struct xchk_agfl_info sai;
> struct xfs_agf *agf;
> @@ -768,7 +768,7 @@ xchk_agfl(
> /* Check agi_count/agi_freecount */
> static inline void
> xchk_agi_xref_icounts(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> struct xfs_agi *agi = XFS_BUF_TO_AGI(sc->sa.agi_bp);
> xfs_agino_t icount;
> @@ -789,7 +789,7 @@ xchk_agi_xref_icounts(
> /* Cross-reference with the other btrees. */
> STATIC void
> xchk_agi_xref(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> struct xfs_owner_info oinfo;
> struct xfs_mount *mp = sc->mp;
> @@ -818,7 +818,7 @@ xchk_agi_xref(
> /* Scrub the AGI. */
> int
> xchk_agi(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> struct xfs_mount *mp = sc->mp;
> struct xfs_agi *agi;
> diff --git a/fs/xfs/scrub/agheader_repair.c b/fs/xfs/scrub/agheader_repair.c
> index 631940f3ca4d..2457968482f8 100644
> --- a/fs/xfs/scrub/agheader_repair.c
> +++ b/fs/xfs/scrub/agheader_repair.c
> @@ -29,7 +29,7 @@
> /* Repair the superblock. */
> int
> xrep_superblock(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> struct xfs_mount *mp = sc->mp;
> struct xfs_buf *bp;
> diff --git a/fs/xfs/scrub/alloc.c b/fs/xfs/scrub/alloc.c
> index 1f6e3a6a1fdd..653d80b3aa39 100644
> --- a/fs/xfs/scrub/alloc.c
> +++ b/fs/xfs/scrub/alloc.c
> @@ -29,7 +29,7 @@
> */
> int
> xchk_setup_ag_allocbt(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_inode *ip)
> {
> return xchk_setup_ag_btree(sc, ip, false);
> @@ -42,7 +42,7 @@ xchk_setup_ag_allocbt(
> */
> STATIC void
> xchk_allocbt_xref_other(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_agblock_t agbno,
> xfs_extlen_t len)
> {
> @@ -82,7 +82,7 @@ xchk_allocbt_xref_other(
> /* Cross-reference with the other btrees. */
> STATIC void
> xchk_allocbt_xref(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_agblock_t agbno,
> xfs_extlen_t len)
> {
> @@ -123,7 +123,7 @@ xchk_allocbt_rec(
> /* Scrub the freespace btrees for some AG. */
> STATIC int
> xchk_allocbt(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_btnum_t which)
> {
> struct xfs_owner_info oinfo;
> @@ -136,14 +136,14 @@ xchk_allocbt(
>
> int
> xchk_bnobt(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> return xchk_allocbt(sc, XFS_BTNUM_BNO);
> }
>
> int
> xchk_cntbt(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> return xchk_allocbt(sc, XFS_BTNUM_CNT);
> }
> @@ -151,7 +151,7 @@ xchk_cntbt(
> /* xref check that the extent is not free */
> void
> xchk_xref_is_used_space(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_agblock_t agbno,
> xfs_extlen_t len)
> {
> diff --git a/fs/xfs/scrub/attr.c b/fs/xfs/scrub/attr.c
> index 0068bebddf3e..6650fb3010b6 100644
> --- a/fs/xfs/scrub/attr.c
> +++ b/fs/xfs/scrub/attr.c
> @@ -33,7 +33,7 @@
> /* Set us up to scrub an inode's extended attributes. */
> int
> xchk_setup_xattr(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_inode *ip)
> {
> size_t sz;
> @@ -57,7 +57,7 @@ xchk_setup_xattr(
>
> struct xchk_xattr {
> struct xfs_attr_list_context context;
> - struct xfs_scrub_context *sc;
> + struct xfs_scrub *sc;
> };
>
> /*
> @@ -127,7 +127,7 @@ xchk_xattr_listent(
> */
> STATIC bool
> xchk_xattr_set_map(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> unsigned long *map,
> unsigned int start,
> unsigned int len)
> @@ -155,7 +155,7 @@ xchk_xattr_set_map(
> */
> STATIC bool
> xchk_xattr_check_freemap(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> unsigned long *map,
> struct xfs_attr3_icleaf_hdr *leafhdr)
> {
> @@ -405,7 +405,7 @@ xchk_xattr_rec(
> /* Scrub the extended attribute metadata. */
> int
> xchk_xattr(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> struct xchk_xattr sx;
> struct attrlist_cursor_kern cursor = { 0 };
> diff --git a/fs/xfs/scrub/bmap.c b/fs/xfs/scrub/bmap.c
> index 19cfbd3910a2..0e5166232b15 100644
> --- a/fs/xfs/scrub/bmap.c
> +++ b/fs/xfs/scrub/bmap.c
> @@ -34,7 +34,7 @@
> /* Set us up with an inode's bmap. */
> int
> xchk_setup_inode_bmap(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_inode *ip)
> {
> int error;
> @@ -79,7 +79,7 @@ xchk_setup_inode_bmap(
> */
>
> struct xchk_bmap_info {
> - struct xfs_scrub_context *sc;
> + struct xfs_scrub *sc;
> xfs_fileoff_t lastoff;
> bool is_rt;
> bool is_shared;
> @@ -391,7 +391,7 @@ xchk_bmapbt_rec(
> /* Scan the btree records. */
> STATIC int
> xchk_bmap_btree(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> int whichfork,
> struct xchk_bmap_info *info)
> {
> @@ -409,7 +409,7 @@ xchk_bmap_btree(
> }
>
> struct xchk_bmap_check_rmap_info {
> - struct xfs_scrub_context *sc;
> + struct xfs_scrub *sc;
> int whichfork;
> struct xfs_iext_cursor icur;
> };
> @@ -424,7 +424,7 @@ xchk_bmap_check_rmap(
> struct xfs_bmbt_irec irec;
> struct xchk_bmap_check_rmap_info *sbcri = priv;
> struct xfs_ifork *ifp;
> - struct xfs_scrub_context *sc = sbcri->sc;
> + struct xfs_scrub *sc = sbcri->sc;
> bool have_map;
>
> /* Is this even the right fork? */
> @@ -488,7 +488,7 @@ xchk_bmap_check_rmap(
> /* Make sure each rmap has a corresponding bmbt entry. */
> STATIC int
> xchk_bmap_check_ag_rmaps(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> int whichfork,
> xfs_agnumber_t agno)
> {
> @@ -522,7 +522,7 @@ xchk_bmap_check_ag_rmaps(
> /* Make sure each rmap has a corresponding bmbt entry. */
> STATIC int
> xchk_bmap_check_rmaps(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> int whichfork)
> {
> loff_t size;
> @@ -579,7 +579,7 @@ xchk_bmap_check_rmaps(
> */
> STATIC int
> xchk_bmap(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> int whichfork)
> {
> struct xfs_bmbt_irec irec;
> @@ -694,7 +694,7 @@ xchk_bmap(
> /* Scrub an inode's data fork. */
> int
> xchk_bmap_data(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> return xchk_bmap(sc, XFS_DATA_FORK);
> }
> @@ -702,7 +702,7 @@ xchk_bmap_data(
> /* Scrub an inode's attr fork. */
> int
> xchk_bmap_attr(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> return xchk_bmap(sc, XFS_ATTR_FORK);
> }
> @@ -710,7 +710,7 @@ xchk_bmap_attr(
> /* Scrub an inode's CoW fork. */
> int
> xchk_bmap_cow(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> if (!xfs_is_reflink_inode(sc->ip))
> return -ENOENT;
> diff --git a/fs/xfs/scrub/btree.c b/fs/xfs/scrub/btree.c
> index 30fe9a147959..c4e1dce8c5b3 100644
> --- a/fs/xfs/scrub/btree.c
> +++ b/fs/xfs/scrub/btree.c
> @@ -30,7 +30,7 @@
> */
> static bool
> __xchk_btree_process_error(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_btree_cur *cur,
> int level,
> int *error,
> @@ -65,7 +65,7 @@ __xchk_btree_process_error(
>
> bool
> xchk_btree_process_error(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_btree_cur *cur,
> int level,
> int *error)
> @@ -76,7 +76,7 @@ xchk_btree_process_error(
>
> bool
> xchk_btree_xref_process_error(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_btree_cur *cur,
> int level,
> int *error)
> @@ -88,7 +88,7 @@ xchk_btree_xref_process_error(
> /* Record btree block corruption. */
> static void
> __xchk_btree_set_corrupt(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_btree_cur *cur,
> int level,
> __u32 errflag,
> @@ -106,7 +106,7 @@ __xchk_btree_set_corrupt(
>
> void
> xchk_btree_set_corrupt(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_btree_cur *cur,
> int level)
> {
> @@ -116,7 +116,7 @@ xchk_btree_set_corrupt(
>
> void
> xchk_btree_xref_set_corrupt(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_btree_cur *cur,
> int level)
> {
> @@ -583,7 +583,7 @@ xchk_btree_block_keys(
> */
> int
> xchk_btree(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_btree_cur *cur,
> xchk_btree_rec_fn scrub_fn,
> struct xfs_owner_info *oinfo,
> diff --git a/fs/xfs/scrub/btree.h b/fs/xfs/scrub/btree.h
> index 598ac04a6c3e..a0b74b515b9b 100644
> --- a/fs/xfs/scrub/btree.h
> +++ b/fs/xfs/scrub/btree.h
> @@ -9,20 +9,20 @@
> /* btree scrub */
>
> /* Check for btree operation errors. */
> -bool xchk_btree_process_error(struct xfs_scrub_context *sc,
> +bool xchk_btree_process_error(struct xfs_scrub *sc,
> struct xfs_btree_cur *cur, int level, int *error);
>
> /* Check for btree xref operation errors. */
> -bool xchk_btree_xref_process_error(struct xfs_scrub_context *sc,
> +bool xchk_btree_xref_process_error(struct xfs_scrub *sc,
> struct xfs_btree_cur *cur, int level,
> int *error);
>
> /* Check for btree corruption. */
> -void xchk_btree_set_corrupt(struct xfs_scrub_context *sc,
> +void xchk_btree_set_corrupt(struct xfs_scrub *sc,
> struct xfs_btree_cur *cur, int level);
>
> /* Check for btree xref discrepancies. */
> -void xchk_btree_xref_set_corrupt(struct xfs_scrub_context *sc,
> +void xchk_btree_xref_set_corrupt(struct xfs_scrub *sc,
> struct xfs_btree_cur *cur, int level);
>
> struct xchk_btree;
> @@ -32,7 +32,7 @@ typedef int (*xchk_btree_rec_fn)(
>
> struct xchk_btree {
> /* caller-provided scrub state */
> - struct xfs_scrub_context *sc;
> + struct xfs_scrub *sc;
> struct xfs_btree_cur *cur;
> xchk_btree_rec_fn scrub_rec;
> struct xfs_owner_info *oinfo;
> @@ -45,7 +45,7 @@ struct xchk_btree {
> bool firstkey[XFS_BTREE_MAXLEVELS];
> struct list_head to_check;
> };
> -int xchk_btree(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur,
> +int xchk_btree(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
> xchk_btree_rec_fn scrub_fn,
> struct xfs_owner_info *oinfo, void *private);
>
> diff --git a/fs/xfs/scrub/common.c b/fs/xfs/scrub/common.c
> index fa1c16063d17..81e8bb7d5486 100644
> --- a/fs/xfs/scrub/common.c
> +++ b/fs/xfs/scrub/common.c
> @@ -69,7 +69,7 @@
> /* Check for operational errors. */
> static bool
> __xchk_process_error(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_agnumber_t agno,
> xfs_agblock_t bno,
> int *error,
> @@ -99,7 +99,7 @@ __xchk_process_error(
>
> bool
> xchk_process_error(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_agnumber_t agno,
> xfs_agblock_t bno,
> int *error)
> @@ -110,7 +110,7 @@ xchk_process_error(
>
> bool
> xchk_xref_process_error(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_agnumber_t agno,
> xfs_agblock_t bno,
> int *error)
> @@ -122,7 +122,7 @@ xchk_xref_process_error(
> /* Check for operational errors for a file offset. */
> static bool
> __xchk_fblock_process_error(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> int whichfork,
> xfs_fileoff_t offset,
> int *error,
> @@ -152,7 +152,7 @@ __xchk_fblock_process_error(
>
> bool
> xchk_fblock_process_error(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> int whichfork,
> xfs_fileoff_t offset,
> int *error)
> @@ -163,7 +163,7 @@ xchk_fblock_process_error(
>
> bool
> xchk_fblock_xref_process_error(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> int whichfork,
> xfs_fileoff_t offset,
> int *error)
> @@ -187,7 +187,7 @@ xchk_fblock_xref_process_error(
> /* Record a block which could be optimized. */
> void
> xchk_block_set_preen(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_buf *bp)
> {
> sc->sm->sm_flags |= XFS_SCRUB_OFLAG_PREEN;
> @@ -201,7 +201,7 @@ xchk_block_set_preen(
> */
> void
> xchk_ino_set_preen(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_ino_t ino)
> {
> sc->sm->sm_flags |= XFS_SCRUB_OFLAG_PREEN;
> @@ -211,7 +211,7 @@ xchk_ino_set_preen(
> /* Record a corrupt block. */
> void
> xchk_block_set_corrupt(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_buf *bp)
> {
> sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT;
> @@ -221,7 +221,7 @@ xchk_block_set_corrupt(
> /* Record a corruption while cross-referencing. */
> void
> xchk_block_xref_set_corrupt(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_buf *bp)
> {
> sc->sm->sm_flags |= XFS_SCRUB_OFLAG_XCORRUPT;
> @@ -235,7 +235,7 @@ xchk_block_xref_set_corrupt(
> */
> void
> xchk_ino_set_corrupt(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_ino_t ino)
> {
> sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT;
> @@ -245,7 +245,7 @@ xchk_ino_set_corrupt(
> /* Record a corruption while cross-referencing with an inode. */
> void
> xchk_ino_xref_set_corrupt(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_ino_t ino)
> {
> sc->sm->sm_flags |= XFS_SCRUB_OFLAG_XCORRUPT;
> @@ -255,7 +255,7 @@ xchk_ino_xref_set_corrupt(
> /* Record corruption in a block indexed by a file fork. */
> void
> xchk_fblock_set_corrupt(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> int whichfork,
> xfs_fileoff_t offset)
> {
> @@ -266,7 +266,7 @@ xchk_fblock_set_corrupt(
> /* Record a corruption while cross-referencing a fork block. */
> void
> xchk_fblock_xref_set_corrupt(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> int whichfork,
> xfs_fileoff_t offset)
> {
> @@ -280,7 +280,7 @@ xchk_fblock_xref_set_corrupt(
> */
> void
> xchk_ino_set_warning(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_ino_t ino)
> {
> sc->sm->sm_flags |= XFS_SCRUB_OFLAG_WARNING;
> @@ -290,7 +290,7 @@ xchk_ino_set_warning(
> /* Warn about a block indexed by a file fork that needs review. */
> void
> xchk_fblock_set_warning(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> int whichfork,
> xfs_fileoff_t offset)
> {
> @@ -301,7 +301,7 @@ xchk_fblock_set_warning(
> /* Signal an incomplete scrub. */
> void
> xchk_set_incomplete(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> sc->sm->sm_flags |= XFS_SCRUB_OFLAG_INCOMPLETE;
> trace_xchk_incomplete(sc, __return_address);
> @@ -345,7 +345,7 @@ xchk_count_rmap_ownedby_irec(
> */
> int
> xchk_count_rmap_ownedby_ag(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_btree_cur *cur,
> struct xfs_owner_info *oinfo,
> xfs_filblks_t *blocks)
> @@ -371,7 +371,7 @@ xchk_count_rmap_ownedby_ag(
> /* Decide if we want to return an AG header read failure. */
> static inline bool
> want_ag_read_header_failure(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> unsigned int type)
> {
> /* Return all AG header read failures when scanning btrees. */
> @@ -398,7 +398,7 @@ want_ag_read_header_failure(
> */
> int
> xchk_ag_read_headers(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_agnumber_t agno,
> struct xfs_buf **agi,
> struct xfs_buf **agf,
> @@ -452,7 +452,7 @@ xchk_ag_btcur_free(
> /* Initialize all the btree cursors for an AG. */
> int
> xchk_ag_btcur_init(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xchk_ag *sa)
> {
> struct xfs_mount *mp = sc->mp;
> @@ -512,7 +512,7 @@ xchk_ag_btcur_init(
> /* Release the AG header context and btree cursors. */
> void
> xchk_ag_free(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xchk_ag *sa)
> {
> xchk_ag_btcur_free(sa);
> @@ -544,7 +544,7 @@ xchk_ag_free(
> */
> int
> xchk_ag_init(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_agnumber_t agno,
> struct xchk_ag *sa)
> {
> @@ -586,7 +586,7 @@ xchk_perag_get(
> */
> int
> xchk_trans_alloc(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> uint resblks)
> {
> if (sc->sm->sm_flags & XFS_SCRUB_IFLAG_REPAIR)
> @@ -599,7 +599,7 @@ xchk_trans_alloc(
> /* Set us up with a transaction and an empty context. */
> int
> xchk_setup_fs(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_inode *ip)
> {
> uint resblks;
> @@ -611,7 +611,7 @@ xchk_setup_fs(
> /* Set us up with AG headers and btree cursors. */
> int
> xchk_setup_ag_btree(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_inode *ip,
> bool force_log)
> {
> @@ -658,7 +658,7 @@ xchk_checkpoint_log(
> */
> int
> xchk_get_inode(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_inode *ip_in)
> {
> struct xfs_imap imap;
> @@ -722,7 +722,7 @@ xchk_get_inode(
> /* Set us up to scrub a file's contents. */
> int
> xchk_setup_inode_contents(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_inode *ip,
> unsigned int resblks)
> {
> @@ -753,7 +753,7 @@ xchk_setup_inode_contents(
> */
> bool
> xchk_should_check_xref(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> int *error,
> struct xfs_btree_cur **curpp)
> {
> @@ -788,7 +788,7 @@ xchk_should_check_xref(
> /* Run the structure verifiers on in-memory buffers to detect bad memory. */
> void
> xchk_buffer_recheck(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_buf *bp)
> {
> xfs_failaddr_t fa;
> @@ -814,7 +814,7 @@ xchk_buffer_recheck(
> */
> int
> xchk_metadata_inode_forks(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> __u32 smtype;
> bool shared;
> diff --git a/fs/xfs/scrub/common.h b/fs/xfs/scrub/common.h
> index 5881cb2ecc26..c321230d32dc 100644
> --- a/fs/xfs/scrub/common.h
> +++ b/fs/xfs/scrub/common.h
> @@ -13,7 +13,7 @@
> */
> static inline bool
> xchk_should_terminate(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> int *error)
> {
> if (fatal_signal_pending(current)) {
> @@ -24,109 +24,109 @@ xchk_should_terminate(
> return false;
> }
>
> -int xchk_trans_alloc(struct xfs_scrub_context *sc, uint resblks);
> -bool xchk_process_error(struct xfs_scrub_context *sc, xfs_agnumber_t agno,
> +int xchk_trans_alloc(struct xfs_scrub *sc, uint resblks);
> +bool xchk_process_error(struct xfs_scrub *sc, xfs_agnumber_t agno,
> xfs_agblock_t bno, int *error);
> -bool xchk_fblock_process_error(struct xfs_scrub_context *sc, int whichfork,
> +bool xchk_fblock_process_error(struct xfs_scrub *sc, int whichfork,
> xfs_fileoff_t offset, int *error);
>
> -bool xchk_xref_process_error(struct xfs_scrub_context *sc,
> +bool xchk_xref_process_error(struct xfs_scrub *sc,
> xfs_agnumber_t agno, xfs_agblock_t bno, int *error);
> -bool xchk_fblock_xref_process_error(struct xfs_scrub_context *sc,
> +bool xchk_fblock_xref_process_error(struct xfs_scrub *sc,
> int whichfork, xfs_fileoff_t offset, int *error);
>
> -void xchk_block_set_preen(struct xfs_scrub_context *sc,
> +void xchk_block_set_preen(struct xfs_scrub *sc,
> struct xfs_buf *bp);
> -void xchk_ino_set_preen(struct xfs_scrub_context *sc, xfs_ino_t ino);
> +void xchk_ino_set_preen(struct xfs_scrub *sc, xfs_ino_t ino);
>
> -void xchk_block_set_corrupt(struct xfs_scrub_context *sc,
> +void xchk_block_set_corrupt(struct xfs_scrub *sc,
> struct xfs_buf *bp);
> -void xchk_ino_set_corrupt(struct xfs_scrub_context *sc, xfs_ino_t ino);
> -void xchk_fblock_set_corrupt(struct xfs_scrub_context *sc, int whichfork,
> +void xchk_ino_set_corrupt(struct xfs_scrub *sc, xfs_ino_t ino);
> +void xchk_fblock_set_corrupt(struct xfs_scrub *sc, int whichfork,
> xfs_fileoff_t offset);
>
> -void xchk_block_xref_set_corrupt(struct xfs_scrub_context *sc,
> +void xchk_block_xref_set_corrupt(struct xfs_scrub *sc,
> struct xfs_buf *bp);
> -void xchk_ino_xref_set_corrupt(struct xfs_scrub_context *sc,
> +void xchk_ino_xref_set_corrupt(struct xfs_scrub *sc,
> xfs_ino_t ino);
> -void xchk_fblock_xref_set_corrupt(struct xfs_scrub_context *sc,
> +void xchk_fblock_xref_set_corrupt(struct xfs_scrub *sc,
> int whichfork, xfs_fileoff_t offset);
>
> -void xchk_ino_set_warning(struct xfs_scrub_context *sc, xfs_ino_t ino);
> -void xchk_fblock_set_warning(struct xfs_scrub_context *sc, int whichfork,
> +void xchk_ino_set_warning(struct xfs_scrub *sc, xfs_ino_t ino);
> +void xchk_fblock_set_warning(struct xfs_scrub *sc, int whichfork,
> xfs_fileoff_t offset);
>
> -void xchk_set_incomplete(struct xfs_scrub_context *sc);
> +void xchk_set_incomplete(struct xfs_scrub *sc);
> int xchk_checkpoint_log(struct xfs_mount *mp);
>
> /* Are we set up for a cross-referencing check? */
> -bool xchk_should_check_xref(struct xfs_scrub_context *sc, int *error,
> +bool xchk_should_check_xref(struct xfs_scrub *sc, int *error,
> struct xfs_btree_cur **curpp);
>
> /* Setup functions */
> -int xchk_setup_fs(struct xfs_scrub_context *sc, struct xfs_inode *ip);
> -int xchk_setup_ag_allocbt(struct xfs_scrub_context *sc,
> +int xchk_setup_fs(struct xfs_scrub *sc, struct xfs_inode *ip);
> +int xchk_setup_ag_allocbt(struct xfs_scrub *sc,
> struct xfs_inode *ip);
> -int xchk_setup_ag_iallocbt(struct xfs_scrub_context *sc,
> +int xchk_setup_ag_iallocbt(struct xfs_scrub *sc,
> struct xfs_inode *ip);
> -int xchk_setup_ag_rmapbt(struct xfs_scrub_context *sc,
> +int xchk_setup_ag_rmapbt(struct xfs_scrub *sc,
> struct xfs_inode *ip);
> -int xchk_setup_ag_refcountbt(struct xfs_scrub_context *sc,
> +int xchk_setup_ag_refcountbt(struct xfs_scrub *sc,
> struct xfs_inode *ip);
> -int xchk_setup_inode(struct xfs_scrub_context *sc,
> +int xchk_setup_inode(struct xfs_scrub *sc,
> struct xfs_inode *ip);
> -int xchk_setup_inode_bmap(struct xfs_scrub_context *sc,
> +int xchk_setup_inode_bmap(struct xfs_scrub *sc,
> struct xfs_inode *ip);
> -int xchk_setup_inode_bmap_data(struct xfs_scrub_context *sc,
> +int xchk_setup_inode_bmap_data(struct xfs_scrub *sc,
> struct xfs_inode *ip);
> -int xchk_setup_directory(struct xfs_scrub_context *sc,
> +int xchk_setup_directory(struct xfs_scrub *sc,
> struct xfs_inode *ip);
> -int xchk_setup_xattr(struct xfs_scrub_context *sc,
> +int xchk_setup_xattr(struct xfs_scrub *sc,
> struct xfs_inode *ip);
> -int xchk_setup_symlink(struct xfs_scrub_context *sc,
> +int xchk_setup_symlink(struct xfs_scrub *sc,
> struct xfs_inode *ip);
> -int xchk_setup_parent(struct xfs_scrub_context *sc,
> +int xchk_setup_parent(struct xfs_scrub *sc,
> struct xfs_inode *ip);
> #ifdef CONFIG_XFS_RT
> -int xchk_setup_rt(struct xfs_scrub_context *sc, struct xfs_inode *ip);
> +int xchk_setup_rt(struct xfs_scrub *sc, struct xfs_inode *ip);
> #else
> static inline int
> -xchk_setup_rt(struct xfs_scrub_context *sc, struct xfs_inode *ip)
> +xchk_setup_rt(struct xfs_scrub *sc, struct xfs_inode *ip)
> {
> return -ENOENT;
> }
> #endif
> #ifdef CONFIG_XFS_QUOTA
> -int xchk_setup_quota(struct xfs_scrub_context *sc, struct xfs_inode *ip);
> +int xchk_setup_quota(struct xfs_scrub *sc, struct xfs_inode *ip);
> #else
> static inline int
> -xchk_setup_quota(struct xfs_scrub_context *sc, struct xfs_inode *ip)
> +xchk_setup_quota(struct xfs_scrub *sc, struct xfs_inode *ip)
> {
> return -ENOENT;
> }
> #endif
>
> -void xchk_ag_free(struct xfs_scrub_context *sc, struct xchk_ag *sa);
> -int xchk_ag_init(struct xfs_scrub_context *sc, xfs_agnumber_t agno,
> +void xchk_ag_free(struct xfs_scrub *sc, struct xchk_ag *sa);
> +int xchk_ag_init(struct xfs_scrub *sc, xfs_agnumber_t agno,
> struct xchk_ag *sa);
> void xchk_perag_get(struct xfs_mount *mp, struct xchk_ag *sa);
> -int xchk_ag_read_headers(struct xfs_scrub_context *sc, xfs_agnumber_t agno,
> +int xchk_ag_read_headers(struct xfs_scrub *sc, xfs_agnumber_t agno,
> struct xfs_buf **agi, struct xfs_buf **agf,
> struct xfs_buf **agfl);
> void xchk_ag_btcur_free(struct xchk_ag *sa);
> -int xchk_ag_btcur_init(struct xfs_scrub_context *sc,
> +int xchk_ag_btcur_init(struct xfs_scrub *sc,
> struct xchk_ag *sa);
> -int xchk_count_rmap_ownedby_ag(struct xfs_scrub_context *sc,
> +int xchk_count_rmap_ownedby_ag(struct xfs_scrub *sc,
> struct xfs_btree_cur *cur,
> struct xfs_owner_info *oinfo,
> xfs_filblks_t *blocks);
>
> -int xchk_setup_ag_btree(struct xfs_scrub_context *sc,
> +int xchk_setup_ag_btree(struct xfs_scrub *sc,
> struct xfs_inode *ip, bool force_log);
> -int xchk_get_inode(struct xfs_scrub_context *sc, struct xfs_inode *ip_in);
> -int xchk_setup_inode_contents(struct xfs_scrub_context *sc,
> +int xchk_get_inode(struct xfs_scrub *sc, struct xfs_inode *ip_in);
> +int xchk_setup_inode_contents(struct xfs_scrub *sc,
> struct xfs_inode *ip, unsigned int resblks);
> -void xchk_buffer_recheck(struct xfs_scrub_context *sc, struct xfs_buf *bp);
> +void xchk_buffer_recheck(struct xfs_scrub *sc, struct xfs_buf *bp);
>
> /*
> * Don't bother cross-referencing if we already found corruption or cross
> @@ -138,7 +138,7 @@ static inline bool xchk_skip_xref(struct xfs_scrub_metadata *sm)
> XFS_SCRUB_OFLAG_XCORRUPT);
> }
>
> -int xchk_metadata_inode_forks(struct xfs_scrub_context *sc);
> +int xchk_metadata_inode_forks(struct xfs_scrub *sc);
> int xchk_ilock_inverted(struct xfs_inode *ip, uint lock_mode);
>
> #endif /* __XFS_SCRUB_COMMON_H__ */
> diff --git a/fs/xfs/scrub/dabtree.c b/fs/xfs/scrub/dabtree.c
> index fee80f6ddfd7..7fc12d540ea6 100644
> --- a/fs/xfs/scrub/dabtree.c
> +++ b/fs/xfs/scrub/dabtree.c
> @@ -40,7 +40,7 @@ xchk_da_process_error(
> int level,
> int *error)
> {
> - struct xfs_scrub_context *sc = ds->sc;
> + struct xfs_scrub *sc = ds->sc;
>
> if (*error == 0)
> return true;
> @@ -75,7 +75,7 @@ xchk_da_set_corrupt(
> struct xchk_da_btree *ds,
> int level)
> {
> - struct xfs_scrub_context *sc = ds->sc;
> + struct xfs_scrub *sc = ds->sc;
>
> sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT;
>
> @@ -474,7 +474,7 @@ xchk_da_btree_block(
> /* Visit all nodes and leaves of a da btree. */
> int
> xchk_da_btree(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> int whichfork,
> xchk_da_btree_rec_fn scrub_fn,
> void *private)
> diff --git a/fs/xfs/scrub/dabtree.h b/fs/xfs/scrub/dabtree.h
> index 80e4af0e2589..a15c03389e8f 100644
> --- a/fs/xfs/scrub/dabtree.h
> +++ b/fs/xfs/scrub/dabtree.h
> @@ -13,7 +13,7 @@ struct xchk_da_btree {
> xfs_dahash_t hashes[XFS_DA_NODE_MAXDEPTH];
> int maxrecs[XFS_DA_NODE_MAXDEPTH];
> struct xfs_da_state *state;
> - struct xfs_scrub_context *sc;
> + struct xfs_scrub *sc;
> void *private;
>
> /*
> @@ -39,7 +39,7 @@ void xchk_da_set_corrupt(struct xchk_da_btree *ds, int level);
>
> int xchk_da_btree_hash(struct xchk_da_btree *ds, int level,
> __be32 *hashp);
> -int xchk_da_btree(struct xfs_scrub_context *sc, int whichfork,
> +int xchk_da_btree(struct xfs_scrub *sc, int whichfork,
> xchk_da_btree_rec_fn scrub_fn, void *private);
>
> #endif /* __XFS_SCRUB_DABTREE_H__ */
> diff --git a/fs/xfs/scrub/dir.c b/fs/xfs/scrub/dir.c
> index 2ac07bb73478..194a3ef69a9f 100644
> --- a/fs/xfs/scrub/dir.c
> +++ b/fs/xfs/scrub/dir.c
> @@ -32,7 +32,7 @@
> /* Set us up to scrub directories. */
> int
> xchk_setup_directory(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_inode *ip)
> {
> return xchk_setup_inode_contents(sc, ip, 0);
> @@ -46,7 +46,7 @@ struct xchk_dir_ctx {
> /* VFS fill-directory iterator */
> struct dir_context dir_iter;
>
> - struct xfs_scrub_context *sc;
> + struct xfs_scrub *sc;
> };
>
> /* Check that an inode's mode matches a given DT_ type. */
> @@ -289,7 +289,7 @@ xchk_dir_rec(
> */
> STATIC void
> xchk_directory_check_free_entry(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_dablk_t lblk,
> struct xfs_dir2_data_free *bf,
> struct xfs_dir2_data_unused *dup)
> @@ -314,7 +314,7 @@ xchk_directory_check_free_entry(
> /* Check free space info in a directory data block. */
> STATIC int
> xchk_directory_data_bestfree(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_dablk_t lblk,
> bool is_block)
> {
> @@ -455,7 +455,7 @@ xchk_directory_data_bestfree(
> */
> STATIC void
> xchk_directory_check_freesp(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_dablk_t lblk,
> struct xfs_buf *dbp,
> unsigned int len)
> @@ -474,7 +474,7 @@ xchk_directory_check_freesp(
> /* Check free space info in a directory leaf1 block. */
> STATIC int
> xchk_directory_leaf1_bestfree(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_da_args *args,
> xfs_dablk_t lblk)
> {
> @@ -572,7 +572,7 @@ xchk_directory_leaf1_bestfree(
> /* Check free space info in a directory freespace block. */
> STATIC int
> xchk_directory_free_bestfree(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_da_args *args,
> xfs_dablk_t lblk)
> {
> @@ -626,7 +626,7 @@ xchk_directory_free_bestfree(
> /* Check free space information in directories. */
> STATIC int
> xchk_directory_blocks(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> struct xfs_bmbt_irec got;
> struct xfs_da_args args;
> @@ -770,7 +770,7 @@ xchk_directory_blocks(
> /* Scrub a whole directory. */
> int
> xchk_directory(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> struct xchk_dir_ctx sdc = {
> .dir_iter.actor = xchk_dir_actor,
> diff --git a/fs/xfs/scrub/ialloc.c b/fs/xfs/scrub/ialloc.c
> index 69d652b7299c..6df8eba9f52b 100644
> --- a/fs/xfs/scrub/ialloc.c
> +++ b/fs/xfs/scrub/ialloc.c
> @@ -36,7 +36,7 @@
> */
> int
> xchk_setup_ag_iallocbt(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_inode *ip)
> {
> return xchk_setup_ag_btree(sc, ip, sc->try_harder);
> @@ -51,7 +51,7 @@ xchk_setup_ag_iallocbt(
> */
> static inline void
> xchk_iallocbt_chunk_xref_other(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_inobt_rec_incore *irec,
> xfs_agino_t agino)
> {
> @@ -76,7 +76,7 @@ xchk_iallocbt_chunk_xref_other(
> /* Cross-reference with the other btrees. */
> STATIC void
> xchk_iallocbt_chunk_xref(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_inobt_rec_incore *irec,
> xfs_agino_t agino,
> xfs_agblock_t agbno,
> @@ -363,7 +363,7 @@ xchk_iallocbt_rec(
> */
> STATIC void
> xchk_iallocbt_xref_rmap_btreeblks(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> int which)
> {
> struct xfs_owner_info oinfo;
> @@ -403,7 +403,7 @@ xchk_iallocbt_xref_rmap_btreeblks(
> */
> STATIC void
> xchk_iallocbt_xref_rmap_inodes(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> int which,
> xfs_filblks_t inode_blocks)
> {
> @@ -427,7 +427,7 @@ xchk_iallocbt_xref_rmap_inodes(
> /* Scrub the inode btrees for some AG. */
> STATIC int
> xchk_iallocbt(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_btnum_t which)
> {
> struct xfs_btree_cur *cur;
> @@ -459,14 +459,14 @@ xchk_iallocbt(
>
> int
> xchk_inobt(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> return xchk_iallocbt(sc, XFS_BTNUM_INO);
> }
>
> int
> xchk_finobt(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> return xchk_iallocbt(sc, XFS_BTNUM_FINO);
> }
> @@ -474,7 +474,7 @@ xchk_finobt(
> /* See if an inode btree has (or doesn't have) an inode chunk record. */
> static inline void
> xchk_xref_inode_check(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_agblock_t agbno,
> xfs_extlen_t len,
> struct xfs_btree_cur **icur,
> @@ -496,7 +496,7 @@ xchk_xref_inode_check(
> /* xref check that the extent is not covered by inodes */
> void
> xchk_xref_is_not_inode_chunk(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_agblock_t agbno,
> xfs_extlen_t len)
> {
> @@ -507,7 +507,7 @@ xchk_xref_is_not_inode_chunk(
> /* xref check that the extent is covered by inodes */
> void
> xchk_xref_is_inode_chunk(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_agblock_t agbno,
> xfs_extlen_t len)
> {
> diff --git a/fs/xfs/scrub/inode.c b/fs/xfs/scrub/inode.c
> index d85fbec39e52..6cc027983c13 100644
> --- a/fs/xfs/scrub/inode.c
> +++ b/fs/xfs/scrub/inode.c
> @@ -38,7 +38,7 @@
> */
> int
> xchk_setup_inode(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_inode *ip)
> {
> int error;
> @@ -77,7 +77,7 @@ xchk_setup_inode(
> /* Validate di_extsize hint. */
> STATIC void
> xchk_inode_extsize(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_dinode *dip,
> xfs_ino_t ino,
> uint16_t mode,
> @@ -99,7 +99,7 @@ xchk_inode_extsize(
> */
> STATIC void
> xchk_inode_cowextsize(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_dinode *dip,
> xfs_ino_t ino,
> uint16_t mode,
> @@ -118,7 +118,7 @@ xchk_inode_cowextsize(
> /* Make sure the di_flags make sense for the inode. */
> STATIC void
> xchk_inode_flags(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_dinode *dip,
> xfs_ino_t ino,
> uint16_t mode,
> @@ -163,7 +163,7 @@ xchk_inode_flags(
> /* Make sure the di_flags2 make sense for the inode. */
> STATIC void
> xchk_inode_flags2(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_dinode *dip,
> xfs_ino_t ino,
> uint16_t mode,
> @@ -206,7 +206,7 @@ xchk_inode_flags2(
> /* Scrub all the ondisk inode fields. */
> STATIC void
> xchk_dinode(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_dinode *dip,
> xfs_ino_t ino)
> {
> @@ -426,7 +426,7 @@ xchk_dinode(
> */
> static void
> xchk_inode_xref_finobt(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_ino_t ino)
> {
> struct xfs_inobt_rec_incore rec;
> @@ -469,7 +469,7 @@ xchk_inode_xref_finobt(
> /* Cross reference the inode fields with the forks. */
> STATIC void
> xchk_inode_xref_bmap(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_dinode *dip)
> {
> xfs_extnum_t nextents;
> @@ -503,7 +503,7 @@ xchk_inode_xref_bmap(
> /* Cross-reference with the other btrees. */
> STATIC void
> xchk_inode_xref(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_ino_t ino,
> struct xfs_dinode *dip)
> {
> @@ -540,7 +540,7 @@ xchk_inode_xref(
> */
> static void
> xchk_inode_check_reflink_iflag(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_ino_t ino)
> {
> struct xfs_mount *mp = sc->mp;
> @@ -564,7 +564,7 @@ xchk_inode_check_reflink_iflag(
> /* Scrub an inode. */
> int
> xchk_inode(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> struct xfs_dinode di;
> int error = 0;
> diff --git a/fs/xfs/scrub/parent.c b/fs/xfs/scrub/parent.c
> index 0a78d8411f23..808459ad0c35 100644
> --- a/fs/xfs/scrub/parent.c
> +++ b/fs/xfs/scrub/parent.c
> @@ -28,7 +28,7 @@
> /* Set us up to scrub parents. */
> int
> xchk_setup_parent(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_inode *ip)
> {
> return xchk_setup_inode_contents(sc, ip, 0);
> @@ -65,7 +65,7 @@ xchk_parent_actor(
> /* Count the number of dentries in the parent dir that point to this inode. */
> STATIC int
> xchk_parent_count_parent_dentries(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_inode *parent,
> xfs_nlink_t *nlink)
> {
> @@ -121,7 +121,7 @@ xchk_parent_count_parent_dentries(
> */
> STATIC int
> xchk_parent_validate(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_ino_t dnum,
> bool *try_again)
> {
> @@ -255,7 +255,7 @@ xchk_parent_validate(
> /* Scrub a parent pointer. */
> int
> xchk_parent(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> struct xfs_mount *mp = sc->mp;
> xfs_ino_t dnum;
> diff --git a/fs/xfs/scrub/quota.c b/fs/xfs/scrub/quota.c
> index d1b52dd7efcd..309ebeecfa5d 100644
> --- a/fs/xfs/scrub/quota.c
> +++ b/fs/xfs/scrub/quota.c
> @@ -31,7 +31,7 @@
> /* Convert a scrub type code to a DQ flag, or return 0 if error. */
> static inline uint
> xchk_quota_to_dqtype(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> switch (sc->sm->sm_type) {
> case XFS_SCRUB_TYPE_UQUOTA:
> @@ -48,7 +48,7 @@ xchk_quota_to_dqtype(
> /* Set us up to scrub a quota. */
> int
> xchk_setup_quota(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_inode *ip)
> {
> uint dqtype;
> @@ -76,7 +76,7 @@ xchk_setup_quota(
> /* Quotas. */
>
> struct xchk_quota_info {
> - struct xfs_scrub_context *sc;
> + struct xfs_scrub *sc;
> xfs_dqid_t last_id;
> };
>
> @@ -88,7 +88,7 @@ xchk_quota_item(
> void *priv)
> {
> struct xchk_quota_info *sqi = priv;
> - struct xfs_scrub_context *sc = sqi->sc;
> + struct xfs_scrub *sc = sqi->sc;
> struct xfs_mount *mp = sc->mp;
> struct xfs_disk_dquot *d = &dq->q_core;
> struct xfs_quotainfo *qi = mp->m_quotainfo;
> @@ -195,7 +195,7 @@ xchk_quota_item(
> /* Check the quota's data fork. */
> STATIC int
> xchk_quota_data_fork(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> struct xfs_bmbt_irec irec = { 0 };
> struct xfs_iext_cursor icur;
> @@ -234,7 +234,7 @@ xchk_quota_data_fork(
> /* Scrub all of a quota type's items. */
> int
> xchk_quota(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> struct xchk_quota_info sqi;
> struct xfs_mount *mp = sc->mp;
> diff --git a/fs/xfs/scrub/refcount.c b/fs/xfs/scrub/refcount.c
> index 274febc49b23..c1162d408987 100644
> --- a/fs/xfs/scrub/refcount.c
> +++ b/fs/xfs/scrub/refcount.c
> @@ -29,7 +29,7 @@
> */
> int
> xchk_setup_ag_refcountbt(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_inode *ip)
> {
> return xchk_setup_ag_btree(sc, ip, false);
> @@ -79,7 +79,7 @@ struct xchk_refcnt_frag {
> };
>
> struct xchk_refcnt_check {
> - struct xfs_scrub_context *sc;
> + struct xfs_scrub *sc;
> struct list_head fragments;
>
> /* refcount extent we're examining */
> @@ -278,7 +278,7 @@ xchk_refcountbt_process_rmap_fragments(
> /* Use the rmap entries covering this extent to verify the refcount. */
> STATIC void
> xchk_refcountbt_xref_rmap(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_agblock_t bno,
> xfs_extlen_t len,
> xfs_nlink_t refcount)
> @@ -325,7 +325,7 @@ xchk_refcountbt_xref_rmap(
> /* Cross-reference with the other btrees. */
> STATIC void
> xchk_refcountbt_xref(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_agblock_t agbno,
> xfs_extlen_t len,
> xfs_nlink_t refcount)
> @@ -382,7 +382,7 @@ xchk_refcountbt_rec(
> /* Make sure we have as many refc blocks as the rmap says. */
> STATIC void
> xchk_refcount_xref_rmap(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_owner_info *oinfo,
> xfs_filblks_t cow_blocks)
> {
> @@ -417,7 +417,7 @@ xchk_refcount_xref_rmap(
> /* Scrub the refcount btree for some AG. */
> int
> xchk_refcountbt(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> struct xfs_owner_info oinfo;
> xfs_agblock_t cow_blocks = 0;
> @@ -437,7 +437,7 @@ xchk_refcountbt(
> /* xref check that a cow staging extent is marked in the refcountbt. */
> void
> xchk_xref_is_cow_staging(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_agblock_t agbno,
> xfs_extlen_t len)
> {
> @@ -483,7 +483,7 @@ xchk_xref_is_cow_staging(
> */
> void
> xchk_xref_is_not_shared(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_agblock_t agbno,
> xfs_extlen_t len)
> {
> diff --git a/fs/xfs/scrub/repair.c b/fs/xfs/scrub/repair.c
> index 7e6a56a5f59d..29debd5649ac 100644
> --- a/fs/xfs/scrub/repair.c
> +++ b/fs/xfs/scrub/repair.c
> @@ -43,7 +43,7 @@
> int
> xrep_attempt(
> struct xfs_inode *ip,
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> bool *fixed)
> {
> int error = 0;
> @@ -106,7 +106,7 @@ xrep_failure(
> */
> int
> xrep_probe(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> int error = 0;
>
> @@ -122,7 +122,7 @@ xrep_probe(
> */
> int
> xrep_roll_ag_trans(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> int error;
>
> @@ -179,7 +179,7 @@ xrep_ag_has_space(
> */
> xfs_extlen_t
> xrep_calc_ag_resblks(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> struct xfs_mount *mp = sc->mp;
> struct xfs_scrub_metadata *sm = sc->sm;
> @@ -279,7 +279,7 @@ xrep_calc_ag_resblks(
> /* Allocate a block in an AG. */
> int
> xrep_alloc_ag_block(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_owner_info *oinfo,
> xfs_fsblock_t *fsbno,
> enum xfs_ag_resv_type resv)
> @@ -330,7 +330,7 @@ xrep_alloc_ag_block(
> /* Initialize a new AG btree root block with zero entries. */
> int
> xrep_init_btblock(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_fsblock_t fsb,
> struct xfs_buf **bpp,
> xfs_btnum_t btnum,
> @@ -385,7 +385,7 @@ xrep_init_btblock(
> /* Collect a dead btree extent for later disposal. */
> int
> xrep_collect_btree_extent(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xrep_extent_list *exlist,
> xfs_fsblock_t fsbno,
> xfs_extlen_t len)
> @@ -415,7 +415,7 @@ xrep_collect_btree_extent(
> */
> void
> xrep_cancel_btree_extents(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xrep_extent_list *exlist)
> {
> struct xrep_extent *rex;
> @@ -463,7 +463,7 @@ xrep_btree_extent_cmp(
> #define RIGHT_ALIGNED (1 << 1)
> int
> xrep_subtract_extents(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xrep_extent_list *exlist,
> struct xrep_extent_list *sublist)
> {
> @@ -620,7 +620,7 @@ xrep_subtract_extents(
> */
> int
> xrep_invalidate_blocks(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xrep_extent_list *exlist)
> {
> struct xrep_extent *rex;
> @@ -658,7 +658,7 @@ xrep_invalidate_blocks(
> /* Ensure the freelist is the correct size. */
> int
> xrep_fix_freelist(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> bool can_shrink)
> {
> struct xfs_alloc_arg args = {0};
> @@ -678,7 +678,7 @@ xrep_fix_freelist(
> */
> STATIC int
> xrep_put_freelist(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_agblock_t agbno)
> {
> struct xfs_owner_info oinfo;
> @@ -714,7 +714,7 @@ xrep_put_freelist(
> /* Dispose of a single metadata block. */
> STATIC int
> xrep_dispose_btree_block(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_fsblock_t fsbno,
> struct xfs_owner_info *oinfo,
> enum xfs_ag_resv_type resv)
> @@ -788,7 +788,7 @@ xrep_dispose_btree_block(
> /* Dispose of btree blocks from an old per-AG btree. */
> int
> xrep_reap_btree_extents(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xrep_extent_list *exlist,
> struct xfs_owner_info *oinfo,
> enum xfs_ag_resv_type type)
> @@ -851,7 +851,7 @@ xrep_reap_btree_extents(
> */
>
> struct xrep_findroot {
> - struct xfs_scrub_context *sc;
> + struct xfs_scrub *sc;
> struct xfs_buf *agfl_bp;
> struct xfs_agf *agf;
> struct xrep_find_ag_btree *btree_info;
> @@ -981,7 +981,7 @@ xrep_findroot_rmap(
> /* Find the roots of the per-AG btrees described in btree_info. */
> int
> xrep_find_ag_btree_roots(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_buf *agf_bp,
> struct xrep_find_ag_btree *btree_info,
> struct xfs_buf *agfl_bp)
> @@ -1016,7 +1016,7 @@ xrep_find_ag_btree_roots(
> /* Force a quotacheck the next time we mount. */
> void
> xrep_force_quotacheck(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> uint dqtype)
> {
> uint flag;
> @@ -1044,7 +1044,7 @@ xrep_force_quotacheck(
> */
> int
> xrep_ino_dqattach(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> int error;
>
> diff --git a/fs/xfs/scrub/repair.h b/fs/xfs/scrub/repair.h
> index 60d81294797b..677f4b73b5ec 100644
> --- a/fs/xfs/scrub/repair.h
> +++ b/fs/xfs/scrub/repair.h
> @@ -6,7 +6,7 @@
> #ifndef __XFS_SCRUB_REPAIR_H__
> #define __XFS_SCRUB_REPAIR_H__
>
> -static inline int xrep_notsupported(struct xfs_scrub_context *sc)
> +static inline int xrep_notsupported(struct xfs_scrub *sc)
> {
> return -EOPNOTSUPP;
> }
> @@ -15,17 +15,17 @@ static inline int xrep_notsupported(struct xfs_scrub_context *sc)
>
> /* Repair helpers */
>
> -int xrep_attempt(struct xfs_inode *ip, struct xfs_scrub_context *sc,
> +int xrep_attempt(struct xfs_inode *ip, struct xfs_scrub *sc,
> bool *fixed);
> void xrep_failure(struct xfs_mount *mp);
> -int xrep_roll_ag_trans(struct xfs_scrub_context *sc);
> +int xrep_roll_ag_trans(struct xfs_scrub *sc);
> bool xrep_ag_has_space(struct xfs_perag *pag, xfs_extlen_t nr_blocks,
> enum xfs_ag_resv_type type);
> -xfs_extlen_t xrep_calc_ag_resblks(struct xfs_scrub_context *sc);
> -int xrep_alloc_ag_block(struct xfs_scrub_context *sc,
> +xfs_extlen_t xrep_calc_ag_resblks(struct xfs_scrub *sc);
> +int xrep_alloc_ag_block(struct xfs_scrub *sc,
> struct xfs_owner_info *oinfo, xfs_fsblock_t *fsbno,
> enum xfs_ag_resv_type resv);
> -int xrep_init_btblock(struct xfs_scrub_context *sc, xfs_fsblock_t fsb,
> +int xrep_init_btblock(struct xfs_scrub *sc, xfs_fsblock_t fsb,
> struct xfs_buf **bpp, xfs_btnum_t btnum,
> const struct xfs_buf_ops *ops);
>
> @@ -48,18 +48,18 @@ xrep_init_extent_list(
>
> #define for_each_xrep_extent_safe(rbe, n, exlist) \
> list_for_each_entry_safe((rbe), (n), &(exlist)->list, list)
> -int xrep_collect_btree_extent(struct xfs_scrub_context *sc,
> +int xrep_collect_btree_extent(struct xfs_scrub *sc,
> struct xrep_extent_list *btlist, xfs_fsblock_t fsbno,
> xfs_extlen_t len);
> -void xrep_cancel_btree_extents(struct xfs_scrub_context *sc,
> +void xrep_cancel_btree_extents(struct xfs_scrub *sc,
> struct xrep_extent_list *btlist);
> -int xrep_subtract_extents(struct xfs_scrub_context *sc,
> +int xrep_subtract_extents(struct xfs_scrub *sc,
> struct xrep_extent_list *exlist,
> struct xrep_extent_list *sublist);
> -int xrep_fix_freelist(struct xfs_scrub_context *sc, bool can_shrink);
> -int xrep_invalidate_blocks(struct xfs_scrub_context *sc,
> +int xrep_fix_freelist(struct xfs_scrub *sc, bool can_shrink);
> +int xrep_invalidate_blocks(struct xfs_scrub *sc,
> struct xrep_extent_list *btlist);
> -int xrep_reap_btree_extents(struct xfs_scrub_context *sc,
> +int xrep_reap_btree_extents(struct xfs_scrub *sc,
> struct xrep_extent_list *exlist,
> struct xfs_owner_info *oinfo, enum xfs_ag_resv_type type);
>
> @@ -78,23 +78,23 @@ struct xrep_find_ag_btree {
> unsigned int height;
> };
>
> -int xrep_find_ag_btree_roots(struct xfs_scrub_context *sc,
> +int xrep_find_ag_btree_roots(struct xfs_scrub *sc,
> struct xfs_buf *agf_bp,
> struct xrep_find_ag_btree *btree_info,
> struct xfs_buf *agfl_bp);
> -void xrep_force_quotacheck(struct xfs_scrub_context *sc, uint dqtype);
> -int xrep_ino_dqattach(struct xfs_scrub_context *sc);
> +void xrep_force_quotacheck(struct xfs_scrub *sc, uint dqtype);
> +int xrep_ino_dqattach(struct xfs_scrub *sc);
>
> /* Metadata repairers */
>
> -int xrep_probe(struct xfs_scrub_context *sc);
> -int xrep_superblock(struct xfs_scrub_context *sc);
> +int xrep_probe(struct xfs_scrub *sc);
> +int xrep_superblock(struct xfs_scrub *sc);
>
> #else
>
> static inline int xrep_attempt(
> struct xfs_inode *ip,
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> bool *fixed)
> {
> return -EOPNOTSUPP;
> @@ -104,7 +104,7 @@ static inline void xrep_failure(struct xfs_mount *mp) {}
>
> static inline xfs_extlen_t
> xrep_calc_ag_resblks(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> ASSERT(!(sc->sm->sm_flags & XFS_SCRUB_IFLAG_REPAIR));
> return 0;
> diff --git a/fs/xfs/scrub/rmap.c b/fs/xfs/scrub/rmap.c
> index 4b75fc2f31f3..dc9c91a706ff 100644
> --- a/fs/xfs/scrub/rmap.c
> +++ b/fs/xfs/scrub/rmap.c
> @@ -30,7 +30,7 @@
> */
> int
> xchk_setup_ag_rmapbt(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_inode *ip)
> {
> return xchk_setup_ag_btree(sc, ip, false);
> @@ -41,7 +41,7 @@ xchk_setup_ag_rmapbt(
> /* Cross-reference a rmap against the refcount btree. */
> STATIC void
> xchk_rmapbt_xref_refc(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_rmap_irec *irec)
> {
> xfs_agblock_t fbno;
> @@ -72,7 +72,7 @@ xchk_rmapbt_xref_refc(
> /* Cross-reference with the other btrees. */
> STATIC void
> xchk_rmapbt_xref(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_rmap_irec *irec)
> {
> xfs_agblock_t agbno = irec->rm_startblock;
> @@ -172,7 +172,7 @@ xchk_rmapbt_rec(
> /* Scrub the rmap btree for some AG. */
> int
> xchk_rmapbt(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> struct xfs_owner_info oinfo;
>
> @@ -184,7 +184,7 @@ xchk_rmapbt(
> /* xref check that the extent is owned by a given owner */
> static inline void
> xchk_xref_check_owner(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_agblock_t bno,
> xfs_extlen_t len,
> struct xfs_owner_info *oinfo,
> @@ -207,7 +207,7 @@ xchk_xref_check_owner(
> /* xref check that the extent is owned by a given owner */
> void
> xchk_xref_is_owned_by(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_agblock_t bno,
> xfs_extlen_t len,
> struct xfs_owner_info *oinfo)
> @@ -218,7 +218,7 @@ xchk_xref_is_owned_by(
> /* xref check that the extent is not owned by a given owner */
> void
> xchk_xref_is_not_owned_by(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_agblock_t bno,
> xfs_extlen_t len,
> struct xfs_owner_info *oinfo)
> @@ -229,7 +229,7 @@ xchk_xref_is_not_owned_by(
> /* xref check that the extent has no reverse mapping at all */
> void
> xchk_xref_has_no_owner(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_agblock_t bno,
> xfs_extlen_t len)
> {
> diff --git a/fs/xfs/scrub/rtbitmap.c b/fs/xfs/scrub/rtbitmap.c
> index 3f0fc83562ae..653a809bba34 100644
> --- a/fs/xfs/scrub/rtbitmap.c
> +++ b/fs/xfs/scrub/rtbitmap.c
> @@ -26,7 +26,7 @@
> /* Set us up with the realtime metadata locked. */
> int
> xchk_setup_rt(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_inode *ip)
> {
> int error;
> @@ -51,7 +51,7 @@ xchk_rtbitmap_rec(
> struct xfs_rtalloc_rec *rec,
> void *priv)
> {
> - struct xfs_scrub_context *sc = priv;
> + struct xfs_scrub *sc = priv;
> xfs_rtblock_t startblock;
> xfs_rtblock_t blockcount;
>
> @@ -68,7 +68,7 @@ xchk_rtbitmap_rec(
> /* Scrub the realtime bitmap. */
> int
> xchk_rtbitmap(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> int error;
>
> @@ -88,7 +88,7 @@ xchk_rtbitmap(
> /* Scrub the realtime summary. */
> int
> xchk_rtsummary(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> struct xfs_inode *rsumip = sc->mp->m_rsumip;
> struct xfs_inode *old_ip = sc->ip;
> @@ -125,7 +125,7 @@ xchk_rtsummary(
> /* xref check that the extent is not free in the rtbitmap */
> void
> xchk_xref_is_used_rt_space(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> xfs_rtblock_t fsbno,
> xfs_extlen_t len)
> {
> diff --git a/fs/xfs/scrub/scrub.c b/fs/xfs/scrub/scrub.c
> index a6efede6e430..b3c6420ccae5 100644
> --- a/fs/xfs/scrub/scrub.c
> +++ b/fs/xfs/scrub/scrub.c
> @@ -151,7 +151,7 @@
> */
> static int
> xchk_probe(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> int error = 0;
>
> @@ -166,7 +166,7 @@ xchk_probe(
> /* Free all the resources and finish the transactions. */
> STATIC int
> xchk_teardown(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_inode *ip_in,
> int error)
> {
> @@ -447,7 +447,7 @@ xchk_validate_inputs(
> }
>
> #ifdef CONFIG_XFS_ONLINE_REPAIR
> -static inline void xchk_postmortem(struct xfs_scrub_context *sc)
> +static inline void xchk_postmortem(struct xfs_scrub *sc)
> {
> /*
> * Userspace asked us to repair something, we repaired it, rescanned
> @@ -460,7 +460,7 @@ static inline void xchk_postmortem(struct xfs_scrub_context *sc)
> xrep_failure(sc->mp);
> }
> #else
> -static inline void xchk_postmortem(struct xfs_scrub_context *sc)
> +static inline void xchk_postmortem(struct xfs_scrub *sc)
> {
> /*
> * Userspace asked us to scrub something, it's broken, and we have no
> @@ -479,7 +479,7 @@ xfs_scrub_metadata(
> struct xfs_inode *ip,
> struct xfs_scrub_metadata *sm)
> {
> - struct xfs_scrub_context sc;
> + struct xfs_scrub sc;
> struct xfs_mount *mp = ip->i_mount;
> bool try_harder = false;
> bool already_fixed = false;
> diff --git a/fs/xfs/scrub/scrub.h b/fs/xfs/scrub/scrub.h
> index 0f59a47c4bb0..47c75d2f28da 100644
> --- a/fs/xfs/scrub/scrub.h
> +++ b/fs/xfs/scrub/scrub.h
> @@ -6,7 +6,7 @@
> #ifndef __XFS_SCRUB_SCRUB_H__
> #define __XFS_SCRUB_SCRUB_H__
>
> -struct xfs_scrub_context;
> +struct xfs_scrub;
>
> /* Type info and names for the scrub types. */
> enum xchk_type {
> @@ -18,14 +18,14 @@ enum xchk_type {
>
> struct xchk_meta_ops {
> /* Acquire whatever resources are needed for the operation. */
> - int (*setup)(struct xfs_scrub_context *,
> + int (*setup)(struct xfs_scrub *,
> struct xfs_inode *);
>
> /* Examine metadata for errors. */
> - int (*scrub)(struct xfs_scrub_context *);
> + int (*scrub)(struct xfs_scrub *);
>
> /* Repair or optimize the metadata. */
> - int (*repair)(struct xfs_scrub_context *);
> + int (*repair)(struct xfs_scrub *);
>
> /* Decide if we even have this piece of metadata. */
> bool (*has)(struct xfs_sb *);
> @@ -53,7 +53,7 @@ struct xchk_ag {
> struct xfs_btree_cur *refc_cur;
> };
>
> -struct xfs_scrub_context {
> +struct xfs_scrub {
> /* General scrub state. */
> struct xfs_mount *mp;
> struct xfs_scrub_metadata *sm;
> @@ -70,71 +70,71 @@ struct xfs_scrub_context {
> };
>
> /* Metadata scrubbers */
> -int xchk_tester(struct xfs_scrub_context *sc);
> -int xchk_superblock(struct xfs_scrub_context *sc);
> -int xchk_agf(struct xfs_scrub_context *sc);
> -int xchk_agfl(struct xfs_scrub_context *sc);
> -int xchk_agi(struct xfs_scrub_context *sc);
> -int xchk_bnobt(struct xfs_scrub_context *sc);
> -int xchk_cntbt(struct xfs_scrub_context *sc);
> -int xchk_inobt(struct xfs_scrub_context *sc);
> -int xchk_finobt(struct xfs_scrub_context *sc);
> -int xchk_rmapbt(struct xfs_scrub_context *sc);
> -int xchk_refcountbt(struct xfs_scrub_context *sc);
> -int xchk_inode(struct xfs_scrub_context *sc);
> -int xchk_bmap_data(struct xfs_scrub_context *sc);
> -int xchk_bmap_attr(struct xfs_scrub_context *sc);
> -int xchk_bmap_cow(struct xfs_scrub_context *sc);
> -int xchk_directory(struct xfs_scrub_context *sc);
> -int xchk_xattr(struct xfs_scrub_context *sc);
> -int xchk_symlink(struct xfs_scrub_context *sc);
> -int xchk_parent(struct xfs_scrub_context *sc);
> +int xchk_tester(struct xfs_scrub *sc);
> +int xchk_superblock(struct xfs_scrub *sc);
> +int xchk_agf(struct xfs_scrub *sc);
> +int xchk_agfl(struct xfs_scrub *sc);
> +int xchk_agi(struct xfs_scrub *sc);
> +int xchk_bnobt(struct xfs_scrub *sc);
> +int xchk_cntbt(struct xfs_scrub *sc);
> +int xchk_inobt(struct xfs_scrub *sc);
> +int xchk_finobt(struct xfs_scrub *sc);
> +int xchk_rmapbt(struct xfs_scrub *sc);
> +int xchk_refcountbt(struct xfs_scrub *sc);
> +int xchk_inode(struct xfs_scrub *sc);
> +int xchk_bmap_data(struct xfs_scrub *sc);
> +int xchk_bmap_attr(struct xfs_scrub *sc);
> +int xchk_bmap_cow(struct xfs_scrub *sc);
> +int xchk_directory(struct xfs_scrub *sc);
> +int xchk_xattr(struct xfs_scrub *sc);
> +int xchk_symlink(struct xfs_scrub *sc);
> +int xchk_parent(struct xfs_scrub *sc);
> #ifdef CONFIG_XFS_RT
> -int xchk_rtbitmap(struct xfs_scrub_context *sc);
> -int xchk_rtsummary(struct xfs_scrub_context *sc);
> +int xchk_rtbitmap(struct xfs_scrub *sc);
> +int xchk_rtsummary(struct xfs_scrub *sc);
> #else
> static inline int
> -xchk_rtbitmap(struct xfs_scrub_context *sc)
> +xchk_rtbitmap(struct xfs_scrub *sc)
> {
> return -ENOENT;
> }
> static inline int
> -xchk_rtsummary(struct xfs_scrub_context *sc)
> +xchk_rtsummary(struct xfs_scrub *sc)
> {
> return -ENOENT;
> }
> #endif
> #ifdef CONFIG_XFS_QUOTA
> -int xchk_quota(struct xfs_scrub_context *sc);
> +int xchk_quota(struct xfs_scrub *sc);
> #else
> static inline int
> -xchk_quota(struct xfs_scrub_context *sc)
> +xchk_quota(struct xfs_scrub *sc)
> {
> return -ENOENT;
> }
> #endif
>
> /* cross-referencing helpers */
> -void xchk_xref_is_used_space(struct xfs_scrub_context *sc,
> +void xchk_xref_is_used_space(struct xfs_scrub *sc,
> xfs_agblock_t agbno, xfs_extlen_t len);
> -void xchk_xref_is_not_inode_chunk(struct xfs_scrub_context *sc,
> +void xchk_xref_is_not_inode_chunk(struct xfs_scrub *sc,
> xfs_agblock_t agbno, xfs_extlen_t len);
> -void xchk_xref_is_inode_chunk(struct xfs_scrub_context *sc,
> +void xchk_xref_is_inode_chunk(struct xfs_scrub *sc,
> xfs_agblock_t agbno, xfs_extlen_t len);
> -void xchk_xref_is_owned_by(struct xfs_scrub_context *sc,
> +void xchk_xref_is_owned_by(struct xfs_scrub *sc,
> xfs_agblock_t agbno, xfs_extlen_t len,
> struct xfs_owner_info *oinfo);
> -void xchk_xref_is_not_owned_by(struct xfs_scrub_context *sc,
> +void xchk_xref_is_not_owned_by(struct xfs_scrub *sc,
> xfs_agblock_t agbno, xfs_extlen_t len,
> struct xfs_owner_info *oinfo);
> -void xchk_xref_has_no_owner(struct xfs_scrub_context *sc,
> +void xchk_xref_has_no_owner(struct xfs_scrub *sc,
> xfs_agblock_t agbno, xfs_extlen_t len);
> -void xchk_xref_is_cow_staging(struct xfs_scrub_context *sc,
> +void xchk_xref_is_cow_staging(struct xfs_scrub *sc,
> xfs_agblock_t bno, xfs_extlen_t len);
> -void xchk_xref_is_not_shared(struct xfs_scrub_context *sc,
> +void xchk_xref_is_not_shared(struct xfs_scrub *sc,
> xfs_agblock_t bno, xfs_extlen_t len);
> #ifdef CONFIG_XFS_RT
> -void xchk_xref_is_used_rt_space(struct xfs_scrub_context *sc,
> +void xchk_xref_is_used_rt_space(struct xfs_scrub *sc,
> xfs_rtblock_t rtbno, xfs_extlen_t len);
> #else
> # define xchk_xref_is_used_rt_space(sc, rtbno, len) do { } while (0)
> diff --git a/fs/xfs/scrub/symlink.c b/fs/xfs/scrub/symlink.c
> index e2a288e34337..56c6347e9482 100644
> --- a/fs/xfs/scrub/symlink.c
> +++ b/fs/xfs/scrub/symlink.c
> @@ -26,7 +26,7 @@
> /* Set us up to scrub a symbolic link. */
> int
> xchk_setup_symlink(
> - struct xfs_scrub_context *sc,
> + struct xfs_scrub *sc,
> struct xfs_inode *ip)
> {
> /* Allocate the buffer without the inode lock held. */
> @@ -41,7 +41,7 @@ xchk_setup_symlink(
>
> int
> xchk_symlink(
> - struct xfs_scrub_context *sc)
> + struct xfs_scrub *sc)
> {
> struct xfs_inode *ip = sc->ip;
> struct xfs_ifork *ifp;
> diff --git a/fs/xfs/scrub/trace.h b/fs/xfs/scrub/trace.h
> index 96f3edda3e91..93db22c39b51 100644
> --- a/fs/xfs/scrub/trace.h
> +++ b/fs/xfs/scrub/trace.h
> @@ -59,7 +59,7 @@ DEFINE_SCRUB_EVENT(xrep_attempt);
> DEFINE_SCRUB_EVENT(xrep_done);
>
> TRACE_EVENT(xchk_op_error,
> - TP_PROTO(struct xfs_scrub_context *sc, xfs_agnumber_t agno,
> + TP_PROTO(struct xfs_scrub *sc, xfs_agnumber_t agno,
> xfs_agblock_t bno, int error, void *ret_ip),
> TP_ARGS(sc, agno, bno, error, ret_ip),
> TP_STRUCT__entry(
> @@ -88,7 +88,7 @@ TRACE_EVENT(xchk_op_error,
> );
>
> TRACE_EVENT(xchk_file_op_error,
> - TP_PROTO(struct xfs_scrub_context *sc, int whichfork,
> + TP_PROTO(struct xfs_scrub *sc, int whichfork,
> xfs_fileoff_t offset, int error, void *ret_ip),
> TP_ARGS(sc, whichfork, offset, error, ret_ip),
> TP_STRUCT__entry(
> @@ -120,7 +120,7 @@ TRACE_EVENT(xchk_file_op_error,
> );
>
> DECLARE_EVENT_CLASS(xchk_block_error_class,
> - TP_PROTO(struct xfs_scrub_context *sc, xfs_daddr_t daddr, void *ret_ip),
> + TP_PROTO(struct xfs_scrub *sc, xfs_daddr_t daddr, void *ret_ip),
> TP_ARGS(sc, daddr, ret_ip),
> TP_STRUCT__entry(
> __field(dev_t, dev)
> @@ -154,7 +154,7 @@ DECLARE_EVENT_CLASS(xchk_block_error_class,
>
> #define DEFINE_SCRUB_BLOCK_ERROR_EVENT(name) \
> DEFINE_EVENT(xchk_block_error_class, name, \
> - TP_PROTO(struct xfs_scrub_context *sc, xfs_daddr_t daddr, \
> + TP_PROTO(struct xfs_scrub *sc, xfs_daddr_t daddr, \
> void *ret_ip), \
> TP_ARGS(sc, daddr, ret_ip))
>
> @@ -162,7 +162,7 @@ DEFINE_SCRUB_BLOCK_ERROR_EVENT(xchk_block_error);
> DEFINE_SCRUB_BLOCK_ERROR_EVENT(xchk_block_preen);
>
> DECLARE_EVENT_CLASS(xchk_ino_error_class,
> - TP_PROTO(struct xfs_scrub_context *sc, xfs_ino_t ino, void *ret_ip),
> + TP_PROTO(struct xfs_scrub *sc, xfs_ino_t ino, void *ret_ip),
> TP_ARGS(sc, ino, ret_ip),
> TP_STRUCT__entry(
> __field(dev_t, dev)
> @@ -185,7 +185,7 @@ DECLARE_EVENT_CLASS(xchk_ino_error_class,
>
> #define DEFINE_SCRUB_INO_ERROR_EVENT(name) \
> DEFINE_EVENT(xchk_ino_error_class, name, \
> - TP_PROTO(struct xfs_scrub_context *sc, xfs_ino_t ino, \
> + TP_PROTO(struct xfs_scrub *sc, xfs_ino_t ino, \
> void *ret_ip), \
> TP_ARGS(sc, ino, ret_ip))
>
> @@ -194,7 +194,7 @@ DEFINE_SCRUB_INO_ERROR_EVENT(xchk_ino_preen);
> DEFINE_SCRUB_INO_ERROR_EVENT(xchk_ino_warning);
>
> DECLARE_EVENT_CLASS(xchk_fblock_error_class,
> - TP_PROTO(struct xfs_scrub_context *sc, int whichfork,
> + TP_PROTO(struct xfs_scrub *sc, int whichfork,
> xfs_fileoff_t offset, void *ret_ip),
> TP_ARGS(sc, whichfork, offset, ret_ip),
> TP_STRUCT__entry(
> @@ -224,7 +224,7 @@ DECLARE_EVENT_CLASS(xchk_fblock_error_class,
>
> #define DEFINE_SCRUB_FBLOCK_ERROR_EVENT(name) \
> DEFINE_EVENT(xchk_fblock_error_class, name, \
> - TP_PROTO(struct xfs_scrub_context *sc, int whichfork, \
> + TP_PROTO(struct xfs_scrub *sc, int whichfork, \
> xfs_fileoff_t offset, void *ret_ip), \
> TP_ARGS(sc, whichfork, offset, ret_ip))
>
> @@ -232,7 +232,7 @@ DEFINE_SCRUB_FBLOCK_ERROR_EVENT(xchk_fblock_error);
> DEFINE_SCRUB_FBLOCK_ERROR_EVENT(xchk_fblock_warning);
>
> TRACE_EVENT(xchk_incomplete,
> - TP_PROTO(struct xfs_scrub_context *sc, void *ret_ip),
> + TP_PROTO(struct xfs_scrub *sc, void *ret_ip),
> TP_ARGS(sc, ret_ip),
> TP_STRUCT__entry(
> __field(dev_t, dev)
> @@ -251,7 +251,7 @@ TRACE_EVENT(xchk_incomplete,
> );
>
> TRACE_EVENT(xchk_btree_op_error,
> - TP_PROTO(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur,
> + TP_PROTO(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
> int level, int error, void *ret_ip),
> TP_ARGS(sc, cur, level, error, ret_ip),
> TP_STRUCT__entry(
> @@ -291,7 +291,7 @@ TRACE_EVENT(xchk_btree_op_error,
> );
>
> TRACE_EVENT(xchk_ifork_btree_op_error,
> - TP_PROTO(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur,
> + TP_PROTO(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
> int level, int error, void *ret_ip),
> TP_ARGS(sc, cur, level, error, ret_ip),
> TP_STRUCT__entry(
> @@ -336,7 +336,7 @@ TRACE_EVENT(xchk_ifork_btree_op_error,
> );
>
> TRACE_EVENT(xchk_btree_error,
> - TP_PROTO(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur,
> + TP_PROTO(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
> int level, void *ret_ip),
> TP_ARGS(sc, cur, level, ret_ip),
> TP_STRUCT__entry(
> @@ -372,7 +372,7 @@ TRACE_EVENT(xchk_btree_error,
> );
>
> TRACE_EVENT(xchk_ifork_btree_error,
> - TP_PROTO(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur,
> + TP_PROTO(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
> int level, void *ret_ip),
> TP_ARGS(sc, cur, level, ret_ip),
> TP_STRUCT__entry(
> @@ -414,7 +414,7 @@ TRACE_EVENT(xchk_ifork_btree_error,
> );
>
> DECLARE_EVENT_CLASS(xchk_sbtree_class,
> - TP_PROTO(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur,
> + TP_PROTO(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
> int level),
> TP_ARGS(sc, cur, level),
> TP_STRUCT__entry(
> @@ -451,7 +451,7 @@ DECLARE_EVENT_CLASS(xchk_sbtree_class,
> )
> #define DEFINE_SCRUB_SBTREE_EVENT(name) \
> DEFINE_EVENT(xchk_sbtree_class, name, \
> - TP_PROTO(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur, \
> + TP_PROTO(struct xfs_scrub *sc, struct xfs_btree_cur *cur, \
> int level), \
> TP_ARGS(sc, cur, level))
>
> @@ -459,7 +459,7 @@ DEFINE_SCRUB_SBTREE_EVENT(xchk_btree_rec);
> DEFINE_SCRUB_SBTREE_EVENT(xchk_btree_key);
>
> TRACE_EVENT(xchk_xref_error,
> - TP_PROTO(struct xfs_scrub_context *sc, int error, void *ret_ip),
> + TP_PROTO(struct xfs_scrub *sc, int error, void *ret_ip),
> TP_ARGS(sc, error, ret_ip),
> TP_STRUCT__entry(
> __field(dev_t, dev)
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 8/8] xfs: fix indentation and other whitespace problems in scrub/repair
2018-07-18 15:52 ` [PATCH 8/8] xfs: fix indentation and other whitespace problems in scrub/repair Darrick J. Wong
@ 2018-07-19 12:59 ` Brian Foster
0 siblings, 0 replies; 30+ messages in thread
From: Brian Foster @ 2018-07-19 12:59 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: linux-xfs
On Wed, Jul 18, 2018 at 08:52:11AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Now that we've shortened everything, fix up all the indentation and
> whitespace problems. There are no functional changes.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
Reviewed-by: Brian Foster <bfoster@redhat.com>
> fs/xfs/scrub/agheader.c | 172 ++++++++++++++++++++--------------------
> fs/xfs/scrub/agheader_repair.c | 8 +-
> fs/xfs/scrub/alloc.c | 48 ++++++-----
> fs/xfs/scrub/attr.c | 20 ++---
> fs/xfs/scrub/bmap.c | 150 +++++++++++++++++------------------
> fs/xfs/scrub/btree.c | 172 ++++++++++++++++++++--------------------
> fs/xfs/scrub/btree.h | 25 +++---
> fs/xfs/scrub/common.c | 158 ++++++++++++++++++-------------------
> fs/xfs/scrub/common.h | 23 ++---
> fs/xfs/scrub/dabtree.c | 56 +++++++------
> fs/xfs/scrub/dabtree.h | 21 ++---
> fs/xfs/scrub/dir.c | 88 ++++++++++----------
> fs/xfs/scrub/ialloc.c | 58 +++++++------
> fs/xfs/scrub/inode.c | 102 ++++++++++++------------
> fs/xfs/scrub/parent.c | 60 +++++++-------
> fs/xfs/scrub/quota.c | 68 ++++++++--------
> fs/xfs/scrub/refcount.c | 70 ++++++++--------
> fs/xfs/scrub/repair.c | 148 +++++++++++++++++-----------------
> fs/xfs/scrub/repair.h | 28 +++----
> fs/xfs/scrub/rmap.c | 78 +++++++++---------
> fs/xfs/scrub/rtbitmap.c | 38 ++++-----
> fs/xfs/scrub/scrub.c | 8 +-
> fs/xfs/scrub/scrub.h | 62 +++++++-------
> fs/xfs/scrub/symlink.c | 10 +-
> fs/xfs/scrub/trace.c | 4 -
> 25 files changed, 832 insertions(+), 843 deletions(-)
>
>
> diff --git a/fs/xfs/scrub/agheader.c b/fs/xfs/scrub/agheader.c
> index 14ba4189ae8f..3068a9382feb 100644
> --- a/fs/xfs/scrub/agheader.c
> +++ b/fs/xfs/scrub/agheader.c
> @@ -30,13 +30,13 @@
> STATIC void
> xchk_superblock_xref(
> struct xfs_scrub *sc,
> - struct xfs_buf *bp)
> + struct xfs_buf *bp)
> {
> - struct xfs_owner_info oinfo;
> - struct xfs_mount *mp = sc->mp;
> - xfs_agnumber_t agno = sc->sm->sm_agno;
> - xfs_agblock_t agbno;
> - int error;
> + struct xfs_owner_info oinfo;
> + struct xfs_mount *mp = sc->mp;
> + xfs_agnumber_t agno = sc->sm->sm_agno;
> + xfs_agblock_t agbno;
> + int error;
>
> if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
> return;
> @@ -68,14 +68,14 @@ int
> xchk_superblock(
> struct xfs_scrub *sc)
> {
> - struct xfs_mount *mp = sc->mp;
> - struct xfs_buf *bp;
> - struct xfs_dsb *sb;
> - xfs_agnumber_t agno;
> - uint32_t v2_ok;
> - __be32 features_mask;
> - int error;
> - __be16 vernum_mask;
> + struct xfs_mount *mp = sc->mp;
> + struct xfs_buf *bp;
> + struct xfs_dsb *sb;
> + xfs_agnumber_t agno;
> + uint32_t v2_ok;
> + __be32 features_mask;
> + int error;
> + __be16 vernum_mask;
>
> agno = sc->sm->sm_agno;
> if (agno == 0)
> @@ -367,9 +367,9 @@ static inline void
> xchk_agf_xref_freeblks(
> struct xfs_scrub *sc)
> {
> - struct xfs_agf *agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
> - xfs_extlen_t blocks = 0;
> - int error;
> + struct xfs_agf *agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
> + xfs_extlen_t blocks = 0;
> + int error;
>
> if (!sc->sa.bno_cur)
> return;
> @@ -387,11 +387,11 @@ static inline void
> xchk_agf_xref_cntbt(
> struct xfs_scrub *sc)
> {
> - struct xfs_agf *agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
> - xfs_agblock_t agbno;
> - xfs_extlen_t blocks;
> - int have;
> - int error;
> + struct xfs_agf *agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
> + xfs_agblock_t agbno;
> + xfs_extlen_t blocks;
> + int have;
> + int error;
>
> if (!sc->sa.cnt_cur)
> return;
> @@ -419,11 +419,11 @@ STATIC void
> xchk_agf_xref_btreeblks(
> struct xfs_scrub *sc)
> {
> - struct xfs_agf *agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
> - struct xfs_mount *mp = sc->mp;
> - xfs_agblock_t blocks;
> - xfs_agblock_t btreeblks;
> - int error;
> + struct xfs_agf *agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
> + struct xfs_mount *mp = sc->mp;
> + xfs_agblock_t blocks;
> + xfs_agblock_t btreeblks;
> + int error;
>
> /* Check agf_rmap_blocks; set up for agf_btreeblks check */
> if (sc->sa.rmap_cur) {
> @@ -465,9 +465,9 @@ static inline void
> xchk_agf_xref_refcblks(
> struct xfs_scrub *sc)
> {
> - struct xfs_agf *agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
> - xfs_agblock_t blocks;
> - int error;
> + struct xfs_agf *agf = XFS_BUF_TO_AGF(sc->sa.agf_bp);
> + xfs_agblock_t blocks;
> + int error;
>
> if (!sc->sa.refc_cur)
> return;
> @@ -484,10 +484,10 @@ STATIC void
> xchk_agf_xref(
> struct xfs_scrub *sc)
> {
> - struct xfs_owner_info oinfo;
> - struct xfs_mount *mp = sc->mp;
> - xfs_agblock_t agbno;
> - int error;
> + struct xfs_owner_info oinfo;
> + struct xfs_mount *mp = sc->mp;
> + xfs_agblock_t agbno;
> + int error;
>
> if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
> return;
> @@ -516,17 +516,17 @@ int
> xchk_agf(
> struct xfs_scrub *sc)
> {
> - struct xfs_mount *mp = sc->mp;
> - struct xfs_agf *agf;
> - xfs_agnumber_t agno;
> - xfs_agblock_t agbno;
> - xfs_agblock_t eoag;
> - xfs_agblock_t agfl_first;
> - xfs_agblock_t agfl_last;
> - xfs_agblock_t agfl_count;
> - xfs_agblock_t fl_count;
> - int level;
> - int error = 0;
> + struct xfs_mount *mp = sc->mp;
> + struct xfs_agf *agf;
> + xfs_agnumber_t agno;
> + xfs_agblock_t agbno;
> + xfs_agblock_t eoag;
> + xfs_agblock_t agfl_first;
> + xfs_agblock_t agfl_last;
> + xfs_agblock_t agfl_count;
> + xfs_agblock_t fl_count;
> + int level;
> + int error = 0;
>
> agno = sc->sa.agno = sc->sm->sm_agno;
> error = xchk_ag_read_headers(sc, agno, &sc->sa.agi_bp,
> @@ -598,10 +598,10 @@ xchk_agf(
> /* AGFL */
>
> struct xchk_agfl_info {
> - struct xfs_owner_info oinfo;
> - unsigned int sz_entries;
> - unsigned int nr_entries;
> - xfs_agblock_t *entries;
> + struct xfs_owner_info oinfo;
> + unsigned int sz_entries;
> + unsigned int nr_entries;
> + xfs_agblock_t *entries;
> struct xfs_scrub *sc;
> };
>
> @@ -609,8 +609,8 @@ struct xchk_agfl_info {
> STATIC void
> xchk_agfl_block_xref(
> struct xfs_scrub *sc,
> - xfs_agblock_t agbno,
> - struct xfs_owner_info *oinfo)
> + xfs_agblock_t agbno,
> + struct xfs_owner_info *oinfo)
> {
> if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
> return;
> @@ -624,13 +624,13 @@ xchk_agfl_block_xref(
> /* Scrub an AGFL block. */
> STATIC int
> xchk_agfl_block(
> - struct xfs_mount *mp,
> - xfs_agblock_t agbno,
> - void *priv)
> + struct xfs_mount *mp,
> + xfs_agblock_t agbno,
> + void *priv)
> {
> - struct xchk_agfl_info *sai = priv;
> + struct xchk_agfl_info *sai = priv;
> struct xfs_scrub *sc = sai->sc;
> - xfs_agnumber_t agno = sc->sa.agno;
> + xfs_agnumber_t agno = sc->sa.agno;
>
> if (xfs_verify_agbno(mp, agno, agbno) &&
> sai->nr_entries < sai->sz_entries)
> @@ -662,10 +662,10 @@ STATIC void
> xchk_agfl_xref(
> struct xfs_scrub *sc)
> {
> - struct xfs_owner_info oinfo;
> - struct xfs_mount *mp = sc->mp;
> - xfs_agblock_t agbno;
> - int error;
> + struct xfs_owner_info oinfo;
> + struct xfs_mount *mp = sc->mp;
> + xfs_agblock_t agbno;
> + int error;
>
> if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
> return;
> @@ -693,12 +693,12 @@ int
> xchk_agfl(
> struct xfs_scrub *sc)
> {
> - struct xchk_agfl_info sai;
> - struct xfs_agf *agf;
> - xfs_agnumber_t agno;
> - unsigned int agflcount;
> - unsigned int i;
> - int error;
> + struct xchk_agfl_info sai;
> + struct xfs_agf *agf;
> + xfs_agnumber_t agno;
> + unsigned int agflcount;
> + unsigned int i;
> + int error;
>
> agno = sc->sa.agno = sc->sm->sm_agno;
> error = xchk_ag_read_headers(sc, agno, &sc->sa.agi_bp,
> @@ -770,10 +770,10 @@ static inline void
> xchk_agi_xref_icounts(
> struct xfs_scrub *sc)
> {
> - struct xfs_agi *agi = XFS_BUF_TO_AGI(sc->sa.agi_bp);
> - xfs_agino_t icount;
> - xfs_agino_t freecount;
> - int error;
> + struct xfs_agi *agi = XFS_BUF_TO_AGI(sc->sa.agi_bp);
> + xfs_agino_t icount;
> + xfs_agino_t freecount;
> + int error;
>
> if (!sc->sa.ino_cur)
> return;
> @@ -791,10 +791,10 @@ STATIC void
> xchk_agi_xref(
> struct xfs_scrub *sc)
> {
> - struct xfs_owner_info oinfo;
> - struct xfs_mount *mp = sc->mp;
> - xfs_agblock_t agbno;
> - int error;
> + struct xfs_owner_info oinfo;
> + struct xfs_mount *mp = sc->mp;
> + xfs_agblock_t agbno;
> + int error;
>
> if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
> return;
> @@ -820,18 +820,18 @@ int
> xchk_agi(
> struct xfs_scrub *sc)
> {
> - struct xfs_mount *mp = sc->mp;
> - struct xfs_agi *agi;
> - xfs_agnumber_t agno;
> - xfs_agblock_t agbno;
> - xfs_agblock_t eoag;
> - xfs_agino_t agino;
> - xfs_agino_t first_agino;
> - xfs_agino_t last_agino;
> - xfs_agino_t icount;
> - int i;
> - int level;
> - int error = 0;
> + struct xfs_mount *mp = sc->mp;
> + struct xfs_agi *agi;
> + xfs_agnumber_t agno;
> + xfs_agblock_t agbno;
> + xfs_agblock_t eoag;
> + xfs_agino_t agino;
> + xfs_agino_t first_agino;
> + xfs_agino_t last_agino;
> + xfs_agino_t icount;
> + int i;
> + int level;
> + int error = 0;
>
> agno = sc->sa.agno = sc->sm->sm_agno;
> error = xchk_ag_read_headers(sc, agno, &sc->sa.agi_bp,
> diff --git a/fs/xfs/scrub/agheader_repair.c b/fs/xfs/scrub/agheader_repair.c
> index 2457968482f8..1e96621ece3a 100644
> --- a/fs/xfs/scrub/agheader_repair.c
> +++ b/fs/xfs/scrub/agheader_repair.c
> @@ -31,10 +31,10 @@ int
> xrep_superblock(
> struct xfs_scrub *sc)
> {
> - struct xfs_mount *mp = sc->mp;
> - struct xfs_buf *bp;
> - xfs_agnumber_t agno;
> - int error;
> + struct xfs_mount *mp = sc->mp;
> + struct xfs_buf *bp;
> + xfs_agnumber_t agno;
> + int error;
>
> /* Don't try to repair AG 0's sb; let xfs_repair deal with it. */
> agno = sc->sm->sm_agno;
> diff --git a/fs/xfs/scrub/alloc.c b/fs/xfs/scrub/alloc.c
> index 653d80b3aa39..036b5c7021eb 100644
> --- a/fs/xfs/scrub/alloc.c
> +++ b/fs/xfs/scrub/alloc.c
> @@ -30,7 +30,7 @@
> int
> xchk_setup_ag_allocbt(
> struct xfs_scrub *sc,
> - struct xfs_inode *ip)
> + struct xfs_inode *ip)
> {
> return xchk_setup_ag_btree(sc, ip, false);
> }
> @@ -43,14 +43,14 @@ xchk_setup_ag_allocbt(
> STATIC void
> xchk_allocbt_xref_other(
> struct xfs_scrub *sc,
> - xfs_agblock_t agbno,
> - xfs_extlen_t len)
> + xfs_agblock_t agbno,
> + xfs_extlen_t len)
> {
> - struct xfs_btree_cur **pcur;
> - xfs_agblock_t fbno;
> - xfs_extlen_t flen;
> - int has_otherrec;
> - int error;
> + struct xfs_btree_cur **pcur;
> + xfs_agblock_t fbno;
> + xfs_extlen_t flen;
> + int has_otherrec;
> + int error;
>
> if (sc->sm->sm_type == XFS_SCRUB_TYPE_BNOBT)
> pcur = &sc->sa.cnt_cur;
> @@ -83,8 +83,8 @@ xchk_allocbt_xref_other(
> STATIC void
> xchk_allocbt_xref(
> struct xfs_scrub *sc,
> - xfs_agblock_t agbno,
> - xfs_extlen_t len)
> + xfs_agblock_t agbno,
> + xfs_extlen_t len)
> {
> if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
> return;
> @@ -98,14 +98,14 @@ xchk_allocbt_xref(
> /* Scrub a bnobt/cntbt record. */
> STATIC int
> xchk_allocbt_rec(
> - struct xchk_btree *bs,
> - union xfs_btree_rec *rec)
> + struct xchk_btree *bs,
> + union xfs_btree_rec *rec)
> {
> - struct xfs_mount *mp = bs->cur->bc_mp;
> - xfs_agnumber_t agno = bs->cur->bc_private.a.agno;
> - xfs_agblock_t bno;
> - xfs_extlen_t len;
> - int error = 0;
> + struct xfs_mount *mp = bs->cur->bc_mp;
> + xfs_agnumber_t agno = bs->cur->bc_private.a.agno;
> + xfs_agblock_t bno;
> + xfs_extlen_t len;
> + int error = 0;
>
> bno = be32_to_cpu(rec->alloc.ar_startblock);
> len = be32_to_cpu(rec->alloc.ar_blockcount);
> @@ -124,10 +124,10 @@ xchk_allocbt_rec(
> STATIC int
> xchk_allocbt(
> struct xfs_scrub *sc,
> - xfs_btnum_t which)
> + xfs_btnum_t which)
> {
> - struct xfs_owner_info oinfo;
> - struct xfs_btree_cur *cur;
> + struct xfs_owner_info oinfo;
> + struct xfs_btree_cur *cur;
>
> xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_AG);
> cur = which == XFS_BTNUM_BNO ? sc->sa.bno_cur : sc->sa.cnt_cur;
> @@ -152,11 +152,11 @@ xchk_cntbt(
> void
> xchk_xref_is_used_space(
> struct xfs_scrub *sc,
> - xfs_agblock_t agbno,
> - xfs_extlen_t len)
> + xfs_agblock_t agbno,
> + xfs_extlen_t len)
> {
> - bool is_freesp;
> - int error;
> + bool is_freesp;
> + int error;
>
> if (!sc->sa.bno_cur || xchk_skip_xref(sc->sm))
> return;
> diff --git a/fs/xfs/scrub/attr.c b/fs/xfs/scrub/attr.c
> index 6650fb3010b6..81d5e90547a1 100644
> --- a/fs/xfs/scrub/attr.c
> +++ b/fs/xfs/scrub/attr.c
> @@ -34,9 +34,9 @@
> int
> xchk_setup_xattr(
> struct xfs_scrub *sc,
> - struct xfs_inode *ip)
> + struct xfs_inode *ip)
> {
> - size_t sz;
> + size_t sz;
>
> /*
> * Allocate the buffer without the inode lock held. We need enough
> @@ -57,7 +57,7 @@ xchk_setup_xattr(
>
> struct xchk_xattr {
> struct xfs_attr_list_context context;
> - struct xfs_scrub *sc;
> + struct xfs_scrub *sc;
> };
>
> /*
> @@ -128,12 +128,12 @@ xchk_xattr_listent(
> STATIC bool
> xchk_xattr_set_map(
> struct xfs_scrub *sc,
> - unsigned long *map,
> - unsigned int start,
> - unsigned int len)
> + unsigned long *map,
> + unsigned int start,
> + unsigned int len)
> {
> - unsigned int mapsize = sc->mp->m_attr_geo->blksize;
> - bool ret = true;
> + unsigned int mapsize = sc->mp->m_attr_geo->blksize;
> + bool ret = true;
>
> if (start >= mapsize)
> return false;
> @@ -155,7 +155,7 @@ xchk_xattr_set_map(
> */
> STATIC bool
> xchk_xattr_check_freemap(
> - struct xfs_scrub *sc,
> + struct xfs_scrub *sc,
> unsigned long *map,
> struct xfs_attr3_icleaf_hdr *leafhdr)
> {
> @@ -405,7 +405,7 @@ xchk_xattr_rec(
> /* Scrub the extended attribute metadata. */
> int
> xchk_xattr(
> - struct xfs_scrub *sc)
> + struct xfs_scrub *sc)
> {
> struct xchk_xattr sx;
> struct attrlist_cursor_kern cursor = { 0 };
> diff --git a/fs/xfs/scrub/bmap.c b/fs/xfs/scrub/bmap.c
> index 0e5166232b15..e1d11f3223e3 100644
> --- a/fs/xfs/scrub/bmap.c
> +++ b/fs/xfs/scrub/bmap.c
> @@ -35,9 +35,9 @@
> int
> xchk_setup_inode_bmap(
> struct xfs_scrub *sc,
> - struct xfs_inode *ip)
> + struct xfs_inode *ip)
> {
> - int error;
> + int error;
>
> error = xchk_get_inode(sc, ip);
> if (error)
> @@ -80,25 +80,25 @@ xchk_setup_inode_bmap(
>
> struct xchk_bmap_info {
> struct xfs_scrub *sc;
> - xfs_fileoff_t lastoff;
> - bool is_rt;
> - bool is_shared;
> - int whichfork;
> + xfs_fileoff_t lastoff;
> + bool is_rt;
> + bool is_shared;
> + int whichfork;
> };
>
> /* Look for a corresponding rmap for this irec. */
> static inline bool
> xchk_bmap_get_rmap(
> - struct xchk_bmap_info *info,
> - struct xfs_bmbt_irec *irec,
> - xfs_agblock_t agbno,
> - uint64_t owner,
> - struct xfs_rmap_irec *rmap)
> + struct xchk_bmap_info *info,
> + struct xfs_bmbt_irec *irec,
> + xfs_agblock_t agbno,
> + uint64_t owner,
> + struct xfs_rmap_irec *rmap)
> {
> - xfs_fileoff_t offset;
> - unsigned int rflags = 0;
> - int has_rmap;
> - int error;
> + xfs_fileoff_t offset;
> + unsigned int rflags = 0;
> + int has_rmap;
> + int error;
>
> if (info->whichfork == XFS_ATTR_FORK)
> rflags |= XFS_RMAP_ATTR_FORK;
> @@ -152,13 +152,13 @@ xchk_bmap_get_rmap(
> /* Make sure that we have rmapbt records for this extent. */
> STATIC void
> xchk_bmap_xref_rmap(
> - struct xchk_bmap_info *info,
> - struct xfs_bmbt_irec *irec,
> - xfs_agblock_t agbno)
> + struct xchk_bmap_info *info,
> + struct xfs_bmbt_irec *irec,
> + xfs_agblock_t agbno)
> {
> - struct xfs_rmap_irec rmap;
> - unsigned long long rmap_end;
> - uint64_t owner;
> + struct xfs_rmap_irec rmap;
> + unsigned long long rmap_end;
> + uint64_t owner;
>
> if (!info->sc->sa.rmap_cur || xchk_skip_xref(info->sc->sm))
> return;
> @@ -222,10 +222,10 @@ xchk_bmap_xref_rmap(
> /* Cross-reference a single rtdev extent record. */
> STATIC void
> xchk_bmap_rt_extent_xref(
> - struct xchk_bmap_info *info,
> - struct xfs_inode *ip,
> - struct xfs_btree_cur *cur,
> - struct xfs_bmbt_irec *irec)
> + struct xchk_bmap_info *info,
> + struct xfs_inode *ip,
> + struct xfs_btree_cur *cur,
> + struct xfs_bmbt_irec *irec)
> {
> if (info->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
> return;
> @@ -237,16 +237,16 @@ xchk_bmap_rt_extent_xref(
> /* Cross-reference a single datadev extent record. */
> STATIC void
> xchk_bmap_extent_xref(
> - struct xchk_bmap_info *info,
> - struct xfs_inode *ip,
> - struct xfs_btree_cur *cur,
> - struct xfs_bmbt_irec *irec)
> + struct xchk_bmap_info *info,
> + struct xfs_inode *ip,
> + struct xfs_btree_cur *cur,
> + struct xfs_bmbt_irec *irec)
> {
> - struct xfs_mount *mp = info->sc->mp;
> - xfs_agnumber_t agno;
> - xfs_agblock_t agbno;
> - xfs_extlen_t len;
> - int error;
> + struct xfs_mount *mp = info->sc->mp;
> + xfs_agnumber_t agno;
> + xfs_agblock_t agbno;
> + xfs_extlen_t len;
> + int error;
>
> if (info->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
> return;
> @@ -284,15 +284,15 @@ xchk_bmap_extent_xref(
> /* Scrub a single extent record. */
> STATIC int
> xchk_bmap_extent(
> - struct xfs_inode *ip,
> - struct xfs_btree_cur *cur,
> - struct xchk_bmap_info *info,
> - struct xfs_bmbt_irec *irec)
> + struct xfs_inode *ip,
> + struct xfs_btree_cur *cur,
> + struct xchk_bmap_info *info,
> + struct xfs_bmbt_irec *irec)
> {
> - struct xfs_mount *mp = info->sc->mp;
> - struct xfs_buf *bp = NULL;
> - xfs_filblks_t end;
> - int error = 0;
> + struct xfs_mount *mp = info->sc->mp;
> + struct xfs_buf *bp = NULL;
> + xfs_filblks_t end;
> + int error = 0;
>
> if (cur)
> xfs_btree_get_block(cur, 0, &bp);
> @@ -357,16 +357,16 @@ xchk_bmap_extent(
> /* Scrub a bmbt record. */
> STATIC int
> xchk_bmapbt_rec(
> - struct xchk_btree *bs,
> - union xfs_btree_rec *rec)
> + struct xchk_btree *bs,
> + union xfs_btree_rec *rec)
> {
> - struct xfs_bmbt_irec irec;
> - struct xchk_bmap_info *info = bs->private;
> - struct xfs_inode *ip = bs->cur->bc_private.b.ip;
> - struct xfs_buf *bp = NULL;
> - struct xfs_btree_block *block;
> - uint64_t owner;
> - int i;
> + struct xfs_bmbt_irec irec;
> + struct xchk_bmap_info *info = bs->private;
> + struct xfs_inode *ip = bs->cur->bc_private.b.ip;
> + struct xfs_buf *bp = NULL;
> + struct xfs_btree_block *block;
> + uint64_t owner;
> + int i;
>
> /*
> * Check the owners of the btree blocks up to the level below
> @@ -392,14 +392,14 @@ xchk_bmapbt_rec(
> STATIC int
> xchk_bmap_btree(
> struct xfs_scrub *sc,
> - int whichfork,
> - struct xchk_bmap_info *info)
> + int whichfork,
> + struct xchk_bmap_info *info)
> {
> - struct xfs_owner_info oinfo;
> - struct xfs_mount *mp = sc->mp;
> - struct xfs_inode *ip = sc->ip;
> - struct xfs_btree_cur *cur;
> - int error;
> + struct xfs_owner_info oinfo;
> + struct xfs_mount *mp = sc->mp;
> + struct xfs_inode *ip = sc->ip;
> + struct xfs_btree_cur *cur;
> + int error;
>
> cur = xfs_bmbt_init_cursor(mp, sc->tp, ip, whichfork);
> xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, whichfork);
> @@ -410,8 +410,8 @@ xchk_bmap_btree(
>
> struct xchk_bmap_check_rmap_info {
> struct xfs_scrub *sc;
> - int whichfork;
> - struct xfs_iext_cursor icur;
> + int whichfork;
> + struct xfs_iext_cursor icur;
> };
>
> /* Can we find bmaps that fit this rmap? */
> @@ -424,7 +424,7 @@ xchk_bmap_check_rmap(
> struct xfs_bmbt_irec irec;
> struct xchk_bmap_check_rmap_info *sbcri = priv;
> struct xfs_ifork *ifp;
> - struct xfs_scrub *sc = sbcri->sc;
> + struct xfs_scrub *sc = sbcri->sc;
> bool have_map;
>
> /* Is this even the right fork? */
> @@ -488,7 +488,7 @@ xchk_bmap_check_rmap(
> /* Make sure each rmap has a corresponding bmbt entry. */
> STATIC int
> xchk_bmap_check_ag_rmaps(
> - struct xfs_scrub *sc,
> + struct xfs_scrub *sc,
> int whichfork,
> xfs_agnumber_t agno)
> {
> @@ -523,11 +523,11 @@ xchk_bmap_check_ag_rmaps(
> STATIC int
> xchk_bmap_check_rmaps(
> struct xfs_scrub *sc,
> - int whichfork)
> + int whichfork)
> {
> - loff_t size;
> - xfs_agnumber_t agno;
> - int error;
> + loff_t size;
> + xfs_agnumber_t agno;
> + int error;
>
> if (!xfs_sb_version_hasrmapbt(&sc->mp->m_sb) ||
> whichfork == XFS_COW_FORK ||
> @@ -580,16 +580,16 @@ xchk_bmap_check_rmaps(
> STATIC int
> xchk_bmap(
> struct xfs_scrub *sc,
> - int whichfork)
> + int whichfork)
> {
> - struct xfs_bmbt_irec irec;
> - struct xchk_bmap_info info = { NULL };
> - struct xfs_mount *mp = sc->mp;
> - struct xfs_inode *ip = sc->ip;
> - struct xfs_ifork *ifp;
> - xfs_fileoff_t endoff;
> - struct xfs_iext_cursor icur;
> - int error = 0;
> + struct xfs_bmbt_irec irec;
> + struct xchk_bmap_info info = { NULL };
> + struct xfs_mount *mp = sc->mp;
> + struct xfs_inode *ip = sc->ip;
> + struct xfs_ifork *ifp;
> + xfs_fileoff_t endoff;
> + struct xfs_iext_cursor icur;
> + int error = 0;
>
> ifp = XFS_IFORK_PTR(ip, whichfork);
>
> diff --git a/fs/xfs/scrub/btree.c b/fs/xfs/scrub/btree.c
> index c4e1dce8c5b3..4ae959f7ad2c 100644
> --- a/fs/xfs/scrub/btree.c
> +++ b/fs/xfs/scrub/btree.c
> @@ -31,11 +31,11 @@
> static bool
> __xchk_btree_process_error(
> struct xfs_scrub *sc,
> - struct xfs_btree_cur *cur,
> - int level,
> - int *error,
> - __u32 errflag,
> - void *ret_ip)
> + struct xfs_btree_cur *cur,
> + int level,
> + int *error,
> + __u32 errflag,
> + void *ret_ip)
> {
> if (*error == 0)
> return true;
> @@ -66,9 +66,9 @@ __xchk_btree_process_error(
> bool
> xchk_btree_process_error(
> struct xfs_scrub *sc,
> - struct xfs_btree_cur *cur,
> - int level,
> - int *error)
> + struct xfs_btree_cur *cur,
> + int level,
> + int *error)
> {
> return __xchk_btree_process_error(sc, cur, level, error,
> XFS_SCRUB_OFLAG_CORRUPT, __return_address);
> @@ -77,9 +77,9 @@ xchk_btree_process_error(
> bool
> xchk_btree_xref_process_error(
> struct xfs_scrub *sc,
> - struct xfs_btree_cur *cur,
> - int level,
> - int *error)
> + struct xfs_btree_cur *cur,
> + int level,
> + int *error)
> {
> return __xchk_btree_process_error(sc, cur, level, error,
> XFS_SCRUB_OFLAG_XFAIL, __return_address);
> @@ -89,10 +89,10 @@ xchk_btree_xref_process_error(
> static void
> __xchk_btree_set_corrupt(
> struct xfs_scrub *sc,
> - struct xfs_btree_cur *cur,
> - int level,
> - __u32 errflag,
> - void *ret_ip)
> + struct xfs_btree_cur *cur,
> + int level,
> + __u32 errflag,
> + void *ret_ip)
> {
> sc->sm->sm_flags |= errflag;
>
> @@ -107,8 +107,8 @@ __xchk_btree_set_corrupt(
> void
> xchk_btree_set_corrupt(
> struct xfs_scrub *sc,
> - struct xfs_btree_cur *cur,
> - int level)
> + struct xfs_btree_cur *cur,
> + int level)
> {
> __xchk_btree_set_corrupt(sc, cur, level, XFS_SCRUB_OFLAG_CORRUPT,
> __return_address);
> @@ -117,8 +117,8 @@ xchk_btree_set_corrupt(
> void
> xchk_btree_xref_set_corrupt(
> struct xfs_scrub *sc,
> - struct xfs_btree_cur *cur,
> - int level)
> + struct xfs_btree_cur *cur,
> + int level)
> {
> __xchk_btree_set_corrupt(sc, cur, level, XFS_SCRUB_OFLAG_XCORRUPT,
> __return_address);
> @@ -225,11 +225,11 @@ xchk_btree_key(
> */
> static bool
> xchk_btree_ptr_ok(
> - struct xchk_btree *bs,
> - int level,
> - union xfs_btree_ptr *ptr)
> + struct xchk_btree *bs,
> + int level,
> + union xfs_btree_ptr *ptr)
> {
> - bool res;
> + bool res;
>
> /* A btree rooted in an inode has no block pointer to the root. */
> if ((bs->cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) &&
> @@ -250,18 +250,18 @@ xchk_btree_ptr_ok(
> /* Check that a btree block's sibling matches what we expect it. */
> STATIC int
> xchk_btree_block_check_sibling(
> - struct xchk_btree *bs,
> - int level,
> - int direction,
> - union xfs_btree_ptr *sibling)
> + struct xchk_btree *bs,
> + int level,
> + int direction,
> + union xfs_btree_ptr *sibling)
> {
> - struct xfs_btree_cur *cur = bs->cur;
> - struct xfs_btree_block *pblock;
> - struct xfs_buf *pbp;
> - struct xfs_btree_cur *ncur = NULL;
> - union xfs_btree_ptr *pp;
> - int success;
> - int error;
> + struct xfs_btree_cur *cur = bs->cur;
> + struct xfs_btree_block *pblock;
> + struct xfs_buf *pbp;
> + struct xfs_btree_cur *ncur = NULL;
> + union xfs_btree_ptr *pp;
> + int success;
> + int error;
>
> error = xfs_btree_dup_cursor(cur, &ncur);
> if (!xchk_btree_process_error(bs->sc, cur, level + 1, &error) ||
> @@ -313,14 +313,14 @@ xchk_btree_block_check_sibling(
> /* Check the siblings of a btree block. */
> STATIC int
> xchk_btree_block_check_siblings(
> - struct xchk_btree *bs,
> - struct xfs_btree_block *block)
> + struct xchk_btree *bs,
> + struct xfs_btree_block *block)
> {
> - struct xfs_btree_cur *cur = bs->cur;
> - union xfs_btree_ptr leftsib;
> - union xfs_btree_ptr rightsib;
> - int level;
> - int error = 0;
> + struct xfs_btree_cur *cur = bs->cur;
> + union xfs_btree_ptr leftsib;
> + union xfs_btree_ptr rightsib;
> + int level;
> + int error = 0;
>
> xfs_btree_get_sibling(cur, block, &leftsib, XFS_BB_LEFTSIB);
> xfs_btree_get_sibling(cur, block, &rightsib, XFS_BB_RIGHTSIB);
> @@ -361,15 +361,15 @@ struct check_owner {
> */
> STATIC int
> xchk_btree_check_block_owner(
> - struct xchk_btree *bs,
> - int level,
> - xfs_daddr_t daddr)
> + struct xchk_btree *bs,
> + int level,
> + xfs_daddr_t daddr)
> {
> - xfs_agnumber_t agno;
> - xfs_agblock_t agbno;
> - xfs_btnum_t btnum;
> - bool init_sa;
> - int error = 0;
> + xfs_agnumber_t agno;
> + xfs_agblock_t agbno;
> + xfs_btnum_t btnum;
> + bool init_sa;
> + int error = 0;
>
> if (!bs->cur)
> return 0;
> @@ -408,12 +408,12 @@ xchk_btree_check_block_owner(
> /* Check the owner of a btree block. */
> STATIC int
> xchk_btree_check_owner(
> - struct xchk_btree *bs,
> - int level,
> - struct xfs_buf *bp)
> + struct xchk_btree *bs,
> + int level,
> + struct xfs_buf *bp)
> {
> - struct xfs_btree_cur *cur = bs->cur;
> - struct check_owner *co;
> + struct xfs_btree_cur *cur = bs->cur;
> + struct check_owner *co;
>
> if ((cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) && bp == NULL)
> return 0;
> @@ -484,14 +484,14 @@ xchk_btree_check_minrecs(
> */
> STATIC int
> xchk_btree_get_block(
> - struct xchk_btree *bs,
> - int level,
> - union xfs_btree_ptr *pp,
> - struct xfs_btree_block **pblock,
> - struct xfs_buf **pbp)
> + struct xchk_btree *bs,
> + int level,
> + union xfs_btree_ptr *pp,
> + struct xfs_btree_block **pblock,
> + struct xfs_buf **pbp)
> {
> - void *failed_at;
> - int error;
> + xfs_failaddr_t failed_at;
> + int error;
>
> *pblock = NULL;
> *pbp = NULL;
> @@ -538,17 +538,17 @@ xchk_btree_get_block(
> */
> STATIC void
> xchk_btree_block_keys(
> - struct xchk_btree *bs,
> - int level,
> - struct xfs_btree_block *block)
> + struct xchk_btree *bs,
> + int level,
> + struct xfs_btree_block *block)
> {
> - union xfs_btree_key block_keys;
> - struct xfs_btree_cur *cur = bs->cur;
> - union xfs_btree_key *high_bk;
> - union xfs_btree_key *parent_keys;
> - union xfs_btree_key *high_pk;
> - struct xfs_btree_block *parent_block;
> - struct xfs_buf *bp;
> + union xfs_btree_key block_keys;
> + struct xfs_btree_cur *cur = bs->cur;
> + union xfs_btree_key *high_bk;
> + union xfs_btree_key *parent_keys;
> + union xfs_btree_key *high_pk;
> + struct xfs_btree_block *parent_block;
> + struct xfs_buf *bp;
>
> if (level >= cur->bc_nlevels - 1)
> return;
> @@ -584,22 +584,22 @@ xchk_btree_block_keys(
> int
> xchk_btree(
> struct xfs_scrub *sc,
> - struct xfs_btree_cur *cur,
> - xchk_btree_rec_fn scrub_fn,
> - struct xfs_owner_info *oinfo,
> - void *private)
> + struct xfs_btree_cur *cur,
> + xchk_btree_rec_fn scrub_fn,
> + struct xfs_owner_info *oinfo,
> + void *private)
> {
> - struct xchk_btree bs = { NULL };
> - union xfs_btree_ptr ptr;
> - union xfs_btree_ptr *pp;
> - union xfs_btree_rec *recp;
> - struct xfs_btree_block *block;
> - int level;
> - struct xfs_buf *bp;
> - struct check_owner *co;
> - struct check_owner *n;
> - int i;
> - int error = 0;
> + struct xchk_btree bs = { NULL };
> + union xfs_btree_ptr ptr;
> + union xfs_btree_ptr *pp;
> + union xfs_btree_rec *recp;
> + struct xfs_btree_block *block;
> + int level;
> + struct xfs_buf *bp;
> + struct check_owner *co;
> + struct check_owner *n;
> + int i;
> + int error = 0;
>
> /* Initialize scrub state */
> bs.cur = cur;
> diff --git a/fs/xfs/scrub/btree.h b/fs/xfs/scrub/btree.h
> index a0b74b515b9b..aada763cd006 100644
> --- a/fs/xfs/scrub/btree.h
> +++ b/fs/xfs/scrub/btree.h
> @@ -14,8 +14,7 @@ bool xchk_btree_process_error(struct xfs_scrub *sc,
>
> /* Check for btree xref operation errors. */
> bool xchk_btree_xref_process_error(struct xfs_scrub *sc,
> - struct xfs_btree_cur *cur, int level,
> - int *error);
> + struct xfs_btree_cur *cur, int level, int *error);
>
> /* Check for btree corruption. */
> void xchk_btree_set_corrupt(struct xfs_scrub *sc,
> @@ -33,20 +32,20 @@ typedef int (*xchk_btree_rec_fn)(
> struct xchk_btree {
> /* caller-provided scrub state */
> struct xfs_scrub *sc;
> - struct xfs_btree_cur *cur;
> - xchk_btree_rec_fn scrub_rec;
> - struct xfs_owner_info *oinfo;
> - void *private;
> + struct xfs_btree_cur *cur;
> + xchk_btree_rec_fn scrub_rec;
> + struct xfs_owner_info *oinfo;
> + void *private;
>
> /* internal scrub state */
> - union xfs_btree_rec lastrec;
> - bool firstrec;
> - union xfs_btree_key lastkey[XFS_BTREE_MAXLEVELS];
> - bool firstkey[XFS_BTREE_MAXLEVELS];
> - struct list_head to_check;
> + union xfs_btree_rec lastrec;
> + bool firstrec;
> + union xfs_btree_key lastkey[XFS_BTREE_MAXLEVELS];
> + bool firstkey[XFS_BTREE_MAXLEVELS];
> + struct list_head to_check;
> };
> int xchk_btree(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
> - xchk_btree_rec_fn scrub_fn,
> - struct xfs_owner_info *oinfo, void *private);
> + xchk_btree_rec_fn scrub_fn, struct xfs_owner_info *oinfo,
> + void *private);
>
> #endif /* __XFS_SCRUB_BTREE_H__ */
> diff --git a/fs/xfs/scrub/common.c b/fs/xfs/scrub/common.c
> index 81e8bb7d5486..248efa74c390 100644
> --- a/fs/xfs/scrub/common.c
> +++ b/fs/xfs/scrub/common.c
> @@ -70,11 +70,11 @@
> static bool
> __xchk_process_error(
> struct xfs_scrub *sc,
> - xfs_agnumber_t agno,
> - xfs_agblock_t bno,
> - int *error,
> - __u32 errflag,
> - void *ret_ip)
> + xfs_agnumber_t agno,
> + xfs_agblock_t bno,
> + int *error,
> + __u32 errflag,
> + void *ret_ip)
> {
> switch (*error) {
> case 0:
> @@ -100,9 +100,9 @@ __xchk_process_error(
> bool
> xchk_process_error(
> struct xfs_scrub *sc,
> - xfs_agnumber_t agno,
> - xfs_agblock_t bno,
> - int *error)
> + xfs_agnumber_t agno,
> + xfs_agblock_t bno,
> + int *error)
> {
> return __xchk_process_error(sc, agno, bno, error,
> XFS_SCRUB_OFLAG_CORRUPT, __return_address);
> @@ -111,9 +111,9 @@ xchk_process_error(
> bool
> xchk_xref_process_error(
> struct xfs_scrub *sc,
> - xfs_agnumber_t agno,
> - xfs_agblock_t bno,
> - int *error)
> + xfs_agnumber_t agno,
> + xfs_agblock_t bno,
> + int *error)
> {
> return __xchk_process_error(sc, agno, bno, error,
> XFS_SCRUB_OFLAG_XFAIL, __return_address);
> @@ -123,11 +123,11 @@ xchk_xref_process_error(
> static bool
> __xchk_fblock_process_error(
> struct xfs_scrub *sc,
> - int whichfork,
> - xfs_fileoff_t offset,
> - int *error,
> - __u32 errflag,
> - void *ret_ip)
> + int whichfork,
> + xfs_fileoff_t offset,
> + int *error,
> + __u32 errflag,
> + void *ret_ip)
> {
> switch (*error) {
> case 0:
> @@ -153,9 +153,9 @@ __xchk_fblock_process_error(
> bool
> xchk_fblock_process_error(
> struct xfs_scrub *sc,
> - int whichfork,
> - xfs_fileoff_t offset,
> - int *error)
> + int whichfork,
> + xfs_fileoff_t offset,
> + int *error)
> {
> return __xchk_fblock_process_error(sc, whichfork, offset, error,
> XFS_SCRUB_OFLAG_CORRUPT, __return_address);
> @@ -164,9 +164,9 @@ xchk_fblock_process_error(
> bool
> xchk_fblock_xref_process_error(
> struct xfs_scrub *sc,
> - int whichfork,
> - xfs_fileoff_t offset,
> - int *error)
> + int whichfork,
> + xfs_fileoff_t offset,
> + int *error)
> {
> return __xchk_fblock_process_error(sc, whichfork, offset, error,
> XFS_SCRUB_OFLAG_XFAIL, __return_address);
> @@ -188,7 +188,7 @@ xchk_fblock_xref_process_error(
> void
> xchk_block_set_preen(
> struct xfs_scrub *sc,
> - struct xfs_buf *bp)
> + struct xfs_buf *bp)
> {
> sc->sm->sm_flags |= XFS_SCRUB_OFLAG_PREEN;
> trace_xchk_block_preen(sc, bp->b_bn, __return_address);
> @@ -202,7 +202,7 @@ xchk_block_set_preen(
> void
> xchk_ino_set_preen(
> struct xfs_scrub *sc,
> - xfs_ino_t ino)
> + xfs_ino_t ino)
> {
> sc->sm->sm_flags |= XFS_SCRUB_OFLAG_PREEN;
> trace_xchk_ino_preen(sc, ino, __return_address);
> @@ -212,7 +212,7 @@ xchk_ino_set_preen(
> void
> xchk_block_set_corrupt(
> struct xfs_scrub *sc,
> - struct xfs_buf *bp)
> + struct xfs_buf *bp)
> {
> sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT;
> trace_xchk_block_error(sc, bp->b_bn, __return_address);
> @@ -222,7 +222,7 @@ xchk_block_set_corrupt(
> void
> xchk_block_xref_set_corrupt(
> struct xfs_scrub *sc,
> - struct xfs_buf *bp)
> + struct xfs_buf *bp)
> {
> sc->sm->sm_flags |= XFS_SCRUB_OFLAG_XCORRUPT;
> trace_xchk_block_error(sc, bp->b_bn, __return_address);
> @@ -236,7 +236,7 @@ xchk_block_xref_set_corrupt(
> void
> xchk_ino_set_corrupt(
> struct xfs_scrub *sc,
> - xfs_ino_t ino)
> + xfs_ino_t ino)
> {
> sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT;
> trace_xchk_ino_error(sc, ino, __return_address);
> @@ -246,7 +246,7 @@ xchk_ino_set_corrupt(
> void
> xchk_ino_xref_set_corrupt(
> struct xfs_scrub *sc,
> - xfs_ino_t ino)
> + xfs_ino_t ino)
> {
> sc->sm->sm_flags |= XFS_SCRUB_OFLAG_XCORRUPT;
> trace_xchk_ino_error(sc, ino, __return_address);
> @@ -256,8 +256,8 @@ xchk_ino_xref_set_corrupt(
> void
> xchk_fblock_set_corrupt(
> struct xfs_scrub *sc,
> - int whichfork,
> - xfs_fileoff_t offset)
> + int whichfork,
> + xfs_fileoff_t offset)
> {
> sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT;
> trace_xchk_fblock_error(sc, whichfork, offset, __return_address);
> @@ -267,8 +267,8 @@ xchk_fblock_set_corrupt(
> void
> xchk_fblock_xref_set_corrupt(
> struct xfs_scrub *sc,
> - int whichfork,
> - xfs_fileoff_t offset)
> + int whichfork,
> + xfs_fileoff_t offset)
> {
> sc->sm->sm_flags |= XFS_SCRUB_OFLAG_XCORRUPT;
> trace_xchk_fblock_error(sc, whichfork, offset, __return_address);
> @@ -281,7 +281,7 @@ xchk_fblock_xref_set_corrupt(
> void
> xchk_ino_set_warning(
> struct xfs_scrub *sc,
> - xfs_ino_t ino)
> + xfs_ino_t ino)
> {
> sc->sm->sm_flags |= XFS_SCRUB_OFLAG_WARNING;
> trace_xchk_ino_warning(sc, ino, __return_address);
> @@ -291,8 +291,8 @@ xchk_ino_set_warning(
> void
> xchk_fblock_set_warning(
> struct xfs_scrub *sc,
> - int whichfork,
> - xfs_fileoff_t offset)
> + int whichfork,
> + xfs_fileoff_t offset)
> {
> sc->sm->sm_flags |= XFS_SCRUB_OFLAG_WARNING;
> trace_xchk_fblock_warning(sc, whichfork, offset, __return_address);
> @@ -319,13 +319,13 @@ struct xchk_rmap_ownedby_info {
>
> STATIC int
> xchk_count_rmap_ownedby_irec(
> - struct xfs_btree_cur *cur,
> - struct xfs_rmap_irec *rec,
> - void *priv)
> + struct xfs_btree_cur *cur,
> + struct xfs_rmap_irec *rec,
> + void *priv)
> {
> - struct xchk_rmap_ownedby_info *sroi = priv;
> - bool irec_attr;
> - bool oinfo_attr;
> + struct xchk_rmap_ownedby_info *sroi = priv;
> + bool irec_attr;
> + bool oinfo_attr;
>
> irec_attr = rec->rm_flags & XFS_RMAP_ATTR_FORK;
> oinfo_attr = sroi->oinfo->oi_flags & XFS_OWNER_INFO_ATTR_FORK;
> @@ -346,11 +346,11 @@ xchk_count_rmap_ownedby_irec(
> int
> xchk_count_rmap_ownedby_ag(
> struct xfs_scrub *sc,
> - struct xfs_btree_cur *cur,
> - struct xfs_owner_info *oinfo,
> - xfs_filblks_t *blocks)
> + struct xfs_btree_cur *cur,
> + struct xfs_owner_info *oinfo,
> + xfs_filblks_t *blocks)
> {
> - struct xchk_rmap_ownedby_info sroi;
> + struct xchk_rmap_ownedby_info sroi;
>
> sroi.oinfo = oinfo;
> *blocks = 0;
> @@ -372,7 +372,7 @@ xchk_count_rmap_ownedby_ag(
> static inline bool
> want_ag_read_header_failure(
> struct xfs_scrub *sc,
> - unsigned int type)
> + unsigned int type)
> {
> /* Return all AG header read failures when scanning btrees. */
> if (sc->sm->sm_type != XFS_SCRUB_TYPE_AGF &&
> @@ -399,13 +399,13 @@ want_ag_read_header_failure(
> int
> xchk_ag_read_headers(
> struct xfs_scrub *sc,
> - xfs_agnumber_t agno,
> - struct xfs_buf **agi,
> - struct xfs_buf **agf,
> - struct xfs_buf **agfl)
> + xfs_agnumber_t agno,
> + struct xfs_buf **agi,
> + struct xfs_buf **agf,
> + struct xfs_buf **agfl)
> {
> - struct xfs_mount *mp = sc->mp;
> - int error;
> + struct xfs_mount *mp = sc->mp;
> + int error;
>
> error = xfs_ialloc_read_agi(mp, sc->tp, agno, agi);
> if (error && want_ag_read_header_failure(sc, XFS_SCRUB_TYPE_AGI))
> @@ -455,8 +455,8 @@ xchk_ag_btcur_init(
> struct xfs_scrub *sc,
> struct xchk_ag *sa)
> {
> - struct xfs_mount *mp = sc->mp;
> - xfs_agnumber_t agno = sa->agno;
> + struct xfs_mount *mp = sc->mp;
> + xfs_agnumber_t agno = sa->agno;
>
> if (sa->agf_bp) {
> /* Set up a bnobt cursor for cross-referencing. */
> @@ -545,10 +545,10 @@ xchk_ag_free(
> int
> xchk_ag_init(
> struct xfs_scrub *sc,
> - xfs_agnumber_t agno,
> + xfs_agnumber_t agno,
> struct xchk_ag *sa)
> {
> - int error;
> + int error;
>
> sa->agno = agno;
> error = xchk_ag_read_headers(sc, agno, &sa->agi_bp,
> @@ -566,7 +566,7 @@ xchk_ag_init(
> void
> xchk_perag_get(
> struct xfs_mount *mp,
> - struct xchk_ag *sa)
> + struct xchk_ag *sa)
> {
> if (!sa->pag)
> sa->pag = xfs_perag_get(mp, sa->agno);
> @@ -587,7 +587,7 @@ xchk_perag_get(
> int
> xchk_trans_alloc(
> struct xfs_scrub *sc,
> - uint resblks)
> + uint resblks)
> {
> if (sc->sm->sm_flags & XFS_SCRUB_IFLAG_REPAIR)
> return xfs_trans_alloc(sc->mp, &M_RES(sc->mp)->tr_itruncate,
> @@ -600,9 +600,9 @@ xchk_trans_alloc(
> int
> xchk_setup_fs(
> struct xfs_scrub *sc,
> - struct xfs_inode *ip)
> + struct xfs_inode *ip)
> {
> - uint resblks;
> + uint resblks;
>
> resblks = xrep_calc_ag_resblks(sc);
> return xchk_trans_alloc(sc, resblks);
> @@ -612,11 +612,11 @@ xchk_setup_fs(
> int
> xchk_setup_ag_btree(
> struct xfs_scrub *sc,
> - struct xfs_inode *ip,
> - bool force_log)
> + struct xfs_inode *ip,
> + bool force_log)
> {
> - struct xfs_mount *mp = sc->mp;
> - int error;
> + struct xfs_mount *mp = sc->mp;
> + int error;
>
> /*
> * If the caller asks us to checkpont the log, do so. This
> @@ -659,12 +659,12 @@ xchk_checkpoint_log(
> int
> xchk_get_inode(
> struct xfs_scrub *sc,
> - struct xfs_inode *ip_in)
> + struct xfs_inode *ip_in)
> {
> - struct xfs_imap imap;
> - struct xfs_mount *mp = sc->mp;
> - struct xfs_inode *ip = NULL;
> - int error;
> + struct xfs_imap imap;
> + struct xfs_mount *mp = sc->mp;
> + struct xfs_inode *ip = NULL;
> + int error;
>
> /* We want to scan the inode we already had opened. */
> if (sc->sm->sm_ino == 0 || sc->sm->sm_ino == ip_in->i_ino) {
> @@ -723,10 +723,10 @@ xchk_get_inode(
> int
> xchk_setup_inode_contents(
> struct xfs_scrub *sc,
> - struct xfs_inode *ip,
> - unsigned int resblks)
> + struct xfs_inode *ip,
> + unsigned int resblks)
> {
> - int error;
> + int error;
>
> error = xchk_get_inode(sc, ip);
> if (error)
> @@ -754,8 +754,8 @@ xchk_setup_inode_contents(
> bool
> xchk_should_check_xref(
> struct xfs_scrub *sc,
> - int *error,
> - struct xfs_btree_cur **curpp)
> + int *error,
> + struct xfs_btree_cur **curpp)
> {
> /* No point in xref if we already know we're corrupt. */
> if (xchk_skip_xref(sc->sm))
> @@ -789,9 +789,9 @@ xchk_should_check_xref(
> void
> xchk_buffer_recheck(
> struct xfs_scrub *sc,
> - struct xfs_buf *bp)
> + struct xfs_buf *bp)
> {
> - xfs_failaddr_t fa;
> + xfs_failaddr_t fa;
>
> if (bp->b_ops == NULL) {
> xchk_block_set_corrupt(sc, bp);
> @@ -816,9 +816,9 @@ int
> xchk_metadata_inode_forks(
> struct xfs_scrub *sc)
> {
> - __u32 smtype;
> - bool shared;
> - int error;
> + __u32 smtype;
> + bool shared;
> + int error;
>
> if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
> return 0;
> diff --git a/fs/xfs/scrub/common.h b/fs/xfs/scrub/common.h
> index c321230d32dc..2d4324d12f9a 100644
> --- a/fs/xfs/scrub/common.h
> +++ b/fs/xfs/scrub/common.h
> @@ -108,24 +108,21 @@ xchk_setup_quota(struct xfs_scrub *sc, struct xfs_inode *ip)
>
> void xchk_ag_free(struct xfs_scrub *sc, struct xchk_ag *sa);
> int xchk_ag_init(struct xfs_scrub *sc, xfs_agnumber_t agno,
> - struct xchk_ag *sa);
> + struct xchk_ag *sa);
> void xchk_perag_get(struct xfs_mount *mp, struct xchk_ag *sa);
> int xchk_ag_read_headers(struct xfs_scrub *sc, xfs_agnumber_t agno,
> - struct xfs_buf **agi, struct xfs_buf **agf,
> - struct xfs_buf **agfl);
> + struct xfs_buf **agi, struct xfs_buf **agf,
> + struct xfs_buf **agfl);
> void xchk_ag_btcur_free(struct xchk_ag *sa);
> -int xchk_ag_btcur_init(struct xfs_scrub *sc,
> - struct xchk_ag *sa);
> -int xchk_count_rmap_ownedby_ag(struct xfs_scrub *sc,
> - struct xfs_btree_cur *cur,
> - struct xfs_owner_info *oinfo,
> - xfs_filblks_t *blocks);
> +int xchk_ag_btcur_init(struct xfs_scrub *sc, struct xchk_ag *sa);
> +int xchk_count_rmap_ownedby_ag(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
> + struct xfs_owner_info *oinfo, xfs_filblks_t *blocks);
>
> -int xchk_setup_ag_btree(struct xfs_scrub *sc,
> - struct xfs_inode *ip, bool force_log);
> +int xchk_setup_ag_btree(struct xfs_scrub *sc, struct xfs_inode *ip,
> + bool force_log);
> int xchk_get_inode(struct xfs_scrub *sc, struct xfs_inode *ip_in);
> -int xchk_setup_inode_contents(struct xfs_scrub *sc,
> - struct xfs_inode *ip, unsigned int resblks);
> +int xchk_setup_inode_contents(struct xfs_scrub *sc, struct xfs_inode *ip,
> + unsigned int resblks);
> void xchk_buffer_recheck(struct xfs_scrub *sc, struct xfs_buf *bp);
>
> /*
> diff --git a/fs/xfs/scrub/dabtree.c b/fs/xfs/scrub/dabtree.c
> index 7fc12d540ea6..f1260b4bfdee 100644
> --- a/fs/xfs/scrub/dabtree.c
> +++ b/fs/xfs/scrub/dabtree.c
> @@ -36,9 +36,9 @@
> */
> bool
> xchk_da_process_error(
> - struct xchk_da_btree *ds,
> - int level,
> - int *error)
> + struct xchk_da_btree *ds,
> + int level,
> + int *error)
> {
> struct xfs_scrub *sc = ds->sc;
>
> @@ -72,8 +72,8 @@ xchk_da_process_error(
> */
> void
> xchk_da_set_corrupt(
> - struct xchk_da_btree *ds,
> - int level)
> + struct xchk_da_btree *ds,
> + int level)
> {
> struct xfs_scrub *sc = ds->sc;
>
> @@ -88,13 +88,13 @@ xchk_da_set_corrupt(
> /* Find an entry at a certain level in a da btree. */
> STATIC void *
> xchk_da_btree_entry(
> - struct xchk_da_btree *ds,
> - int level,
> - int rec)
> + struct xchk_da_btree *ds,
> + int level,
> + int rec)
> {
> - char *ents;
> - struct xfs_da_state_blk *blk;
> - void *baddr;
> + char *ents;
> + struct xfs_da_state_blk *blk;
> + void *baddr;
>
> /* Dispatch the entry finding function. */
> blk = &ds->state->path.blk[level];
> @@ -158,9 +158,9 @@ xchk_da_btree_hash(
> */
> STATIC bool
> xchk_da_btree_ptr_ok(
> - struct xchk_da_btree *ds,
> - int level,
> - xfs_dablk_t blkno)
> + struct xchk_da_btree *ds,
> + int level,
> + xfs_dablk_t blkno)
> {
> if (blkno < ds->lowest || (ds->highest != 0 && blkno >= ds->highest)) {
> xchk_da_set_corrupt(ds, level);
> @@ -246,13 +246,13 @@ static const struct xfs_buf_ops xchk_da_btree_buf_ops = {
> /* Check a block's sibling. */
> STATIC int
> xchk_da_btree_block_check_sibling(
> - struct xchk_da_btree *ds,
> - int level,
> - int direction,
> - xfs_dablk_t sibling)
> + struct xchk_da_btree *ds,
> + int level,
> + int direction,
> + xfs_dablk_t sibling)
> {
> - int retval;
> - int error;
> + int retval;
> + int error;
>
> memcpy(&ds->state->altpath, &ds->state->path,
> sizeof(ds->state->altpath));
> @@ -294,13 +294,13 @@ xchk_da_btree_block_check_sibling(
> /* Check a block's sibling pointers. */
> STATIC int
> xchk_da_btree_block_check_siblings(
> - struct xchk_da_btree *ds,
> - int level,
> - struct xfs_da_blkinfo *hdr)
> + struct xchk_da_btree *ds,
> + int level,
> + struct xfs_da_blkinfo *hdr)
> {
> - xfs_dablk_t forw;
> - xfs_dablk_t back;
> - int error = 0;
> + xfs_dablk_t forw;
> + xfs_dablk_t back;
> + int error = 0;
>
> forw = be32_to_cpu(hdr->forw);
> back = be32_to_cpu(hdr->back);
> @@ -474,9 +474,9 @@ xchk_da_btree_block(
> /* Visit all nodes and leaves of a da btree. */
> int
> xchk_da_btree(
> - struct xfs_scrub *sc,
> + struct xfs_scrub *sc,
> int whichfork,
> - xchk_da_btree_rec_fn scrub_fn,
> + xchk_da_btree_rec_fn scrub_fn,
> void *private)
> {
> struct xchk_da_btree ds = {};
> diff --git a/fs/xfs/scrub/dabtree.h b/fs/xfs/scrub/dabtree.h
> index a15c03389e8f..cb3f0003245b 100644
> --- a/fs/xfs/scrub/dabtree.h
> +++ b/fs/xfs/scrub/dabtree.h
> @@ -9,12 +9,12 @@
> /* dir/attr btree */
>
> struct xchk_da_btree {
> - struct xfs_da_args dargs;
> - xfs_dahash_t hashes[XFS_DA_NODE_MAXDEPTH];
> - int maxrecs[XFS_DA_NODE_MAXDEPTH];
> - struct xfs_da_state *state;
> + struct xfs_da_args dargs;
> + xfs_dahash_t hashes[XFS_DA_NODE_MAXDEPTH];
> + int maxrecs[XFS_DA_NODE_MAXDEPTH];
> + struct xfs_da_state *state;
> struct xfs_scrub *sc;
> - void *private;
> + void *private;
>
> /*
> * Lowest and highest directory block address in which we expect
> @@ -22,10 +22,10 @@ struct xchk_da_btree {
> * (presumably) means between LEAF_OFFSET and FREE_OFFSET; for
> * attributes there is no limit.
> */
> - xfs_dablk_t lowest;
> - xfs_dablk_t highest;
> + xfs_dablk_t lowest;
> + xfs_dablk_t highest;
>
> - int tree_level;
> + int tree_level;
> };
>
> typedef int (*xchk_da_btree_rec_fn)(struct xchk_da_btree *ds,
> @@ -37,9 +37,8 @@ bool xchk_da_process_error(struct xchk_da_btree *ds, int level, int *error);
> /* Check for da btree corruption. */
> void xchk_da_set_corrupt(struct xchk_da_btree *ds, int level);
>
> -int xchk_da_btree_hash(struct xchk_da_btree *ds, int level,
> - __be32 *hashp);
> +int xchk_da_btree_hash(struct xchk_da_btree *ds, int level, __be32 *hashp);
> int xchk_da_btree(struct xfs_scrub *sc, int whichfork,
> - xchk_da_btree_rec_fn scrub_fn, void *private);
> + xchk_da_btree_rec_fn scrub_fn, void *private);
>
> #endif /* __XFS_SCRUB_DABTREE_H__ */
> diff --git a/fs/xfs/scrub/dir.c b/fs/xfs/scrub/dir.c
> index 194a3ef69a9f..f58709052b03 100644
> --- a/fs/xfs/scrub/dir.c
> +++ b/fs/xfs/scrub/dir.c
> @@ -33,7 +33,7 @@
> int
> xchk_setup_directory(
> struct xfs_scrub *sc,
> - struct xfs_inode *ip)
> + struct xfs_inode *ip)
> {
> return xchk_setup_inode_contents(sc, ip, 0);
> }
> @@ -44,7 +44,7 @@ xchk_setup_directory(
>
> struct xchk_dir_ctx {
> /* VFS fill-directory iterator */
> - struct dir_context dir_iter;
> + struct dir_context dir_iter;
>
> struct xfs_scrub *sc;
> };
> @@ -52,15 +52,15 @@ struct xchk_dir_ctx {
> /* Check that an inode's mode matches a given DT_ type. */
> STATIC int
> xchk_dir_check_ftype(
> - struct xchk_dir_ctx *sdc,
> - xfs_fileoff_t offset,
> - xfs_ino_t inum,
> - int dtype)
> + struct xchk_dir_ctx *sdc,
> + xfs_fileoff_t offset,
> + xfs_ino_t inum,
> + int dtype)
> {
> - struct xfs_mount *mp = sdc->sc->mp;
> - struct xfs_inode *ip;
> - int ino_dtype;
> - int error = 0;
> + struct xfs_mount *mp = sdc->sc->mp;
> + struct xfs_inode *ip;
> + int ino_dtype;
> + int error = 0;
>
> if (!xfs_sb_version_hasftype(&mp->m_sb)) {
> if (dtype != DT_UNKNOWN && dtype != DT_DIR)
> @@ -102,20 +102,20 @@ xchk_dir_check_ftype(
> */
> STATIC int
> xchk_dir_actor(
> - struct dir_context *dir_iter,
> - const char *name,
> - int namelen,
> - loff_t pos,
> - u64 ino,
> - unsigned type)
> + struct dir_context *dir_iter,
> + const char *name,
> + int namelen,
> + loff_t pos,
> + u64 ino,
> + unsigned type)
> {
> - struct xfs_mount *mp;
> - struct xfs_inode *ip;
> - struct xchk_dir_ctx *sdc;
> - struct xfs_name xname;
> - xfs_ino_t lookup_ino;
> - xfs_dablk_t offset;
> - int error = 0;
> + struct xfs_mount *mp;
> + struct xfs_inode *ip;
> + struct xchk_dir_ctx *sdc;
> + struct xfs_name xname;
> + xfs_ino_t lookup_ino;
> + xfs_dablk_t offset;
> + int error = 0;
>
> sdc = container_of(dir_iter, struct xchk_dir_ctx, dir_iter);
> ip = sdc->sc->ip;
> @@ -289,7 +289,7 @@ xchk_dir_rec(
> */
> STATIC void
> xchk_directory_check_free_entry(
> - struct xfs_scrub *sc,
> + struct xfs_scrub *sc,
> xfs_dablk_t lblk,
> struct xfs_dir2_data_free *bf,
> struct xfs_dir2_data_unused *dup)
> @@ -314,7 +314,7 @@ xchk_directory_check_free_entry(
> /* Check free space info in a directory data block. */
> STATIC int
> xchk_directory_data_bestfree(
> - struct xfs_scrub *sc,
> + struct xfs_scrub *sc,
> xfs_dablk_t lblk,
> bool is_block)
> {
> @@ -455,7 +455,7 @@ xchk_directory_data_bestfree(
> */
> STATIC void
> xchk_directory_check_freesp(
> - struct xfs_scrub *sc,
> + struct xfs_scrub *sc,
> xfs_dablk_t lblk,
> struct xfs_buf *dbp,
> unsigned int len)
> @@ -474,7 +474,7 @@ xchk_directory_check_freesp(
> /* Check free space info in a directory leaf1 block. */
> STATIC int
> xchk_directory_leaf1_bestfree(
> - struct xfs_scrub *sc,
> + struct xfs_scrub *sc,
> struct xfs_da_args *args,
> xfs_dablk_t lblk)
> {
> @@ -572,7 +572,7 @@ xchk_directory_leaf1_bestfree(
> /* Check free space info in a directory freespace block. */
> STATIC int
> xchk_directory_free_bestfree(
> - struct xfs_scrub *sc,
> + struct xfs_scrub *sc,
> struct xfs_da_args *args,
> xfs_dablk_t lblk)
> {
> @@ -628,18 +628,18 @@ STATIC int
> xchk_directory_blocks(
> struct xfs_scrub *sc)
> {
> - struct xfs_bmbt_irec got;
> - struct xfs_da_args args;
> - struct xfs_ifork *ifp;
> - struct xfs_mount *mp = sc->mp;
> - xfs_fileoff_t leaf_lblk;
> - xfs_fileoff_t free_lblk;
> - xfs_fileoff_t lblk;
> - struct xfs_iext_cursor icur;
> - xfs_dablk_t dabno;
> - bool found;
> - int is_block = 0;
> - int error;
> + struct xfs_bmbt_irec got;
> + struct xfs_da_args args;
> + struct xfs_ifork *ifp;
> + struct xfs_mount *mp = sc->mp;
> + xfs_fileoff_t leaf_lblk;
> + xfs_fileoff_t free_lblk;
> + xfs_fileoff_t lblk;
> + struct xfs_iext_cursor icur;
> + xfs_dablk_t dabno;
> + bool found;
> + int is_block = 0;
> + int error;
>
> /* Ignore local format directories. */
> if (sc->ip->i_d.di_format != XFS_DINODE_FMT_EXTENTS &&
> @@ -772,14 +772,14 @@ int
> xchk_directory(
> struct xfs_scrub *sc)
> {
> - struct xchk_dir_ctx sdc = {
> + struct xchk_dir_ctx sdc = {
> .dir_iter.actor = xchk_dir_actor,
> .dir_iter.pos = 0,
> .sc = sc,
> };
> - size_t bufsize;
> - loff_t oldpos;
> - int error = 0;
> + size_t bufsize;
> + loff_t oldpos;
> + int error = 0;
>
> if (!S_ISDIR(VFS_I(sc->ip)->i_mode))
> return -ENOENT;
> diff --git a/fs/xfs/scrub/ialloc.c b/fs/xfs/scrub/ialloc.c
> index 6df8eba9f52b..224dba937492 100644
> --- a/fs/xfs/scrub/ialloc.c
> +++ b/fs/xfs/scrub/ialloc.c
> @@ -37,7 +37,7 @@
> int
> xchk_setup_ag_iallocbt(
> struct xfs_scrub *sc,
> - struct xfs_inode *ip)
> + struct xfs_inode *ip)
> {
> return xchk_setup_ag_btree(sc, ip, sc->try_harder);
> }
> @@ -51,7 +51,7 @@ xchk_setup_ag_iallocbt(
> */
> static inline void
> xchk_iallocbt_chunk_xref_other(
> - struct xfs_scrub *sc,
> + struct xfs_scrub *sc,
> struct xfs_inobt_rec_incore *irec,
> xfs_agino_t agino)
> {
> @@ -76,7 +76,7 @@ xchk_iallocbt_chunk_xref_other(
> /* Cross-reference with the other btrees. */
> STATIC void
> xchk_iallocbt_chunk_xref(
> - struct xfs_scrub *sc,
> + struct xfs_scrub *sc,
> struct xfs_inobt_rec_incore *irec,
> xfs_agino_t agino,
> xfs_agblock_t agbno,
> @@ -364,13 +364,13 @@ xchk_iallocbt_rec(
> STATIC void
> xchk_iallocbt_xref_rmap_btreeblks(
> struct xfs_scrub *sc,
> - int which)
> + int which)
> {
> - struct xfs_owner_info oinfo;
> - xfs_filblks_t blocks;
> - xfs_extlen_t inobt_blocks = 0;
> - xfs_extlen_t finobt_blocks = 0;
> - int error;
> + struct xfs_owner_info oinfo;
> + xfs_filblks_t blocks;
> + xfs_extlen_t inobt_blocks = 0;
> + xfs_extlen_t finobt_blocks = 0;
> + int error;
>
> if (!sc->sa.ino_cur || !sc->sa.rmap_cur ||
> (xfs_sb_version_hasfinobt(&sc->mp->m_sb) && !sc->sa.fino_cur) ||
> @@ -404,12 +404,12 @@ xchk_iallocbt_xref_rmap_btreeblks(
> STATIC void
> xchk_iallocbt_xref_rmap_inodes(
> struct xfs_scrub *sc,
> - int which,
> - xfs_filblks_t inode_blocks)
> + int which,
> + xfs_filblks_t inode_blocks)
> {
> - struct xfs_owner_info oinfo;
> - xfs_filblks_t blocks;
> - int error;
> + struct xfs_owner_info oinfo;
> + xfs_filblks_t blocks;
> + int error;
>
> if (!sc->sa.rmap_cur || xchk_skip_xref(sc->sm))
> return;
> @@ -428,12 +428,12 @@ xchk_iallocbt_xref_rmap_inodes(
> STATIC int
> xchk_iallocbt(
> struct xfs_scrub *sc,
> - xfs_btnum_t which)
> + xfs_btnum_t which)
> {
> - struct xfs_btree_cur *cur;
> - struct xfs_owner_info oinfo;
> - xfs_filblks_t inode_blocks = 0;
> - int error;
> + struct xfs_btree_cur *cur;
> + struct xfs_owner_info oinfo;
> + xfs_filblks_t inode_blocks = 0;
> + int error;
>
> xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_INOBT);
> cur = which == XFS_BTNUM_INO ? sc->sa.ino_cur : sc->sa.fino_cur;
> @@ -475,13 +475,13 @@ xchk_finobt(
> static inline void
> xchk_xref_inode_check(
> struct xfs_scrub *sc,
> - xfs_agblock_t agbno,
> - xfs_extlen_t len,
> - struct xfs_btree_cur **icur,
> - bool should_have_inodes)
> + xfs_agblock_t agbno,
> + xfs_extlen_t len,
> + struct xfs_btree_cur **icur,
> + bool should_have_inodes)
> {
> - bool has_inodes;
> - int error;
> + bool has_inodes;
> + int error;
>
> if (!(*icur) || xchk_skip_xref(sc->sm))
> return;
> @@ -497,8 +497,8 @@ xchk_xref_inode_check(
> void
> xchk_xref_is_not_inode_chunk(
> struct xfs_scrub *sc,
> - xfs_agblock_t agbno,
> - xfs_extlen_t len)
> + xfs_agblock_t agbno,
> + xfs_extlen_t len)
> {
> xchk_xref_inode_check(sc, agbno, len, &sc->sa.ino_cur, false);
> xchk_xref_inode_check(sc, agbno, len, &sc->sa.fino_cur, false);
> @@ -508,8 +508,8 @@ xchk_xref_is_not_inode_chunk(
> void
> xchk_xref_is_inode_chunk(
> struct xfs_scrub *sc,
> - xfs_agblock_t agbno,
> - xfs_extlen_t len)
> + xfs_agblock_t agbno,
> + xfs_extlen_t len)
> {
> xchk_xref_inode_check(sc, agbno, len, &sc->sa.ino_cur, true);
> }
> diff --git a/fs/xfs/scrub/inode.c b/fs/xfs/scrub/inode.c
> index 6cc027983c13..5b3b177c0fc9 100644
> --- a/fs/xfs/scrub/inode.c
> +++ b/fs/xfs/scrub/inode.c
> @@ -39,9 +39,9 @@
> int
> xchk_setup_inode(
> struct xfs_scrub *sc,
> - struct xfs_inode *ip)
> + struct xfs_inode *ip)
> {
> - int error;
> + int error;
>
> /*
> * Try to get the inode. If the verifiers fail, we try again
> @@ -78,12 +78,12 @@ xchk_setup_inode(
> STATIC void
> xchk_inode_extsize(
> struct xfs_scrub *sc,
> - struct xfs_dinode *dip,
> - xfs_ino_t ino,
> - uint16_t mode,
> - uint16_t flags)
> + struct xfs_dinode *dip,
> + xfs_ino_t ino,
> + uint16_t mode,
> + uint16_t flags)
> {
> - xfs_failaddr_t fa;
> + xfs_failaddr_t fa;
>
> fa = xfs_inode_validate_extsize(sc->mp, be32_to_cpu(dip->di_extsize),
> mode, flags);
> @@ -100,13 +100,13 @@ xchk_inode_extsize(
> STATIC void
> xchk_inode_cowextsize(
> struct xfs_scrub *sc,
> - struct xfs_dinode *dip,
> - xfs_ino_t ino,
> - uint16_t mode,
> - uint16_t flags,
> - uint64_t flags2)
> + struct xfs_dinode *dip,
> + xfs_ino_t ino,
> + uint16_t mode,
> + uint16_t flags,
> + uint64_t flags2)
> {
> - xfs_failaddr_t fa;
> + xfs_failaddr_t fa;
>
> fa = xfs_inode_validate_cowextsize(sc->mp,
> be32_to_cpu(dip->di_cowextsize), mode, flags,
> @@ -119,12 +119,12 @@ xchk_inode_cowextsize(
> STATIC void
> xchk_inode_flags(
> struct xfs_scrub *sc,
> - struct xfs_dinode *dip,
> - xfs_ino_t ino,
> - uint16_t mode,
> - uint16_t flags)
> + struct xfs_dinode *dip,
> + xfs_ino_t ino,
> + uint16_t mode,
> + uint16_t flags)
> {
> - struct xfs_mount *mp = sc->mp;
> + struct xfs_mount *mp = sc->mp;
>
> if (flags & ~XFS_DIFLAG_ANY)
> goto bad;
> @@ -164,13 +164,13 @@ xchk_inode_flags(
> STATIC void
> xchk_inode_flags2(
> struct xfs_scrub *sc,
> - struct xfs_dinode *dip,
> - xfs_ino_t ino,
> - uint16_t mode,
> - uint16_t flags,
> - uint64_t flags2)
> + struct xfs_dinode *dip,
> + xfs_ino_t ino,
> + uint16_t mode,
> + uint16_t flags,
> + uint64_t flags2)
> {
> - struct xfs_mount *mp = sc->mp;
> + struct xfs_mount *mp = sc->mp;
>
> if (flags2 & ~XFS_DIFLAG2_ANY)
> goto bad;
> @@ -207,16 +207,16 @@ xchk_inode_flags2(
> STATIC void
> xchk_dinode(
> struct xfs_scrub *sc,
> - struct xfs_dinode *dip,
> - xfs_ino_t ino)
> + struct xfs_dinode *dip,
> + xfs_ino_t ino)
> {
> - struct xfs_mount *mp = sc->mp;
> - size_t fork_recs;
> - unsigned long long isize;
> - uint64_t flags2;
> - uint32_t nextents;
> - uint16_t flags;
> - uint16_t mode;
> + struct xfs_mount *mp = sc->mp;
> + size_t fork_recs;
> + unsigned long long isize;
> + uint64_t flags2;
> + uint32_t nextents;
> + uint16_t flags;
> + uint16_t mode;
>
> flags = be16_to_cpu(dip->di_flags);
> if (dip->di_version >= 3)
> @@ -426,7 +426,7 @@ xchk_dinode(
> */
> static void
> xchk_inode_xref_finobt(
> - struct xfs_scrub *sc,
> + struct xfs_scrub *sc,
> xfs_ino_t ino)
> {
> struct xfs_inobt_rec_incore rec;
> @@ -470,12 +470,12 @@ xchk_inode_xref_finobt(
> STATIC void
> xchk_inode_xref_bmap(
> struct xfs_scrub *sc,
> - struct xfs_dinode *dip)
> + struct xfs_dinode *dip)
> {
> - xfs_extnum_t nextents;
> - xfs_filblks_t count;
> - xfs_filblks_t acount;
> - int error;
> + xfs_extnum_t nextents;
> + xfs_filblks_t count;
> + xfs_filblks_t acount;
> + int error;
>
> if (xchk_skip_xref(sc->sm))
> return;
> @@ -504,13 +504,13 @@ xchk_inode_xref_bmap(
> STATIC void
> xchk_inode_xref(
> struct xfs_scrub *sc,
> - xfs_ino_t ino,
> - struct xfs_dinode *dip)
> + xfs_ino_t ino,
> + struct xfs_dinode *dip)
> {
> - struct xfs_owner_info oinfo;
> - xfs_agnumber_t agno;
> - xfs_agblock_t agbno;
> - int error;
> + struct xfs_owner_info oinfo;
> + xfs_agnumber_t agno;
> + xfs_agblock_t agbno;
> + int error;
>
> if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
> return;
> @@ -541,11 +541,11 @@ xchk_inode_xref(
> static void
> xchk_inode_check_reflink_iflag(
> struct xfs_scrub *sc,
> - xfs_ino_t ino)
> + xfs_ino_t ino)
> {
> - struct xfs_mount *mp = sc->mp;
> - bool has_shared;
> - int error;
> + struct xfs_mount *mp = sc->mp;
> + bool has_shared;
> + int error;
>
> if (!xfs_sb_version_hasreflink(&mp->m_sb))
> return;
> @@ -566,8 +566,8 @@ int
> xchk_inode(
> struct xfs_scrub *sc)
> {
> - struct xfs_dinode di;
> - int error = 0;
> + struct xfs_dinode di;
> + int error = 0;
>
> /*
> * If sc->ip is NULL, that means that the setup function called
> diff --git a/fs/xfs/scrub/parent.c b/fs/xfs/scrub/parent.c
> index 808459ad0c35..aacb0284c48a 100644
> --- a/fs/xfs/scrub/parent.c
> +++ b/fs/xfs/scrub/parent.c
> @@ -29,7 +29,7 @@
> int
> xchk_setup_parent(
> struct xfs_scrub *sc,
> - struct xfs_inode *ip)
> + struct xfs_inode *ip)
> {
> return xchk_setup_inode_contents(sc, ip, 0);
> }
> @@ -39,22 +39,22 @@ xchk_setup_parent(
> /* Look for an entry in a parent pointing to this inode. */
>
> struct xchk_parent_ctx {
> - struct dir_context dc;
> - xfs_ino_t ino;
> - xfs_nlink_t nlink;
> + struct dir_context dc;
> + xfs_ino_t ino;
> + xfs_nlink_t nlink;
> };
>
> /* Look for a single entry in a directory pointing to an inode. */
> STATIC int
> xchk_parent_actor(
> - struct dir_context *dc,
> - const char *name,
> - int namelen,
> - loff_t pos,
> - u64 ino,
> - unsigned type)
> + struct dir_context *dc,
> + const char *name,
> + int namelen,
> + loff_t pos,
> + u64 ino,
> + unsigned type)
> {
> - struct xchk_parent_ctx *spc;
> + struct xchk_parent_ctx *spc;
>
> spc = container_of(dc, struct xchk_parent_ctx, dc);
> if (spc->ino == ino)
> @@ -66,19 +66,19 @@ xchk_parent_actor(
> STATIC int
> xchk_parent_count_parent_dentries(
> struct xfs_scrub *sc,
> - struct xfs_inode *parent,
> - xfs_nlink_t *nlink)
> + struct xfs_inode *parent,
> + xfs_nlink_t *nlink)
> {
> - struct xchk_parent_ctx spc = {
> + struct xchk_parent_ctx spc = {
> .dc.actor = xchk_parent_actor,
> .dc.pos = 0,
> .ino = sc->ip->i_ino,
> .nlink = 0,
> };
> - size_t bufsize;
> - loff_t oldpos;
> - uint lock_mode;
> - int error = 0;
> + size_t bufsize;
> + loff_t oldpos;
> + uint lock_mode;
> + int error = 0;
>
> /*
> * If there are any blocks, read-ahead block 0 as we're almost
> @@ -122,14 +122,14 @@ xchk_parent_count_parent_dentries(
> STATIC int
> xchk_parent_validate(
> struct xfs_scrub *sc,
> - xfs_ino_t dnum,
> - bool *try_again)
> + xfs_ino_t dnum,
> + bool *try_again)
> {
> - struct xfs_mount *mp = sc->mp;
> - struct xfs_inode *dp = NULL;
> - xfs_nlink_t expected_nlink;
> - xfs_nlink_t nlink;
> - int error = 0;
> + struct xfs_mount *mp = sc->mp;
> + struct xfs_inode *dp = NULL;
> + xfs_nlink_t expected_nlink;
> + xfs_nlink_t nlink;
> + int error = 0;
>
> *try_again = false;
>
> @@ -257,11 +257,11 @@ int
> xchk_parent(
> struct xfs_scrub *sc)
> {
> - struct xfs_mount *mp = sc->mp;
> - xfs_ino_t dnum;
> - bool try_again;
> - int tries = 0;
> - int error = 0;
> + struct xfs_mount *mp = sc->mp;
> + xfs_ino_t dnum;
> + bool try_again;
> + int tries = 0;
> + int error = 0;
>
> /*
> * If we're a directory, check that the '..' link points up to
> diff --git a/fs/xfs/scrub/quota.c b/fs/xfs/scrub/quota.c
> index 309ebeecfa5d..782d582d3edd 100644
> --- a/fs/xfs/scrub/quota.c
> +++ b/fs/xfs/scrub/quota.c
> @@ -49,10 +49,10 @@ xchk_quota_to_dqtype(
> int
> xchk_setup_quota(
> struct xfs_scrub *sc,
> - struct xfs_inode *ip)
> + struct xfs_inode *ip)
> {
> - uint dqtype;
> - int error;
> + uint dqtype;
> + int error;
>
> if (!XFS_IS_QUOTA_RUNNING(sc->mp) || !XFS_IS_QUOTA_ON(sc->mp))
> return -ENOENT;
> @@ -77,33 +77,33 @@ xchk_setup_quota(
>
> struct xchk_quota_info {
> struct xfs_scrub *sc;
> - xfs_dqid_t last_id;
> + xfs_dqid_t last_id;
> };
>
> /* Scrub the fields in an individual quota item. */
> STATIC int
> xchk_quota_item(
> - struct xfs_dquot *dq,
> - uint dqtype,
> - void *priv)
> + struct xfs_dquot *dq,
> + uint dqtype,
> + void *priv)
> {
> - struct xchk_quota_info *sqi = priv;
> + struct xchk_quota_info *sqi = priv;
> struct xfs_scrub *sc = sqi->sc;
> - struct xfs_mount *mp = sc->mp;
> - struct xfs_disk_dquot *d = &dq->q_core;
> - struct xfs_quotainfo *qi = mp->m_quotainfo;
> - xfs_fileoff_t offset;
> - unsigned long long bsoft;
> - unsigned long long isoft;
> - unsigned long long rsoft;
> - unsigned long long bhard;
> - unsigned long long ihard;
> - unsigned long long rhard;
> - unsigned long long bcount;
> - unsigned long long icount;
> - unsigned long long rcount;
> - xfs_ino_t fs_icount;
> - xfs_dqid_t id = be32_to_cpu(d->d_id);
> + struct xfs_mount *mp = sc->mp;
> + struct xfs_disk_dquot *d = &dq->q_core;
> + struct xfs_quotainfo *qi = mp->m_quotainfo;
> + xfs_fileoff_t offset;
> + unsigned long long bsoft;
> + unsigned long long isoft;
> + unsigned long long rsoft;
> + unsigned long long bhard;
> + unsigned long long ihard;
> + unsigned long long rhard;
> + unsigned long long bcount;
> + unsigned long long icount;
> + unsigned long long rcount;
> + xfs_ino_t fs_icount;
> + xfs_dqid_t id = be32_to_cpu(d->d_id);
>
> /*
> * Except for the root dquot, the actual dquot we got must either have
> @@ -197,12 +197,12 @@ STATIC int
> xchk_quota_data_fork(
> struct xfs_scrub *sc)
> {
> - struct xfs_bmbt_irec irec = { 0 };
> - struct xfs_iext_cursor icur;
> - struct xfs_quotainfo *qi = sc->mp->m_quotainfo;
> - struct xfs_ifork *ifp;
> - xfs_fileoff_t max_dqid_off;
> - int error = 0;
> + struct xfs_bmbt_irec irec = { 0 };
> + struct xfs_iext_cursor icur;
> + struct xfs_quotainfo *qi = sc->mp->m_quotainfo;
> + struct xfs_ifork *ifp;
> + xfs_fileoff_t max_dqid_off;
> + int error = 0;
>
> /* Invoke the fork scrubber. */
> error = xchk_metadata_inode_forks(sc);
> @@ -236,11 +236,11 @@ int
> xchk_quota(
> struct xfs_scrub *sc)
> {
> - struct xchk_quota_info sqi;
> - struct xfs_mount *mp = sc->mp;
> - struct xfs_quotainfo *qi = mp->m_quotainfo;
> - uint dqtype;
> - int error = 0;
> + struct xchk_quota_info sqi;
> + struct xfs_mount *mp = sc->mp;
> + struct xfs_quotainfo *qi = mp->m_quotainfo;
> + uint dqtype;
> + int error = 0;
>
> dqtype = xchk_quota_to_dqtype(sc);
>
> diff --git a/fs/xfs/scrub/refcount.c b/fs/xfs/scrub/refcount.c
> index c1162d408987..e8c82b026083 100644
> --- a/fs/xfs/scrub/refcount.c
> +++ b/fs/xfs/scrub/refcount.c
> @@ -30,7 +30,7 @@
> int
> xchk_setup_ag_refcountbt(
> struct xfs_scrub *sc,
> - struct xfs_inode *ip)
> + struct xfs_inode *ip)
> {
> return xchk_setup_ag_btree(sc, ip, false);
> }
> @@ -74,21 +74,21 @@ xchk_setup_ag_refcountbt(
> * should always hold true. If not, the refcount is incorrect.
> */
> struct xchk_refcnt_frag {
> - struct list_head list;
> - struct xfs_rmap_irec rm;
> + struct list_head list;
> + struct xfs_rmap_irec rm;
> };
>
> struct xchk_refcnt_check {
> struct xfs_scrub *sc;
> - struct list_head fragments;
> + struct list_head fragments;
>
> /* refcount extent we're examining */
> - xfs_agblock_t bno;
> - xfs_extlen_t len;
> - xfs_nlink_t refcount;
> + xfs_agblock_t bno;
> + xfs_extlen_t len;
> + xfs_nlink_t refcount;
>
> /* number of owners seen */
> - xfs_nlink_t seen;
> + xfs_nlink_t seen;
> };
>
> /*
> @@ -278,7 +278,7 @@ xchk_refcountbt_process_rmap_fragments(
> /* Use the rmap entries covering this extent to verify the refcount. */
> STATIC void
> xchk_refcountbt_xref_rmap(
> - struct xfs_scrub *sc,
> + struct xfs_scrub *sc,
> xfs_agblock_t bno,
> xfs_extlen_t len,
> xfs_nlink_t refcount)
> @@ -326,9 +326,9 @@ xchk_refcountbt_xref_rmap(
> STATIC void
> xchk_refcountbt_xref(
> struct xfs_scrub *sc,
> - xfs_agblock_t agbno,
> - xfs_extlen_t len,
> - xfs_nlink_t refcount)
> + xfs_agblock_t agbno,
> + xfs_extlen_t len,
> + xfs_nlink_t refcount)
> {
> if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
> return;
> @@ -341,17 +341,17 @@ xchk_refcountbt_xref(
> /* Scrub a refcountbt record. */
> STATIC int
> xchk_refcountbt_rec(
> - struct xchk_btree *bs,
> - union xfs_btree_rec *rec)
> + struct xchk_btree *bs,
> + union xfs_btree_rec *rec)
> {
> - struct xfs_mount *mp = bs->cur->bc_mp;
> - xfs_agblock_t *cow_blocks = bs->private;
> - xfs_agnumber_t agno = bs->cur->bc_private.a.agno;
> - xfs_agblock_t bno;
> - xfs_extlen_t len;
> - xfs_nlink_t refcount;
> - bool has_cowflag;
> - int error = 0;
> + struct xfs_mount *mp = bs->cur->bc_mp;
> + xfs_agblock_t *cow_blocks = bs->private;
> + xfs_agnumber_t agno = bs->cur->bc_private.a.agno;
> + xfs_agblock_t bno;
> + xfs_extlen_t len;
> + xfs_nlink_t refcount;
> + bool has_cowflag;
> + int error = 0;
>
> bno = be32_to_cpu(rec->refc.rc_startblock);
> len = be32_to_cpu(rec->refc.rc_blockcount);
> @@ -383,12 +383,12 @@ xchk_refcountbt_rec(
> STATIC void
> xchk_refcount_xref_rmap(
> struct xfs_scrub *sc,
> - struct xfs_owner_info *oinfo,
> - xfs_filblks_t cow_blocks)
> + struct xfs_owner_info *oinfo,
> + xfs_filblks_t cow_blocks)
> {
> - xfs_extlen_t refcbt_blocks = 0;
> - xfs_filblks_t blocks;
> - int error;
> + xfs_extlen_t refcbt_blocks = 0;
> + xfs_filblks_t blocks;
> + int error;
>
> if (!sc->sa.rmap_cur || xchk_skip_xref(sc->sm))
> return;
> @@ -419,9 +419,9 @@ int
> xchk_refcountbt(
> struct xfs_scrub *sc)
> {
> - struct xfs_owner_info oinfo;
> - xfs_agblock_t cow_blocks = 0;
> - int error;
> + struct xfs_owner_info oinfo;
> + xfs_agblock_t cow_blocks = 0;
> + int error;
>
> xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_REFC);
> error = xchk_btree(sc, sc->sa.refc_cur, xchk_refcountbt_rec,
> @@ -437,7 +437,7 @@ xchk_refcountbt(
> /* xref check that a cow staging extent is marked in the refcountbt. */
> void
> xchk_xref_is_cow_staging(
> - struct xfs_scrub *sc,
> + struct xfs_scrub *sc,
> xfs_agblock_t agbno,
> xfs_extlen_t len)
> {
> @@ -484,11 +484,11 @@ xchk_xref_is_cow_staging(
> void
> xchk_xref_is_not_shared(
> struct xfs_scrub *sc,
> - xfs_agblock_t agbno,
> - xfs_extlen_t len)
> + xfs_agblock_t agbno,
> + xfs_extlen_t len)
> {
> - bool shared;
> - int error;
> + bool shared;
> + int error;
>
> if (!sc->sa.refc_cur || xchk_skip_xref(sc->sm))
> return;
> diff --git a/fs/xfs/scrub/repair.c b/fs/xfs/scrub/repair.c
> index 29debd5649ac..5de1cac424ec 100644
> --- a/fs/xfs/scrub/repair.c
> +++ b/fs/xfs/scrub/repair.c
> @@ -42,11 +42,11 @@
> */
> int
> xrep_attempt(
> - struct xfs_inode *ip,
> + struct xfs_inode *ip,
> struct xfs_scrub *sc,
> - bool *fixed)
> + bool *fixed)
> {
> - int error = 0;
> + int error = 0;
>
> trace_xrep_attempt(ip, sc->sm, error);
>
> @@ -94,7 +94,7 @@ xrep_attempt(
> */
> void
> xrep_failure(
> - struct xfs_mount *mp)
> + struct xfs_mount *mp)
> {
> xfs_alert_ratelimited(mp,
> "Corruption not fixed during online repair. Unmount and run xfs_repair.");
> @@ -108,7 +108,7 @@ int
> xrep_probe(
> struct xfs_scrub *sc)
> {
> - int error = 0;
> + int error = 0;
>
> if (xchk_should_terminate(sc, &error))
> return error;
> @@ -124,7 +124,7 @@ int
> xrep_roll_ag_trans(
> struct xfs_scrub *sc)
> {
> - int error;
> + int error;
>
> /* Keep the AG header buffers locked so we can keep going. */
> xfs_trans_bhold(sc->tp, sc->sa.agi_bp);
> @@ -163,9 +163,9 @@ xrep_roll_ag_trans(
> */
> bool
> xrep_ag_has_space(
> - struct xfs_perag *pag,
> - xfs_extlen_t nr_blocks,
> - enum xfs_ag_resv_type type)
> + struct xfs_perag *pag,
> + xfs_extlen_t nr_blocks,
> + enum xfs_ag_resv_type type)
> {
> return !xfs_ag_resv_critical(pag, XFS_AG_RESV_RMAPBT) &&
> !xfs_ag_resv_critical(pag, XFS_AG_RESV_METADATA) &&
> @@ -179,7 +179,7 @@ xrep_ag_has_space(
> */
> xfs_extlen_t
> xrep_calc_ag_resblks(
> - struct xfs_scrub *sc)
> + struct xfs_scrub *sc)
> {
> struct xfs_mount *mp = sc->mp;
> struct xfs_scrub_metadata *sm = sc->sm;
> @@ -280,13 +280,13 @@ xrep_calc_ag_resblks(
> int
> xrep_alloc_ag_block(
> struct xfs_scrub *sc,
> - struct xfs_owner_info *oinfo,
> - xfs_fsblock_t *fsbno,
> - enum xfs_ag_resv_type resv)
> + struct xfs_owner_info *oinfo,
> + xfs_fsblock_t *fsbno,
> + enum xfs_ag_resv_type resv)
> {
> - struct xfs_alloc_arg args = {0};
> - xfs_agblock_t bno;
> - int error;
> + struct xfs_alloc_arg args = {0};
> + xfs_agblock_t bno;
> + int error;
>
> switch (resv) {
> case XFS_AG_RESV_AGFL:
> @@ -330,7 +330,7 @@ xrep_alloc_ag_block(
> /* Initialize a new AG btree root block with zero entries. */
> int
> xrep_init_btblock(
> - struct xfs_scrub *sc,
> + struct xfs_scrub *sc,
> xfs_fsblock_t fsb,
> struct xfs_buf **bpp,
> xfs_btnum_t btnum,
> @@ -386,11 +386,11 @@ xrep_init_btblock(
> int
> xrep_collect_btree_extent(
> struct xfs_scrub *sc,
> - struct xrep_extent_list *exlist,
> - xfs_fsblock_t fsbno,
> - xfs_extlen_t len)
> + struct xrep_extent_list *exlist,
> + xfs_fsblock_t fsbno,
> + xfs_extlen_t len)
> {
> - struct xrep_extent *rex;
> + struct xrep_extent *rex;
>
> trace_xrep_collect_btree_extent(sc->mp,
> XFS_FSB_TO_AGNO(sc->mp, fsbno),
> @@ -416,10 +416,10 @@ xrep_collect_btree_extent(
> void
> xrep_cancel_btree_extents(
> struct xfs_scrub *sc,
> - struct xrep_extent_list *exlist)
> + struct xrep_extent_list *exlist)
> {
> - struct xrep_extent *rex;
> - struct xrep_extent *n;
> + struct xrep_extent *rex;
> + struct xrep_extent *n;
>
> for_each_xrep_extent_safe(rex, n, exlist) {
> list_del(&rex->list);
> @@ -430,12 +430,12 @@ xrep_cancel_btree_extents(
> /* Compare two btree extents. */
> static int
> xrep_btree_extent_cmp(
> - void *priv,
> - struct list_head *a,
> - struct list_head *b)
> + void *priv,
> + struct list_head *a,
> + struct list_head *b)
> {
> - struct xrep_extent *ap;
> - struct xrep_extent *bp;
> + struct xrep_extent *ap;
> + struct xrep_extent *bp;
>
> ap = container_of(a, struct xrep_extent, list);
> bp = container_of(b, struct xrep_extent, list);
> @@ -464,17 +464,17 @@ xrep_btree_extent_cmp(
> int
> xrep_subtract_extents(
> struct xfs_scrub *sc,
> - struct xrep_extent_list *exlist,
> - struct xrep_extent_list *sublist)
> + struct xrep_extent_list *exlist,
> + struct xrep_extent_list *sublist)
> {
> - struct list_head *lp;
> - struct xrep_extent *ex;
> - struct xrep_extent *newex;
> - struct xrep_extent *subex;
> - xfs_fsblock_t sub_fsb;
> - xfs_extlen_t sub_len;
> - int state;
> - int error = 0;
> + struct list_head *lp;
> + struct xrep_extent *ex;
> + struct xrep_extent *newex;
> + struct xrep_extent *subex;
> + xfs_fsblock_t sub_fsb;
> + xfs_extlen_t sub_len;
> + int state;
> + int error = 0;
>
> if (list_empty(&exlist->list) || list_empty(&sublist->list))
> return 0;
> @@ -621,13 +621,13 @@ xrep_subtract_extents(
> int
> xrep_invalidate_blocks(
> struct xfs_scrub *sc,
> - struct xrep_extent_list *exlist)
> + struct xrep_extent_list *exlist)
> {
> - struct xrep_extent *rex;
> - struct xrep_extent *n;
> - struct xfs_buf *bp;
> - xfs_fsblock_t fsbno;
> - xfs_agblock_t i;
> + struct xrep_extent *rex;
> + struct xrep_extent *n;
> + struct xfs_buf *bp;
> + xfs_fsblock_t fsbno;
> + xfs_agblock_t i;
>
> /*
> * For each block in each extent, see if there's an incore buffer for
> @@ -659,9 +659,9 @@ xrep_invalidate_blocks(
> int
> xrep_fix_freelist(
> struct xfs_scrub *sc,
> - bool can_shrink)
> + bool can_shrink)
> {
> - struct xfs_alloc_arg args = {0};
> + struct xfs_alloc_arg args = {0};
>
> args.mp = sc->mp;
> args.tp = sc->tp;
> @@ -679,10 +679,10 @@ xrep_fix_freelist(
> STATIC int
> xrep_put_freelist(
> struct xfs_scrub *sc,
> - xfs_agblock_t agbno)
> + xfs_agblock_t agbno)
> {
> - struct xfs_owner_info oinfo;
> - int error;
> + struct xfs_owner_info oinfo;
> + int error;
>
> /* Make sure there's space on the freelist. */
> error = xrep_fix_freelist(sc, true);
> @@ -715,16 +715,16 @@ xrep_put_freelist(
> STATIC int
> xrep_dispose_btree_block(
> struct xfs_scrub *sc,
> - xfs_fsblock_t fsbno,
> - struct xfs_owner_info *oinfo,
> - enum xfs_ag_resv_type resv)
> + xfs_fsblock_t fsbno,
> + struct xfs_owner_info *oinfo,
> + enum xfs_ag_resv_type resv)
> {
> - struct xfs_btree_cur *cur;
> - struct xfs_buf *agf_bp = NULL;
> - xfs_agnumber_t agno;
> - xfs_agblock_t agbno;
> - bool has_other_rmap;
> - int error;
> + struct xfs_btree_cur *cur;
> + struct xfs_buf *agf_bp = NULL;
> + xfs_agnumber_t agno;
> + xfs_agblock_t agbno;
> + bool has_other_rmap;
> + int error;
>
> agno = XFS_FSB_TO_AGNO(sc->mp, fsbno);
> agbno = XFS_FSB_TO_AGBNO(sc->mp, fsbno);
> @@ -789,13 +789,13 @@ xrep_dispose_btree_block(
> int
> xrep_reap_btree_extents(
> struct xfs_scrub *sc,
> - struct xrep_extent_list *exlist,
> - struct xfs_owner_info *oinfo,
> - enum xfs_ag_resv_type type)
> + struct xrep_extent_list *exlist,
> + struct xfs_owner_info *oinfo,
> + enum xfs_ag_resv_type type)
> {
> - struct xrep_extent *rex;
> - struct xrep_extent *n;
> - int error = 0;
> + struct xrep_extent *rex;
> + struct xrep_extent *n;
> + int error = 0;
>
> ASSERT(xfs_sb_version_hasrmapbt(&sc->mp->m_sb));
>
> @@ -851,7 +851,7 @@ xrep_reap_btree_extents(
> */
>
> struct xrep_findroot {
> - struct xfs_scrub *sc;
> + struct xfs_scrub *sc;
> struct xfs_buf *agfl_bp;
> struct xfs_agf *agf;
> struct xrep_find_ag_btree *btree_info;
> @@ -860,11 +860,11 @@ struct xrep_findroot {
> /* See if our block is in the AGFL. */
> STATIC int
> xrep_findroot_agfl_walk(
> - struct xfs_mount *mp,
> - xfs_agblock_t bno,
> - void *priv)
> + struct xfs_mount *mp,
> + xfs_agblock_t bno,
> + void *priv)
> {
> - xfs_agblock_t *agbno = priv;
> + xfs_agblock_t *agbno = priv;
>
> return (*agbno == bno) ? XFS_BTREE_QUERY_RANGE_ABORT : 0;
> }
> @@ -981,7 +981,7 @@ xrep_findroot_rmap(
> /* Find the roots of the per-AG btrees described in btree_info. */
> int
> xrep_find_ag_btree_roots(
> - struct xfs_scrub *sc,
> + struct xfs_scrub *sc,
> struct xfs_buf *agf_bp,
> struct xrep_find_ag_btree *btree_info,
> struct xfs_buf *agfl_bp)
> @@ -1017,9 +1017,9 @@ xrep_find_ag_btree_roots(
> void
> xrep_force_quotacheck(
> struct xfs_scrub *sc,
> - uint dqtype)
> + uint dqtype)
> {
> - uint flag;
> + uint flag;
>
> flag = xfs_quota_chkd_flag(dqtype);
> if (!(flag & sc->mp->m_qflags))
> @@ -1046,7 +1046,7 @@ int
> xrep_ino_dqattach(
> struct xfs_scrub *sc)
> {
> - int error;
> + int error;
>
> error = xfs_qm_dqattach_locked(sc->ip, false);
> switch (error) {
> diff --git a/fs/xfs/scrub/repair.h b/fs/xfs/scrub/repair.h
> index 677f4b73b5ec..91355f6b0087 100644
> --- a/fs/xfs/scrub/repair.h
> +++ b/fs/xfs/scrub/repair.h
> @@ -15,33 +15,31 @@ static inline int xrep_notsupported(struct xfs_scrub *sc)
>
> /* Repair helpers */
>
> -int xrep_attempt(struct xfs_inode *ip, struct xfs_scrub *sc,
> - bool *fixed);
> +int xrep_attempt(struct xfs_inode *ip, struct xfs_scrub *sc, bool *fixed);
> void xrep_failure(struct xfs_mount *mp);
> int xrep_roll_ag_trans(struct xfs_scrub *sc);
> bool xrep_ag_has_space(struct xfs_perag *pag, xfs_extlen_t nr_blocks,
> enum xfs_ag_resv_type type);
> xfs_extlen_t xrep_calc_ag_resblks(struct xfs_scrub *sc);
> -int xrep_alloc_ag_block(struct xfs_scrub *sc,
> - struct xfs_owner_info *oinfo, xfs_fsblock_t *fsbno,
> - enum xfs_ag_resv_type resv);
> +int xrep_alloc_ag_block(struct xfs_scrub *sc, struct xfs_owner_info *oinfo,
> + xfs_fsblock_t *fsbno, enum xfs_ag_resv_type resv);
> int xrep_init_btblock(struct xfs_scrub *sc, xfs_fsblock_t fsb,
> struct xfs_buf **bpp, xfs_btnum_t btnum,
> const struct xfs_buf_ops *ops);
>
> struct xrep_extent {
> - struct list_head list;
> - xfs_fsblock_t fsbno;
> - xfs_extlen_t len;
> + struct list_head list;
> + xfs_fsblock_t fsbno;
> + xfs_extlen_t len;
> };
>
> struct xrep_extent_list {
> - struct list_head list;
> + struct list_head list;
> };
>
> static inline void
> xrep_init_extent_list(
> - struct xrep_extent_list *exlist)
> + struct xrep_extent_list *exlist)
> {
> INIT_LIST_HEAD(&exlist->list);
> }
> @@ -78,10 +76,8 @@ struct xrep_find_ag_btree {
> unsigned int height;
> };
>
> -int xrep_find_ag_btree_roots(struct xfs_scrub *sc,
> - struct xfs_buf *agf_bp,
> - struct xrep_find_ag_btree *btree_info,
> - struct xfs_buf *agfl_bp);
> +int xrep_find_ag_btree_roots(struct xfs_scrub *sc, struct xfs_buf *agf_bp,
> + struct xrep_find_ag_btree *btree_info, struct xfs_buf *agfl_bp);
> void xrep_force_quotacheck(struct xfs_scrub *sc, uint dqtype);
> int xrep_ino_dqattach(struct xfs_scrub *sc);
>
> @@ -93,9 +89,9 @@ int xrep_superblock(struct xfs_scrub *sc);
> #else
>
> static inline int xrep_attempt(
> - struct xfs_inode *ip,
> + struct xfs_inode *ip,
> struct xfs_scrub *sc,
> - bool *fixed)
> + bool *fixed)
> {
> return -EOPNOTSUPP;
> }
> diff --git a/fs/xfs/scrub/rmap.c b/fs/xfs/scrub/rmap.c
> index dc9c91a706ff..5e293c129813 100644
> --- a/fs/xfs/scrub/rmap.c
> +++ b/fs/xfs/scrub/rmap.c
> @@ -31,7 +31,7 @@
> int
> xchk_setup_ag_rmapbt(
> struct xfs_scrub *sc,
> - struct xfs_inode *ip)
> + struct xfs_inode *ip)
> {
> return xchk_setup_ag_btree(sc, ip, false);
> }
> @@ -42,15 +42,15 @@ xchk_setup_ag_rmapbt(
> STATIC void
> xchk_rmapbt_xref_refc(
> struct xfs_scrub *sc,
> - struct xfs_rmap_irec *irec)
> + struct xfs_rmap_irec *irec)
> {
> - xfs_agblock_t fbno;
> - xfs_extlen_t flen;
> - bool non_inode;
> - bool is_bmbt;
> - bool is_attr;
> - bool is_unwritten;
> - int error;
> + xfs_agblock_t fbno;
> + xfs_extlen_t flen;
> + bool non_inode;
> + bool is_bmbt;
> + bool is_attr;
> + bool is_unwritten;
> + int error;
>
> if (!sc->sa.refc_cur || xchk_skip_xref(sc->sm))
> return;
> @@ -73,10 +73,10 @@ xchk_rmapbt_xref_refc(
> STATIC void
> xchk_rmapbt_xref(
> struct xfs_scrub *sc,
> - struct xfs_rmap_irec *irec)
> + struct xfs_rmap_irec *irec)
> {
> - xfs_agblock_t agbno = irec->rm_startblock;
> - xfs_extlen_t len = irec->rm_blockcount;
> + xfs_agblock_t agbno = irec->rm_startblock;
> + xfs_extlen_t len = irec->rm_blockcount;
>
> if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
> return;
> @@ -96,17 +96,17 @@ xchk_rmapbt_xref(
> /* Scrub an rmapbt record. */
> STATIC int
> xchk_rmapbt_rec(
> - struct xchk_btree *bs,
> - union xfs_btree_rec *rec)
> + struct xchk_btree *bs,
> + union xfs_btree_rec *rec)
> {
> - struct xfs_mount *mp = bs->cur->bc_mp;
> - struct xfs_rmap_irec irec;
> - xfs_agnumber_t agno = bs->cur->bc_private.a.agno;
> - bool non_inode;
> - bool is_unwritten;
> - bool is_bmbt;
> - bool is_attr;
> - int error;
> + struct xfs_mount *mp = bs->cur->bc_mp;
> + struct xfs_rmap_irec irec;
> + xfs_agnumber_t agno = bs->cur->bc_private.a.agno;
> + bool non_inode;
> + bool is_unwritten;
> + bool is_bmbt;
> + bool is_attr;
> + int error;
>
> error = xfs_rmap_btrec_to_irec(rec, &irec);
> if (!xchk_btree_process_error(bs->sc, bs->cur, 0, &error))
> @@ -174,7 +174,7 @@ int
> xchk_rmapbt(
> struct xfs_scrub *sc)
> {
> - struct xfs_owner_info oinfo;
> + struct xfs_owner_info oinfo;
>
> xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_AG);
> return xchk_btree(sc, sc->sa.rmap_cur, xchk_rmapbt_rec,
> @@ -185,13 +185,13 @@ xchk_rmapbt(
> static inline void
> xchk_xref_check_owner(
> struct xfs_scrub *sc,
> - xfs_agblock_t bno,
> - xfs_extlen_t len,
> - struct xfs_owner_info *oinfo,
> - bool should_have_rmap)
> + xfs_agblock_t bno,
> + xfs_extlen_t len,
> + struct xfs_owner_info *oinfo,
> + bool should_have_rmap)
> {
> - bool has_rmap;
> - int error;
> + bool has_rmap;
> + int error;
>
> if (!sc->sa.rmap_cur || xchk_skip_xref(sc->sm))
> return;
> @@ -208,9 +208,9 @@ xchk_xref_check_owner(
> void
> xchk_xref_is_owned_by(
> struct xfs_scrub *sc,
> - xfs_agblock_t bno,
> - xfs_extlen_t len,
> - struct xfs_owner_info *oinfo)
> + xfs_agblock_t bno,
> + xfs_extlen_t len,
> + struct xfs_owner_info *oinfo)
> {
> xchk_xref_check_owner(sc, bno, len, oinfo, true);
> }
> @@ -219,9 +219,9 @@ xchk_xref_is_owned_by(
> void
> xchk_xref_is_not_owned_by(
> struct xfs_scrub *sc,
> - xfs_agblock_t bno,
> - xfs_extlen_t len,
> - struct xfs_owner_info *oinfo)
> + xfs_agblock_t bno,
> + xfs_extlen_t len,
> + struct xfs_owner_info *oinfo)
> {
> xchk_xref_check_owner(sc, bno, len, oinfo, false);
> }
> @@ -230,11 +230,11 @@ xchk_xref_is_not_owned_by(
> void
> xchk_xref_has_no_owner(
> struct xfs_scrub *sc,
> - xfs_agblock_t bno,
> - xfs_extlen_t len)
> + xfs_agblock_t bno,
> + xfs_extlen_t len)
> {
> - bool has_rmap;
> - int error;
> + bool has_rmap;
> + int error;
>
> if (!sc->sa.rmap_cur || xchk_skip_xref(sc->sm))
> return;
> diff --git a/fs/xfs/scrub/rtbitmap.c b/fs/xfs/scrub/rtbitmap.c
> index 653a809bba34..665d4bbb17cc 100644
> --- a/fs/xfs/scrub/rtbitmap.c
> +++ b/fs/xfs/scrub/rtbitmap.c
> @@ -27,9 +27,9 @@
> int
> xchk_setup_rt(
> struct xfs_scrub *sc,
> - struct xfs_inode *ip)
> + struct xfs_inode *ip)
> {
> - int error;
> + int error;
>
> error = xchk_setup_fs(sc, ip);
> if (error)
> @@ -47,13 +47,13 @@ xchk_setup_rt(
> /* Scrub a free extent record from the realtime bitmap. */
> STATIC int
> xchk_rtbitmap_rec(
> - struct xfs_trans *tp,
> - struct xfs_rtalloc_rec *rec,
> - void *priv)
> + struct xfs_trans *tp,
> + struct xfs_rtalloc_rec *rec,
> + void *priv)
> {
> struct xfs_scrub *sc = priv;
> - xfs_rtblock_t startblock;
> - xfs_rtblock_t blockcount;
> + xfs_rtblock_t startblock;
> + xfs_rtblock_t blockcount;
>
> startblock = rec->ar_startext * tp->t_mountp->m_sb.sb_rextsize;
> blockcount = rec->ar_extcount * tp->t_mountp->m_sb.sb_rextsize;
> @@ -70,7 +70,7 @@ int
> xchk_rtbitmap(
> struct xfs_scrub *sc)
> {
> - int error;
> + int error;
>
> /* Invoke the fork scrubber. */
> error = xchk_metadata_inode_forks(sc);
> @@ -90,10 +90,10 @@ int
> xchk_rtsummary(
> struct xfs_scrub *sc)
> {
> - struct xfs_inode *rsumip = sc->mp->m_rsumip;
> - struct xfs_inode *old_ip = sc->ip;
> - uint old_ilock_flags = sc->ilock_flags;
> - int error = 0;
> + struct xfs_inode *rsumip = sc->mp->m_rsumip;
> + struct xfs_inode *old_ip = sc->ip;
> + uint old_ilock_flags = sc->ilock_flags;
> + int error = 0;
>
> /*
> * We ILOCK'd the rt bitmap ip in the setup routine, now lock the
> @@ -126,14 +126,14 @@ xchk_rtsummary(
> void
> xchk_xref_is_used_rt_space(
> struct xfs_scrub *sc,
> - xfs_rtblock_t fsbno,
> - xfs_extlen_t len)
> + xfs_rtblock_t fsbno,
> + xfs_extlen_t len)
> {
> - xfs_rtblock_t startext;
> - xfs_rtblock_t endext;
> - xfs_rtblock_t extcount;
> - bool is_free;
> - int error;
> + xfs_rtblock_t startext;
> + xfs_rtblock_t endext;
> + xfs_rtblock_t extcount;
> + bool is_free;
> + int error;
>
> if (xchk_skip_xref(sc->sm))
> return;
> diff --git a/fs/xfs/scrub/scrub.c b/fs/xfs/scrub/scrub.c
> index b3c6420ccae5..5956b8073e2f 100644
> --- a/fs/xfs/scrub/scrub.c
> +++ b/fs/xfs/scrub/scrub.c
> @@ -153,7 +153,7 @@ static int
> xchk_probe(
> struct xfs_scrub *sc)
> {
> - int error = 0;
> + int error = 0;
>
> if (xchk_should_terminate(sc, &error))
> return error;
> @@ -167,8 +167,8 @@ xchk_probe(
> STATIC int
> xchk_teardown(
> struct xfs_scrub *sc,
> - struct xfs_inode *ip_in,
> - int error)
> + struct xfs_inode *ip_in,
> + int error)
> {
> xchk_ag_free(sc, &sc->sa);
> if (sc->tp) {
> @@ -479,7 +479,7 @@ xfs_scrub_metadata(
> struct xfs_inode *ip,
> struct xfs_scrub_metadata *sm)
> {
> - struct xfs_scrub sc;
> + struct xfs_scrub sc;
> struct xfs_mount *mp = ip->i_mount;
> bool try_harder = false;
> bool already_fixed = false;
> diff --git a/fs/xfs/scrub/scrub.h b/fs/xfs/scrub/scrub.h
> index 47c75d2f28da..af323b229c4b 100644
> --- a/fs/xfs/scrub/scrub.h
> +++ b/fs/xfs/scrub/scrub.h
> @@ -36,21 +36,21 @@ struct xchk_meta_ops {
>
> /* Buffer pointers and btree cursors for an entire AG. */
> struct xchk_ag {
> - xfs_agnumber_t agno;
> - struct xfs_perag *pag;
> + xfs_agnumber_t agno;
> + struct xfs_perag *pag;
>
> /* AG btree roots */
> - struct xfs_buf *agf_bp;
> - struct xfs_buf *agfl_bp;
> - struct xfs_buf *agi_bp;
> + struct xfs_buf *agf_bp;
> + struct xfs_buf *agfl_bp;
> + struct xfs_buf *agi_bp;
>
> /* AG btrees */
> - struct xfs_btree_cur *bno_cur;
> - struct xfs_btree_cur *cnt_cur;
> - struct xfs_btree_cur *ino_cur;
> - struct xfs_btree_cur *fino_cur;
> - struct xfs_btree_cur *rmap_cur;
> - struct xfs_btree_cur *refc_cur;
> + struct xfs_btree_cur *bno_cur;
> + struct xfs_btree_cur *cnt_cur;
> + struct xfs_btree_cur *ino_cur;
> + struct xfs_btree_cur *fino_cur;
> + struct xfs_btree_cur *rmap_cur;
> + struct xfs_btree_cur *refc_cur;
> };
>
> struct xfs_scrub {
> @@ -66,7 +66,7 @@ struct xfs_scrub {
> bool has_quotaofflock;
>
> /* State tracking for single-AG operations. */
> - struct xchk_ag sa;
> + struct xchk_ag sa;
> };
>
> /* Metadata scrubbers */
> @@ -115,27 +115,25 @@ xchk_quota(struct xfs_scrub *sc)
> #endif
>
> /* cross-referencing helpers */
> -void xchk_xref_is_used_space(struct xfs_scrub *sc,
> - xfs_agblock_t agbno, xfs_extlen_t len);
> -void xchk_xref_is_not_inode_chunk(struct xfs_scrub *sc,
> - xfs_agblock_t agbno, xfs_extlen_t len);
> -void xchk_xref_is_inode_chunk(struct xfs_scrub *sc,
> - xfs_agblock_t agbno, xfs_extlen_t len);
> -void xchk_xref_is_owned_by(struct xfs_scrub *sc,
> - xfs_agblock_t agbno, xfs_extlen_t len,
> - struct xfs_owner_info *oinfo);
> -void xchk_xref_is_not_owned_by(struct xfs_scrub *sc,
> - xfs_agblock_t agbno, xfs_extlen_t len,
> - struct xfs_owner_info *oinfo);
> -void xchk_xref_has_no_owner(struct xfs_scrub *sc,
> - xfs_agblock_t agbno, xfs_extlen_t len);
> -void xchk_xref_is_cow_staging(struct xfs_scrub *sc,
> - xfs_agblock_t bno, xfs_extlen_t len);
> -void xchk_xref_is_not_shared(struct xfs_scrub *sc,
> - xfs_agblock_t bno, xfs_extlen_t len);
> +void xchk_xref_is_used_space(struct xfs_scrub *sc, xfs_agblock_t agbno,
> + xfs_extlen_t len);
> +void xchk_xref_is_not_inode_chunk(struct xfs_scrub *sc, xfs_agblock_t agbno,
> + xfs_extlen_t len);
> +void xchk_xref_is_inode_chunk(struct xfs_scrub *sc, xfs_agblock_t agbno,
> + xfs_extlen_t len);
> +void xchk_xref_is_owned_by(struct xfs_scrub *sc, xfs_agblock_t agbno,
> + xfs_extlen_t len, struct xfs_owner_info *oinfo);
> +void xchk_xref_is_not_owned_by(struct xfs_scrub *sc, xfs_agblock_t agbno,
> + xfs_extlen_t len, struct xfs_owner_info *oinfo);
> +void xchk_xref_has_no_owner(struct xfs_scrub *sc, xfs_agblock_t agbno,
> + xfs_extlen_t len);
> +void xchk_xref_is_cow_staging(struct xfs_scrub *sc, xfs_agblock_t bno,
> + xfs_extlen_t len);
> +void xchk_xref_is_not_shared(struct xfs_scrub *sc, xfs_agblock_t bno,
> + xfs_extlen_t len);
> #ifdef CONFIG_XFS_RT
> -void xchk_xref_is_used_rt_space(struct xfs_scrub *sc,
> - xfs_rtblock_t rtbno, xfs_extlen_t len);
> +void xchk_xref_is_used_rt_space(struct xfs_scrub *sc, xfs_rtblock_t rtbno,
> + xfs_extlen_t len);
> #else
> # define xchk_xref_is_used_rt_space(sc, rtbno, len) do { } while (0)
> #endif
> diff --git a/fs/xfs/scrub/symlink.c b/fs/xfs/scrub/symlink.c
> index 56c6347e9482..f7ebaa946999 100644
> --- a/fs/xfs/scrub/symlink.c
> +++ b/fs/xfs/scrub/symlink.c
> @@ -27,7 +27,7 @@
> int
> xchk_setup_symlink(
> struct xfs_scrub *sc,
> - struct xfs_inode *ip)
> + struct xfs_inode *ip)
> {
> /* Allocate the buffer without the inode lock held. */
> sc->buf = kmem_zalloc_large(XFS_SYMLINK_MAXLEN + 1, KM_SLEEP);
> @@ -43,10 +43,10 @@ int
> xchk_symlink(
> struct xfs_scrub *sc)
> {
> - struct xfs_inode *ip = sc->ip;
> - struct xfs_ifork *ifp;
> - loff_t len;
> - int error = 0;
> + struct xfs_inode *ip = sc->ip;
> + struct xfs_ifork *ifp;
> + loff_t len;
> + int error = 0;
>
> if (!S_ISLNK(VFS_I(ip)->i_mode))
> return -ENOENT;
> diff --git a/fs/xfs/scrub/trace.c b/fs/xfs/scrub/trace.c
> index 1ef1202a1e45..96feaf8dcdec 100644
> --- a/fs/xfs/scrub/trace.c
> +++ b/fs/xfs/scrub/trace.c
> @@ -23,8 +23,8 @@
> /* Figure out which block the btree cursor was pointing to. */
> static inline xfs_fsblock_t
> xchk_btree_cur_fsbno(
> - struct xfs_btree_cur *cur,
> - int level)
> + struct xfs_btree_cur *cur,
> + int level)
> {
> if (level < cur->bc_nlevels && cur->bc_bufs[level])
> return XFS_DADDR_TO_FSB(cur->bc_mp, cur->bc_bufs[level]->b_bn);
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 1/8] xfs: check leaf attribute block freemap in verifier
2018-07-19 12:24 ` Brian Foster
@ 2018-07-19 15:20 ` Darrick J. Wong
0 siblings, 0 replies; 30+ messages in thread
From: Darrick J. Wong @ 2018-07-19 15:20 UTC (permalink / raw)
To: Brian Foster; +Cc: Darrick J. Wong, linux-xfs
On Thu, Jul 19, 2018 at 08:24:21AM -0400, Brian Foster wrote:
> On Wed, Jul 18, 2018 at 08:50:34AM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> >
> > Check the leaf attribute freemap when we we're verifying the block.
> >
>
> s/we//
Fixed.
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > ---
> > fs/xfs/libxfs/xfs_attr_leaf.c | 18 ++++++++++++++++++
> > 1 file changed, 18 insertions(+)
> >
> >
> > diff --git a/fs/xfs/libxfs/xfs_attr_leaf.c b/fs/xfs/libxfs/xfs_attr_leaf.c
> > index 76e90046731c..b3c19339e1b5 100644
> > --- a/fs/xfs/libxfs/xfs_attr_leaf.c
> > +++ b/fs/xfs/libxfs/xfs_attr_leaf.c
> > @@ -244,6 +244,8 @@ xfs_attr3_leaf_verify(
> > struct xfs_attr_leafblock *leaf = bp->b_addr;
> > struct xfs_perag *pag = bp->b_pag;
> > struct xfs_attr_leaf_entry *entries;
> > + uint16_t end;
> > + int i;
> >
> > xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &ichdr, leaf);
> >
> > @@ -289,6 +291,22 @@ xfs_attr3_leaf_verify(
> > /* XXX: need to range check rest of attr header values */
> > /* XXX: hash order check? */
> >
> > + for (i = 0; i < XFS_ATTR_LEAF_MAPSIZE; i++) {
> > + if (ichdr.freemap[i].base > mp->m_attr_geo->blksize)
> > + return __this_address;
> > + if (ichdr.freemap[i].base & 0x3)
> > + return __this_address;
>
> Same question as Carlos.. can you elaborate on the 0x3 magic number? (A
> one-liner comment might be useful).
/* Attribute data must be aligned to a multiple of four bytes. */
--D
> Brian
>
> > + if (ichdr.freemap[i].size > mp->m_attr_geo->blksize)
> > + return __this_address;
> > + if (ichdr.freemap[i].size & 0x3)
> > + return __this_address;
> > + end = ichdr.freemap[i].base + ichdr.freemap[i].size;
> > + if (end < ichdr.freemap[i].base)
> > + return __this_address;
> > + if (end > mp->m_attr_geo->blksize)
> > + return __this_address;
> > + }
> > +
> > return NULL;
> > }
> >
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH v2 1/8] xfs: check leaf attribute block freemap in verifier
2018-07-18 15:50 ` [PATCH 1/8] xfs: check leaf attribute block freemap in verifier Darrick J. Wong
2018-07-19 12:19 ` Carlos Maiolino
2018-07-19 12:24 ` Brian Foster
@ 2018-07-19 15:25 ` Darrick J. Wong
2018-07-19 15:30 ` Brian Foster
` (2 more replies)
2 siblings, 3 replies; 30+ messages in thread
From: Darrick J. Wong @ 2018-07-19 15:25 UTC (permalink / raw)
To: linux-xfs; +Cc: Brian Foster, Carlos Maiolino
From: Darrick J. Wong <darrick.wong@oracle.com>
Check the leaf attribute freemap when we're verifying the block.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
---
v2: add comments about alignment
---
fs/xfs/libxfs/xfs_attr_leaf.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/fs/xfs/libxfs/xfs_attr_leaf.c b/fs/xfs/libxfs/xfs_attr_leaf.c
index 76e90046731c..a673037c7d37 100644
--- a/fs/xfs/libxfs/xfs_attr_leaf.c
+++ b/fs/xfs/libxfs/xfs_attr_leaf.c
@@ -244,6 +244,8 @@ xfs_attr3_leaf_verify(
struct xfs_attr_leafblock *leaf = bp->b_addr;
struct xfs_perag *pag = bp->b_pag;
struct xfs_attr_leaf_entry *entries;
+ uint16_t end;
+ int i;
xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &ichdr, leaf);
@@ -289,6 +291,26 @@ xfs_attr3_leaf_verify(
/* XXX: need to range check rest of attr header values */
/* XXX: hash order check? */
+ /*
+ * Quickly check the freemap information. Attribute data has to be
+ * aligned to 4-byte boundaries, and likewise for the free space.
+ */
+ for (i = 0; i < XFS_ATTR_LEAF_MAPSIZE; i++) {
+ if (ichdr.freemap[i].base > mp->m_attr_geo->blksize)
+ return __this_address;
+ if (ichdr.freemap[i].base & 0x3)
+ return __this_address;
+ if (ichdr.freemap[i].size > mp->m_attr_geo->blksize)
+ return __this_address;
+ if (ichdr.freemap[i].size & 0x3)
+ return __this_address;
+ end = ichdr.freemap[i].base + ichdr.freemap[i].size;
+ if (end < ichdr.freemap[i].base)
+ return __this_address;
+ if (end > mp->m_attr_geo->blksize)
+ return __this_address;
+ }
+
return NULL;
}
^ permalink raw reply related [flat|nested] 30+ messages in thread
* Re: [PATCH v2 1/8] xfs: check leaf attribute block freemap in verifier
2018-07-19 15:25 ` [PATCH v2 " Darrick J. Wong
@ 2018-07-19 15:30 ` Brian Foster
2018-07-19 15:46 ` Carlos Maiolino
2018-07-19 16:40 ` Christoph Hellwig
2 siblings, 0 replies; 30+ messages in thread
From: Brian Foster @ 2018-07-19 15:30 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: linux-xfs, Carlos Maiolino
On Thu, Jul 19, 2018 at 08:25:16AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Check the leaf attribute freemap when we're verifying the block.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
> ---
> v2: add comments about alignment
> ---
Reviewed-by: Brian Foster <bfoster@redhat.com>
> fs/xfs/libxfs/xfs_attr_leaf.c | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/fs/xfs/libxfs/xfs_attr_leaf.c b/fs/xfs/libxfs/xfs_attr_leaf.c
> index 76e90046731c..a673037c7d37 100644
> --- a/fs/xfs/libxfs/xfs_attr_leaf.c
> +++ b/fs/xfs/libxfs/xfs_attr_leaf.c
> @@ -244,6 +244,8 @@ xfs_attr3_leaf_verify(
> struct xfs_attr_leafblock *leaf = bp->b_addr;
> struct xfs_perag *pag = bp->b_pag;
> struct xfs_attr_leaf_entry *entries;
> + uint16_t end;
> + int i;
>
> xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &ichdr, leaf);
>
> @@ -289,6 +291,26 @@ xfs_attr3_leaf_verify(
> /* XXX: need to range check rest of attr header values */
> /* XXX: hash order check? */
>
> + /*
> + * Quickly check the freemap information. Attribute data has to be
> + * aligned to 4-byte boundaries, and likewise for the free space.
> + */
> + for (i = 0; i < XFS_ATTR_LEAF_MAPSIZE; i++) {
> + if (ichdr.freemap[i].base > mp->m_attr_geo->blksize)
> + return __this_address;
> + if (ichdr.freemap[i].base & 0x3)
> + return __this_address;
> + if (ichdr.freemap[i].size > mp->m_attr_geo->blksize)
> + return __this_address;
> + if (ichdr.freemap[i].size & 0x3)
> + return __this_address;
> + end = ichdr.freemap[i].base + ichdr.freemap[i].size;
> + if (end < ichdr.freemap[i].base)
> + return __this_address;
> + if (end > mp->m_attr_geo->blksize)
> + return __this_address;
> + }
> +
> return NULL;
> }
>
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v2 1/8] xfs: check leaf attribute block freemap in verifier
2018-07-19 15:25 ` [PATCH v2 " Darrick J. Wong
2018-07-19 15:30 ` Brian Foster
@ 2018-07-19 15:46 ` Carlos Maiolino
2018-07-19 16:40 ` Christoph Hellwig
2 siblings, 0 replies; 30+ messages in thread
From: Carlos Maiolino @ 2018-07-19 15:46 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: linux-xfs, Brian Foster
On Thu, Jul 19, 2018 at 08:25:16AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Check the leaf attribute freemap when we're verifying the block.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
> ---
> v2: add comments about alignment
> ---
> fs/xfs/libxfs/xfs_attr_leaf.c | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
Thanks for the comment and explanation
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
> diff --git a/fs/xfs/libxfs/xfs_attr_leaf.c b/fs/xfs/libxfs/xfs_attr_leaf.c
> index 76e90046731c..a673037c7d37 100644
> --- a/fs/xfs/libxfs/xfs_attr_leaf.c
> +++ b/fs/xfs/libxfs/xfs_attr_leaf.c
> @@ -244,6 +244,8 @@ xfs_attr3_leaf_verify(
> struct xfs_attr_leafblock *leaf = bp->b_addr;
> struct xfs_perag *pag = bp->b_pag;
> struct xfs_attr_leaf_entry *entries;
> + uint16_t end;
> + int i;
>
> xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &ichdr, leaf);
>
> @@ -289,6 +291,26 @@ xfs_attr3_leaf_verify(
> /* XXX: need to range check rest of attr header values */
> /* XXX: hash order check? */
>
> + /*
> + * Quickly check the freemap information. Attribute data has to be
> + * aligned to 4-byte boundaries, and likewise for the free space.
> + */
> + for (i = 0; i < XFS_ATTR_LEAF_MAPSIZE; i++) {
> + if (ichdr.freemap[i].base > mp->m_attr_geo->blksize)
> + return __this_address;
> + if (ichdr.freemap[i].base & 0x3)
> + return __this_address;
> + if (ichdr.freemap[i].size > mp->m_attr_geo->blksize)
> + return __this_address;
> + if (ichdr.freemap[i].size & 0x3)
> + return __this_address;
> + end = ichdr.freemap[i].base + ichdr.freemap[i].size;
> + if (end < ichdr.freemap[i].base)
> + return __this_address;
> + if (end > mp->m_attr_geo->blksize)
> + return __this_address;
> + }
> +
> return NULL;
> }
>
--
Carlos
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v2 1/8] xfs: check leaf attribute block freemap in verifier
2018-07-19 15:25 ` [PATCH v2 " Darrick J. Wong
2018-07-19 15:30 ` Brian Foster
2018-07-19 15:46 ` Carlos Maiolino
@ 2018-07-19 16:40 ` Christoph Hellwig
2 siblings, 0 replies; 30+ messages in thread
From: Christoph Hellwig @ 2018-07-19 16:40 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: linux-xfs, Brian Foster, Carlos Maiolino
On Thu, Jul 19, 2018 at 08:25:16AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Check the leaf attribute freemap when we're verifying the block.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Looks good,
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 2/8] xfs: return from _defer_finish with a clean transaction
2018-07-18 15:50 ` [PATCH 2/8] xfs: return from _defer_finish with a clean transaction Darrick J. Wong
2018-07-19 12:24 ` Brian Foster
@ 2018-07-19 16:41 ` Christoph Hellwig
1 sibling, 0 replies; 30+ messages in thread
From: Christoph Hellwig @ 2018-07-19 16:41 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: linux-xfs
Looks good,
Reviewed-by: Christoph Hellwig <hch@lst.de>
(no need to mention me in the changelog, though :))
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 3/8] xfs: trivial xfs_btree_del_cursor cleanups
2018-07-18 15:50 ` [PATCH 3/8] xfs: trivial xfs_btree_del_cursor cleanups Darrick J. Wong
2018-07-19 12:24 ` Brian Foster
2018-07-19 12:25 ` Carlos Maiolino
@ 2018-07-19 16:43 ` Christoph Hellwig
2018-07-19 19:22 ` Darrick J. Wong
2 siblings, 1 reply; 30+ messages in thread
From: Christoph Hellwig @ 2018-07-19 16:43 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: linux-xfs
On Wed, Jul 18, 2018 at 08:50:51AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> The error argument to xfs_btree_del_cursor already understands the
> "nonzero for error" semantics, so remove pointless error testing in the
> callers and pass it directly.
Looks fine, but we should also get rid of the XFS_BTREE_ERROR and
XFS_BTREE_NOERROR defines as mixing them with errno values is going
to be very confusing.
Reviewed-by: Christoph Hellwig <hch@lst.de>
(assuming we get another patch for the above eventually)
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 4/8] xfs: clean up xfs_btree_del_cursor callers
2018-07-18 15:50 ` [PATCH 4/8] xfs: clean up xfs_btree_del_cursor callers Darrick J. Wong
2018-07-19 12:24 ` Brian Foster
2018-07-19 12:28 ` Carlos Maiolino
@ 2018-07-19 16:46 ` Christoph Hellwig
2 siblings, 0 replies; 30+ messages in thread
From: Christoph Hellwig @ 2018-07-19 16:46 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: linux-xfs
On Wed, Jul 18, 2018 at 08:50:57AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Less trivial cleanups of the error argument to xfs_btree_del_cursor;
> these require some minor code refactoring.
Both cases don't rely share a common patter, why have them in a single
patch?
Otherwise looks fine:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 3/8] xfs: trivial xfs_btree_del_cursor cleanups
2018-07-19 16:43 ` Christoph Hellwig
@ 2018-07-19 19:22 ` Darrick J. Wong
2018-07-20 16:04 ` Christoph Hellwig
0 siblings, 1 reply; 30+ messages in thread
From: Darrick J. Wong @ 2018-07-19 19:22 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-xfs
On Thu, Jul 19, 2018 at 09:43:53AM -0700, Christoph Hellwig wrote:
> On Wed, Jul 18, 2018 at 08:50:51AM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> >
> > The error argument to xfs_btree_del_cursor already understands the
> > "nonzero for error" semantics, so remove pointless error testing in the
> > callers and pass it directly.
>
> Looks fine, but we should also get rid of the XFS_BTREE_ERROR and
> XFS_BTREE_NOERROR defines as mixing them with errno values is going
> to be very confusing.
>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
>
> (assuming we get another patch for the above eventually)
Eventually, yes. The remaining usages are not so trivial to fix and
require more careful auditing.
--D
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 3/8] xfs: trivial xfs_btree_del_cursor cleanups
2018-07-19 19:22 ` Darrick J. Wong
@ 2018-07-20 16:04 ` Christoph Hellwig
0 siblings, 0 replies; 30+ messages in thread
From: Christoph Hellwig @ 2018-07-20 16:04 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: Christoph Hellwig, linux-xfs
On Thu, Jul 19, 2018 at 12:22:30PM -0700, Darrick J. Wong wrote:
> Eventually, yes. The remaining usages are not so trivial to fix and
> require more careful auditing.
I think a simple s/XFS_BTREE_NOERROR/0/g, s/XFS_BTREE_ERROR/-EIO/g
should do the job.
^ permalink raw reply [flat|nested] 30+ messages in thread
end of thread, other threads:[~2018-07-20 16:53 UTC | newest]
Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-18 15:50 [PATCH 0/8] xfs-4.19: fixes & cleanups Darrick J. Wong
2018-07-18 15:50 ` [PATCH 1/8] xfs: check leaf attribute block freemap in verifier Darrick J. Wong
2018-07-19 12:19 ` Carlos Maiolino
2018-07-19 12:24 ` Brian Foster
2018-07-19 15:20 ` Darrick J. Wong
2018-07-19 15:25 ` [PATCH v2 " Darrick J. Wong
2018-07-19 15:30 ` Brian Foster
2018-07-19 15:46 ` Carlos Maiolino
2018-07-19 16:40 ` Christoph Hellwig
2018-07-18 15:50 ` [PATCH 2/8] xfs: return from _defer_finish with a clean transaction Darrick J. Wong
2018-07-19 12:24 ` Brian Foster
2018-07-19 16:41 ` Christoph Hellwig
2018-07-18 15:50 ` [PATCH 3/8] xfs: trivial xfs_btree_del_cursor cleanups Darrick J. Wong
2018-07-19 12:24 ` Brian Foster
2018-07-19 12:25 ` Carlos Maiolino
2018-07-19 16:43 ` Christoph Hellwig
2018-07-19 19:22 ` Darrick J. Wong
2018-07-20 16:04 ` Christoph Hellwig
2018-07-18 15:50 ` [PATCH 4/8] xfs: clean up xfs_btree_del_cursor callers Darrick J. Wong
2018-07-19 12:24 ` Brian Foster
2018-07-19 12:28 ` Carlos Maiolino
2018-07-19 16:46 ` Christoph Hellwig
2018-07-18 15:51 ` [PATCH 5/8] xfs: shorten xfs_scrub_ prefix Darrick J. Wong
2018-07-19 12:59 ` Brian Foster
2018-07-18 15:51 ` [PATCH 6/8] xfs: shorten xfs_repair_ prefix to xrep_ Darrick J. Wong
2018-07-19 12:59 ` Brian Foster
2018-07-18 15:52 ` [PATCH 7/8] xfs: shorten struct xfs_scrub_context to struct xfs_scrub Darrick J. Wong
2018-07-19 12:59 ` Brian Foster
2018-07-18 15:52 ` [PATCH 8/8] xfs: fix indentation and other whitespace problems in scrub/repair Darrick J. Wong
2018-07-19 12:59 ` Brian Foster
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.