From: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
To: mingo@elte.hu
Cc: LKML <linux-kernel@vger.kernel.org>,
Steven Rostedt <rostedt@goodmis.org>
Subject: [PATCH] ring_buffer: use list_replace() in rb_get_reader_page()
Date: Mon, 25 May 2009 11:58:40 +0800 [thread overview]
Message-ID: <4A1A1770.6070103@cn.fujitsu.com> (raw)
Use list_replace() to splice list in rb_get_reader_page()
[ Impact: cleanup ]
Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
---
kernel/trace/ring_buffer.c | 12 ++----------
1 files changed, 2 insertions(+), 10 deletions(-)
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index f558b37..f88bfcc 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -2179,22 +2179,14 @@ rb_get_reader_page(struct ring_buffer_per_cpu *cpu_buffer)
if (cpu_buffer->commit_page == cpu_buffer->reader_page)
goto out;
- /*
- * Splice the empty reader page into the list around the head.
- * Reset the reader page to size zero.
- */
-
+ /* Reset the reader page to size zero */
reader = cpu_buffer->head_page;
- cpu_buffer->reader_page->list.next = reader->list.next;
- cpu_buffer->reader_page->list.prev = reader->list.prev;
-
local_set(&cpu_buffer->reader_page->write, 0);
local_set(&cpu_buffer->reader_page->entries, 0);
local_set(&cpu_buffer->reader_page->page->commit, 0);
/* Make the reader page now replace the head */
- reader->list.prev->next = &cpu_buffer->reader_page->list;
- reader->list.next->prev = &cpu_buffer->reader_page->list;
+ list_replace(&reader->list, &cpu_buffer->reader_page->list);
/*
* If the tail is on the reader, then we must set the head
--
1.6.1.2
next reply other threads:[~2009-05-25 3:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-25 3:58 Xiao Guangrong [this message]
2009-05-26 19:14 ` Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A1A1770.6070103@cn.fujitsu.com \
--to=xiaoguangrong@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome