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

xfs: shorten xfs_repair_ prefix to xrep_

Shorten all the metadata repair xfs_repair_* symbols to xrep_.
Whitespace damage will be fixed by a subsequent patch. There are no
functional changes.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>

+168 -168
+1 -1
fs/xfs/scrub/agheader_repair.c
··· 28 28 29 29 /* Repair the superblock. */ 30 30 int 31 - xfs_repair_superblock( 31 + xrep_superblock( 32 32 struct xfs_scrub_context *sc) 33 33 { 34 34 struct xfs_mount *mp = sc->mp;
+1 -1
fs/xfs/scrub/common.c
··· 604 604 { 605 605 uint resblks; 606 606 607 - resblks = xfs_repair_calc_ag_resblks(sc); 607 + resblks = xrep_calc_ag_resblks(sc); 608 608 return xchk_trans_alloc(sc, resblks); 609 609 } 610 610
+82 -82
fs/xfs/scrub/repair.c
··· 41 41 * and will set *fixed to true if it thinks it repaired anything. 42 42 */ 43 43 int 44 - xfs_repair_attempt( 44 + xrep_attempt( 45 45 struct xfs_inode *ip, 46 46 struct xfs_scrub_context *sc, 47 47 bool *fixed) 48 48 { 49 49 int error = 0; 50 50 51 - trace_xfs_repair_attempt(ip, sc->sm, error); 51 + trace_xrep_attempt(ip, sc->sm, error); 52 52 53 53 xchk_ag_btcur_free(&sc->sa); 54 54 55 55 /* Repair whatever's broken. */ 56 56 ASSERT(sc->ops->repair); 57 57 error = sc->ops->repair(sc); 58 - trace_xfs_repair_done(ip, sc->sm, error); 58 + trace_xrep_done(ip, sc->sm, error); 59 59 switch (error) { 60 60 case 0: 61 61 /* ··· 93 93 * structure to track rate limiting information. 94 94 */ 95 95 void 96 - xfs_repair_failure( 96 + xrep_failure( 97 97 struct xfs_mount *mp) 98 98 { 99 99 xfs_alert_ratelimited(mp, ··· 105 105 * given mountpoint. 106 106 */ 107 107 int 108 - xfs_repair_probe( 108 + xrep_probe( 109 109 struct xfs_scrub_context *sc) 110 110 { 111 111 int error = 0; ··· 121 121 * the btree cursors. 122 122 */ 123 123 int 124 - xfs_repair_roll_ag_trans( 124 + xrep_roll_ag_trans( 125 125 struct xfs_scrub_context *sc) 126 126 { 127 127 int error; ··· 162 162 * in AG reservations) to construct a whole btree. 163 163 */ 164 164 bool 165 - xfs_repair_ag_has_space( 165 + xrep_ag_has_space( 166 166 struct xfs_perag *pag, 167 167 xfs_extlen_t nr_blocks, 168 168 enum xfs_ag_resv_type type) ··· 178 178 * any type of per-AG btree. 179 179 */ 180 180 xfs_extlen_t 181 - xfs_repair_calc_ag_resblks( 181 + xrep_calc_ag_resblks( 182 182 struct xfs_scrub_context *sc) 183 183 { 184 184 struct xfs_mount *mp = sc->mp; ··· 231 231 } 232 232 xfs_perag_put(pag); 233 233 234 - trace_xfs_repair_calc_ag_resblks(mp, sm->sm_agno, icount, aglen, 234 + trace_xrep_calc_ag_resblks(mp, sm->sm_agno, icount, aglen, 235 235 freelen, usedlen); 236 236 237 237 /* ··· 270 270 rmapbt_sz = 0; 271 271 } 272 272 273 - trace_xfs_repair_calc_ag_resblks_btsize(mp, sm->sm_agno, bnobt_sz, 273 + trace_xrep_calc_ag_resblks_btsize(mp, sm->sm_agno, bnobt_sz, 274 274 inobt_sz, rmapbt_sz, refcbt_sz); 275 275 276 276 return max(max(bnobt_sz, inobt_sz), max(rmapbt_sz, refcbt_sz)); ··· 278 278 279 279 /* Allocate a block in an AG. */ 280 280 int 281 - xfs_repair_alloc_ag_block( 281 + xrep_alloc_ag_block( 282 282 struct xfs_scrub_context *sc, 283 283 struct xfs_owner_info *oinfo, 284 284 xfs_fsblock_t *fsbno, ··· 329 329 330 330 /* Initialize a new AG btree root block with zero entries. */ 331 331 int 332 - xfs_repair_init_btblock( 332 + xrep_init_btblock( 333 333 struct xfs_scrub_context *sc, 334 334 xfs_fsblock_t fsb, 335 335 struct xfs_buf **bpp, ··· 340 340 struct xfs_mount *mp = sc->mp; 341 341 struct xfs_buf *bp; 342 342 343 - trace_xfs_repair_init_btblock(mp, XFS_FSB_TO_AGNO(mp, fsb), 343 + trace_xrep_init_btblock(mp, XFS_FSB_TO_AGNO(mp, fsb), 344 344 XFS_FSB_TO_AGBNO(mp, fsb), btnum); 345 345 346 346 ASSERT(XFS_FSB_TO_AGNO(mp, fsb) == sc->sa.agno); ··· 384 384 385 385 /* Collect a dead btree extent for later disposal. */ 386 386 int 387 - xfs_repair_collect_btree_extent( 387 + xrep_collect_btree_extent( 388 388 struct xfs_scrub_context *sc, 389 - struct xfs_repair_extent_list *exlist, 389 + struct xrep_extent_list *exlist, 390 390 xfs_fsblock_t fsbno, 391 391 xfs_extlen_t len) 392 392 { 393 - struct xfs_repair_extent *rex; 393 + struct xrep_extent *rex; 394 394 395 - trace_xfs_repair_collect_btree_extent(sc->mp, 395 + trace_xrep_collect_btree_extent(sc->mp, 396 396 XFS_FSB_TO_AGNO(sc->mp, fsbno), 397 397 XFS_FSB_TO_AGBNO(sc->mp, fsbno), len); 398 398 399 - rex = kmem_alloc(sizeof(struct xfs_repair_extent), KM_MAYFAIL); 399 + rex = kmem_alloc(sizeof(struct xrep_extent), KM_MAYFAIL); 400 400 if (!rex) 401 401 return -ENOMEM; 402 402 ··· 414 414 * Therefore, free all the memory associated with the list so we can die. 415 415 */ 416 416 void 417 - xfs_repair_cancel_btree_extents( 417 + xrep_cancel_btree_extents( 418 418 struct xfs_scrub_context *sc, 419 - struct xfs_repair_extent_list *exlist) 419 + struct xrep_extent_list *exlist) 420 420 { 421 - struct xfs_repair_extent *rex; 422 - struct xfs_repair_extent *n; 421 + struct xrep_extent *rex; 422 + struct xrep_extent *n; 423 423 424 - for_each_xfs_repair_extent_safe(rex, n, exlist) { 424 + for_each_xrep_extent_safe(rex, n, exlist) { 425 425 list_del(&rex->list); 426 426 kmem_free(rex); 427 427 } ··· 429 429 430 430 /* Compare two btree extents. */ 431 431 static int 432 - xfs_repair_btree_extent_cmp( 432 + xrep_btree_extent_cmp( 433 433 void *priv, 434 434 struct list_head *a, 435 435 struct list_head *b) 436 436 { 437 - struct xfs_repair_extent *ap; 438 - struct xfs_repair_extent *bp; 437 + struct xrep_extent *ap; 438 + struct xrep_extent *bp; 439 439 440 - ap = container_of(a, struct xfs_repair_extent, list); 441 - bp = container_of(b, struct xfs_repair_extent, list); 440 + ap = container_of(a, struct xrep_extent, list); 441 + bp = container_of(b, struct xrep_extent, list); 442 442 443 443 if (ap->fsbno > bp->fsbno) 444 444 return 1; ··· 462 462 #define LEFT_ALIGNED (1 << 0) 463 463 #define RIGHT_ALIGNED (1 << 1) 464 464 int 465 - xfs_repair_subtract_extents( 465 + xrep_subtract_extents( 466 466 struct xfs_scrub_context *sc, 467 - struct xfs_repair_extent_list *exlist, 468 - struct xfs_repair_extent_list *sublist) 467 + struct xrep_extent_list *exlist, 468 + struct xrep_extent_list *sublist) 469 469 { 470 470 struct list_head *lp; 471 - struct xfs_repair_extent *ex; 472 - struct xfs_repair_extent *newex; 473 - struct xfs_repair_extent *subex; 471 + struct xrep_extent *ex; 472 + struct xrep_extent *newex; 473 + struct xrep_extent *subex; 474 474 xfs_fsblock_t sub_fsb; 475 475 xfs_extlen_t sub_len; 476 476 int state; ··· 480 480 return 0; 481 481 ASSERT(!list_empty(&sublist->list)); 482 482 483 - list_sort(NULL, &exlist->list, xfs_repair_btree_extent_cmp); 484 - list_sort(NULL, &sublist->list, xfs_repair_btree_extent_cmp); 483 + list_sort(NULL, &exlist->list, xrep_btree_extent_cmp); 484 + list_sort(NULL, &sublist->list, xrep_btree_extent_cmp); 485 485 486 486 /* 487 487 * Now that we've sorted both lists, we iterate exlist once, rolling ··· 491 491 * list traversal is similar to merge sort, but we're deleting 492 492 * instead. In this manner we avoid O(n^2) operations. 493 493 */ 494 - subex = list_first_entry(&sublist->list, struct xfs_repair_extent, 494 + subex = list_first_entry(&sublist->list, struct xrep_extent, 495 495 list); 496 496 lp = exlist->list.next; 497 497 while (lp != &exlist->list) { 498 - ex = list_entry(lp, struct xfs_repair_extent, list); 498 + ex = list_entry(lp, struct xrep_extent, list); 499 499 500 500 /* 501 501 * Advance subex and/or ex until we find a pair that ··· 548 548 * Deleting from the middle: add the new right extent 549 549 * and then shrink the left extent. 550 550 */ 551 - newex = kmem_alloc(sizeof(struct xfs_repair_extent), 551 + newex = kmem_alloc(sizeof(struct xrep_extent), 552 552 KM_MAYFAIL); 553 553 if (!newex) { 554 554 error = -ENOMEM; ··· 619 619 * is not intended for use with file data repairs; we have bunmapi for that. 620 620 */ 621 621 int 622 - xfs_repair_invalidate_blocks( 622 + xrep_invalidate_blocks( 623 623 struct xfs_scrub_context *sc, 624 - struct xfs_repair_extent_list *exlist) 624 + struct xrep_extent_list *exlist) 625 625 { 626 - struct xfs_repair_extent *rex; 627 - struct xfs_repair_extent *n; 626 + struct xrep_extent *rex; 627 + struct xrep_extent *n; 628 628 struct xfs_buf *bp; 629 629 xfs_fsblock_t fsbno; 630 630 xfs_agblock_t i; ··· 637 637 * because we never own those; and if we can't TRYLOCK the buffer we 638 638 * assume it's owned by someone else. 639 639 */ 640 - for_each_xfs_repair_extent_safe(rex, n, exlist) { 640 + for_each_xrep_extent_safe(rex, n, exlist) { 641 641 for (fsbno = rex->fsbno, i = rex->len; i > 0; fsbno++, i--) { 642 642 /* Skip AG headers and post-EOFS blocks */ 643 643 if (!xfs_verify_fsbno(sc->mp, fsbno)) ··· 657 657 658 658 /* Ensure the freelist is the correct size. */ 659 659 int 660 - xfs_repair_fix_freelist( 660 + xrep_fix_freelist( 661 661 struct xfs_scrub_context *sc, 662 662 bool can_shrink) 663 663 { ··· 677 677 * Put a block back on the AGFL. 678 678 */ 679 679 STATIC int 680 - xfs_repair_put_freelist( 680 + xrep_put_freelist( 681 681 struct xfs_scrub_context *sc, 682 682 xfs_agblock_t agbno) 683 683 { ··· 685 685 int error; 686 686 687 687 /* Make sure there's space on the freelist. */ 688 - error = xfs_repair_fix_freelist(sc, true); 688 + error = xrep_fix_freelist(sc, true); 689 689 if (error) 690 690 return error; 691 691 ··· 713 713 714 714 /* Dispose of a single metadata block. */ 715 715 STATIC int 716 - xfs_repair_dispose_btree_block( 716 + xrep_dispose_btree_block( 717 717 struct xfs_scrub_context *sc, 718 718 xfs_fsblock_t fsbno, 719 719 struct xfs_owner_info *oinfo, ··· 767 767 if (has_other_rmap) 768 768 error = xfs_rmap_free(sc->tp, agf_bp, agno, agbno, 1, oinfo); 769 769 else if (resv == XFS_AG_RESV_AGFL) 770 - error = xfs_repair_put_freelist(sc, agbno); 770 + error = xrep_put_freelist(sc, agbno); 771 771 else 772 772 error = xfs_free_extent(sc->tp, fsbno, 1, oinfo, resv); 773 773 if (agf_bp != sc->sa.agf_bp) ··· 777 777 778 778 if (sc->ip) 779 779 return xfs_trans_roll_inode(&sc->tp, sc->ip); 780 - return xfs_repair_roll_ag_trans(sc); 780 + return xrep_roll_ag_trans(sc); 781 781 782 782 out_free: 783 783 if (agf_bp != sc->sa.agf_bp) ··· 787 787 788 788 /* Dispose of btree blocks from an old per-AG btree. */ 789 789 int 790 - xfs_repair_reap_btree_extents( 790 + xrep_reap_btree_extents( 791 791 struct xfs_scrub_context *sc, 792 - struct xfs_repair_extent_list *exlist, 792 + struct xrep_extent_list *exlist, 793 793 struct xfs_owner_info *oinfo, 794 794 enum xfs_ag_resv_type type) 795 795 { 796 - struct xfs_repair_extent *rex; 797 - struct xfs_repair_extent *n; 796 + struct xrep_extent *rex; 797 + struct xrep_extent *n; 798 798 int error = 0; 799 799 800 800 ASSERT(xfs_sb_version_hasrmapbt(&sc->mp->m_sb)); 801 801 802 802 /* Dispose of every block from the old btree. */ 803 - for_each_xfs_repair_extent_safe(rex, n, exlist) { 803 + for_each_xrep_extent_safe(rex, n, exlist) { 804 804 ASSERT(sc->ip != NULL || 805 805 XFS_FSB_TO_AGNO(sc->mp, rex->fsbno) == sc->sa.agno); 806 806 807 - trace_xfs_repair_dispose_btree_extent(sc->mp, 807 + trace_xrep_dispose_btree_extent(sc->mp, 808 808 XFS_FSB_TO_AGNO(sc->mp, rex->fsbno), 809 809 XFS_FSB_TO_AGBNO(sc->mp, rex->fsbno), rex->len); 810 810 811 811 for (; rex->len > 0; rex->len--, rex->fsbno++) { 812 - error = xfs_repair_dispose_btree_block(sc, rex->fsbno, 812 + error = xrep_dispose_btree_block(sc, rex->fsbno, 813 813 oinfo, type); 814 814 if (error) 815 815 goto out; ··· 819 819 } 820 820 821 821 out: 822 - xfs_repair_cancel_btree_extents(sc, exlist); 822 + xrep_cancel_btree_extents(sc, exlist); 823 823 return error; 824 824 } 825 825 ··· 831 831 * btree roots. This is not guaranteed to work if the AG is heavily damaged 832 832 * or the rmap data are corrupt. 833 833 * 834 - * Callers of xfs_repair_find_ag_btree_roots must lock the AGF and AGFL 834 + * Callers of xrep_find_ag_btree_roots must lock the AGF and AGFL 835 835 * buffers if the AGF is being rebuilt; or the AGF and AGI buffers if the 836 836 * AGI is being rebuilt. It must maintain these locks until it's safe for 837 837 * other threads to change the btrees' shapes. The caller provides 838 838 * information about the btrees to look for by passing in an array of 839 - * xfs_repair_find_ag_btree with the (rmap owner, buf_ops, magic) fields set. 839 + * xrep_find_ag_btree with the (rmap owner, buf_ops, magic) fields set. 840 840 * The (root, height) fields will be set on return if anything is found. The 841 841 * last element of the array should have a NULL buf_ops to mark the end of the 842 842 * array. ··· 850 850 * should be the roots. 851 851 */ 852 852 853 - struct xfs_repair_findroot { 853 + struct xrep_findroot { 854 854 struct xfs_scrub_context *sc; 855 855 struct xfs_buf *agfl_bp; 856 856 struct xfs_agf *agf; 857 - struct xfs_repair_find_ag_btree *btree_info; 857 + struct xrep_find_ag_btree *btree_info; 858 858 }; 859 859 860 860 /* See if our block is in the AGFL. */ 861 861 STATIC int 862 - xfs_repair_findroot_agfl_walk( 862 + xrep_findroot_agfl_walk( 863 863 struct xfs_mount *mp, 864 864 xfs_agblock_t bno, 865 865 void *priv) ··· 871 871 872 872 /* Does this block match the btree information passed in? */ 873 873 STATIC int 874 - xfs_repair_findroot_block( 875 - struct xfs_repair_findroot *ri, 876 - struct xfs_repair_find_ag_btree *fab, 874 + xrep_findroot_block( 875 + struct xrep_findroot *ri, 876 + struct xrep_find_ag_btree *fab, 877 877 uint64_t owner, 878 878 xfs_agblock_t agbno, 879 879 bool *found_it) ··· 894 894 */ 895 895 if (owner == XFS_RMAP_OWN_AG) { 896 896 error = xfs_agfl_walk(mp, ri->agf, ri->agfl_bp, 897 - xfs_repair_findroot_agfl_walk, &agbno); 897 + xrep_findroot_agfl_walk, &agbno); 898 898 if (error == XFS_BTREE_QUERY_RANGE_ABORT) 899 899 return 0; 900 900 if (error) ··· 932 932 fab->height = xfs_btree_get_level(btblock) + 1; 933 933 *found_it = true; 934 934 935 - trace_xfs_repair_findroot_block(mp, ri->sc->sa.agno, agbno, 935 + trace_xrep_findroot_block(mp, ri->sc->sa.agno, agbno, 936 936 be32_to_cpu(btblock->bb_magic), fab->height - 1); 937 937 out: 938 938 xfs_trans_brelse(ri->sc->tp, bp); ··· 944 944 * looking for? 945 945 */ 946 946 STATIC int 947 - xfs_repair_findroot_rmap( 947 + xrep_findroot_rmap( 948 948 struct xfs_btree_cur *cur, 949 949 struct xfs_rmap_irec *rec, 950 950 void *priv) 951 951 { 952 - struct xfs_repair_findroot *ri = priv; 953 - struct xfs_repair_find_ag_btree *fab; 952 + struct xrep_findroot *ri = priv; 953 + struct xrep_find_ag_btree *fab; 954 954 xfs_agblock_t b; 955 955 bool found_it; 956 956 int error = 0; ··· 965 965 for (fab = ri->btree_info; fab->buf_ops; fab++) { 966 966 if (rec->rm_owner != fab->rmap_owner) 967 967 continue; 968 - error = xfs_repair_findroot_block(ri, fab, 968 + error = xrep_findroot_block(ri, fab, 969 969 rec->rm_owner, rec->rm_startblock + b, 970 970 &found_it); 971 971 if (error) ··· 980 980 981 981 /* Find the roots of the per-AG btrees described in btree_info. */ 982 982 int 983 - xfs_repair_find_ag_btree_roots( 983 + xrep_find_ag_btree_roots( 984 984 struct xfs_scrub_context *sc, 985 985 struct xfs_buf *agf_bp, 986 - struct xfs_repair_find_ag_btree *btree_info, 986 + struct xrep_find_ag_btree *btree_info, 987 987 struct xfs_buf *agfl_bp) 988 988 { 989 989 struct xfs_mount *mp = sc->mp; 990 - struct xfs_repair_findroot ri; 991 - struct xfs_repair_find_ag_btree *fab; 990 + struct xrep_findroot ri; 991 + struct xrep_find_ag_btree *fab; 992 992 struct xfs_btree_cur *cur; 993 993 int error; 994 994 ··· 1007 1007 } 1008 1008 1009 1009 cur = xfs_rmapbt_init_cursor(mp, sc->tp, agf_bp, sc->sa.agno); 1010 - error = xfs_rmap_query_all(cur, xfs_repair_findroot_rmap, &ri); 1010 + error = xfs_rmap_query_all(cur, xrep_findroot_rmap, &ri); 1011 1011 xfs_btree_del_cursor(cur, error); 1012 1012 1013 1013 return error; ··· 1015 1015 1016 1016 /* Force a quotacheck the next time we mount. */ 1017 1017 void 1018 - xfs_repair_force_quotacheck( 1018 + xrep_force_quotacheck( 1019 1019 struct xfs_scrub_context *sc, 1020 1020 uint dqtype) 1021 1021 { ··· 1043 1043 * repair corruptions in the quota metadata. 1044 1044 */ 1045 1045 int 1046 - xfs_repair_ino_dqattach( 1046 + xrep_ino_dqattach( 1047 1047 struct xfs_scrub_context *sc) 1048 1048 { 1049 1049 int error; ··· 1057 1057 "inode %llu repair encountered quota error %d, quotacheck forced.", 1058 1058 (unsigned long long)sc->ip->i_ino, error); 1059 1059 if (XFS_IS_UQUOTA_ON(sc->mp) && !sc->ip->i_udquot) 1060 - xfs_repair_force_quotacheck(sc, XFS_DQ_USER); 1060 + xrep_force_quotacheck(sc, XFS_DQ_USER); 1061 1061 if (XFS_IS_GQUOTA_ON(sc->mp) && !sc->ip->i_gdquot) 1062 - xfs_repair_force_quotacheck(sc, XFS_DQ_GROUP); 1062 + xrep_force_quotacheck(sc, XFS_DQ_GROUP); 1063 1063 if (XFS_IS_PQUOTA_ON(sc->mp) && !sc->ip->i_pdquot) 1064 - xfs_repair_force_quotacheck(sc, XFS_DQ_PROJ); 1064 + xrep_force_quotacheck(sc, XFS_DQ_PROJ); 1065 1065 /* fall through */ 1066 1066 case -ESRCH: 1067 1067 error = 0;
+37 -37
fs/xfs/scrub/repair.h
··· 6 6 #ifndef __XFS_SCRUB_REPAIR_H__ 7 7 #define __XFS_SCRUB_REPAIR_H__ 8 8 9 - static inline int xfs_repair_notsupported(struct xfs_scrub_context *sc) 9 + static inline int xrep_notsupported(struct xfs_scrub_context *sc) 10 10 { 11 11 return -EOPNOTSUPP; 12 12 } ··· 15 15 16 16 /* Repair helpers */ 17 17 18 - int xfs_repair_attempt(struct xfs_inode *ip, struct xfs_scrub_context *sc, 18 + int xrep_attempt(struct xfs_inode *ip, struct xfs_scrub_context *sc, 19 19 bool *fixed); 20 - void xfs_repair_failure(struct xfs_mount *mp); 21 - int xfs_repair_roll_ag_trans(struct xfs_scrub_context *sc); 22 - bool xfs_repair_ag_has_space(struct xfs_perag *pag, xfs_extlen_t nr_blocks, 20 + void xrep_failure(struct xfs_mount *mp); 21 + int xrep_roll_ag_trans(struct xfs_scrub_context *sc); 22 + bool xrep_ag_has_space(struct xfs_perag *pag, xfs_extlen_t nr_blocks, 23 23 enum xfs_ag_resv_type type); 24 - xfs_extlen_t xfs_repair_calc_ag_resblks(struct xfs_scrub_context *sc); 25 - int xfs_repair_alloc_ag_block(struct xfs_scrub_context *sc, 24 + xfs_extlen_t xrep_calc_ag_resblks(struct xfs_scrub_context *sc); 25 + int xrep_alloc_ag_block(struct xfs_scrub_context *sc, 26 26 struct xfs_owner_info *oinfo, xfs_fsblock_t *fsbno, 27 27 enum xfs_ag_resv_type resv); 28 - int xfs_repair_init_btblock(struct xfs_scrub_context *sc, xfs_fsblock_t fsb, 28 + int xrep_init_btblock(struct xfs_scrub_context *sc, xfs_fsblock_t fsb, 29 29 struct xfs_buf **bpp, xfs_btnum_t btnum, 30 30 const struct xfs_buf_ops *ops); 31 31 32 - struct xfs_repair_extent { 32 + struct xrep_extent { 33 33 struct list_head list; 34 34 xfs_fsblock_t fsbno; 35 35 xfs_extlen_t len; 36 36 }; 37 37 38 - struct xfs_repair_extent_list { 38 + struct xrep_extent_list { 39 39 struct list_head list; 40 40 }; 41 41 42 42 static inline void 43 - xfs_repair_init_extent_list( 44 - struct xfs_repair_extent_list *exlist) 43 + xrep_init_extent_list( 44 + struct xrep_extent_list *exlist) 45 45 { 46 46 INIT_LIST_HEAD(&exlist->list); 47 47 } 48 48 49 - #define for_each_xfs_repair_extent_safe(rbe, n, exlist) \ 49 + #define for_each_xrep_extent_safe(rbe, n, exlist) \ 50 50 list_for_each_entry_safe((rbe), (n), &(exlist)->list, list) 51 - int xfs_repair_collect_btree_extent(struct xfs_scrub_context *sc, 52 - struct xfs_repair_extent_list *btlist, xfs_fsblock_t fsbno, 51 + int xrep_collect_btree_extent(struct xfs_scrub_context *sc, 52 + struct xrep_extent_list *btlist, xfs_fsblock_t fsbno, 53 53 xfs_extlen_t len); 54 - void xfs_repair_cancel_btree_extents(struct xfs_scrub_context *sc, 55 - struct xfs_repair_extent_list *btlist); 56 - int xfs_repair_subtract_extents(struct xfs_scrub_context *sc, 57 - struct xfs_repair_extent_list *exlist, 58 - struct xfs_repair_extent_list *sublist); 59 - int xfs_repair_fix_freelist(struct xfs_scrub_context *sc, bool can_shrink); 60 - int xfs_repair_invalidate_blocks(struct xfs_scrub_context *sc, 61 - struct xfs_repair_extent_list *btlist); 62 - int xfs_repair_reap_btree_extents(struct xfs_scrub_context *sc, 63 - struct xfs_repair_extent_list *exlist, 54 + void xrep_cancel_btree_extents(struct xfs_scrub_context *sc, 55 + struct xrep_extent_list *btlist); 56 + int xrep_subtract_extents(struct xfs_scrub_context *sc, 57 + struct xrep_extent_list *exlist, 58 + struct xrep_extent_list *sublist); 59 + int xrep_fix_freelist(struct xfs_scrub_context *sc, bool can_shrink); 60 + int xrep_invalidate_blocks(struct xfs_scrub_context *sc, 61 + struct xrep_extent_list *btlist); 62 + int xrep_reap_btree_extents(struct xfs_scrub_context *sc, 63 + struct xrep_extent_list *exlist, 64 64 struct xfs_owner_info *oinfo, enum xfs_ag_resv_type type); 65 65 66 - struct xfs_repair_find_ag_btree { 66 + struct xrep_find_ag_btree { 67 67 /* in: rmap owner of the btree we're looking for */ 68 68 uint64_t rmap_owner; 69 69 ··· 78 78 unsigned int height; 79 79 }; 80 80 81 - int xfs_repair_find_ag_btree_roots(struct xfs_scrub_context *sc, 81 + int xrep_find_ag_btree_roots(struct xfs_scrub_context *sc, 82 82 struct xfs_buf *agf_bp, 83 - struct xfs_repair_find_ag_btree *btree_info, 83 + struct xrep_find_ag_btree *btree_info, 84 84 struct xfs_buf *agfl_bp); 85 - void xfs_repair_force_quotacheck(struct xfs_scrub_context *sc, uint dqtype); 86 - int xfs_repair_ino_dqattach(struct xfs_scrub_context *sc); 85 + void xrep_force_quotacheck(struct xfs_scrub_context *sc, uint dqtype); 86 + int xrep_ino_dqattach(struct xfs_scrub_context *sc); 87 87 88 88 /* Metadata repairers */ 89 89 90 - int xfs_repair_probe(struct xfs_scrub_context *sc); 91 - int xfs_repair_superblock(struct xfs_scrub_context *sc); 90 + int xrep_probe(struct xfs_scrub_context *sc); 91 + int xrep_superblock(struct xfs_scrub_context *sc); 92 92 93 93 #else 94 94 95 - static inline int xfs_repair_attempt( 95 + static inline int xrep_attempt( 96 96 struct xfs_inode *ip, 97 97 struct xfs_scrub_context *sc, 98 98 bool *fixed) ··· 100 100 return -EOPNOTSUPP; 101 101 } 102 102 103 - static inline void xfs_repair_failure(struct xfs_mount *mp) {} 103 + static inline void xrep_failure(struct xfs_mount *mp) {} 104 104 105 105 static inline xfs_extlen_t 106 - xfs_repair_calc_ag_resblks( 106 + xrep_calc_ag_resblks( 107 107 struct xfs_scrub_context *sc) 108 108 { 109 109 ASSERT(!(sc->sm->sm_flags & XFS_SCRUB_IFLAG_REPAIR)); 110 110 return 0; 111 111 } 112 112 113 - #define xfs_repair_probe xfs_repair_notsupported 114 - #define xfs_repair_superblock xfs_repair_notsupported 113 + #define xrep_probe xrep_notsupported 114 + #define xrep_superblock xrep_notsupported 115 115 116 116 #endif /* CONFIG_XFS_ONLINE_REPAIR */ 117 117
+27 -27
fs/xfs/scrub/scrub.c
··· 202 202 .type = ST_NONE, 203 203 .setup = xchk_setup_fs, 204 204 .scrub = xchk_probe, 205 - .repair = xfs_repair_probe, 205 + .repair = xrep_probe, 206 206 }, 207 207 [XFS_SCRUB_TYPE_SB] = { /* superblock */ 208 208 .type = ST_PERAG, 209 209 .setup = xchk_setup_fs, 210 210 .scrub = xchk_superblock, 211 - .repair = xfs_repair_superblock, 211 + .repair = xrep_superblock, 212 212 }, 213 213 [XFS_SCRUB_TYPE_AGF] = { /* agf */ 214 214 .type = ST_PERAG, 215 215 .setup = xchk_setup_fs, 216 216 .scrub = xchk_agf, 217 - .repair = xfs_repair_notsupported, 217 + .repair = xrep_notsupported, 218 218 }, 219 219 [XFS_SCRUB_TYPE_AGFL]= { /* agfl */ 220 220 .type = ST_PERAG, 221 221 .setup = xchk_setup_fs, 222 222 .scrub = xchk_agfl, 223 - .repair = xfs_repair_notsupported, 223 + .repair = xrep_notsupported, 224 224 }, 225 225 [XFS_SCRUB_TYPE_AGI] = { /* agi */ 226 226 .type = ST_PERAG, 227 227 .setup = xchk_setup_fs, 228 228 .scrub = xchk_agi, 229 - .repair = xfs_repair_notsupported, 229 + .repair = xrep_notsupported, 230 230 }, 231 231 [XFS_SCRUB_TYPE_BNOBT] = { /* bnobt */ 232 232 .type = ST_PERAG, 233 233 .setup = xchk_setup_ag_allocbt, 234 234 .scrub = xchk_bnobt, 235 - .repair = xfs_repair_notsupported, 235 + .repair = xrep_notsupported, 236 236 }, 237 237 [XFS_SCRUB_TYPE_CNTBT] = { /* cntbt */ 238 238 .type = ST_PERAG, 239 239 .setup = xchk_setup_ag_allocbt, 240 240 .scrub = xchk_cntbt, 241 - .repair = xfs_repair_notsupported, 241 + .repair = xrep_notsupported, 242 242 }, 243 243 [XFS_SCRUB_TYPE_INOBT] = { /* inobt */ 244 244 .type = ST_PERAG, 245 245 .setup = xchk_setup_ag_iallocbt, 246 246 .scrub = xchk_inobt, 247 - .repair = xfs_repair_notsupported, 247 + .repair = xrep_notsupported, 248 248 }, 249 249 [XFS_SCRUB_TYPE_FINOBT] = { /* finobt */ 250 250 .type = ST_PERAG, 251 251 .setup = xchk_setup_ag_iallocbt, 252 252 .scrub = xchk_finobt, 253 253 .has = xfs_sb_version_hasfinobt, 254 - .repair = xfs_repair_notsupported, 254 + .repair = xrep_notsupported, 255 255 }, 256 256 [XFS_SCRUB_TYPE_RMAPBT] = { /* rmapbt */ 257 257 .type = ST_PERAG, 258 258 .setup = xchk_setup_ag_rmapbt, 259 259 .scrub = xchk_rmapbt, 260 260 .has = xfs_sb_version_hasrmapbt, 261 - .repair = xfs_repair_notsupported, 261 + .repair = xrep_notsupported, 262 262 }, 263 263 [XFS_SCRUB_TYPE_REFCNTBT] = { /* refcountbt */ 264 264 .type = ST_PERAG, 265 265 .setup = xchk_setup_ag_refcountbt, 266 266 .scrub = xchk_refcountbt, 267 267 .has = xfs_sb_version_hasreflink, 268 - .repair = xfs_repair_notsupported, 268 + .repair = xrep_notsupported, 269 269 }, 270 270 [XFS_SCRUB_TYPE_INODE] = { /* inode record */ 271 271 .type = ST_INODE, 272 272 .setup = xchk_setup_inode, 273 273 .scrub = xchk_inode, 274 - .repair = xfs_repair_notsupported, 274 + .repair = xrep_notsupported, 275 275 }, 276 276 [XFS_SCRUB_TYPE_BMBTD] = { /* inode data fork */ 277 277 .type = ST_INODE, 278 278 .setup = xchk_setup_inode_bmap, 279 279 .scrub = xchk_bmap_data, 280 - .repair = xfs_repair_notsupported, 280 + .repair = xrep_notsupported, 281 281 }, 282 282 [XFS_SCRUB_TYPE_BMBTA] = { /* inode attr fork */ 283 283 .type = ST_INODE, 284 284 .setup = xchk_setup_inode_bmap, 285 285 .scrub = xchk_bmap_attr, 286 - .repair = xfs_repair_notsupported, 286 + .repair = xrep_notsupported, 287 287 }, 288 288 [XFS_SCRUB_TYPE_BMBTC] = { /* inode CoW fork */ 289 289 .type = ST_INODE, 290 290 .setup = xchk_setup_inode_bmap, 291 291 .scrub = xchk_bmap_cow, 292 - .repair = xfs_repair_notsupported, 292 + .repair = xrep_notsupported, 293 293 }, 294 294 [XFS_SCRUB_TYPE_DIR] = { /* directory */ 295 295 .type = ST_INODE, 296 296 .setup = xchk_setup_directory, 297 297 .scrub = xchk_directory, 298 - .repair = xfs_repair_notsupported, 298 + .repair = xrep_notsupported, 299 299 }, 300 300 [XFS_SCRUB_TYPE_XATTR] = { /* extended attributes */ 301 301 .type = ST_INODE, 302 302 .setup = xchk_setup_xattr, 303 303 .scrub = xchk_xattr, 304 - .repair = xfs_repair_notsupported, 304 + .repair = xrep_notsupported, 305 305 }, 306 306 [XFS_SCRUB_TYPE_SYMLINK] = { /* symbolic link */ 307 307 .type = ST_INODE, 308 308 .setup = xchk_setup_symlink, 309 309 .scrub = xchk_symlink, 310 - .repair = xfs_repair_notsupported, 310 + .repair = xrep_notsupported, 311 311 }, 312 312 [XFS_SCRUB_TYPE_PARENT] = { /* parent pointers */ 313 313 .type = ST_INODE, 314 314 .setup = xchk_setup_parent, 315 315 .scrub = xchk_parent, 316 - .repair = xfs_repair_notsupported, 316 + .repair = xrep_notsupported, 317 317 }, 318 318 [XFS_SCRUB_TYPE_RTBITMAP] = { /* realtime bitmap */ 319 319 .type = ST_FS, 320 320 .setup = xchk_setup_rt, 321 321 .scrub = xchk_rtbitmap, 322 322 .has = xfs_sb_version_hasrealtime, 323 - .repair = xfs_repair_notsupported, 323 + .repair = xrep_notsupported, 324 324 }, 325 325 [XFS_SCRUB_TYPE_RTSUM] = { /* realtime summary */ 326 326 .type = ST_FS, 327 327 .setup = xchk_setup_rt, 328 328 .scrub = xchk_rtsummary, 329 329 .has = xfs_sb_version_hasrealtime, 330 - .repair = xfs_repair_notsupported, 330 + .repair = xrep_notsupported, 331 331 }, 332 332 [XFS_SCRUB_TYPE_UQUOTA] = { /* user quota */ 333 333 .type = ST_FS, 334 334 .setup = xchk_setup_quota, 335 335 .scrub = xchk_quota, 336 - .repair = xfs_repair_notsupported, 336 + .repair = xrep_notsupported, 337 337 }, 338 338 [XFS_SCRUB_TYPE_GQUOTA] = { /* group quota */ 339 339 .type = ST_FS, 340 340 .setup = xchk_setup_quota, 341 341 .scrub = xchk_quota, 342 - .repair = xfs_repair_notsupported, 342 + .repair = xrep_notsupported, 343 343 }, 344 344 [XFS_SCRUB_TYPE_PQUOTA] = { /* project quota */ 345 345 .type = ST_FS, 346 346 .setup = xchk_setup_quota, 347 347 .scrub = xchk_quota, 348 - .repair = xfs_repair_notsupported, 348 + .repair = xrep_notsupported, 349 349 }, 350 350 }; 351 351 ··· 457 457 if ((sc->sm->sm_flags & XFS_SCRUB_IFLAG_REPAIR) && 458 458 (sc->sm->sm_flags & (XFS_SCRUB_OFLAG_CORRUPT | 459 459 XFS_SCRUB_OFLAG_XCORRUPT))) 460 - xfs_repair_failure(sc->mp); 460 + xrep_failure(sc->mp); 461 461 } 462 462 #else 463 463 static inline void xchk_postmortem(struct xfs_scrub_context *sc) ··· 555 555 * If it's broken, userspace wants us to fix it, and we haven't 556 556 * already tried to fix it, then attempt a repair. 557 557 */ 558 - error = xfs_repair_attempt(ip, &sc, &already_fixed); 558 + error = xrep_attempt(ip, &sc, &already_fixed); 559 559 if (error == -EAGAIN) { 560 560 if (sc.try_harder) 561 561 try_harder = true; 562 562 error = xchk_teardown(&sc, ip, 0); 563 563 if (error) { 564 - xfs_repair_failure(mp); 564 + xrep_failure(mp); 565 565 goto out; 566 566 } 567 567 goto retry_op;
+20 -20
fs/xfs/scrub/trace.h
··· 55 55 DEFINE_SCRUB_EVENT(xchk_start); 56 56 DEFINE_SCRUB_EVENT(xchk_done); 57 57 DEFINE_SCRUB_EVENT(xchk_deadlock_retry); 58 - DEFINE_SCRUB_EVENT(xfs_repair_attempt); 59 - DEFINE_SCRUB_EVENT(xfs_repair_done); 58 + DEFINE_SCRUB_EVENT(xrep_attempt); 59 + DEFINE_SCRUB_EVENT(xrep_done); 60 60 61 61 TRACE_EVENT(xchk_op_error, 62 62 TP_PROTO(struct xfs_scrub_context *sc, xfs_agnumber_t agno, ··· 483 483 /* repair tracepoints */ 484 484 #if IS_ENABLED(CONFIG_XFS_ONLINE_REPAIR) 485 485 486 - DECLARE_EVENT_CLASS(xfs_repair_extent_class, 486 + DECLARE_EVENT_CLASS(xrep_extent_class, 487 487 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, 488 488 xfs_agblock_t agbno, xfs_extlen_t len), 489 489 TP_ARGS(mp, agno, agbno, len), ··· 506 506 __entry->len) 507 507 ); 508 508 #define DEFINE_REPAIR_EXTENT_EVENT(name) \ 509 - DEFINE_EVENT(xfs_repair_extent_class, name, \ 509 + DEFINE_EVENT(xrep_extent_class, name, \ 510 510 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ 511 511 xfs_agblock_t agbno, xfs_extlen_t len), \ 512 512 TP_ARGS(mp, agno, agbno, len)) 513 - DEFINE_REPAIR_EXTENT_EVENT(xfs_repair_dispose_btree_extent); 514 - DEFINE_REPAIR_EXTENT_EVENT(xfs_repair_collect_btree_extent); 515 - DEFINE_REPAIR_EXTENT_EVENT(xfs_repair_agfl_insert); 513 + DEFINE_REPAIR_EXTENT_EVENT(xrep_dispose_btree_extent); 514 + DEFINE_REPAIR_EXTENT_EVENT(xrep_collect_btree_extent); 515 + DEFINE_REPAIR_EXTENT_EVENT(xrep_agfl_insert); 516 516 517 - DECLARE_EVENT_CLASS(xfs_repair_rmap_class, 517 + DECLARE_EVENT_CLASS(xrep_rmap_class, 518 518 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, 519 519 xfs_agblock_t agbno, xfs_extlen_t len, 520 520 uint64_t owner, uint64_t offset, unsigned int flags), ··· 547 547 __entry->flags) 548 548 ); 549 549 #define DEFINE_REPAIR_RMAP_EVENT(name) \ 550 - DEFINE_EVENT(xfs_repair_rmap_class, name, \ 550 + DEFINE_EVENT(xrep_rmap_class, name, \ 551 551 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ 552 552 xfs_agblock_t agbno, xfs_extlen_t len, \ 553 553 uint64_t owner, uint64_t offset, unsigned int flags), \ 554 554 TP_ARGS(mp, agno, agbno, len, owner, offset, flags)) 555 - DEFINE_REPAIR_RMAP_EVENT(xfs_repair_alloc_extent_fn); 556 - DEFINE_REPAIR_RMAP_EVENT(xfs_repair_ialloc_extent_fn); 557 - DEFINE_REPAIR_RMAP_EVENT(xfs_repair_rmap_extent_fn); 558 - DEFINE_REPAIR_RMAP_EVENT(xfs_repair_bmap_extent_fn); 555 + DEFINE_REPAIR_RMAP_EVENT(xrep_alloc_extent_fn); 556 + DEFINE_REPAIR_RMAP_EVENT(xrep_ialloc_extent_fn); 557 + DEFINE_REPAIR_RMAP_EVENT(xrep_rmap_extent_fn); 558 + DEFINE_REPAIR_RMAP_EVENT(xrep_bmap_extent_fn); 559 559 560 - TRACE_EVENT(xfs_repair_refcount_extent_fn, 560 + TRACE_EVENT(xrep_refcount_extent_fn, 561 561 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, 562 562 struct xfs_refcount_irec *irec), 563 563 TP_ARGS(mp, agno, irec), ··· 583 583 __entry->refcount) 584 584 ) 585 585 586 - TRACE_EVENT(xfs_repair_init_btblock, 586 + TRACE_EVENT(xrep_init_btblock, 587 587 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno, 588 588 xfs_btnum_t btnum), 589 589 TP_ARGS(mp, agno, agbno, btnum), ··· 605 605 __entry->agbno, 606 606 __entry->btnum) 607 607 ) 608 - TRACE_EVENT(xfs_repair_findroot_block, 608 + TRACE_EVENT(xrep_findroot_block, 609 609 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno, 610 610 uint32_t magic, uint16_t level), 611 611 TP_ARGS(mp, agno, agbno, magic, level), ··· 630 630 __entry->magic, 631 631 __entry->level) 632 632 ) 633 - TRACE_EVENT(xfs_repair_calc_ag_resblks, 633 + TRACE_EVENT(xrep_calc_ag_resblks, 634 634 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, 635 635 xfs_agino_t icount, xfs_agblock_t aglen, xfs_agblock_t freelen, 636 636 xfs_agblock_t usedlen), ··· 659 659 __entry->freelen, 660 660 __entry->usedlen) 661 661 ) 662 - TRACE_EVENT(xfs_repair_calc_ag_resblks_btsize, 662 + TRACE_EVENT(xrep_calc_ag_resblks_btsize, 663 663 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, 664 664 xfs_agblock_t bnobt_sz, xfs_agblock_t inobt_sz, 665 665 xfs_agblock_t rmapbt_sz, xfs_agblock_t refcbt_sz), ··· 688 688 __entry->rmapbt_sz, 689 689 __entry->refcbt_sz) 690 690 ) 691 - TRACE_EVENT(xfs_repair_reset_counters, 691 + TRACE_EVENT(xrep_reset_counters, 692 692 TP_PROTO(struct xfs_mount *mp), 693 693 TP_ARGS(mp), 694 694 TP_STRUCT__entry( ··· 701 701 MAJOR(__entry->dev), MINOR(__entry->dev)) 702 702 ) 703 703 704 - TRACE_EVENT(xfs_repair_ialloc_insert, 704 + TRACE_EVENT(xrep_ialloc_insert, 705 705 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, 706 706 xfs_agino_t startino, uint16_t holemask, uint8_t count, 707 707 uint8_t freecount, uint64_t freemask),