Lines Matching full:sc
25 struct xfs_scrub *sc, in xchk_setup_directory() argument
28 return xchk_setup_inode_contents(sc, ip, 0); in xchk_setup_directory()
39 struct xfs_scrub *sc; member
50 struct xfs_mount *mp = sdc->sc->mp; in xchk_dir_check_ftype()
57 xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK, in xchk_dir_check_ftype()
70 error = xfs_iget(mp, sdc->sc->tp, inum, 0, 0, &ip); in xchk_dir_check_ftype()
71 if (!xchk_fblock_xref_process_error(sdc->sc, XFS_DATA_FORK, offset, in xchk_dir_check_ftype()
79 xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK, offset); in xchk_dir_check_ftype()
111 ip = sdc->sc->ip; in xchk_dir_actor()
116 if (xchk_should_terminate(sdc->sc, &error)) in xchk_dir_actor()
121 xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK, offset); in xchk_dir_actor()
127 xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK, offset); in xchk_dir_actor()
134 xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK, in xchk_dir_actor()
137 xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK, in xchk_dir_actor()
145 xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK, in xchk_dir_actor()
148 xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK, in xchk_dir_actor()
157 error = xfs_dir_lookup(sdc->sc->tp, ip, &xname, &lookup_ino, NULL); in xchk_dir_actor()
161 if (!xchk_fblock_process_error(sdc->sc, XFS_DATA_FORK, offset, in xchk_dir_actor()
165 xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK, offset); in xchk_dir_actor()
179 if (error == 0 && sdc->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_dir_actor()
237 if (!xchk_fblock_process_error(ds->sc, XFS_DATA_FORK, rec_bno, in xchk_dir_rec()
241 xchk_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno); in xchk_dir_rec()
244 xchk_buffer_recheck(ds->sc, bp); in xchk_dir_rec()
246 if (ds->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_dir_rec()
255 xchk_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno); in xchk_dir_rec()
263 xchk_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno); in xchk_dir_rec()
281 xchk_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno); in xchk_dir_rec()
283 xchk_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno); in xchk_dir_rec()
288 xchk_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno); in xchk_dir_rec()
303 struct xfs_scrub *sc, in xchk_directory_check_free_entry() argument
322 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_check_free_entry()
328 struct xfs_scrub *sc, in xchk_directory_data_bestfree() argument
336 struct xfs_mount *mp = sc->mp; in xchk_directory_data_bestfree()
349 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_data_bestfree()
350 error = xfs_dir3_block_read(sc->tp, sc->ip, &bp); in xchk_directory_data_bestfree()
353 error = xfs_dir3_data_read(sc->tp, sc->ip, lblk, 0, &bp); in xchk_directory_data_bestfree()
355 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, lblk, &error)) in xchk_directory_data_bestfree()
357 xchk_buffer_recheck(sc, bp); in xchk_directory_data_bestfree()
361 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_directory_data_bestfree()
372 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_data_bestfree()
382 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_data_bestfree()
388 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_data_bestfree()
410 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, in xchk_directory_data_bestfree()
421 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_data_bestfree()
429 xchk_directory_check_free_entry(sc, lblk, bf, dup); in xchk_directory_data_bestfree()
430 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_directory_data_bestfree()
436 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_data_bestfree()
446 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_data_bestfree()
450 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_data_bestfree()
452 xfs_trans_brelse(sc->tp, bp); in xchk_directory_data_bestfree()
465 struct xfs_scrub *sc, in xchk_directory_check_freesp() argument
472 dfp = xfs_dir2_data_bestfree_p(sc->mp, dbp->b_addr); in xchk_directory_check_freesp()
475 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_check_freesp()
478 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_check_freesp()
484 struct xfs_scrub *sc, in xchk_directory_leaf1_bestfree() argument
493 struct xfs_da_geometry *geo = sc->mp->m_dir_geo; in xchk_directory_leaf1_bestfree()
504 error = xfs_dir3_leaf_read(sc->tp, sc->ip, lblk, &bp); in xchk_directory_leaf1_bestfree()
505 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, lblk, &error)) in xchk_directory_leaf1_bestfree()
507 xchk_buffer_recheck(sc, bp); in xchk_directory_leaf1_bestfree()
510 xfs_dir2_leaf_hdr_from_disk(sc->ip->i_mount, &leafhdr, leaf); in xchk_directory_leaf1_bestfree()
515 if (xfs_sb_version_hascrc(&sc->mp->m_sb)) { in xchk_directory_leaf1_bestfree()
519 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_leaf1_bestfree()
526 if (bestcount != xfs_dir2_byte_to_db(geo, sc->ip->i_d.di_size)) { in xchk_directory_leaf1_bestfree()
527 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_leaf1_bestfree()
533 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_leaf1_bestfree()
539 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_leaf1_bestfree()
547 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_leaf1_bestfree()
554 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_leaf1_bestfree()
555 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_directory_leaf1_bestfree()
561 error = xfs_dir3_data_read(sc->tp, sc->ip, in xchk_directory_leaf1_bestfree()
565 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, lblk, in xchk_directory_leaf1_bestfree()
571 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, in xchk_directory_leaf1_bestfree()
579 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_leaf1_bestfree()
581 xchk_directory_check_freesp(sc, lblk, dbp, best); in xchk_directory_leaf1_bestfree()
582 xfs_trans_brelse(sc->tp, dbp); in xchk_directory_leaf1_bestfree()
583 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_directory_leaf1_bestfree()
587 xfs_trans_brelse(sc->tp, bp); in xchk_directory_leaf1_bestfree()
594 struct xfs_scrub *sc, in xchk_directory_free_bestfree() argument
607 error = xfs_dir2_free_read(sc->tp, sc->ip, lblk, &bp); in xchk_directory_free_bestfree()
608 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, lblk, &error)) in xchk_directory_free_bestfree()
610 xchk_buffer_recheck(sc, bp); in xchk_directory_free_bestfree()
612 if (xfs_sb_version_hascrc(&sc->mp->m_sb)) { in xchk_directory_free_bestfree()
616 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_free_bestfree()
620 xfs_dir2_free_hdr_from_disk(sc->ip->i_mount, &freehdr, bp->b_addr); in xchk_directory_free_bestfree()
627 error = xfs_dir3_data_read(sc->tp, sc->ip, in xchk_directory_free_bestfree()
630 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, lblk, in xchk_directory_free_bestfree()
633 xchk_directory_check_freesp(sc, lblk, dbp, best); in xchk_directory_free_bestfree()
634 xfs_trans_brelse(sc->tp, dbp); in xchk_directory_free_bestfree()
638 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_free_bestfree()
640 xfs_trans_brelse(sc->tp, bp); in xchk_directory_free_bestfree()
647 struct xfs_scrub *sc) in xchk_directory_blocks() argument
651 struct xfs_ifork *ifp = XFS_IFORK_PTR(sc->ip, XFS_DATA_FORK); in xchk_directory_blocks()
652 struct xfs_mount *mp = sc->mp; in xchk_directory_blocks()
672 args.dp = sc->ip; in xchk_directory_blocks()
674 args.trans = sc->tp; in xchk_directory_blocks()
676 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, lblk, &error)) in xchk_directory_blocks()
680 found = xfs_iext_lookup_extent(sc->ip, ifp, lblk, &icur, &got); in xchk_directory_blocks()
681 while (found && !(sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)) { in xchk_directory_blocks()
686 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, in xchk_directory_blocks()
710 error = xchk_directory_data_bestfree(sc, lblk, in xchk_directory_blocks()
717 found = xfs_iext_lookup_extent(sc->ip, ifp, lblk, &icur, &got); in xchk_directory_blocks()
720 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_directory_blocks()
724 if (xfs_iext_lookup_extent(sc->ip, ifp, leaf_lblk, &icur, &got) && in xchk_directory_blocks()
729 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_blocks()
732 error = xchk_directory_leaf1_bestfree(sc, &args, in xchk_directory_blocks()
738 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_directory_blocks()
743 found = xfs_iext_lookup_extent(sc->ip, ifp, lblk, &icur, &got); in xchk_directory_blocks()
744 while (found && !(sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)) { in xchk_directory_blocks()
751 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_blocks()
755 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_blocks()
774 error = xchk_directory_free_bestfree(sc, &args, in xchk_directory_blocks()
781 found = xfs_iext_lookup_extent(sc->ip, ifp, lblk, &icur, &got); in xchk_directory_blocks()
790 struct xfs_scrub *sc) in xchk_directory() argument
795 .sc = sc, in xchk_directory()
801 if (!S_ISDIR(VFS_I(sc->ip)->i_mode)) in xchk_directory()
805 if (sc->ip->i_d.di_size < xfs_dir2_sf_hdr_size(0)) { in xchk_directory()
806 xchk_ino_set_corrupt(sc, sc->ip->i_ino); in xchk_directory()
811 error = xchk_da_btree(sc, XFS_DATA_FORK, xchk_dir_rec, NULL); in xchk_directory()
815 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_directory()
819 error = xchk_directory_blocks(sc); in xchk_directory()
823 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_directory()
831 sc->ip->i_d.di_size); in xchk_directory()
850 sc->ilock_flags &= ~XFS_ILOCK_EXCL; in xchk_directory()
851 xfs_iunlock(sc->ip, XFS_ILOCK_EXCL); in xchk_directory()
853 error = xfs_readdir(sc->tp, sc->ip, &sdc.dir_iter, bufsize); in xchk_directory()
854 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, 0, in xchk_directory()