diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2018-12-12 08:46:23 -0800 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2018-12-12 08:47:16 -0800 |
commit | 66e3237e724c6650dca03627b40bb00a812d3f7a (patch) | |
tree | 84a31606547b538fb2e8fb4dd5b732f0444c53fb /fs/xfs/scrub/refcount.c | |
parent | 02b100fb83f9b0f8719deef6c4ed973b4d9ce00c (diff) |
xfs: const-ify xfs_owner_info arguments
Only certain functions actually change the contents of an
xfs_owner_info; the rest can accept a const struct pointer. This will
enable us to save stack space by hoisting static owner info types to
be const global variables.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Diffstat (limited to 'fs/xfs/scrub/refcount.c')
-rw-r--r-- | fs/xfs/scrub/refcount.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/xfs/scrub/refcount.c b/fs/xfs/scrub/refcount.c index e8c82b026083..b7ade620acee 100644 --- a/fs/xfs/scrub/refcount.c +++ b/fs/xfs/scrub/refcount.c @@ -383,9 +383,9 @@ 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_extlen_t refcbt_blocks = 0; xfs_filblks_t blocks; int error; @@ -394,10 +394,11 @@ xchk_refcount_xref_rmap( return; /* Check that we saw as many refcbt blocks as the rmap knows about. */ + xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_REFC); error = xfs_btree_count_blocks(sc->sa.refc_cur, &refcbt_blocks); if (!xchk_btree_process_error(sc, sc->sa.refc_cur, 0, &error)) return; - error = xchk_count_rmap_ownedby_ag(sc, sc->sa.rmap_cur, oinfo, + error = xchk_count_rmap_ownedby_ag(sc, sc->sa.rmap_cur, &oinfo, &blocks); if (!xchk_should_check_xref(sc, &error, &sc->sa.rmap_cur)) return; @@ -405,8 +406,8 @@ xchk_refcount_xref_rmap( 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 = xchk_count_rmap_ownedby_ag(sc, sc->sa.rmap_cur, oinfo, + xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_COW); + error = xchk_count_rmap_ownedby_ag(sc, sc->sa.rmap_cur, &oinfo, &blocks); if (!xchk_should_check_xref(sc, &error, &sc->sa.rmap_cur)) return; @@ -429,7 +430,7 @@ xchk_refcountbt( if (error) return error; - xchk_refcount_xref_rmap(sc, &oinfo, cow_blocks); + xchk_refcount_xref_rmap(sc, cow_blocks); return 0; } |