diff options
Diffstat (limited to 'fs/xfs/xfs_mount.h')
-rw-r--r-- | fs/xfs/xfs_mount.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index 8ff3fc3e83de..05b791aa24d1 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h @@ -274,6 +274,17 @@ typedef struct xfs_mount { /* online file link count check stuff */ struct xfs_hook_chain m_nlink_delta_hooks; + +#if IS_ENABLED(CONFIG_XFS_ONLINE_SCRUB) && IS_ENABLED(CONFIG_XFS_RT) + /* + * Counter of live intents. We track the number of log intent items + * that have been queued (but not yet processed) so that scrub can + * detect the presence of other threads that are in the middle of + * processing a chain of deferred items. + */ + atomic_t m_rt_intents; + wait_queue_head_t m_rt_intents_wq; +#endif } xfs_mount_t; /* @@ -593,4 +604,26 @@ struct xfs_error_cfg * xfs_error_get_cfg(struct xfs_mount *mp, void xfs_force_summary_recalc(struct xfs_mount *mp); void xfs_mod_delalloc(struct xfs_mount *mp, int64_t delta); +#if IS_ENABLED(CONFIG_XFS_ONLINE_SCRUB) +# if IS_ENABLED(CONFIG_XFS_RT) +int xfs_rt_wait_intents(struct xfs_mount *mp); +# else +# define xfs_rt_wait_intents(mp) (-ENOSYS) +# endif /* CONFIG_XFS_RT */ + +void xfs_fs_bump_intents(struct xfs_mount *mp, bool isrt, xfs_fsblock_t fsb); +void xfs_fs_drop_intents(struct xfs_mount *mp, bool isrt, xfs_fsblock_t fsb); +int xfs_perag_wait_intents(struct xfs_perag *pag); + +#else +static inline void +xfs_fs_bump_intents(struct xfs_mount *mp, bool isrt, xfs_fsblock_t fsb) { } +static inline void +xfs_fs_drop_intents(struct xfs_mount *mp, bool isrt, xfs_fsblock_t fsb) { } + +int xfs_perag_wait_intents(struct xfs_perag *pag); +# define xfs_perag_wait_intents(pag) (-ENOSYS) +# define xfs_rt_wait_intents(mp) (-ENOSYS) +#endif /* CONFIG_XFS_ONLINE_SCRUB */ + #endif /* __XFS_MOUNT_H__ */ |