2023-08-10 22:48:01 +08:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2022-2023 Oracle. All Rights Reserved.
|
|
|
|
* Author: Darrick J. Wong <djwong@kernel.org>
|
|
|
|
*/
|
|
|
|
#ifndef __XFS_SCRUB_REAP_H__
|
|
|
|
#define __XFS_SCRUB_REAP_H__
|
|
|
|
|
2023-12-16 02:03:38 +08:00
|
|
|
struct xagb_bitmap;
|
|
|
|
struct xfsb_bitmap;
|
|
|
|
|
2023-08-10 22:48:04 +08:00
|
|
|
int xrep_reap_agblocks(struct xfs_scrub *sc, struct xagb_bitmap *bitmap,
|
|
|
|
const struct xfs_owner_info *oinfo, enum xfs_ag_resv_type type);
|
2023-12-16 02:03:38 +08:00
|
|
|
int xrep_reap_fsblocks(struct xfs_scrub *sc, struct xfsb_bitmap *bitmap,
|
|
|
|
const struct xfs_owner_info *oinfo);
|
2024-04-16 05:54:30 +08:00
|
|
|
int xrep_reap_ifork(struct xfs_scrub *sc, struct xfs_inode *ip, int whichfork);
|
2023-08-10 22:48:01 +08:00
|
|
|
|
2024-04-16 05:54:29 +08:00
|
|
|
/* Buffer cache scan context. */
|
|
|
|
struct xrep_bufscan {
|
|
|
|
/* Disk address for the buffers we want to scan. */
|
|
|
|
xfs_daddr_t daddr;
|
|
|
|
|
|
|
|
/* Maximum number of sectors to scan. */
|
|
|
|
xfs_daddr_t max_sectors;
|
|
|
|
|
|
|
|
/* Each round, increment the search length by this number of sectors. */
|
|
|
|
xfs_daddr_t daddr_step;
|
|
|
|
|
|
|
|
/* Internal scan state; initialize to zero. */
|
|
|
|
xfs_daddr_t __sector_count;
|
|
|
|
};
|
|
|
|
|
|
|
|
xfs_daddr_t xrep_bufscan_max_sectors(struct xfs_mount *mp,
|
|
|
|
xfs_extlen_t fsblocks);
|
|
|
|
struct xfs_buf *xrep_bufscan_advance(struct xfs_mount *mp,
|
|
|
|
struct xrep_bufscan *scan);
|
|
|
|
|
2023-08-10 22:48:01 +08:00
|
|
|
#endif /* __XFS_SCRUB_REAP_H__ */
|