diff options
author | Dave Chinner <dchinner@redhat.com> | 2022-07-07 22:05:18 +1000 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2022-07-07 22:05:18 +1000 |
commit | 85c73bf726e41be276bcad3325d9a8aef10be289 (patch) | |
tree | 1cd74ee0a59eeb2fb856fd40387bec20ef553adf /fs/xfs/scrub | |
parent | 7561cea5dbb97fecb952548a0fb74fb105bf4664 (diff) | |
download | linux-next-85c73bf726e41be276bcad3325d9a8aef10be289.tar.gz |
xfs: rework xfs_buf_incore() API
Make it consistent with the other buffer APIs to return a error and
the buffer is placed in a parameter.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/scrub')
-rw-r--r-- | fs/xfs/scrub/repair.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/fs/xfs/scrub/repair.c b/fs/xfs/scrub/repair.c index 1e7b6b209ee8..5e7428782571 100644 --- a/fs/xfs/scrub/repair.c +++ b/fs/xfs/scrub/repair.c @@ -457,16 +457,19 @@ xrep_invalidate_blocks( * assume it's owned by someone else. */ for_each_xbitmap_block(fsbno, bmr, n, bitmap) { + int error; + /* Skip AG headers and post-EOFS blocks */ if (!xfs_verify_fsbno(sc->mp, fsbno)) continue; - bp = xfs_buf_incore(sc->mp->m_ddev_targp, + error = xfs_buf_incore(sc->mp->m_ddev_targp, XFS_FSB_TO_DADDR(sc->mp, fsbno), - XFS_FSB_TO_BB(sc->mp, 1), XBF_TRYLOCK); - if (bp) { - xfs_trans_bjoin(sc->tp, bp); - xfs_trans_binval(sc->tp, bp); - } + XFS_FSB_TO_BB(sc->mp, 1), XBF_TRYLOCK, &bp); + if (error) + continue; + + xfs_trans_bjoin(sc->tp, bp); + xfs_trans_binval(sc->tp, bp); } return 0; |