[PATCH 3/4] tracing: update file->f_pos when splice(2) it

From: Lai Jiangshan
Date: Thu Apr 02 2009 - 03:19:17 EST



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: Lai Jiangshan <laijs@xxxxxxxxxxxxxx>
---
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 2a81dec..d101c12 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -3408,13 +3408,6 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos,
int size, i;
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) {
struct page *page;
int r;
@@ -3454,6 +3447,7 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos,
spd.partial[i].offset = 0;
spd.partial[i].private = (unsigned long)ref;
spd.nr_pages++;
+ *ppos += size;
}

spd.nr_pages = i;







--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/