Lines Matching defs:sc

35 	struct xfs_scrub	*sc)
39 if (xchk_could_repair(sc)) {
40 error = xrep_setup_directory(sc);
45 return xchk_setup_inode_contents(sc, 0);
63 struct xfs_scrub *sc;
88 struct xfs_scrub *sc,
93 struct xfs_mount *mp = sc->mp;
97 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
102 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
111 struct xfs_scrub *sc,
142 struct xfs_scrub *sc = sd->sc;
145 xfs_inode_to_parent_rec(&sd->pptr_rec, sc->ip);
146 error = xfs_parent_lookup(sc->tp, ip, name, &sd->pptr_rec,
149 xchk_fblock_xref_set_corrupt(sc, XFS_DATA_FORK, 0);
162 struct xfs_scrub *sc = sd->sc;
172 if (ip == sc->ip) {
173 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
178 lockmode = xchk_dir_lock_child(sc, ip);
186 trace_xchk_dir_defer(sc->ip, name, ip->i_ino);
190 if (!xchk_fblock_xref_process_error(sc, XFS_DATA_FORK, 0,
195 if (!xchk_fblock_xref_process_error(sc, XFS_DATA_FORK, 0,
215 struct xfs_scrub *sc,
232 if (xchk_should_terminate(sc, &error))
237 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
243 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
250 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
257 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
261 error = xchk_dir_lookup(sc, dp, name, &lookup_ino);
265 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, offset, &error))
268 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
281 error = xchk_iget(sc, ino, &ip);
284 xchk_fblock_process_error(sc, XFS_DATA_FORK, 0, &error);
287 if (!xchk_fblock_xref_process_error(sc, XFS_DATA_FORK, offset, &error))
290 xchk_dir_check_ftype(sc, offset, ip, name->type);
299 xchk_irele(sc, ip);
301 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
360 if (!xchk_fblock_process_error(ds->sc, XFS_DATA_FORK, rec_bno,
364 xchk_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno);
367 xchk_buffer_recheck(ds->sc, bp);
369 if (ds->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
378 xchk_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno);
386 xchk_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno);
404 xchk_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno);
406 xchk_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno);
415 xchk_fblock_set_corrupt(ds->sc, XFS_DATA_FORK, rec_bno);
430 struct xfs_scrub *sc,
449 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
455 struct xfs_scrub *sc,
463 struct xfs_mount *mp = sc->mp;
476 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
477 error = xfs_dir3_block_read(sc->tp, sc->ip, sc->ip->i_ino, &bp);
480 error = xfs_dir3_data_read(sc->tp, sc->ip, sc->ip->i_ino, lblk,
483 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, lblk, &error))
485 xchk_buffer_recheck(sc, bp);
489 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
500 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
510 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
516 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
538 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK,
549 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
557 xchk_directory_check_free_entry(sc, lblk, bf, dup);
558 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
564 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
574 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
578 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
580 xfs_trans_brelse(sc->tp, bp);
593 struct xfs_scrub *sc,
600 dfp = xfs_dir2_data_bestfree_p(sc->mp, dbp->b_addr);
603 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
606 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
612 struct xfs_scrub *sc,
622 struct xfs_da_geometry *geo = sc->mp->m_dir_geo;
633 error = xfs_dir3_leaf_read(sc->tp, sc->ip, sc->ip->i_ino, lblk, &bp);
634 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, lblk, &error))
636 xchk_buffer_recheck(sc, bp);
639 xfs_dir2_leaf_hdr_from_disk(sc->ip->i_mount, &leafhdr, leaf);
644 if (xfs_has_crc(sc->mp)) {
648 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
660 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
666 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
672 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
680 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
687 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
688 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
694 error = xfs_dir3_data_read(sc->tp, sc->ip, args->owner,
697 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, lblk,
703 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK,
711 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
713 xchk_directory_check_freesp(sc, lblk, dbp, best);
714 xfs_trans_brelse(sc->tp, dbp);
715 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
719 xfs_trans_brelse(sc->tp, bp);
726 struct xfs_scrub *sc,
739 error = xfs_dir2_free_read(sc->tp, sc->ip, sc->ip->i_ino, lblk, &bp);
740 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, lblk, &error))
742 xchk_buffer_recheck(sc, bp);
744 if (xfs_has_crc(sc->mp)) {
748 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
752 xfs_dir2_free_hdr_from_disk(sc->ip->i_mount, &freehdr, bp->b_addr);
759 error = xfs_dir3_data_read(sc->tp, sc->ip, args->owner,
762 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, lblk,
765 xchk_directory_check_freesp(sc, lblk, dbp, best);
766 xfs_trans_brelse(sc->tp, dbp);
770 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
772 xfs_trans_brelse(sc->tp, bp);
779 struct xfs_scrub *sc)
783 .dp = sc->ip,
785 .geo = sc->mp->m_dir_geo,
786 .trans = sc->tp,
787 .owner = sc->ip->i_ino,
789 struct xfs_ifork *ifp = xfs_ifork_ptr(sc->ip, XFS_DATA_FORK);
790 struct xfs_mount *mp = sc->mp;
813 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, lblk, &error))
817 found = xfs_iext_lookup_extent(sc->ip, ifp, lblk, &icur, &got);
818 while (found && !(sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)) {
839 error = xchk_directory_data_bestfree(sc, lblk,
846 found = xfs_iext_lookup_extent(sc->ip, ifp, lblk, &icur, &got);
849 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
853 if (xfs_iext_lookup_extent(sc->ip, ifp, leaf_lblk, &icur, &got) &&
858 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
861 error = xchk_directory_leaf1_bestfree(sc, &args, last_data_db,
867 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
872 found = xfs_iext_lookup_extent(sc->ip, ifp, lblk, &icur, &got);
873 while (found && !(sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)) {
880 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
884 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
903 error = xchk_directory_free_bestfree(sc, &args,
910 found = xfs_iext_lookup_extent(sc->ip, ifp, lblk, &icur, &got);
927 struct xfs_scrub *sc = sd->sc;
936 error = xchk_dir_lookup(sc, sc->ip, xname, &child_ino);
957 struct xfs_scrub *sc = sd->sc;
967 if (!xchk_fblock_xref_process_error(sc, XFS_DATA_FORK, 0,
972 error = xchk_iget(sc, dirent->ino, &ip);
974 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
977 if (!xchk_fblock_xref_process_error(sc, XFS_DATA_FORK, 0, &error))
984 lockmode = xchk_dir_lock_child(sc, ip);
986 trace_xchk_dir_slowpath(sc->ip, xname, ip->i_ino);
994 xchk_iunlock(sc, sc->ilock_flags);
997 trace_xchk_dir_ultraslowpath(sc->ip, xname, ip->i_ino);
999 error = xchk_dir_trylock_for_pptrs(sc, ip, &lockmode);
1009 if (!xchk_fblock_xref_process_error(sc, XFS_DATA_FORK, 0, &error))
1017 xchk_irele(sc, ip);
1032 if (sd->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
1055 struct xfs_scrub *sc)
1060 if (!S_ISDIR(VFS_I(sc->ip)->i_mode))
1063 if (xchk_file_looks_zapped(sc, XFS_SICK_INO_DIR_ZAPPED)) {
1064 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
1069 if (sc->ip->i_disk_size < xfs_dir2_sf_hdr_size(0)) {
1070 xchk_ino_set_corrupt(sc, sc->ip->i_ino);
1075 error = xchk_da_btree(sc, XFS_DATA_FORK, xchk_dir_rec, NULL);
1079 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
1083 error = xchk_directory_blocks(sc);
1087 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
1093 sd->sc = sc;
1096 if (xfs_has_parent(sc->mp)) {
1103 descr = xchk_xfile_ino_descr(sc, "slow directory entries");
1110 descr = xchk_xfile_ino_descr(sc, "slow directory entry names");
1118 error = xchk_dir_walk(sc, sc->ip, xchk_dir_actor, sd);
1124 if (xfs_has_parent(sc->mp)) {
1147 xchk_mark_healthy_if_clean(sc, XFS_SICK_INO_DIR_ZAPPED);