Date: Tue, 1 Nov 2011 04:21:57 +0000 (UTC) From: Jeff Roberson <jeff@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r226983 - user/attilio/vmcontention/sys/vm Message-ID: <201111010421.pA14LvCQ048495@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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@freebsd.org> * Copyright (c) 2008 Mayur Shardul <mayur.shardul@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_ */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201111010421.pA14LvCQ048495>