clock: output clock description in metadata
[lttng-modules.git] / wrapper / splice.c
CommitLineData
5dd620fa
MD
1/*
2 * Copyright (C) 2011 Mathieu Desnoyers (mathieu.desnoyers@efficios.com)
3 *
4 * wrapper around vmalloc_sync_all. Using KALLSYMS to get its address when
5 * available, else we need to have a kernel that exports this function to GPL
6 * modules.
7 *
8 * Dual LGPL v2.1/GPL v2 license.
9 */
10
11#ifdef CONFIG_KALLSYMS
12
13#include <linux/kallsyms.h>
14#include <linux/fs.h>
15#include <linux/splice.h>
c539a324 16#include "kallsyms.h"
5dd620fa
MD
17
18static
19ssize_t (*splice_to_pipe_sym)(struct pipe_inode_info *pipe,
20 struct splice_pipe_desc *spd);
21
22ssize_t wrapper_splice_to_pipe(struct pipe_inode_info *pipe,
23 struct splice_pipe_desc *spd)
24{
25 if (!splice_to_pipe_sym)
c539a324 26 splice_to_pipe_sym = (void *) kallsyms_lookup_funcptr("splice_to_pipe");
5dd620fa
MD
27 if (splice_to_pipe_sym) {
28 return splice_to_pipe_sym(pipe, spd);
29 } else {
30 printk(KERN_WARNING "LTTng: splice_to_pipe symbol lookup failed.\n");
31 return -ENOSYS;
32 }
33}
34
35#else
36
37#include <linux/fs.h>
38#include <linux/splice.h>
39
40ssize_t wrapper_splice_to_pipe(struct pipe_inode_info *pipe,
41 struct splice_pipe_desc *spd)
42{
43 return splice_to_pipe(pipe, spd);
44}
45
46#endif
This page took 0.023799 seconds and 4 git commands to generate.