Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xfs: remove return value from xchk_ag_btcur_init

Functions called by this function cannot fail, so get rid of the return
and error checking.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>

+7 -17
+3 -12
fs/xfs/scrub/agheader.c
··· 477 477 { 478 478 struct xfs_mount *mp = sc->mp; 479 479 xfs_agblock_t agbno; 480 - int error; 481 480 482 481 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) 483 482 return; 484 483 485 484 agbno = XFS_AGF_BLOCK(mp); 486 485 487 - error = xchk_ag_btcur_init(sc, &sc->sa); 488 - if (error) 489 - return; 486 + xchk_ag_btcur_init(sc, &sc->sa); 490 487 491 488 xchk_xref_is_used_space(sc, agbno, 1); 492 489 xchk_agf_xref_freeblks(sc); ··· 657 660 { 658 661 struct xfs_mount *mp = sc->mp; 659 662 xfs_agblock_t agbno; 660 - int error; 661 663 662 664 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) 663 665 return; 664 666 665 667 agbno = XFS_AGFL_BLOCK(mp); 666 668 667 - error = xchk_ag_btcur_init(sc, &sc->sa); 668 - if (error) 669 - return; 669 + xchk_ag_btcur_init(sc, &sc->sa); 670 670 671 671 xchk_xref_is_used_space(sc, agbno, 1); 672 672 xchk_xref_is_not_inode_chunk(sc, agbno, 1); ··· 807 813 { 808 814 struct xfs_mount *mp = sc->mp; 809 815 xfs_agblock_t agbno; 810 - int error; 811 816 812 817 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) 813 818 return; 814 819 815 820 agbno = XFS_AGI_BLOCK(mp); 816 821 817 - error = xchk_ag_btcur_init(sc, &sc->sa); 818 - if (error) 819 - return; 822 + xchk_ag_btcur_init(sc, &sc->sa); 820 823 821 824 xchk_xref_is_used_space(sc, agbno, 1); 822 825 xchk_xref_is_not_inode_chunk(sc, agbno, 1);
+3 -4
fs/xfs/scrub/common.c
··· 452 452 } 453 453 454 454 /* Initialize all the btree cursors for an AG. */ 455 - int 455 + void 456 456 xchk_ag_btcur_init( 457 457 struct xfs_scrub *sc, 458 458 struct xchk_ag *sa) ··· 502 502 sa->refc_cur = xfs_refcountbt_init_cursor(mp, sc->tp, 503 503 sa->agf_bp, agno); 504 504 } 505 - 506 - return 0; 507 505 } 508 506 509 507 /* Release the AG header context and btree cursors. */ ··· 549 551 if (error) 550 552 return error; 551 553 552 - return xchk_ag_btcur_init(sc, sa); 554 + xchk_ag_btcur_init(sc, sa); 555 + return 0; 553 556 } 554 557 555 558 /*
+1 -1
fs/xfs/scrub/common.h
··· 122 122 int xchk_ag_read_headers(struct xfs_scrub *sc, xfs_agnumber_t agno, 123 123 struct xchk_ag *sa); 124 124 void xchk_ag_btcur_free(struct xchk_ag *sa); 125 - int xchk_ag_btcur_init(struct xfs_scrub *sc, struct xchk_ag *sa); 125 + void xchk_ag_btcur_init(struct xfs_scrub *sc, struct xchk_ag *sa); 126 126 int xchk_count_rmap_ownedby_ag(struct xfs_scrub *sc, struct xfs_btree_cur *cur, 127 127 const struct xfs_owner_info *oinfo, xfs_filblks_t *blocks); 128 128