diff options
author | Manuel Bentele | 2020-10-23 15:18:01 +0200 |
---|---|---|
committer | Manuel Bentele | 2020-10-23 15:18:01 +0200 |
commit | dbb41ce2b7f309d394054a6bd1e33afd578798a5 (patch) | |
tree | 6a31092063d9f2fb5ac5720ec6759040e793c3d5 /src/kernel/tests/include/tst_path_has_mnt_flags.h | |
parent | Set Linux kernel version to unknown if it is not detectable (diff) | |
download | xloop-dbb41ce2b7f309d394054a6bd1e33afd578798a5.tar.gz xloop-dbb41ce2b7f309d394054a6bd1e33afd578798a5.tar.xz xloop-dbb41ce2b7f309d394054a6bd1e33afd578798a5.zip |
Move the source code of all xloop components to the common 'src' directory
Diffstat (limited to 'src/kernel/tests/include/tst_path_has_mnt_flags.h')
-rw-r--r-- | src/kernel/tests/include/tst_path_has_mnt_flags.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/kernel/tests/include/tst_path_has_mnt_flags.h b/src/kernel/tests/include/tst_path_has_mnt_flags.h new file mode 100644 index 0000000..a9e1f40 --- /dev/null +++ b/src/kernel/tests/include/tst_path_has_mnt_flags.h @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. + * Copyright (c) 2018 Cyril Hrubis <chrubis@suse.cz> + * Author: Xiao Yang <yangx.jy@cn.fujitsu.com> + */ + +#ifndef TST_PATH_HAS_MNT_FLAGS_H__ +#define TST_PATH_HAS_MNT_FLAGS_H__ + +#ifdef TST_TEST_H__ +# define tst_path_has_mnt_flags(...) tst_path_has_mnt_flags_(NULL, __VA_ARGS__) +#else +# define tst_path_has_mnt_flags tst_path_has_mnt_flags_ +#endif + +/* lib/tst_path_has_mnt_flags.c + * + * Check whether a path is on a filesystem that is mounted with + * specified flags + * @path: path to file, if path is NULL tst_tmpdir is used. + * @flags: NULL or NULL terminated array of mount flags + * + * Return: 0..n - number of flags matched + */ +int tst_path_has_mnt_flags_(void (*cleanup_fn)(void), + const char *path, const char *flags[]); + +#endif /* TST_PATH_HAS_MNT_FLAGS_H__ */ |