svn commit: r226983 - user/attilio/vmcontention/sys/vm

Jeff Roberson jeff at FreeBSD.org
Tue Nov 1 04:21:57 UTC 2011


Author: jeff
Date: Tue Nov  1 04:21:57 2011
New Revision: 226983
URL: http://svn.freebsd.org/changeset/base/226983

Log:
   - Add some convenience inlines.
   - Update the copyright.

Modified:
  user/attilio/vmcontention/sys/vm/vm_radix.h

Modified: user/attilio/vmcontention/sys/vm/vm_radix.h
==============================================================================
--- user/attilio/vmcontention/sys/vm/vm_radix.h	Tue Nov  1 04:01:39 2011	(r226982)
+++ user/attilio/vmcontention/sys/vm/vm_radix.h	Tue Nov  1 04:21:57 2011	(r226983)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2011 Jeffrey Roberson <jeff at freebsd.org>
  * Copyright (c) 2008 Mayur Shardul <mayur.shardul at gmail.com>
  * All rights reserved.
  *
@@ -99,5 +100,37 @@ vm_radix_lookup_ge(struct vm_radix *rtre
         return (NULL);
 }
 
+static inline void *
+vm_radix_last(struct vm_radix *rtree, int color)
+{
+
+	return vm_radix_lookup_le(rtree, 0, color);
+}
+
+static inline void *
+vm_radix_first(struct vm_radix *rtree, int color)
+{
+
+	return vm_radix_lookup_ge(rtree, 0, color);
+}
+
+static inline void *
+vm_radix_next(struct vm_radix *rtree, vm_pindex_t index, int color)
+{
+
+	if (index == -1)
+		return (NULL);
+	return vm_radix_lookup_ge(rtree, index + 1, color);
+}
+
+static inline void *
+vm_radix_prev(struct vm_radix *rtree, vm_pindex_t index, int color)
+{
+
+	if (index == 0)
+		return (NULL);
+	return vm_radix_lookup_le(rtree, index - 1, color);
+}
+
 #endif /* _KERNEL */
 #endif /* !_VM_RADIX_H_ */


More information about the svn-src-user mailing list