Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/drm2/include/linux Define rb_erase and rb_e...
details: https://anonhg.NetBSD.org/src/rev/bf4de6eff77b
branches: trunk
changeset: 1027895:bf4de6eff77b
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sun Dec 19 01:08:43 2021 +0000
description:
Define rb_erase and rb_erase_cached -- easy wrappers.
diffstat:
sys/external/bsd/drm2/include/linux/rbtree.h | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
diffs (29 lines):
diff -r c9740bdbd0b9 -r bf4de6eff77b sys/external/bsd/drm2/include/linux/rbtree.h
--- a/sys/external/bsd/drm2/include/linux/rbtree.h Sun Dec 19 01:08:35 2021 +0000
+++ b/sys/external/bsd/drm2/include/linux/rbtree.h Sun Dec 19 01:08:43 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rbtree.h,v 1.4 2021/12/19 00:47:54 riastradh Exp $ */
+/* $NetBSD: rbtree.h,v 1.5 2021/12/19 01:08:43 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -49,4 +49,19 @@
return RB_TREE_MIN(&root->rbr_tree) == NULL;
}
+static inline void
+rb_erase(struct rb_root *root, struct rb_node *rbnode)
+{
+ struct rb_tree *tree = &root->rbr_tree;
+ void *node = (char *)rbnode - tree->rbt_ops->rbto_node_offset;
+
+ rb_tree_remove_node(tree, node);
+}
+
+static inline void
+rb_erase_cached(struct rb_root_cached *root, struct rb_node *rbnode)
+{
+ rb_erase(&root->rbrc_root, rbnode);
+}
+
#endif /* _LINUX_RBTREE_H_ */
Home |
Main Index |
Thread Index |
Old Index