]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - scrub/repair.h
xfs_scrub: don't error out if an optimize-only repair isn't supported
[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
9struct xfs_action_list {
10 struct list_head list;
11 size_t nr;
12 bool sorted;
13};
14
15bool xfs_action_lists_alloc(size_t nr, struct xfs_action_list **listsp);
16void xfs_action_lists_free(struct xfs_action_list **listsp);
17
18void xfs_action_list_init(struct xfs_action_list *alist);
19size_t xfs_action_list_length(struct xfs_action_list *alist);
20void xfs_action_list_add(struct xfs_action_list *dest,
21 struct action_item *item);
22void xfs_action_list_splice(struct xfs_action_list *dest,
23 struct xfs_action_list *src);
24
25void xfs_action_list_find_mustfix(struct xfs_action_list *actions,
26 struct xfs_action_list *immediate_alist,
27 unsigned long long *broken_primaries,
28 unsigned long long *broken_secondaries);
29
30/* Passed through to xfs_repair_metadata() */
31#define ALP_REPAIR_ONLY (XRM_REPAIR_ONLY)
32#define ALP_NOFIX_COMPLAIN (XRM_NOFIX_COMPLAIN)
33#define ALP_NOPROGRESS (1U << 31)
34
35bool xfs_action_list_process(struct scrub_ctx *ctx, int fd,
36 struct xfs_action_list *alist, unsigned int repair_flags);
37void xfs_action_list_defer(struct scrub_ctx *ctx, xfs_agnumber_t agno,
38 struct xfs_action_list *alist);
39bool xfs_action_list_process_or_defer(struct scrub_ctx *ctx, xfs_agnumber_t agno,
40 struct xfs_action_list *alist);
41
42#endif /* XFS_SCRUB_REPAIR_H_ */