From owner-freebsd-current@FreeBSD.ORG Sun Sep 28 16:46:51 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2DD4516A4B3; Sun, 28 Sep 2003 16:46:51 -0700 (PDT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2079F44022; Sun, 28 Sep 2003 16:46:50 -0700 (PDT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.9p2/8.12.9) with ESMTP id h8SNkK7R086827; Sun, 28 Sep 2003 19:46:20 -0400 (EDT) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)h8SNkKju086824; Sun, 28 Sep 2003 19:46:20 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Sun, 28 Sep 2003 19:46:20 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: "Greg 'groggy' Lehey" In-Reply-To: <20030928230008.GF11520@wantadilla.lemis.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: arch@FreeBSD.org cc: Poul-Henning Kamp cc: current@FreeBSD.org Subject: Re: HEADSUP: Change of makedev() semantics. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Sep 2003 23:46:51 -0000 On Mon, 29 Sep 2003, Greg 'groggy' Lehey wrote: > On Sunday, 28 September 2003 at 23:22:07 +0200, Poul-Henning Kamp wrote: > > Basically: > > > > 3. If you do a "normal" device driver, cache the result > > from when you call make_dev(). > > ... > > > > ./dev/vinum > > Failure to cache result of make_dev() ? > > Where should this be cached? Can you point to example code? Actually, it looks like Vinum is caching the dev_t's, but it's not always using them to get back to the dev_t--sometimes it's invoking makedev() instead. However, this appears to happen only in the vinumrevive.c code, so I'm not sure if that's a property of the cached reference being unavailable -- it looks like it should be available in that context though. I.e., using sd->dev instead of VINUM_SD() -- it looks like there is a valid (struct sd *) reference there to follow, so you can get to the dev_t without doing a makedev(). Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Network Associates Laboratories