Lines Matching refs:sm
173 if (error == 0 && (sc->sm->sm_flags & XFS_SCRUB_IFLAG_REPAIR)) in xchk_teardown()
368 struct xfs_scrub_metadata *sm) in xchk_validate_inputs() argument
375 sm->sm_flags &= ~XFS_SCRUB_FLAGS_OUT; in xchk_validate_inputs()
376 if (sm->sm_flags & ~XFS_SCRUB_FLAGS_IN) in xchk_validate_inputs()
379 if (memchr_inv(sm->sm_reserved, 0, sizeof(sm->sm_reserved))) in xchk_validate_inputs()
384 if (sm->sm_type >= XFS_SCRUB_TYPE_NR) in xchk_validate_inputs()
386 ops = &meta_scrub_ops[sm->sm_type]; in xchk_validate_inputs()
398 if (sm->sm_ino || sm->sm_gen || sm->sm_agno) in xchk_validate_inputs()
402 if (sm->sm_ino || sm->sm_gen || in xchk_validate_inputs()
403 sm->sm_agno >= mp->m_sb.sb_agcount) in xchk_validate_inputs()
407 if (sm->sm_agno || (sm->sm_gen && !sm->sm_ino)) in xchk_validate_inputs()
415 if ((sm->sm_flags & XFS_SCRUB_IFLAG_FORCE_REBUILD) && in xchk_validate_inputs()
416 !(sm->sm_flags & XFS_SCRUB_IFLAG_REPAIR)) in xchk_validate_inputs()
425 if (sm->sm_flags & XFS_SCRUB_IFLAG_REPAIR) { in xchk_validate_inputs()
448 if ((sc->sm->sm_flags & XFS_SCRUB_IFLAG_REPAIR) && in xchk_postmortem()
449 (sc->sm->sm_flags & (XFS_SCRUB_OFLAG_CORRUPT | in xchk_postmortem()
460 if (sc->sm->sm_flags & (XFS_SCRUB_OFLAG_CORRUPT | in xchk_postmortem()
471 struct xfs_scrub_metadata *sm) in xfs_scrub_metadata() argument
482 trace_xchk_start(XFS_I(file_inode(file)), sm, error); in xfs_scrub_metadata()
492 error = xchk_validate_inputs(mp, sm); in xfs_scrub_metadata()
507 sc->sm = sm; in xfs_scrub_metadata()
508 sc->ops = &meta_scrub_ops[sm->sm_type]; in xfs_scrub_metadata()
509 sc->sick_mask = xchk_health_mask_for_scrub_type(sm->sm_type); in xfs_scrub_metadata()
515 if (sm->sm_flags & XFS_SCRUB_IFLAG_REPAIR) { in xfs_scrub_metadata()
540 if (error || (sm->sm_flags & XFS_SCRUB_OFLAG_INCOMPLETE)) in xfs_scrub_metadata()
545 if ((sc->sm->sm_flags & XFS_SCRUB_IFLAG_REPAIR) && in xfs_scrub_metadata()
547 bool needs_fix = xchk_needs_repair(sc->sm); in xfs_scrub_metadata()
550 if (sc->sm->sm_flags & XFS_SCRUB_IFLAG_FORCE_REBUILD) in xfs_scrub_metadata()
562 sc->sm->sm_flags |= XFS_SCRUB_OFLAG_NO_REPAIR_NEEDED; in xfs_scrub_metadata()
592 xchk_stats_merge(mp, sm, &run); in xfs_scrub_metadata()
595 trace_xchk_done(XFS_I(file_inode(file)), sm, error); in xfs_scrub_metadata()
597 sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT; in xfs_scrub_metadata()