X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=wrapper%2Fsplice.c;h=44a4d6b87b2b8062b571ed6270b4556006e8572a;hb=HEAD;hp=96fdf1d03ffff0aa09a2efea02bb45ae7cec24d7;hpb=b7cdc18250880cc44edeef4a4b42c8ac7a135a6d;p=lttng-modules.git diff --git a/wrapper/splice.c b/wrapper/splice.c deleted file mode 100644 index 96fdf1d0..00000000 --- a/wrapper/splice.c +++ /dev/null @@ -1,50 +0,0 @@ -/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only) - * - * wrapper/splice.c - * - * wrapper around splice_to_pipe. Using KALLSYMS to get its address when - * available, else we need to have a kernel that exports this function to GPL - * modules. The export was introduced in kernel 4.2. - * - * Copyright (C) 2011-2012 Mathieu Desnoyers - */ - -#include - -#if (defined(CONFIG_KALLSYMS) \ - && (LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0))) - -#include -#include -#include -#include - -static -ssize_t (*splice_to_pipe_sym)(struct pipe_inode_info *pipe, - struct splice_pipe_desc *spd); - -ssize_t wrapper_splice_to_pipe(struct pipe_inode_info *pipe, - struct splice_pipe_desc *spd) -{ - if (!splice_to_pipe_sym) - splice_to_pipe_sym = (void *) kallsyms_lookup_funcptr("splice_to_pipe"); - if (splice_to_pipe_sym) { - return splice_to_pipe_sym(pipe, spd); - } else { - printk_once(KERN_WARNING "LTTng: splice_to_pipe symbol lookup failed.\n"); - return -ENOSYS; - } -} - -#else - -#include -#include - -ssize_t wrapper_splice_to_pipe(struct pipe_inode_info *pipe, - struct splice_pipe_desc *spd) -{ - return splice_to_pipe(pipe, spd); -} - -#endif