2ecc98f38bf706eea4ef476fc99c7b4ae85ae85e
1 /* SPDX-License-Identifier: (GPL-2.0 or LGPL-2.1)
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 #if (defined(CONFIG_KALLSYMS) \
15 && (LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)))
17 #include <linux/kallsyms.h>
19 #include <linux/splice.h>
20 #include <wrapper/kallsyms.h>
23 ssize_t (*splice_to_pipe_sym
)(struct pipe_inode_info
*pipe
,
24 struct splice_pipe_desc
*spd
);
26 ssize_t
wrapper_splice_to_pipe(struct pipe_inode_info
*pipe
,
27 struct splice_pipe_desc
*spd
)
29 if (!splice_to_pipe_sym
)
30 splice_to_pipe_sym
= (void *) kallsyms_lookup_funcptr("splice_to_pipe");
31 if (splice_to_pipe_sym
) {
32 return splice_to_pipe_sym(pipe
, spd
);
34 printk_once(KERN_WARNING
"LTTng: splice_to_pipe symbol lookup failed.\n");
42 #include <linux/splice.h>
44 ssize_t
wrapper_splice_to_pipe(struct pipe_inode_info
*pipe
,
45 struct splice_pipe_desc
*spd
)
47 return splice_to_pipe(pipe
, spd
);
This page took 0.030338 seconds and 3 git commands to generate.