From owner-freebsd-arch@FreeBSD.ORG Wed Jun 9 11:16:44 2004 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 AA2AC16A4CE for ; Wed, 9 Jun 2004 11:16:44 +0000 (GMT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 006D243D49 for ; Wed, 9 Jun 2004 11:16:44 +0000 (GMT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.11/8.12.11) with ESMTP id i59BGUPv053994 for ; Wed, 9 Jun 2004 13:16:30 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: arch@freebsd.org From: Poul-Henning Kamp Date: Wed, 09 Jun 2004 13:16:30 +0200 Message-ID: <53993.1086779790@critter.freebsd.dk> Subject: dev_t / udev_t confusion ? 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: Wed, 09 Jun 2004 11:16:44 -0000 I have an item on my TODO list which says "fix dev_t / udev_t kernel confusion before 5-STABLE ?". The confusions is that in userland dev_t is an integer type which encodes the major+minor number of a device, in the kernel it it a pointer to "struct cdev" which represents the device to the kernel. Back when dev_t became a struct pointer, I counted the number of kernel source files which used the kernel dev_t vs the ones that used the useland dev_t and found something like 325:25. Since we share a number of device drivers with other OSs, and following the simple plurality, I called the userland dev_t "udev_t" in the kernel. And therefore, "dev_t" in userland and "dev_t" in the kernel are entirely different. We had a discussion about fixing this some point back, and I am not sure if we really reached closure on it. The change proposed is more or less to do: s/dev_t/struct cdev */ s/udev_t/dev_t/ over all the kernel sources (366 files or so). The benefit is that we get the dev_t/udev_t confusion solved, the disadvantage (apart from the churn) is that we reduce the already limited direct source compatibility with other BSDs a bit further. Personally I'm pretty 50/50 on this issue, but if we want to do it, we want to do it before 5-STABLE, not after (to avoid the FreeBSD3 syndrome). Personally I don't think there is much need for a long discussion and I would prefer to see simply a show of hands for yes and no, and any hear any really heavy duty arguments pro et contra. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.