[lttng-dev] [PATCH 04/11] lttng: remove splice_to_pipe wrapper

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Thu Dec 1 16:41:16 EST 2011


Use the newly exported splice_to_pipe symbol.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
---
 drivers/staging/lttng/lib/Makefile                 |    3 +-
 .../lttng/lib/ringbuffer/ring_buffer_splice.c      |    3 +-
 drivers/staging/lttng/wrapper/splice.c             |   46 --------------------
 drivers/staging/lttng/wrapper/splice.h             |   23 ----------
 4 files changed, 2 insertions(+), 73 deletions(-)
 delete mode 100644 drivers/staging/lttng/wrapper/splice.c
 delete mode 100644 drivers/staging/lttng/wrapper/splice.h

diff --git a/drivers/staging/lttng/lib/Makefile b/drivers/staging/lttng/lib/Makefile
index e5735ec..9fa49ef 100644
--- a/drivers/staging/lttng/lib/Makefile
+++ b/drivers/staging/lttng/lib/Makefile
@@ -7,5 +7,4 @@ 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
diff --git a/drivers/staging/lttng/lib/ringbuffer/ring_buffer_splice.c b/drivers/staging/lttng/lib/ringbuffer/ring_buffer_splice.c
index ded18ba..fc89901 100644
--- a/drivers/staging/lttng/lib/ringbuffer/ring_buffer_splice.c
+++ b/drivers/staging/lttng/lib/ringbuffer/ring_buffer_splice.c
@@ -13,7 +13,6 @@
 #include <linux/module.h>
 #include <linux/fs.h>
 
-#include "../../wrapper/splice.h"
 #include "../../wrapper/ringbuffer/backend.h"
 #include "../../wrapper/ringbuffer/frontend.h"
 #include "../../wrapper/ringbuffer/vfs.h"
@@ -142,7 +141,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/drivers/staging/lttng/wrapper/splice.c b/drivers/staging/lttng/wrapper/splice.c
deleted file mode 100644
index ba224ee..0000000
--- a/drivers/staging/lttng/wrapper/splice.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2011 Mathieu Desnoyers (mathieu.desnoyers at efficios.com)
- *
- * wrapper around vmalloc_sync_all. Using KALLSYMS to get its address when
- * available, else we need to have a kernel that exports this function to GPL
- * modules.
- *
- * Dual LGPL v2.1/GPL v2 license.
- */
-
-#ifdef CONFIG_KALLSYMS
-
-#include <linux/kallsyms.h>
-#include <linux/fs.h>
-#include <linux/splice.h>
-#include "kallsyms.h"
-
-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(KERN_WARNING "LTTng: splice_to_pipe symbol lookup failed.\n");
-		return -ENOSYS;
-	}
-}
-
-#else
-
-#include <linux/fs.h>
-#include <linux/splice.h>
-
-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/drivers/staging/lttng/wrapper/splice.h b/drivers/staging/lttng/wrapper/splice.h
deleted file mode 100644
index f75309a..0000000
--- a/drivers/staging/lttng/wrapper/splice.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef _LTT_WRAPPER_SPLICE_H
-#define _LTT_WRAPPER_SPLICE_H
-
-/*
- * Copyright (C) 2011 Mathieu Desnoyers (mathieu.desnoyers at efficios.com)
- *
- * wrapper around vmalloc_sync_all. Using KALLSYMS to get its address when
- * available, else we need to have a kernel that exports this function to GPL
- * modules.
- *
- * Dual LGPL v2.1/GPL v2 license.
- */
-
-#include <linux/splice.h>
-
-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 /* _LTT_WRAPPER_SPLICE_H */
-- 
1.7.5.4




More information about the lttng-dev mailing list