From owner-svn-src-user@FreeBSD.ORG Tue Nov 1 04:21:57 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D46AF1065676; Tue, 1 Nov 2011 04:21:57 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C4B0D8FC1A; Tue, 1 Nov 2011 04:21:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA14LvDt048497; Tue, 1 Nov 2011 04:21:57 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA14LvCQ048495; Tue, 1 Nov 2011 04:21:57 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201111010421.pA14LvCQ048495@svn.freebsd.org> From: Jeff Roberson Date: Tue, 1 Nov 2011 04:21:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226983 - user/attilio/vmcontention/sys/vm X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Nov 2011 04:21:57 -0000 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 * Copyright (c) 2008 Mayur Shardul * 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_ */