/* Setup functions */ int xchk_setup_agheader(struct xfs_scrub *sc); int xchk_setup_fs(struct xfs_scrub *sc); int xchk_setup_rt(struct xfs_scrub *sc); int xchk_setup_ag_allocbt(struct xfs_scrub *sc); int xchk_setup_ag_iallocbt(struct xfs_scrub *sc); int xchk_setup_ag_rmapbt(struct xfs_scrub *sc); int xchk_setup_ag_refcountbt(struct xfs_scrub *sc); int xchk_setup_inode(struct xfs_scrub *sc); int xchk_setup_inode_bmap(struct xfs_scrub *sc); int xchk_setup_inode_bmap_data(struct xfs_scrub *sc); int xchk_setup_directory(struct xfs_scrub *sc); int xchk_setup_xattr(struct xfs_scrub *sc); int xchk_setup_symlink(struct xfs_scrub *sc); int xchk_setup_parent(struct xfs_scrub *sc); int xchk_setup_dirtree(struct xfs_scrub *sc); int xchk_setup_metapath(struct xfs_scrub *sc); #ifdef CONFIG_XFS_RT int xchk_setup_rtbitmap(struct xfs_scrub *sc); int xchk_setup_rtsummary(struct xfs_scrub *sc); int xchk_setup_rgsuperblock(struct xfs_scrub *sc); int xchk_setup_rtrmapbt(struct xfs_scrub *sc); int xchk_setup_rtrefcountbt(struct xfs_scrub *sc); #else # define xchk_setup_rtbitmap xchk_setup_nothing # define xchk_setup_rtsummary xchk_setup_nothing # define xchk_setup_rgsuperblock xchk_setup_nothing # define xchk_setup_rtrmapbt xchk_setup_nothing # define xchk_setup_rtrefcountbt xchk_setup_nothing #endif #ifdef CONFIG_XFS_QUOTA int xchk_ino_dqattach(struct xfs_scrub *sc); int xchk_setup_quota(struct xfs_scrub *sc); int xchk_setup_quotacheck(struct xfs_scrub *sc); #else staticinlineint
xchk_ino_dqattach(struct xfs_scrub *sc)
{ return 0;
} # define xchk_setup_quota xchk_setup_nothing # define xchk_setup_quotacheck xchk_setup_nothing #endif int xchk_setup_fscounters(struct xfs_scrub *sc); int xchk_setup_nlinks(struct xfs_scrub *sc);
void xchk_ag_free(struct xfs_scrub *sc, struct xchk_ag *sa); int xchk_ag_init(struct xfs_scrub *sc, xfs_agnumber_t agno, struct xchk_ag *sa); int xchk_perag_drain_and_lock(struct xfs_scrub *sc);
/* * Grab all AG resources, treating the inability to grab the perag structure as * a fs corruption. This is intended for callers checking an ondisk reference * to a given AG, which means that the AG must still exist.
*/ staticinlineint
xchk_ag_init_existing( struct xfs_scrub *sc,
xfs_agnumber_t agno, struct xchk_ag *sa)
{ int error = xchk_ag_init(sc, agno, sa);
/* * Grab the inode at @inum. The caller must have created a scrub transaction * so that we can confirm the inumber by walking the inobt and not deadlock on * a loop in the inobt.
*/ int xchk_iget(struct xfs_scrub *sc, xfs_ino_t inum, struct xfs_inode **ipp); int xchk_iget_agi(struct xfs_scrub *sc, xfs_ino_t inum, struct xfs_buf **agi_bpp, struct xfs_inode **ipp); void xchk_irele(struct xfs_scrub *sc, struct xfs_inode *ip); int xchk_install_handle_inode(struct xfs_scrub *sc, struct xfs_inode *ip);
/* * Safe version of (untrusted) xchk_iget that uses an empty transaction to * avoid deadlocking on loops in the inobt. This should only be used in a * scrub or repair setup routine, and only prior to grabbing a transaction.
*/ staticinlineint
xchk_iget_safe(struct xfs_scrub *sc, xfs_ino_t inum, struct xfs_inode **ipp)
{ int error;
/* Decide if a repair is required. */ staticinlinebool xchk_needs_repair(conststruct xfs_scrub_metadata *sm)
{ return sm->sm_flags & (XFS_SCRUB_OFLAG_CORRUPT |
XFS_SCRUB_OFLAG_XCORRUPT |
XFS_SCRUB_OFLAG_PREEN);
}
/* * "Should we prepare for a repair?" * * Return true if the caller permits us to repair metadata and we're not * setting up for a post-repair evaluation.
*/ staticinlinebool xchk_could_repair(conststruct xfs_scrub *sc)
{ return (sc->sm->sm_flags & XFS_SCRUB_IFLAG_REPAIR) &&
!(sc->flags & XREP_ALREADY_FIXED);
}
int xchk_metadata_inode_forks(struct xfs_scrub *sc);
/* * Setting up a hook to wait for intents to drain is costly -- we have to take * the CPU hotplug lock and force an i-cache flush on all CPUs once to set it * up, and again to tear it down. These costs add up quickly, so we only want * to enable the drain waiter if the drain actually detected a conflict with * running intent chains.
*/ staticinlinebool xchk_need_intent_drain(struct xfs_scrub *sc)
{ return sc->flags & XCHK_NEED_DRAIN;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.