]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - scrub/unicrash.h
xfs_scrub: fix weirdness in directory name check code
[thirdparty/xfsprogs-dev.git] / scrub / unicrash.h
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_UNICRASH_H_
7 #define XFS_SCRUB_UNICRASH_H_
8
9 struct unicrash;
10
11 /* Unicode name collision detection. */
12 #ifdef HAVE_LIBICU
13
14 struct dirent;
15
16 int unicrash_dir_init(struct unicrash **ucp, struct scrub_ctx *ctx,
17 struct xfs_bulkstat *bstat);
18 int unicrash_xattr_init(struct unicrash **ucp, struct scrub_ctx *ctx,
19 struct xfs_bulkstat *bstat);
20 int unicrash_fs_label_init(struct unicrash **ucp, struct scrub_ctx *ctx);
21 void unicrash_free(struct unicrash *uc);
22 int unicrash_check_dir_name(struct unicrash *uc, struct descr *dsc,
23 struct dirent *dirent);
24 int unicrash_check_xattr_name(struct unicrash *uc, struct descr *dsc,
25 const char *attrname);
26 int unicrash_check_fs_label(struct unicrash *uc, struct descr *dsc,
27 const char *label);
28 bool unicrash_load(void);
29 void unicrash_unload(void);
30 #else
31 # define unicrash_dir_init(u, c, b) (0)
32 # define unicrash_xattr_init(u, c, b) (0)
33 # define unicrash_fs_label_init(u, c) (0)
34 # define unicrash_free(u) do {(u) = (u);} while (0)
35 # define unicrash_check_dir_name(u, d, n) (0)
36 # define unicrash_check_xattr_name(u, d, n) (0)
37 # define unicrash_check_fs_label(u, d, n) (0)
38 # define unicrash_load() (0)
39 # define unicrash_unload() do { } while (0)
40 #endif /* HAVE_LIBICU */
41
42 #endif /* XFS_SCRUB_UNICRASH_H_ */