1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Copyright (c) 2022-2024 Oracle.  All Rights Reserved.
4 * Author: Darrick J. Wong <djwong@kernel.org>
5 */
6#ifndef __XFS_SCRUB_RCBAG_H__
7#define __XFS_SCRUB_RCBAG_H__
8
9struct xfs_mount;
10struct rcbag;
11struct xfs_buftarg;
12
13int rcbag_init(struct xfs_mount *mp, struct xfs_buftarg *btp,
14		struct rcbag **bagp);
15void rcbag_free(struct rcbag **bagp);
16int rcbag_add(struct rcbag *bag, struct xfs_trans *tp,
17		const struct xfs_rmap_irec *rmap);
18uint64_t rcbag_count(const struct rcbag *bag);
19
20int rcbag_next_edge(struct rcbag *bag, struct xfs_trans *tp,
21		const struct xfs_rmap_irec *next_rmap, bool next_valid,
22		uint32_t *next_bnop);
23int rcbag_remove_ending_at(struct rcbag *bag, struct xfs_trans *tp,
24		uint32_t next_bno);
25
26void rcbag_dump(struct rcbag *bag, struct xfs_trans *tp);
27
28#endif /* __XFS_SCRUB_RCBAG_H__ */
29