Skip to content

Commit

Permalink
ring-buffer: rename label out_unlock to out_reset
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Steven Rostedt committed Feb 12, 2009
1 parent e7669b8 commit 45141d4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions kernel/trace/ring_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ __rb_reserve_next(struct ring_buffer_per_cpu *cpu_buffer,
*/
if (unlikely(in_nmi())) {
if (!__raw_spin_trylock(&cpu_buffer->lock))
goto out_unlock;
goto out_reset;
} else
__raw_spin_lock(&cpu_buffer->lock);

Expand All @@ -1030,7 +1030,7 @@ __rb_reserve_next(struct ring_buffer_per_cpu *cpu_buffer,

/* we grabbed the lock before incrementing */
if (RB_WARN_ON(cpu_buffer, next_page == reader_page))
goto out_unlock;
goto out_reset;

/*
* If for some reason, we had an interrupt storm that made
Expand All @@ -1039,12 +1039,12 @@ __rb_reserve_next(struct ring_buffer_per_cpu *cpu_buffer,
*/
if (unlikely(next_page == commit_page)) {
WARN_ON_ONCE(1);
goto out_unlock;
goto out_reset;
}

if (next_page == head_page) {
if (!(buffer->flags & RB_FL_OVERWRITE))
goto out_unlock;
goto out_reset;

/* tail_page has not moved yet? */
if (tail_page == cpu_buffer->tail_page) {
Expand Down Expand Up @@ -1118,7 +1118,7 @@ __rb_reserve_next(struct ring_buffer_per_cpu *cpu_buffer,

return event;

out_unlock:
out_reset:
/* reset write */
if (tail <= BUF_PAGE_SIZE)
local_set(&tail_page->write, tail);
Expand Down

0 comments on commit 45141d4

Please sign in to comment.