]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - scrub/unicrash.h
xfs_scrub: warn about normalized Unicode name collisions
[thirdparty/xfsprogs-dev.git] / scrub / unicrash.h
1 /*
2 * Copyright (C) 2018 Oracle. All Rights Reserved.
3 *
4 * Author: Darrick J. Wong <darrick.wong@oracle.com>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it would be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20 #ifndef XFS_SCRUB_UNICRASH_H_
21 #define XFS_SCRUB_UNICRASH_H_
22
23 struct unicrash;
24
25 /* Unicode name collision detection. */
26 #ifdef HAVE_U8NORMALIZE
27
28 struct dirent;
29
30 bool unicrash_dir_init(struct unicrash **ucp, struct scrub_ctx *ctx,
31 struct xfs_bstat *bstat);
32 bool unicrash_xattr_init(struct unicrash **ucp, struct scrub_ctx *ctx,
33 struct xfs_bstat *bstat);
34 void unicrash_free(struct unicrash *uc);
35 bool unicrash_check_dir_name(struct unicrash *uc, const char *descr,
36 struct dirent *dirent);
37 bool unicrash_check_xattr_name(struct unicrash *uc, const char *descr,
38 const char *attrname);
39 #else
40 # define unicrash_dir_init(u, c, b) (true)
41 # define unicrash_xattr_init(u, c, b) (true)
42 # define unicrash_free(u) do {(u) = (u);} while (0)
43 # define unicrash_check_dir_name(u, d, n) (true)
44 # define unicrash_check_xattr_name(u, d, n) (true)
45 #endif /* HAVE_U8NORMALIZE */
46
47 #endif /* XFS_SCRUB_UNICRASH_H_ */