]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - scrub/repair.h
misc: add static to various sourcefile-local functions
[thirdparty/xfsprogs-dev.git] / scrub / repair.h
CommitLineData
ee310b0c
DW
1/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Copyright (C) 2018 Oracle. All Rights Reserved.
4 * Author: Darrick J. Wong <darrick.wong@oracle.com>
5 */
6#ifndef XFS_SCRUB_REPAIR_H_
7#define XFS_SCRUB_REPAIR_H_
8
83d2c80b 9struct action_list {
ee310b0c 10 struct list_head list;
0e5dce33 11 unsigned long long nr;
ee310b0c
DW
12 bool sorted;
13};
14
83d2c80b
DW
15int action_lists_alloc(size_t nr, struct action_list **listsp);
16void action_lists_free(struct action_list **listsp);
ee310b0c 17
83d2c80b 18void action_list_init(struct action_list *alist);
12ca67b3
DW
19
20static inline bool action_list_empty(const struct action_list *alist)
21{
22 return list_empty(&alist->list);
23}
24
0e5dce33 25unsigned long long action_list_length(struct action_list *alist);
83d2c80b
DW
26void action_list_add(struct action_list *dest, struct action_item *item);
27void action_list_splice(struct action_list *dest, struct action_list *src);
ee310b0c 28
83d2c80b
DW
29void action_list_find_mustfix(struct action_list *actions,
30 struct action_list *immediate_alist,
ee310b0c
DW
31 unsigned long long *broken_primaries,
32 unsigned long long *broken_secondaries);
33
34/* Passed through to xfs_repair_metadata() */
35#define ALP_REPAIR_ONLY (XRM_REPAIR_ONLY)
06e49f3e 36#define ALP_COMPLAIN_IF_UNFIXED (XRM_COMPLAIN_IF_UNFIXED)
ee310b0c
DW
37#define ALP_NOPROGRESS (1U << 31)
38
83d2c80b
DW
39int action_list_process(struct scrub_ctx *ctx, int fd,
40 struct action_list *alist, unsigned int repair_flags);
41void action_list_defer(struct scrub_ctx *ctx, xfs_agnumber_t agno,
42 struct action_list *alist);
43int action_list_process_or_defer(struct scrub_ctx *ctx, xfs_agnumber_t agno,
44 struct action_list *alist);
ee310b0c
DW
45
46#endif /* XFS_SCRUB_REPAIR_H_ */