1 /* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
5 * wrapper around splice_to_pipe. Using KALLSYMS to get its address when
6 * available, else we need to have a kernel that exports this function to GPL
7 * modules. The export was introduced in kernel 4.2.
9 * Copyright (C) 2011-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 #include <lttng/kernel-version.h>
14 #ifdef CONFIG_KALLSYMS
16 #include <linux/kallsyms.h>
18 #include <linux/splice.h>
19 #include <wrapper/kallsyms.h>
22 ssize_t (*splice_to_pipe_sym
)(struct pipe_inode_info
*pipe
,
23 struct splice_pipe_desc
*spd
);
25 ssize_t
wrapper_splice_to_pipe(struct pipe_inode_info
*pipe
,
26 struct splice_pipe_desc
*spd
)
28 if (!splice_to_pipe_sym
)
29 splice_to_pipe_sym
= (void *) kallsyms_lookup_funcptr("splice_to_pipe");
30 if (splice_to_pipe_sym
) {
31 return splice_to_pipe_sym(pipe
, spd
);
33 printk_once(KERN_WARNING
"LTTng: splice_to_pipe symbol lookup failed.\n");
39 * Canary function to check for 'splice_to_pipe()' at compile time.
41 * From 'include/linux/splice.h':
43 * extern ssize_t splice_to_pipe(struct pipe_inode_info *,
44 * struct splice_pipe_desc *spd);
46 __attribute__((unused
)) static
47 ssize_t
__canary__splice_to_pipe(struct pipe_inode_info
*pipe
,
48 struct splice_pipe_desc
*spd
)
50 return splice_to_pipe(pipe
, spd
);
56 #include <linux/splice.h>
58 ssize_t
wrapper_splice_to_pipe(struct pipe_inode_info
*pipe
,
59 struct splice_pipe_desc
*spd
)
61 return splice_to_pipe(pipe
, spd
);
This page took 0.030925 seconds and 5 git commands to generate.