]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - scrub/descr.h
xfs_scrub: update copyright years for scrub/ files
[thirdparty/xfsprogs-dev.git] / scrub / descr.h
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3 * Copyright (C) 2019-2023 Oracle. All Rights Reserved.
4 * Author: Darrick J. Wong <djwong@kernel.org>
5 */
6 #ifndef XFS_SCRUB_DESCR_H_
7 #define XFS_SCRUB_DESCR_H_
8
9 typedef int (*descr_fn)(struct scrub_ctx *ctx, char *buf, size_t buflen,
10 void *data);
11
12 struct descr {
13 struct scrub_ctx *ctx;
14 descr_fn fn;
15 void *where;
16 };
17
18 #define DEFINE_DESCR(_name, _ctx, _fn) \
19 struct descr _name = { .ctx = (_ctx), .fn = (_fn) }
20
21 const char *__descr_render(struct descr *dsc, const char *file, int line);
22 #define descr_render(dsc) __descr_render((dsc), __FILE__, __LINE__)
23
24 void descr_set(struct descr *dsc, void *where);
25
26 int descr_init_phase(struct scrub_ctx *ctx, unsigned int nr_threads);
27 void descr_end_phase(void);
28
29 #endif /* XFS_SCRUB_DESCR_H_ */