]>
Commit | Line | Data |
---|---|---|
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 | ||
9 | extern bool collect_rmaps; | |
10 | ||
2d273771 | 11 | extern bool rmap_needs_work(struct xfs_mount *); |
9e0f480e | 12 | |
2d273771 DW |
13 | extern void rmaps_init(struct xfs_mount *); |
14 | extern void rmaps_free(struct xfs_mount *); | |
9e0f480e | 15 | |
2d273771 DW |
16 | extern int rmap_add_rec(struct xfs_mount *, xfs_ino_t, int, struct xfs_bmbt_irec *); |
17 | extern int rmap_finish_collecting_fork_recs(struct xfs_mount *mp, | |
b7f12e53 | 18 | xfs_agnumber_t agno); |
2d273771 | 19 | extern 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 |
21 | extern int rmap_add_bmbt_rec(struct xfs_mount *, xfs_ino_t, int, xfs_fsblock_t); |
22 | extern int rmap_fold_raw_recs(struct xfs_mount *mp, xfs_agnumber_t agno); | |
23 | extern bool rmaps_are_mergeable(struct xfs_rmap_irec *r1, struct xfs_rmap_irec *r2); | |
9e0f480e | 24 | |
2d273771 DW |
25 | extern int rmap_add_fixed_ag_rec(struct xfs_mount *, xfs_agnumber_t); |
26 | extern int rmap_store_ag_btree_rec(struct xfs_mount *, xfs_agnumber_t); | |
713b6817 | 27 | |
11b9e510 | 28 | extern size_t rmap_record_count(struct xfs_mount *, xfs_agnumber_t); |
2d273771 | 29 | extern int rmap_init_cursor(xfs_agnumber_t, struct xfs_slab_cursor **); |
11b9e510 | 30 | extern void rmap_avoid_check(void); |
97238aea | 31 | void rmaps_verify_btree(struct xfs_mount *mp, xfs_agnumber_t agno); |
11b9e510 | 32 | |
14f8b681 | 33 | extern int64_t rmap_diffkeys(struct xfs_rmap_irec *kp1, |
11b9e510 DW |
34 | struct xfs_rmap_irec *kp2); |
35 | extern void rmap_high_key_from_rec(struct xfs_rmap_irec *rec, | |
36 | struct xfs_rmap_irec *key); | |
37 | ||
00f34bca | 38 | extern int compute_refcounts(struct xfs_mount *, xfs_agnumber_t); |
80dbc783 DW |
39 | extern size_t refcount_record_count(struct xfs_mount *, xfs_agnumber_t); |
40 | extern int init_refcount_cursor(xfs_agnumber_t, struct xfs_slab_cursor **); | |
41 | extern void refcount_avoid_check(void); | |
97238aea | 42 | void check_refcounts(struct xfs_mount *mp, xfs_agnumber_t agno); |
80dbc783 | 43 | |
7e174ec7 DW |
44 | extern void record_inode_reflink_flag(struct xfs_mount *, struct xfs_dinode *, |
45 | xfs_agnumber_t, xfs_agino_t, xfs_ino_t); | |
ca8d7d6a | 46 | extern int fix_inode_reflink_flags(struct xfs_mount *, xfs_agnumber_t); |
00f34bca | 47 | |
62cf990a DW |
48 | extern void fix_freelist(struct xfs_mount *, xfs_agnumber_t, bool); |
49 | extern void rmap_store_agflcount(struct xfs_mount *, xfs_agnumber_t, int); | |
50 | ||
76555964 DW |
51 | xfs_extlen_t estimate_rmapbt_blocks(struct xfs_perag *pag); |
52 | xfs_extlen_t estimate_refcountbt_blocks(struct xfs_perag *pag); | |
53 | ||
9e0f480e | 54 | #endif /* RMAP_H_ */ |