• Home
  • Raw
  • Download

Lines Matching refs:sc

25 	struct xfs_scrub	*sc)  in xchk_setup_directory()  argument
27 return xchk_setup_inode_contents(sc, 0); in xchk_setup_directory()
38 struct xfs_scrub *sc; member
49 struct xfs_mount *mp = sdc->sc->mp; in xchk_dir_check_ftype()
56 xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK, in xchk_dir_check_ftype()
74 error = xfs_iget(mp, sdc->sc->tp, inum, 0, 0, &ip); in xchk_dir_check_ftype()
77 xchk_fblock_process_error(sdc->sc, XFS_DATA_FORK, 0, &error); in xchk_dir_check_ftype()
80 if (!xchk_fblock_xref_process_error(sdc->sc, XFS_DATA_FORK, offset, in xchk_dir_check_ftype()
88 xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK, offset); in xchk_dir_check_ftype()
121 ip = sdc->sc->ip; in xchk_dir_actor()
126 if (xchk_should_terminate(sdc->sc, &error)) in xchk_dir_actor()
131 xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK, offset); in xchk_dir_actor()
137 xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK, offset); in xchk_dir_actor()
144 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()
156 xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK, in xchk_dir_actor()
160 xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK, in xchk_dir_actor()
169 error = xfs_dir_lookup(sdc->sc->tp, ip, &xname, &lookup_ino, NULL); in xchk_dir_actor()
173 if (!xchk_fblock_process_error(sdc->sc, XFS_DATA_FORK, offset, in xchk_dir_actor()
177 xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK, offset); in xchk_dir_actor()
193 if (error == 0 && sdc->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_dir_actor()
251 if (!xchk_fblock_process_error(ds->sc, XFS_DATA_FORK, rec_bno, in xchk_dir_rec()
255 xchk_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno); in xchk_dir_rec()
258 xchk_buffer_recheck(ds->sc, bp); in xchk_dir_rec()
260 if (ds->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_dir_rec()
269 xchk_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno); in xchk_dir_rec()
277 xchk_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno); in xchk_dir_rec()
295 xchk_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno); in xchk_dir_rec()
297 xchk_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno); in xchk_dir_rec()
302 xchk_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno); in xchk_dir_rec()
317 struct xfs_scrub *sc, in xchk_directory_check_free_entry() argument
336 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_check_free_entry()
342 struct xfs_scrub *sc, in xchk_directory_data_bestfree() argument
350 struct xfs_mount *mp = sc->mp; in xchk_directory_data_bestfree()
363 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_data_bestfree()
364 error = xfs_dir3_block_read(sc->tp, sc->ip, &bp); in xchk_directory_data_bestfree()
367 error = xfs_dir3_data_read(sc->tp, sc->ip, lblk, 0, &bp); in xchk_directory_data_bestfree()
369 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, lblk, &error)) in xchk_directory_data_bestfree()
371 xchk_buffer_recheck(sc, bp); in xchk_directory_data_bestfree()
375 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_directory_data_bestfree()
386 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_data_bestfree()
396 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_data_bestfree()
402 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_data_bestfree()
424 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, in xchk_directory_data_bestfree()
435 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_data_bestfree()
443 xchk_directory_check_free_entry(sc, lblk, bf, dup); in xchk_directory_data_bestfree()
444 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_directory_data_bestfree()
450 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_data_bestfree()
460 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_data_bestfree()
464 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_data_bestfree()
466 xfs_trans_brelse(sc->tp, bp); in xchk_directory_data_bestfree()
479 struct xfs_scrub *sc, in xchk_directory_check_freesp() argument
486 dfp = xfs_dir2_data_bestfree_p(sc->mp, dbp->b_addr); in xchk_directory_check_freesp()
489 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_check_freesp()
492 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_check_freesp()
498 struct xfs_scrub *sc, in xchk_directory_leaf1_bestfree() argument
507 struct xfs_da_geometry *geo = sc->mp->m_dir_geo; in xchk_directory_leaf1_bestfree()
518 error = xfs_dir3_leaf_read(sc->tp, sc->ip, lblk, &bp); in xchk_directory_leaf1_bestfree()
519 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, lblk, &error)) in xchk_directory_leaf1_bestfree()
521 xchk_buffer_recheck(sc, bp); in xchk_directory_leaf1_bestfree()
524 xfs_dir2_leaf_hdr_from_disk(sc->ip->i_mount, &leafhdr, leaf); in xchk_directory_leaf1_bestfree()
529 if (xfs_has_crc(sc->mp)) { in xchk_directory_leaf1_bestfree()
533 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_leaf1_bestfree()
540 if (bestcount != xfs_dir2_byte_to_db(geo, sc->ip->i_disk_size)) { in xchk_directory_leaf1_bestfree()
541 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()
553 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_leaf1_bestfree()
561 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_leaf1_bestfree()
568 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_leaf1_bestfree()
569 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_directory_leaf1_bestfree()
575 error = xfs_dir3_data_read(sc->tp, sc->ip, in xchk_directory_leaf1_bestfree()
579 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, lblk, in xchk_directory_leaf1_bestfree()
585 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, in xchk_directory_leaf1_bestfree()
593 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_leaf1_bestfree()
595 xchk_directory_check_freesp(sc, lblk, dbp, best); in xchk_directory_leaf1_bestfree()
596 xfs_trans_brelse(sc->tp, dbp); in xchk_directory_leaf1_bestfree()
597 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_directory_leaf1_bestfree()
601 xfs_trans_brelse(sc->tp, bp); in xchk_directory_leaf1_bestfree()
608 struct xfs_scrub *sc, in xchk_directory_free_bestfree() argument
621 error = xfs_dir2_free_read(sc->tp, sc->ip, lblk, &bp); in xchk_directory_free_bestfree()
622 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, lblk, &error)) in xchk_directory_free_bestfree()
624 xchk_buffer_recheck(sc, bp); in xchk_directory_free_bestfree()
626 if (xfs_has_crc(sc->mp)) { in xchk_directory_free_bestfree()
630 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_free_bestfree()
634 xfs_dir2_free_hdr_from_disk(sc->ip->i_mount, &freehdr, bp->b_addr); in xchk_directory_free_bestfree()
641 error = xfs_dir3_data_read(sc->tp, sc->ip, in xchk_directory_free_bestfree()
644 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, lblk, in xchk_directory_free_bestfree()
647 xchk_directory_check_freesp(sc, lblk, dbp, best); in xchk_directory_free_bestfree()
648 xfs_trans_brelse(sc->tp, dbp); in xchk_directory_free_bestfree()
652 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_free_bestfree()
654 xfs_trans_brelse(sc->tp, bp); in xchk_directory_free_bestfree()
661 struct xfs_scrub *sc) in xchk_directory_blocks() argument
665 struct xfs_ifork *ifp = XFS_IFORK_PTR(sc->ip, XFS_DATA_FORK); in xchk_directory_blocks()
666 struct xfs_mount *mp = sc->mp; in xchk_directory_blocks()
686 args.dp = sc->ip; in xchk_directory_blocks()
688 args.trans = sc->tp; in xchk_directory_blocks()
690 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, lblk, &error)) in xchk_directory_blocks()
694 found = xfs_iext_lookup_extent(sc->ip, ifp, lblk, &icur, &got); in xchk_directory_blocks()
695 while (found && !(sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)) { in xchk_directory_blocks()
715 error = xchk_directory_data_bestfree(sc, lblk, in xchk_directory_blocks()
722 found = xfs_iext_lookup_extent(sc->ip, ifp, lblk, &icur, &got); in xchk_directory_blocks()
725 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_directory_blocks()
729 if (xfs_iext_lookup_extent(sc->ip, ifp, leaf_lblk, &icur, &got) && in xchk_directory_blocks()
734 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_blocks()
737 error = xchk_directory_leaf1_bestfree(sc, &args, in xchk_directory_blocks()
743 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_directory_blocks()
748 found = xfs_iext_lookup_extent(sc->ip, ifp, lblk, &icur, &got); in xchk_directory_blocks()
749 while (found && !(sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)) { in xchk_directory_blocks()
756 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_blocks()
760 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk); in xchk_directory_blocks()
779 error = xchk_directory_free_bestfree(sc, &args, in xchk_directory_blocks()
786 found = xfs_iext_lookup_extent(sc->ip, ifp, lblk, &icur, &got); in xchk_directory_blocks()
795 struct xfs_scrub *sc) in xchk_directory() argument
800 .sc = sc, in xchk_directory()
806 if (!S_ISDIR(VFS_I(sc->ip)->i_mode)) in xchk_directory()
810 if (sc->ip->i_disk_size < xfs_dir2_sf_hdr_size(0)) { in xchk_directory()
811 xchk_ino_set_corrupt(sc, sc->ip->i_ino); in xchk_directory()
816 error = xchk_da_btree(sc, XFS_DATA_FORK, xchk_dir_rec, NULL); in xchk_directory()
820 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_directory()
824 error = xchk_directory_blocks(sc); in xchk_directory()
828 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_directory()
836 sc->ip->i_disk_size); in xchk_directory()
855 sc->ilock_flags &= ~XFS_ILOCK_EXCL; in xchk_directory()
856 xfs_iunlock(sc->ip, XFS_ILOCK_EXCL); in xchk_directory()
858 error = xfs_readdir(sc->tp, sc->ip, &sdc.dir_iter, bufsize); in xchk_directory()
859 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, 0, in xchk_directory()