Commit 46e0dd89 authored by Darrick J. Wong's avatar Darrick J. Wong

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: default avatarDarrick J. Wong <djwong@kernel.org>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
parent 302436c2
...@@ -34,7 +34,7 @@ xchk_setup_inode_bmap( ...@@ -34,7 +34,7 @@ xchk_setup_inode_bmap(
if (xchk_need_intent_drain(sc)) if (xchk_need_intent_drain(sc))
xchk_fsgates_enable(sc, XCHK_FSGATES_DRAIN); xchk_fsgates_enable(sc, XCHK_FSGATES_DRAIN);
error = xchk_get_inode(sc); error = xchk_iget_for_scrubbing(sc);
if (error) if (error)
goto out; goto out;
......
...@@ -832,12 +832,14 @@ xchk_install_handle_inode( ...@@ -832,12 +832,14 @@ xchk_install_handle_inode(
} }
/* /*
* Given an inode and the scrub control structure, grab either the * In preparation to scrub metadata structures that hang off of an inode,
* inode referenced in the control structure or the inode passed in. * grab either the inode referenced in the scrub control structure or the
* The inode is not locked. * inode passed in. If the inumber does not reference an allocated inode
* record, the function returns ENOENT to end the scrub early. The inode
* is not locked.
*/ */
int int
xchk_get_inode( xchk_iget_for_scrubbing(
struct xfs_scrub *sc) struct xfs_scrub *sc)
{ {
struct xfs_imap imap; struct xfs_imap imap;
...@@ -994,7 +996,7 @@ xchk_setup_inode_contents( ...@@ -994,7 +996,7 @@ xchk_setup_inode_contents(
{ {
int error; int error;
error = xchk_get_inode(sc); error = xchk_iget_for_scrubbing(sc);
if (error) if (error)
return error; return error;
......
...@@ -135,7 +135,7 @@ int xchk_count_rmap_ownedby_ag(struct xfs_scrub *sc, struct xfs_btree_cur *cur, ...@@ -135,7 +135,7 @@ int xchk_count_rmap_ownedby_ag(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
const struct xfs_owner_info *oinfo, xfs_filblks_t *blocks); const struct xfs_owner_info *oinfo, xfs_filblks_t *blocks);
int xchk_setup_ag_btree(struct xfs_scrub *sc, bool force_log); int xchk_setup_ag_btree(struct xfs_scrub *sc, bool force_log);
int xchk_get_inode(struct xfs_scrub *sc); int xchk_iget_for_scrubbing(struct xfs_scrub *sc);
int xchk_setup_inode_contents(struct xfs_scrub *sc, unsigned int resblks); int xchk_setup_inode_contents(struct xfs_scrub *sc, unsigned int resblks);
void xchk_buffer_recheck(struct xfs_scrub *sc, struct xfs_buf *bp); void xchk_buffer_recheck(struct xfs_scrub *sc, struct xfs_buf *bp);
......
...@@ -39,7 +39,7 @@ xchk_setup_inode( ...@@ -39,7 +39,7 @@ xchk_setup_inode(
* Try to get the inode. If the verifiers fail, we try again * Try to get the inode. If the verifiers fail, we try again
* in raw mode. * in raw mode.
*/ */
error = xchk_get_inode(sc); error = xchk_iget_for_scrubbing(sc);
switch (error) { switch (error) {
case 0: case 0:
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment