Skip to content

Commit 46e0dd8

Browse files
author
Darrick J. Wong
committed
xfs: rename xchk_get_inode -> xchk_iget_for_scrubbing
Dave Chinner suggested renaming this function to make more obvious what it does. The function returns an incore inode to callers that want to scrub a metadata structure that hangs off an inode. If the iget fails with EINVAL, it will single-step the loading process to distinguish between actually free inodes or impossible inumbers (ENOENT); discrepancies between the inobt freemask and the free status in the inode record (EFSCORRUPTED). Any other negative errno is returned unchanged. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Dave Chinner <dchinner@redhat.com>
1 parent 302436c commit 46e0dd8

4 files changed

Lines changed: 10 additions & 8 deletions

File tree

fs/xfs/scrub/bmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ xchk_setup_inode_bmap(
3434
if (xchk_need_intent_drain(sc))
3535
xchk_fsgates_enable(sc, XCHK_FSGATES_DRAIN);
3636

37-
error = xchk_get_inode(sc);
37+
error = xchk_iget_for_scrubbing(sc);
3838
if (error)
3939
goto out;
4040

fs/xfs/scrub/common.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -832,12 +832,14 @@ xchk_install_handle_inode(
832832
}
833833

834834
/*
835-
* Given an inode and the scrub control structure, grab either the
836-
* inode referenced in the control structure or the inode passed in.
837-
* The inode is not locked.
835+
* In preparation to scrub metadata structures that hang off of an inode,
836+
* grab either the inode referenced in the scrub control structure or the
837+
* inode passed in. If the inumber does not reference an allocated inode
838+
* record, the function returns ENOENT to end the scrub early. The inode
839+
* is not locked.
838840
*/
839841
int
840-
xchk_get_inode(
842+
xchk_iget_for_scrubbing(
841843
struct xfs_scrub *sc)
842844
{
843845
struct xfs_imap imap;
@@ -994,7 +996,7 @@ xchk_setup_inode_contents(
994996
{
995997
int error;
996998

997-
error = xchk_get_inode(sc);
999+
error = xchk_iget_for_scrubbing(sc);
9981000
if (error)
9991001
return error;
10001002

fs/xfs/scrub/common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ int xchk_count_rmap_ownedby_ag(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
135135
const struct xfs_owner_info *oinfo, xfs_filblks_t *blocks);
136136

137137
int xchk_setup_ag_btree(struct xfs_scrub *sc, bool force_log);
138-
int xchk_get_inode(struct xfs_scrub *sc);
138+
int xchk_iget_for_scrubbing(struct xfs_scrub *sc);
139139
int xchk_setup_inode_contents(struct xfs_scrub *sc, unsigned int resblks);
140140
void xchk_buffer_recheck(struct xfs_scrub *sc, struct xfs_buf *bp);
141141

fs/xfs/scrub/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ xchk_setup_inode(
3939
* Try to get the inode. If the verifiers fail, we try again
4040
* in raw mode.
4141
*/
42-
error = xchk_get_inode(sc);
42+
error = xchk_iget_for_scrubbing(sc);
4343
switch (error) {
4444
case 0:
4545
break;

0 commit comments

Comments
 (0)