From owner-cvs-src@FreeBSD.ORG Tue Mar 8 10:40:48 2005 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E559E16A4CE; Tue, 8 Mar 2005 10:40:48 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id CC75343D41; Tue, 8 Mar 2005 10:40:48 +0000 (GMT) (envelope-from phk@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j28Aem4l077618; Tue, 8 Mar 2005 10:40:48 GMT (envelope-from phk@repoman.freebsd.org) Received: (from phk@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j28Aem95077617; Tue, 8 Mar 2005 10:40:48 GMT (envelope-from phk) Message-Id: <200503081040.j28Aem95077617@repoman.freebsd.org> From: Poul-Henning Kamp Date: Tue, 8 Mar 2005 10:40:48 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/kern subr_unit.c src/sys/sys systm.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2005 10:40:49 -0000 phk 2005-03-08 10:40:48 UTC FreeBSD src repository Modified files: sys/kern subr_unit.c sys/sys systm.h Log: Reengineer subr_unit Add support for passing in a mutex. If NULL is passed a global subr_unit mutex is used. Add alloc_unrl() which expects the mutex to be held. Allocating a unit will never sleep as it does not need to allocate memory. Cut possible range in half so we can use -1 to mean "out of number". Collapse first and last runs into the head by means of counters. This saves memory in the common case(s). Revision Changes Path 1.6 +511 -287 src/sys/kern/subr_unit.c 1.227 +3 -2 src/sys/sys/systm.h