[RFC patch 14/41] Splice and pipe : export pipe buf operations for GPL modules

Mathieu Desnoyers
2009-03-05T23:36:34Z

[-- Attachment #1: splice-support-modules.patch --]
[-- Type: text/plain, Size: 2162 bytes --]

LTTng splice transport use the generic pipe and splice operations from a GPL
module.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
CC: Jens Axboe <axboe@kernel.dk>
CC: Linus Torvalds <torvalds@osdl.org>
CC: Ingo Molnar <mingo@elte.hu>
---
fs/pipe.c | 5 +++++
fs/splice.c | 1 +
2 files changed, 6 insertions(+)

Index: linux-2.6-lttng/fs/pipe.c
===================================================================
--- linux-2.6-lttng.orig/fs/pipe.c 2009-02-06 14:45:33.000000000 -0500
+++ linux-2.6-lttng/fs/pipe.c 2009-02-06 14:57:50.000000000 -0500
@@ -188,6 +188,7 @@ void *generic_pipe_buf_map(struct pipe_i

return kmap(buf->page);
}
+EXPORT_SYMBOL_GPL(generic_pipe_buf_map);

/**
* generic_pipe_buf_unmap - unmap a previously mapped pipe buffer
@@ -207,6 +208,7 @@ void generic_pipe_buf_unmap(struct pipe_
} else
kunmap(buf->page);
}
+EXPORT_SYMBOL_GPL(generic_pipe_buf_unmap);

/**
* generic_pipe_buf_steal - attempt to take ownership of a &pipe_buffer
@@ -237,6 +239,7 @@ int generic_pipe_buf_steal(struct pipe_i

return 1;
}
+EXPORT_SYMBOL_GPL(generic_pipe_buf_steal);

/**
* generic_pipe_buf_get - get a reference to a &struct pipe_buffer
@@ -252,6 +255,7 @@ void generic_pipe_buf_get(struct pipe_in
{
page_cache_get(buf->page);
}
+EXPORT_SYMBOL_GPL(generic_pipe_buf_get);

/**
* generic_pipe_buf_confirm - verify contents of the pipe buffer
@@ -267,6 +271,7 @@ int generic_pipe_buf_confirm(struct pipe
{
return 0;
}
+EXPORT_SYMBOL_GPL(generic_pipe_buf_confirm);

static const struct pipe_buf_operations anon_pipe_buf_ops = {
.can_merge = 1,
Index: linux-2.6-lttng/fs/splice.c
===================================================================
--- linux-2.6-lttng.orig/fs/splice.c 2009-02-06 14:45:33.000000000 -0500
+++ linux-2.6-lttng/fs/splice.c 2009-02-06 14:57:50.000000000 -0500
@@ -260,6 +260,7 @@ ssize_t splice_to_pipe(struct pipe_inode

return ret;
}
+EXPORT_SYMBOL_GPL(splice_to_pipe);

static void spd_release_page(struct splice_pipe_desc *spd, unsigned int i)
{