From owner-freebsd-arch@FreeBSD.ORG Sun Sep 28 16:59:12 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AA0F916A4B3; Sun, 28 Sep 2003 16:59:12 -0700 (PDT) Received: from ozlabs.org (ozlabs.org [203.10.76.45]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8C2674403F; Sun, 28 Sep 2003 16:59:11 -0700 (PDT) (envelope-from grog@lemis.com) Received: from blackwater.lemis.com (blackwater.lemis.com [192.109.197.80]) by ozlabs.org (Postfix) with ESMTP id 44B7E2BD41; Mon, 29 Sep 2003 09:59:09 +1000 (EST) Received: by blackwater.lemis.com (Postfix, from userid 1004) id 73D0351836; Mon, 29 Sep 2003 09:29:06 +0930 (CST) Date: Mon, 29 Sep 2003 09:29:06 +0930 From: Greg 'groggy' Lehey To: Robert Watson Message-ID: <20030928235906.GG11520@wantadilla.lemis.com> References: <20030928230008.GF11520@wantadilla.lemis.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="S5HS5MvDw4DmbRmb" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i Organization: The FreeBSD Project Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-418-838-708 WWW-Home-Page: http://www.FreeBSD.org/ X-PGP-Fingerprint: 9A1B 8202 BCCE B846 F92F 09AC 22E6 F290 507A 4223 cc: arch@FreeBSD.org cc: Poul-Henning Kamp cc: current@FreeBSD.org Subject: Re: HEADSUP: Change of makedev() semantics. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Sep 2003 23:59:12 -0000 --S5HS5MvDw4DmbRmb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sunday, 28 September 2003 at 19:46:20 -0400, Robert Watson wrote: > > 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, Ah, you mean saving the results rather than calling make_dev() every time? Yes, it only calls make_dev() once for any device. > 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. No, it should always be available. I was going to say "I don't see any references to make_dev() in vinumrevive.c, nor any references to makedev() at all", but I see that VINUM_SD includes both. > 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(). Yes, this is a bug (and an indication of the dangers of using macros :-) I'll fix it. Greg -- See complete headers for address and phone numbers. NOTE: Due to the currently active Microsoft-based worms, I am limiting all incoming mail to 131,072 bytes. This is enough for normal mail, but not for large attachments. Please send these as URLs. --S5HS5MvDw4DmbRmb Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.0 (FreeBSD) iD8DBQE/d3XKIubykFB6QiMRAm5CAKCPLcOmXQlsNb4IVNsJz2Wx1ip2SQCfTBtE E5DAbhM6C3Lms7NO/7/bJn0= =SbzM -----END PGP SIGNATURE----- --S5HS5MvDw4DmbRmb--