Lines Matching full:ri

149 	struct xrep_inode	*ri;  in xrep_setup_inode()  local
155 ri = sc->buf; in xrep_setup_inode()
156 memcpy(&ri->imap, imap, sizeof(struct xfs_imap)); in xrep_setup_inode()
157 ri->sc = sc; in xrep_setup_inode()
251 struct xrep_inode *ri = priv; in xrep_dinode_findmode_dirent() local
254 if (xchk_should_terminate(ri->sc, &error)) in xrep_dinode_findmode_dirent()
273 if (ri->alleged_ftype != XFS_DIR3_FT_UNKNOWN && in xrep_dinode_findmode_dirent()
274 ri->alleged_ftype != name->type) { in xrep_dinode_findmode_dirent()
275 trace_xrep_dinode_findmode_dirent_inval(ri->sc, dp, name->type, in xrep_dinode_findmode_dirent()
276 ri->alleged_ftype); in xrep_dinode_findmode_dirent()
281 trace_xrep_dinode_findmode_dirent(ri->sc, dp, name->type); in xrep_dinode_findmode_dirent()
282 ri->alleged_ftype = name->type; in xrep_dinode_findmode_dirent()
306 struct xrep_inode *ri, in xrep_dinode_trylock_directory() argument
315 if (xchk_should_terminate(ri->sc, &error)) in xrep_dinode_trylock_directory()
337 struct xrep_inode *ri, in xrep_dinode_findmode_walk_directory() argument
340 struct xfs_scrub *sc = ri->sc; in xrep_dinode_findmode_walk_directory()
352 error = xrep_dinode_trylock_directory(ri, dp, &lock_mode); in xrep_dinode_findmode_walk_directory()
376 error = xchk_dir_walk(sc, dp, xrep_dinode_findmode_dirent, ri); in xrep_dinode_findmode_walk_directory()
391 struct xrep_inode *ri, in xrep_dinode_find_mode() argument
394 struct xfs_scrub *sc = ri->sc; in xrep_dinode_find_mode()
410 xchk_iscan_start(sc, 5000, 100, &ri->ftype_iscan); in xrep_dinode_find_mode()
411 xchk_iscan_set_agi_trylock(&ri->ftype_iscan); in xrep_dinode_find_mode()
412 ri->ftype_iscan.skip_ino = sc->sm->sm_ino; in xrep_dinode_find_mode()
413 ri->alleged_ftype = XFS_DIR3_FT_UNKNOWN; in xrep_dinode_find_mode()
414 while ((error = xchk_iscan_iter(&ri->ftype_iscan, &dp)) == 1) { in xrep_dinode_find_mode()
416 error = xrep_dinode_findmode_walk_directory(ri, dp); in xrep_dinode_find_mode()
417 xchk_iscan_mark_visited(&ri->ftype_iscan, dp); in xrep_dinode_find_mode()
424 xchk_iscan_iter_finish(&ri->ftype_iscan); in xrep_dinode_find_mode()
425 xchk_iscan_teardown(&ri->ftype_iscan); in xrep_dinode_find_mode()
428 if (ri->alleged_ftype != XFS_DIR3_FT_UNKNOWN) { in xrep_dinode_find_mode()
452 switch (ri->alleged_ftype) { in xrep_dinode_find_mode()
482 struct xrep_inode *ri, in xrep_dinode_mode() argument
485 struct xfs_scrub *sc = ri->sc; in xrep_dinode_mode()
495 error = xrep_dinode_find_mode(ri, &mode); in xrep_dinode_mode()
515 ri->zap_acls = true; in xrep_dinode_mode()
578 struct xrep_inode *ri, in xrep_dinode_zap_symlink() argument
581 struct xfs_scrub *sc = ri->sc; in xrep_dinode_zap_symlink()
590 ri->ino_sick_mask |= XFS_SICK_INO_SYMLINK_ZAPPED; in xrep_dinode_zap_symlink()
601 struct xrep_inode *ri, in xrep_dinode_zap_dir() argument
604 struct xfs_scrub *sc = ri->sc; in xrep_dinode_zap_dir()
618 ri->ino_sick_mask |= XFS_SICK_INO_DIR_ZAPPED; in xrep_dinode_zap_dir()
624 struct xrep_inode *ri, in xrep_dinode_size() argument
627 struct xfs_scrub *sc = ri->sc; in xrep_dinode_size()
655 xrep_dinode_zap_symlink(ri, dip); in xrep_dinode_size()
667 xrep_dinode_zap_dir(ri, dip); in xrep_dinode_size()
713 struct xrep_inode *ri = priv; in xrep_dinode_walk_rmap() local
716 if (xchk_should_terminate(ri->sc, &error)) in xrep_dinode_walk_rmap()
720 if (rec->rm_owner != ri->sc->sm->sm_ino) in xrep_dinode_walk_rmap()
724 ri->attr_blocks += rec->rm_blockcount; in xrep_dinode_walk_rmap()
726 ri->attr_extents++; in xrep_dinode_walk_rmap()
731 ri->data_blocks += rec->rm_blockcount; in xrep_dinode_walk_rmap()
733 ri->data_extents++; in xrep_dinode_walk_rmap()
741 struct xrep_inode *ri, in xrep_dinode_count_ag_rmaps() argument
748 error = xfs_alloc_read_agf(pag, ri->sc->tp, 0, &agf); in xrep_dinode_count_ag_rmaps()
752 cur = xfs_rmapbt_init_cursor(ri->sc->mp, ri->sc->tp, agf, pag); in xrep_dinode_count_ag_rmaps()
753 error = xfs_rmap_query_all(cur, xrep_dinode_walk_rmap, ri); in xrep_dinode_count_ag_rmaps()
755 xfs_trans_brelse(ri->sc->tp, agf); in xrep_dinode_count_ag_rmaps()
762 struct xrep_inode *ri) in xrep_dinode_count_rmaps() argument
768 if (!xfs_has_rmapbt(ri->sc->mp) || xfs_has_realtime(ri->sc->mp)) in xrep_dinode_count_rmaps()
771 for_each_perag(ri->sc->mp, agno, pag) { in xrep_dinode_count_rmaps()
772 error = xrep_dinode_count_ag_rmaps(ri, pag); in xrep_dinode_count_rmaps()
780 if (ri->data_extents && ri->rt_extents) in xrep_dinode_count_rmaps()
783 trace_xrep_dinode_count_rmaps(ri->sc, in xrep_dinode_count_rmaps()
784 ri->data_blocks, ri->rt_blocks, ri->attr_blocks, in xrep_dinode_count_rmaps()
785 ri->data_extents, ri->rt_extents, ri->attr_extents); in xrep_dinode_count_rmaps()
987 struct xrep_inode *ri, in xrep_dinode_zap_dfork() argument
991 struct xfs_scrub *sc = ri->sc; in xrep_dinode_zap_dfork()
995 ri->ino_sick_mask |= XFS_SICK_INO_BMBTD_ZAPPED; in xrep_dinode_zap_dfork()
998 ri->data_blocks = 0; in xrep_dinode_zap_dfork()
999 ri->rt_blocks = 0; in xrep_dinode_zap_dfork()
1016 if (ri->data_extents || ri->rt_extents || S_ISREG(mode)) { in xrep_dinode_zap_dfork()
1024 xrep_dinode_zap_symlink(ri, dip); in xrep_dinode_zap_dfork()
1027 xrep_dinode_zap_dir(ri, dip); in xrep_dinode_zap_dfork()
1088 struct xrep_inode *ri, in xrep_dinode_zap_afork() argument
1092 struct xfs_scrub *sc = ri->sc; in xrep_dinode_zap_afork()
1096 ri->ino_sick_mask |= XFS_SICK_INO_BMBTA_ZAPPED; in xrep_dinode_zap_afork()
1100 ri->attr_blocks = 0; in xrep_dinode_zap_afork()
1117 struct xrep_inode *ri, in xrep_dinode_ensure_forkoff() argument
1122 struct xfs_scrub *sc = ri->sc; in xrep_dinode_ensure_forkoff()
1159 } else if (ri->attr_extents > 0) { in xrep_dinode_ensure_forkoff()
1210 } else if (ri->data_extents > 0 || ri->rt_extents > 0) { in xrep_dinode_ensure_forkoff()
1250 (ri->data_extents > 0 || ri->rt_extents > 0) && in xrep_dinode_ensure_forkoff()
1257 xrep_dinode_zap_afork(ri, dip, mode); in xrep_dinode_ensure_forkoff()
1276 ri->attr_extents > 0 && in xrep_dinode_ensure_forkoff()
1289 xrep_dinode_zap_afork(ri, dip, mode); in xrep_dinode_ensure_forkoff()
1308 struct xrep_inode *ri, in xrep_dinode_zap_forks() argument
1311 struct xfs_scrub *sc = ri->sc; in xrep_dinode_zap_forks()
1317 bool zap_attrfork = ri->zap_acls; in xrep_dinode_zap_forks()
1342 xrep_dinode_zap_afork(ri, dip, mode); in xrep_dinode_zap_forks()
1344 xrep_dinode_zap_dfork(ri, dip, mode); in xrep_dinode_zap_forks()
1345 xrep_dinode_ensure_forkoff(ri, dip, mode); in xrep_dinode_zap_forks()
1360 struct xrep_inode *ri) in xrep_dinode_core() argument
1362 struct xfs_scrub *sc = ri->sc; in xrep_dinode_core()
1370 error = xrep_dinode_count_rmaps(ri); in xrep_dinode_core()
1376 ri->imap.im_blkno, ri->imap.im_len, XBF_UNMAPPED, &bp, in xrep_dinode_core()
1386 dip = xfs_buf_offset(bp, ri->imap.im_boffset); in xrep_dinode_core()
1388 iget_error = xrep_dinode_mode(ri, dip); in xrep_dinode_core()
1392 xrep_dinode_flags(sc, dip, ri->rt_extents > 0); in xrep_dinode_core()
1393 xrep_dinode_size(ri, dip); in xrep_dinode_core()
1395 xrep_dinode_zap_forks(ri, dip); in xrep_dinode_core()
1402 xfs_trans_log_buf(sc->tp, bp, ri->imap.im_boffset, in xrep_dinode_core()
1403 ri->imap.im_boffset + sc->mp->m_sb.sb_inodesize - 1); in xrep_dinode_core()
1439 if (ri->ino_sick_mask) in xrep_dinode_core()
1440 xfs_inode_mark_sick(sc->ip, ri->ino_sick_mask); in xrep_dinode_core()
1447 struct xrep_inode *ri) in xrep_dinode_problems() argument
1449 struct xfs_scrub *sc = ri->sc; in xrep_dinode_problems()
1452 error = xrep_dinode_core(ri); in xrep_dinode_problems()
1858 struct xrep_inode *ri = sc->buf; in xrep_inode() local
1860 ASSERT(ri != NULL); in xrep_inode()
1862 error = xrep_dinode_problems(ri); in xrep_inode()