]>
git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - scrub/scrub.h
1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2018 Oracle. All Rights Reserved.
4 * Author: Darrick J. Wong <darrick.wong@oracle.com>
6 #ifndef XFS_SCRUB_SCRUB_H_
7 #define XFS_SCRUB_SCRUB_H_
9 /* Online scrub and repair. */
11 CHECK_DONE
, /* no further processing needed */
12 CHECK_REPAIR
, /* schedule this for repairs */
13 CHECK_ABORT
, /* end program */
14 CHECK_RETRY
, /* repair failed, try again later */
19 void xfs_scrub_report_preen_triggers(struct scrub_ctx
*ctx
);
20 int xfs_scrub_primary_super(struct scrub_ctx
*ctx
, struct action_list
*alist
);
21 int xfs_scrub_ag_headers(struct scrub_ctx
*ctx
, xfs_agnumber_t agno
,
22 struct action_list
*alist
);
23 int xfs_scrub_ag_metadata(struct scrub_ctx
*ctx
, xfs_agnumber_t agno
,
24 struct action_list
*alist
);
25 int xfs_scrub_fs_metadata(struct scrub_ctx
*ctx
, struct action_list
*alist
);
26 int xfs_scrub_fs_summary(struct scrub_ctx
*ctx
, struct action_list
*alist
);
28 bool xfs_can_scrub_fs_metadata(struct scrub_ctx
*ctx
);
29 bool xfs_can_scrub_inode(struct scrub_ctx
*ctx
);
30 bool xfs_can_scrub_bmap(struct scrub_ctx
*ctx
);
31 bool xfs_can_scrub_dir(struct scrub_ctx
*ctx
);
32 bool xfs_can_scrub_attr(struct scrub_ctx
*ctx
);
33 bool xfs_can_scrub_symlink(struct scrub_ctx
*ctx
);
34 bool xfs_can_scrub_parent(struct scrub_ctx
*ctx
);
35 bool xfs_can_repair(struct scrub_ctx
*ctx
);
37 int xfs_scrub_inode_fields(struct scrub_ctx
*ctx
, uint64_t ino
, uint32_t gen
,
38 struct action_list
*alist
);
39 int xfs_scrub_data_fork(struct scrub_ctx
*ctx
, uint64_t ino
, uint32_t gen
,
40 struct action_list
*alist
);
41 int xfs_scrub_attr_fork(struct scrub_ctx
*ctx
, uint64_t ino
, uint32_t gen
,
42 struct action_list
*alist
);
43 int xfs_scrub_cow_fork(struct scrub_ctx
*ctx
, uint64_t ino
, uint32_t gen
,
44 struct action_list
*alist
);
45 int xfs_scrub_dir(struct scrub_ctx
*ctx
, uint64_t ino
, uint32_t gen
,
46 struct action_list
*alist
);
47 int xfs_scrub_attr(struct scrub_ctx
*ctx
, uint64_t ino
, uint32_t gen
,
48 struct action_list
*alist
);
49 int xfs_scrub_symlink(struct scrub_ctx
*ctx
, uint64_t ino
, uint32_t gen
,
50 struct action_list
*alist
);
51 int xfs_scrub_parent(struct scrub_ctx
*ctx
, uint64_t ino
, uint32_t gen
,
52 struct action_list
*alist
);
54 /* Repair parameters are the scrub inputs and retry count. */
56 struct list_head list
;
65 * Only ask the kernel to repair this object if the kernel directly told us it
66 * was corrupt. Objects that are only flagged as having cross-referencing
67 * errors or flagged as eligible for optimization are left for later.
69 #define XRM_REPAIR_ONLY (1U << 0)
71 /* Complain if still broken even after fix. */
72 #define XRM_COMPLAIN_IF_UNFIXED (1U << 1)
74 enum check_outcome
xfs_repair_metadata(struct scrub_ctx
*ctx
, int fd
,
75 struct action_item
*aitem
, unsigned int repair_flags
);
77 #endif /* XFS_SCRUB_SCRUB_H_ */