]>
git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - repair/bulkload.h
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Copyright (C) 2020 Oracle. All Rights Reserved.
4 * Author: Darrick J. Wong <darrick.wong@oracle.com>
6 #ifndef __XFS_REPAIR_BULKLOAD_H__
7 #define __XFS_REPAIR_BULKLOAD_H__
9 extern int bload_leaf_slack
;
10 extern int bload_node_slack
;
16 struct bulkload_resv
{
17 /* Link to list of extents that we've reserved. */
18 struct list_head list
;
20 /* FSB of the block we reserved. */
23 /* Length of the reservation. */
26 /* How much of this reservation we've used. */
31 struct repair_ctx
*sc
;
33 /* List of extents that we've reserved. */
34 struct list_head resv_list
;
36 /* Fake root for new btree. */
37 struct xbtree_afakeroot afake
;
39 /* rmap owner of these blocks */
40 struct xfs_owner_info oinfo
;
42 /* The last reservation we allocated from. */
43 struct bulkload_resv
*last_resv
;
45 /* Number of blocks reserved via resv_list. */
46 unsigned int nr_reserved
;
49 #define for_each_bulkload_reservation(bkl, resv, n) \
50 list_for_each_entry_safe((resv), (n), &(bkl)->resv_list, list)
52 void bulkload_init_ag(struct bulkload
*bkl
, struct repair_ctx
*sc
,
53 const struct xfs_owner_info
*oinfo
);
54 int bulkload_add_blocks(struct bulkload
*bkl
, xfs_fsblock_t fsbno
,
56 void bulkload_destroy(struct bulkload
*bkl
, int error
);
57 int bulkload_claim_block(struct xfs_btree_cur
*cur
, struct bulkload
*bkl
,
58 union xfs_btree_ptr
*ptr
);
59 void bulkload_estimate_ag_slack(struct repair_ctx
*sc
,
60 struct xfs_btree_bload
*bload
, unsigned int free
);
62 #endif /* __XFS_REPAIR_BULKLOAD_H__ */