new file mode 100644
@@ -0,0 +1,35 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (C) 2024 Andrea Cervesato <andrea.cervesato@suse.com>
+ * Copyright (C) 2024 Cyril Hrubis <chrubis@suse.cz>
+ */
+
+#ifndef LAPI_FICLONE_H__
+#define LAPI_FICLONE_H__
+
+#include "config.h"
+
+#ifdef HAVE_LINUX_FS_H
+# include <linux/fs.h>
+#endif
+
+#include <stdint.h>
+
+#ifndef HAVE_STRUCT_FILE_CLONE_RANGE
+struct file_clone_range {
+ int64_t src_fd;
+ uint64_t src_offset;
+ uint64_t src_length;
+ uint64_t dest_offset;
+};
+#endif
+
+#ifndef FICLONE
+# define FICLONE _IOW(0x94, 9, int)
+#endif
+
+#ifndef FICLONERANGE
+# define FICLONERANGE _IOW(0x94, 13, struct file_clone_range)
+#endif
+
+#endif /* LAPI_FICLONE_H__ */
@@ -18,18 +18,8 @@
#include <sys/user.h>
#include <limits.h>
-#include <stdint.h>
#include "lapi/abisize.h"
-#ifndef HAVE_STRUCT_FILE_CLONE_RANGE
-struct file_clone_range {
- int64_t src_fd;
- uint64_t src_offset;
- uint64_t src_length;
- uint64_t dest_offset;
-};
-#endif
-
#ifndef FS_IOC_GETFLAGS
# define FS_IOC_GETFLAGS _IOR('f', 1, long)
#endif
@@ -58,14 +48,6 @@ struct file_clone_range {
# define FS_VERITY_FL 0x00100000 /* Verity protected inode */
#endif
-#ifndef FICLONE
-# define FICLONE _IOW(0x94, 9, int)
-#endif
-
-#ifndef FICLONERANGE
-# define FICLONERANGE _IOW(0x94, 13, struct file_clone_range)
-#endif
-
/*
* Helper function to get MAX_LFS_FILESIZE.
* Missing PAGE_SHIFT on some libc prevents defining MAX_LFS_FILESIZE.
@@ -19,7 +19,7 @@
*/
#include "tst_test.h"
-#include "lapi/fs.h"
+#include "lapi/ficlone.h"
#define MNTPOINT "mnt"
#define SRCPATH MNTPOINT "/file0"
@@ -12,7 +12,7 @@
*/
#include "tst_test.h"
-#include "lapi/fs.h"
+#include "lapi/ficlone.h"
#define MNTPOINT "mnt"
#define SRCPATH MNTPOINT "/file0"
@@ -11,7 +11,7 @@
*/
#include "tst_test.h"
-#include "lapi/fs.h"
+#include "lapi/ficlone.h"
#define MNTPOINT "mnt"
@@ -19,7 +19,7 @@
*/
#include "tst_test.h"
-#include "lapi/fs.h"
+#include "lapi/ficlone.h"
#define MNTPOINT "mnt"
#define SRCPATH MNTPOINT "/file0"
@@ -13,7 +13,7 @@
*/
#include "tst_test.h"
-#include "lapi/fs.h"
+#include "lapi/ficlone.h"
#define MNTPOINT "mnt"
#define SRCPATH MNTPOINT "/file0"
In the end splitting the ficlone fallbacks from fs.h is the easiest solution we can do. Fixes: 3acc96d4b3fa8 ("Add fallback definitions for lapi/fs.h") Signed-off-by: Cyril Hrubis <chrubis@suse.cz> --- Passes the CI https://github.com/metan-ucw/ltp/actions/runs/10091715692/job/27903833146 include/lapi/ficlone.h | 35 +++++++++++++++++++ include/lapi/fs.h | 18 ---------- .../kernel/syscalls/ioctl/ioctl_ficlone01.c | 2 +- .../kernel/syscalls/ioctl/ioctl_ficlone02.c | 2 +- .../kernel/syscalls/ioctl/ioctl_ficlone03.c | 2 +- .../syscalls/ioctl/ioctl_ficlonerange01.c | 2 +- .../syscalls/ioctl/ioctl_ficlonerange02.c | 2 +- 7 files changed, 40 insertions(+), 23 deletions(-) create mode 100644 include/lapi/ficlone.h