diff options
author | Steven Rostedt <srostedt@redhat.com> | 2009-02-12 13:19:48 -0500 |
---|---|---|
committer | Steven Rostedt <srostedt@redhat.com> | 2009-02-12 13:39:46 -0500 |
commit | 45141d4667d208421ca787a3301542b6a5e0b112 (patch) | |
tree | 7f1cedbd431b9b01345730e338c179e6bb8029ad /kernel/trace/ring_buffer.c | |
parent | e7669b8e329255bbcb40af65b38e342825d97a46 (diff) |
ring-buffer: rename label out_unlock to out_reset
Impact: clean up
While reviewing the ring buffer code, I thougth I saw a bug with
if (!__raw_spin_trylock(&cpu_buffer->lock))
goto out_unlock;
But I forgot that we use a variable "lock_taken" that is set if
the spinlock is taken, and only unlock it if that variable is set.
To avoid further confusion from other reviewers, this patch
renames the label out_unlock with out_reset, which is the more
appropriate name.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Diffstat (limited to 'kernel/trace/ring_buffer.c')
-rw-r--r-- | kernel/trace/ring_buffer.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index dc18b5b9ccb4..f39d7e9a4305 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c | |||
@@ -1017,7 +1017,7 @@ __rb_reserve_next(struct ring_buffer_per_cpu *cpu_buffer, | |||
1017 | */ | 1017 | */ |
1018 | if (unlikely(in_nmi())) { | 1018 | if (unlikely(in_nmi())) { |
1019 | if (!__raw_spin_trylock(&cpu_buffer->lock)) | 1019 | if (!__raw_spin_trylock(&cpu_buffer->lock)) |
1020 | goto out_unlock; | 1020 | goto out_reset; |
1021 | } else | 1021 | } else |
1022 | __raw_spin_lock(&cpu_buffer->lock); | 1022 | __raw_spin_lock(&cpu_buffer->lock); |
1023 | 1023 | ||
@@ -1030,7 +1030,7 @@ __rb_reserve_next(struct ring_buffer_per_cpu *cpu_buffer, | |||
1030 | 1030 | ||
1031 | /* we grabbed the lock before incrementing */ | 1031 | /* we grabbed the lock before incrementing */ |
1032 | if (RB_WARN_ON(cpu_buffer, next_page == reader_page)) | 1032 | if (RB_WARN_ON(cpu_buffer, next_page == reader_page)) |
1033 | goto out_unlock; | 1033 | goto out_reset; |
1034 | 1034 | ||
1035 | /* | 1035 | /* |
1036 | * If for some reason, we had an interrupt storm that made | 1036 | * If for some reason, we had an interrupt storm that made |
@@ -1039,12 +1039,12 @@ __rb_reserve_next(struct ring_buffer_per_cpu *cpu_buffer, | |||
1039 | */ | 1039 | */ |
1040 | if (unlikely(next_page == commit_page)) { | 1040 | if (unlikely(next_page == commit_page)) { |
1041 | WARN_ON_ONCE(1); | 1041 | WARN_ON_ONCE(1); |
1042 | goto out_unlock; | 1042 | goto out_reset; |
1043 | } | 1043 | } |
1044 | 1044 | ||
1045 | if (next_page == head_page) { | 1045 | if (next_page == head_page) { |
1046 | if (!(buffer->flags & RB_FL_OVERWRITE)) | 1046 | if (!(buffer->flags & RB_FL_OVERWRITE)) |
1047 | goto out_unlock; | 1047 | goto out_reset; |
1048 | 1048 | ||
1049 | /* tail_page has not moved yet? */ | 1049 | /* tail_page has not moved yet? */ |
1050 | if (tail_page == cpu_buffer->tail_page) { | 1050 | if (tail_page == cpu_buffer->tail_page) { |
@@ -1118,7 +1118,7 @@ __rb_reserve_next(struct ring_buffer_per_cpu *cpu_buffer, | |||
1118 | 1118 | ||
1119 | return event; | 1119 | return event; |
1120 | 1120 | ||
1121 | out_unlock: | 1121 | out_reset: |
1122 | /* reset write */ | 1122 | /* reset write */ |
1123 | if (tail <= BUF_PAGE_SIZE) | 1123 | if (tail <= BUF_PAGE_SIZE) |
1124 | local_set(&tail_page->write, tail); | 1124 | local_set(&tail_page->write, tail); |