lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 25 May 2009 11:58:40 +0800
From:	Xiao Guangrong <xiaoguangrong@...fujitsu.com>
To:	mingo@...e.hu
CC:	LKML <linux-kernel@...r.kernel.org>,
	Steven Rostedt <rostedt@...dmis.org>
Subject: [PATCH] ring_buffer: use list_replace() in rb_get_reader_page()

Use list_replace() to splice list in rb_get_reader_page()

[ Impact: cleanup ]

Signed-off-by: Xiao Guangrong <xiaoguangrong@...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


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ