]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - repair/rmap.h
xfsprogs: Release v6.7.0
[thirdparty/xfsprogs-dev.git] / repair / rmap.h
CommitLineData
959ef981 1// SPDX-License-Identifier: GPL-2.0+
9e0f480e
DW
2/*
3 * Copyright (C) 2016 Oracle. All Rights Reserved.
9e0f480e 4 * Author: Darrick J. Wong <darrick.wong@oracle.com>
9e0f480e
DW
5 */
6#ifndef RMAP_H_
7#define RMAP_H_
8
9extern bool collect_rmaps;
10
2d273771 11extern bool rmap_needs_work(struct xfs_mount *);
9e0f480e 12
2d273771
DW
13extern void rmaps_init(struct xfs_mount *);
14extern void rmaps_free(struct xfs_mount *);
9e0f480e 15
2d273771
DW
16extern int rmap_add_rec(struct xfs_mount *, xfs_ino_t, int, struct xfs_bmbt_irec *);
17extern int rmap_finish_collecting_fork_recs(struct xfs_mount *mp,
b7f12e53 18 xfs_agnumber_t agno);
2d273771 19extern int rmap_add_ag_rec(struct xfs_mount *, xfs_agnumber_t agno,
1102c155 20 xfs_agblock_t agbno, xfs_extlen_t len, uint64_t owner);
2d273771
DW
21extern int rmap_add_bmbt_rec(struct xfs_mount *, xfs_ino_t, int, xfs_fsblock_t);
22extern int rmap_fold_raw_recs(struct xfs_mount *mp, xfs_agnumber_t agno);
23extern bool rmaps_are_mergeable(struct xfs_rmap_irec *r1, struct xfs_rmap_irec *r2);
9e0f480e 24
2d273771
DW
25extern int rmap_add_fixed_ag_rec(struct xfs_mount *, xfs_agnumber_t);
26extern int rmap_store_ag_btree_rec(struct xfs_mount *, xfs_agnumber_t);
713b6817 27
11b9e510 28extern size_t rmap_record_count(struct xfs_mount *, xfs_agnumber_t);
2d273771 29extern int rmap_init_cursor(xfs_agnumber_t, struct xfs_slab_cursor **);
11b9e510 30extern void rmap_avoid_check(void);
97238aea 31void rmaps_verify_btree(struct xfs_mount *mp, xfs_agnumber_t agno);
11b9e510 32
14f8b681 33extern int64_t rmap_diffkeys(struct xfs_rmap_irec *kp1,
11b9e510
DW
34 struct xfs_rmap_irec *kp2);
35extern void rmap_high_key_from_rec(struct xfs_rmap_irec *rec,
36 struct xfs_rmap_irec *key);
37
00f34bca 38extern int compute_refcounts(struct xfs_mount *, xfs_agnumber_t);
80dbc783
DW
39extern size_t refcount_record_count(struct xfs_mount *, xfs_agnumber_t);
40extern int init_refcount_cursor(xfs_agnumber_t, struct xfs_slab_cursor **);
41extern void refcount_avoid_check(void);
97238aea 42void check_refcounts(struct xfs_mount *mp, xfs_agnumber_t agno);
80dbc783 43
7e174ec7
DW
44extern void record_inode_reflink_flag(struct xfs_mount *, struct xfs_dinode *,
45 xfs_agnumber_t, xfs_agino_t, xfs_ino_t);
ca8d7d6a 46extern int fix_inode_reflink_flags(struct xfs_mount *, xfs_agnumber_t);
00f34bca 47
62cf990a
DW
48extern void fix_freelist(struct xfs_mount *, xfs_agnumber_t, bool);
49extern void rmap_store_agflcount(struct xfs_mount *, xfs_agnumber_t, int);
50
76555964
DW
51xfs_extlen_t estimate_rmapbt_blocks(struct xfs_perag *pag);
52xfs_extlen_t estimate_refcountbt_blocks(struct xfs_perag *pag);
53
9e0f480e 54#endif /* RMAP_H_ */