Commit c7625a55 authored by Lai Jiangshan's avatar Lai Jiangshan Committed by Ingo Molnar

tracing: update file->f_pos when splice(2) it

Impact: Cleanup

These two lines:

	if (unlikely(*ppos))
		return -ESPIPE;

in tracing_buffers_splice_read() are not needed, VFS layer
has disabled seek(2).

We remove these two lines, and then we can update file->f_pos.

And tracing_buffers_read() updates file->f_pos, this fix
make tracing_buffers_splice_read() updates file->f_pos too.
Signed-off-by: default avatarLai Jiangshan <laijs@cn.fujitsu.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Steven Rostedt <srostedt@redhat.com>
LKML-Reference: <49D46670.4010503@cn.fujitsu.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent ddd538f3
...@@ -3428,13 +3428,6 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos, ...@@ -3428,13 +3428,6 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos,
int size, i; int size, i;
size_t ret; size_t ret;
/*
* We can't seek on a buffer input
*/
if (unlikely(*ppos))
return -ESPIPE;
for (i = 0; i < PIPE_BUFFERS && len; i++, len -= size) { for (i = 0; i < PIPE_BUFFERS && len; i++, len -= size) {
struct page *page; struct page *page;
int r; int r;
...@@ -3474,6 +3467,7 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos, ...@@ -3474,6 +3467,7 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos,
spd.partial[i].offset = 0; spd.partial[i].offset = 0;
spd.partial[i].private = (unsigned long)ref; spd.partial[i].private = (unsigned long)ref;
spd.nr_pages++; spd.nr_pages++;
*ppos += size;
} }
spd.nr_pages = i; spd.nr_pages = i;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment