From owner-freebsd-arch@FreeBSD.ORG Tue May 27 20:10:23 2008 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D9DC1065676 for ; Tue, 27 May 2008 20:10:23 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id 22F298FC15 for ; Tue, 27 May 2008 20:10:22 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m4RKA2BE036928 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 27 May 2008 23:10:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m4RKA27E086446; Tue, 27 May 2008 23:10:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2/Submit) id m4RKA2YF086225; Tue, 27 May 2008 23:10:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 27 May 2008 23:10:02 +0300 From: Kostik Belousov To: Ed Schouten Message-ID: <20080527201002.GU21317@deviant.kiev.zoral.com.ua> References: <20080527130615.GJ64397@hoeg.nl> <20080527150244.GN21317@deviant.kiev.zoral.com.ua> <20080527165753.GK64397@hoeg.nl> <20080527191302.GS21317@deviant.kiev.zoral.com.ua> <20080527193242.GN64397@hoeg.nl> <20080527194823.GT21317@deviant.kiev.zoral.com.ua> <20080527194840.GO64397@hoeg.nl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="dXvu6+ixFx2ZffE8" Content-Disposition: inline In-Reply-To: <20080527194840.GO64397@hoeg.nl> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.91.2, clamav-milter version 0.91.2 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.4 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on skuns.kiev.zoral.com.ua Cc: arch@freebsd.org Subject: Re: Simplifying devfs: minor == unit X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2008 20:10:23 -0000 --dXvu6+ixFx2ZffE8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 27, 2008 at 09:48:40PM +0200, Ed Schouten wrote: > * Kostik Belousov wrote: > > In fact, I do not understand why you leave the UMINORMASK stuff. It mak= es > > no sense with the unit =3D=3D minor, IMHO. >=20 > That's because the uminor() and umajor() routines operate on user device > numbers (dev_t's). We need to leave those intact, to make things like > the binary compat work. What does it mean to take bits 8-15 from the the unit number to denote some fictitious major ? And, what binary compatibility you talk about ? You changed the layout of the encoding for the minor, but still take the major from it, while there is simply no space for major after your patch, and definitely not in [8:15]. Also, look at the sys/types.h: #ifndef _KERNEL /* * minor() gives a cookie instead of an index since we don't want to * change the meanings of bits 0-15 or waste time and space shifting * bits 16-31 for devices that don't use them. */ #define major(x) ((int)(((u_int)(x) >> 8)&0xff)) /* major number */ #define minor(x) ((int)((x)&0xffff00ff)) /* minor number */ #endif /* !_KERNEL */ #define makedev(x,y) ((dev_t)(((x) << 8) | (y))) /* create dev_t */ I think, if you want to do the change you proposed, the minors for cdevs shall be cleanly separated from the major/minor something, the later has no relations with the cdevs in the current FreeBSD. I.e., in your patch, the uminor() can and shall be made identity function, to match minor2unit() and unit2minor(), and umajor() shall just return 0. It would be nice to verify that the linuxolator emulation still works (look at the compat/linux/linux_stats.c). --dXvu6+ixFx2ZffE8 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkg8apkACgkQC3+MBN1Mb4hcHgCfYnCrI9/5GgT58CKE9Dqm2Vvh 0NoAn2eJoh8ydCn2jU15ZtICYhsnNux6 =QwvR -----END PGP SIGNATURE----- --dXvu6+ixFx2ZffE8--