linux/fs/xfs/scrub/iscan.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * Copyright (c) 2021-2024 Oracle.  All Rights Reserved.
 * Author: Darrick J. Wong <[email protected]>
 */
#ifndef __XFS_SCRUB_ISCAN_H__
#define __XFS_SCRUB_ISCAN_H__

struct xchk_iscan {};

/* Set if the scan has been aborted due to some event in the fs. */
#define XCHK_ISCAN_OPSTATE_ABORTED

/* Use trylock to acquire the AGI */
#define XCHK_ISCAN_OPSTATE_TRYLOCK_AGI

static inline bool
xchk_iscan_aborted(const struct xchk_iscan *iscan)
{}

static inline void
xchk_iscan_abort(struct xchk_iscan *iscan)
{}

static inline bool
xchk_iscan_agi_needs_trylock(const struct xchk_iscan *iscan)
{}

static inline void
xchk_iscan_set_agi_trylock(struct xchk_iscan *iscan)
{}

void xchk_iscan_start(struct xfs_scrub *sc, unsigned int iget_timeout,
		unsigned int iget_retry_delay, struct xchk_iscan *iscan);
void xchk_iscan_finish_early(struct xchk_iscan *iscan);
void xchk_iscan_teardown(struct xchk_iscan *iscan);

int xchk_iscan_iter(struct xchk_iscan *iscan, struct xfs_inode **ipp);
void xchk_iscan_iter_finish(struct xchk_iscan *iscan);

void xchk_iscan_mark_visited(struct xchk_iscan *iscan, struct xfs_inode *ip);
bool xchk_iscan_want_live_update(struct xchk_iscan *iscan, xfs_ino_t ino);

#endif /* __XFS_SCRUB_ISCAN_H__ */