diff options
| author | Steven Rostedt (Red Hat) <rostedt@goodmis.org> | 2014-10-29 17:30:50 -0400 |
|---|---|---|
| committer | Steven Rostedt <rostedt@goodmis.org> | 2014-11-19 22:01:18 -0500 |
| commit | 01cb06a4c229908d239149017049fdd1fca1dd51 (patch) | |
| tree | 16af818800dc163c155c20dbacb782257d604534 /kernel/trace | |
| parent | 8cd709ae7658a7fd7f6630699e3229188c2591e4 (diff) | |
tracing: Add seq_buf_get_buf() and seq_buf_commit() helper functions
Add two helper functions; seq_buf_get_buf() and seq_buf_commit() that
are used by seq_buf_path(). This makes the code similar to the
seq_file: seq_path() function, and will help to be able to consolidate
the functions between seq_file and trace_seq.
Link: http://lkml.kernel.org/r/20141104160222.644881406@goodmis.org
Link: http://lkml.kernel.org/r/20141114011412.977571447@goodmis.org
Tested-by: Jiri Kosina <jkosina@suse.cz>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Reviewed-by: Petr Mladek <pmladek@suse.cz>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace')
| -rw-r--r-- | kernel/trace/seq_buf.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/kernel/trace/seq_buf.c b/kernel/trace/seq_buf.c index c53f1d5088e8..086f594ac890 100644 --- a/kernel/trace/seq_buf.c +++ b/kernel/trace/seq_buf.c | |||
| @@ -293,8 +293,8 @@ int seq_buf_putmem_hex(struct seq_buf *s, const void *mem, | |||
| 293 | */ | 293 | */ |
| 294 | int seq_buf_path(struct seq_buf *s, const struct path *path, const char *esc) | 294 | int seq_buf_path(struct seq_buf *s, const struct path *path, const char *esc) |
| 295 | { | 295 | { |
| 296 | char *buf = s->buffer + s->len; | 296 | char *buf; |
| 297 | size_t size = seq_buf_buffer_left(s); | 297 | size_t size = seq_buf_get_buf(s, &buf); |
| 298 | int res = -1; | 298 | int res = -1; |
| 299 | 299 | ||
| 300 | WARN_ON(s->size == 0); | 300 | WARN_ON(s->size == 0); |
| @@ -307,8 +307,7 @@ int seq_buf_path(struct seq_buf *s, const struct path *path, const char *esc) | |||
| 307 | res = end - buf; | 307 | res = end - buf; |
| 308 | } | 308 | } |
| 309 | } | 309 | } |
| 310 | if (res > 0) | 310 | seq_buf_commit(s, res); |
| 311 | s->len += res; | ||
| 312 | 311 | ||
| 313 | return res; | 312 | return res; |
| 314 | } | 313 | } |
