summaryrefslogtreecommitdiffstats
path: root/fs/block_dev.c
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2013-07-18 20:47:10 +0200
committerSteven Rostedt <rostedt@goodmis.org>2013-07-19 03:31:32 +0200
commit7710b639953b791610f0022a7d52d9801c93b969 (patch)
treead1e4822ad3b1b067ee2806142613caec0ed1e60 /fs/block_dev.c
parenttracing: Add ref_data to function and fgraph tracer structs (diff)
downloadlinux-7710b639953b791610f0022a7d52d9801c93b969.tar.xz
linux-7710b639953b791610f0022a7d52d9801c93b969.zip
tracing: Simplify the iteration logic in f_start/f_next
f_next() looks overcomplicated, and it is not strictly correct even if this doesn't matter. Say, FORMAT_FIELD_SEPERATOR should not return NULL (means EOF) if trace_get_fields() returns an empty list, we should simply advance to FORMAT_PRINTFMT as we do when we find the end of list. 1. Change f_next() to return "struct list_head *" rather than "ftrace_event_field *", and change f_show() to do list_entry(). This simplifies the code a bit, only f_show() needs to know about ftrace_event_field, and f_next() can play with ->prev directly 2. Change f_next() to not play with ->prev / return inside the switch() statement. It can simply set node = head/common_head, the prev-or-advance-to-the-next-magic below does all work. While at it. f_start() looks overcomplicated too. I don't think *pos == 0 makes sense as a separate case, just change this code to do "while" instead of "do/while". The patch also moves f_start() down, close to f_stop(). This is purely cosmetic, just to make the locking added by the next patch more clear/visible. Link: http://lkml.kernel.org/r/20130718184710.GA4783@redhat.com Signed-off-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'fs/block_dev.c')
0 files changed, 0 insertions, 0 deletions