Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/riastradh-drm2]: src/sys/external/bsd/drm2/linux Work around rb_tree_ite...
details: https://anonhg.NetBSD.org/src/rev/08b9c1e90842
branches: riastradh-drm2
changeset: 788327:08b9c1e90842
user: riastradh <riastradh%NetBSD.org@localhost>
date: Wed Jul 24 03:16:32 2013 +0000
description:
Work around rb_tree_iterate API botch in linux_idr.c.
diffstat:
sys/external/bsd/drm2/linux/linux_idr.c | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
diffs (43 lines):
diff -r 35bcd5c293f5 -r 08b9c1e90842 sys/external/bsd/drm2/linux/linux_idr.c
--- a/sys/external/bsd/drm2/linux/linux_idr.c Wed Jul 24 03:16:15 2013 +0000
+++ b/sys/external/bsd/drm2/linux/linux_idr.c Wed Jul 24 03:16:32 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_idr.c,v 1.1.2.6 2013/07/24 03:16:15 riastradh Exp $ */
+/* $NetBSD: linux_idr.c,v 1.1.2.7 2013/07/24 03:16:32 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_idr.c,v 1.1.2.6 2013/07/24 03:16:15 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_idr.c,v 1.1.2.7 2013/07/24 03:16:32 riastradh Exp $");
#include <sys/param.h>
#include <sys/atomic.h>
@@ -160,8 +160,7 @@
struct idr_node *node;
rw_enter(&idr->idr_lock, RW_WRITER);
- while ((node = rb_tree_iterate(&idr->idr_tree, NULL, RB_DIR_RIGHT)) !=
- NULL) {
+ while ((node = RB_TREE_MIN(&idr->idr_tree)) != NULL) {
rb_tree_remove_node(&idr->idr_tree, node);
rw_exit(&idr->idr_lock);
kmem_free(node, sizeof(*node));
@@ -223,12 +222,11 @@
int
idr_for_each(struct idr *idr, int (*proc)(int, void *, void *), void *arg)
{
- struct idr_node *node = NULL;
+ struct idr_node *node;
int error = 0;
rw_enter(&idr->idr_lock, RW_READER);
- while ((node = rb_tree_iterate(&idr->idr_tree, node, RB_DIR_RIGHT))
- != NULL) {
+ RB_TREE_FOREACH(node, &idr->idr_tree) {
error = (*proc)(node->in_index, node->in_data, arg);
if (error)
break;
Home |
Main Index |
Thread Index |
Old Index