From 3583bb4c76219ca9736894b458d3d61c3b8abc1d Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Mon, 13 Apr 2020 12:23:25 -0400 Subject: [PATCH] wrapper: remove splice_to_pipe wrapper Signed-off-by: Mathieu Desnoyers --- lib/Kbuild | 3 +- lib/ringbuffer/ring_buffer_splice.c | 4 +-- wrapper/splice.c | 50 ----------------------------- wrapper/splice.h | 24 -------------- 4 files changed, 3 insertions(+), 78 deletions(-) delete mode 100644 wrapper/splice.c delete mode 100644 wrapper/splice.h diff --git a/lib/Kbuild b/lib/Kbuild index eb420800..6c731136 100644 --- a/lib/Kbuild +++ b/lib/Kbuild @@ -15,7 +15,6 @@ lttng-lib-ring-buffer-objs := \ ringbuffer/ring_buffer_vfs.o \ ringbuffer/ring_buffer_splice.o \ ringbuffer/ring_buffer_mmap.o \ - prio_heap/lttng_prio_heap.o \ - ../wrapper/splice.o + prio_heap/lttng_prio_heap.o # vim:syntax=make diff --git a/lib/ringbuffer/ring_buffer_splice.c b/lib/ringbuffer/ring_buffer_splice.c index f0b5479a..9695b9fe 100644 --- a/lib/ringbuffer/ring_buffer_splice.c +++ b/lib/ringbuffer/ring_buffer_splice.c @@ -13,8 +13,8 @@ #include #include #include +#include -#include #include #include #include @@ -152,7 +152,7 @@ static int subbuf_splice_actor(struct file *in, if (!spd.nr_pages) return 0; - return wrapper_splice_to_pipe(pipe, &spd); + return splice_to_pipe(pipe, &spd); } ssize_t lib_ring_buffer_splice_read(struct file *in, loff_t *ppos, 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 diff --git a/wrapper/splice.h b/wrapper/splice.h deleted file mode 100644 index a42bd6fb..00000000 --- a/wrapper/splice.h +++ /dev/null @@ -1,24 +0,0 @@ -/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only) - * - * wrapper/splice.h - * - * 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. - * - * Copyright (C) 2011-2012 Mathieu Desnoyers - */ - -#ifndef _LTTNG_WRAPPER_SPLICE_H -#define _LTTNG_WRAPPER_SPLICE_H - -#include - -ssize_t wrapper_splice_to_pipe(struct pipe_inode_info *pipe, - struct splice_pipe_desc *spd); - -#ifndef PIPE_DEF_BUFFERS -#define PIPE_DEF_BUFFERS 16 -#endif - -#endif /* _LTTNG_WRAPPER_SPLICE_H */ -- 2.34.1