Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S266017AbUAEXOP (ORCPT ); Mon, 5 Jan 2004 18:14:15 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S265994AbUAEXOO (ORCPT ); Mon, 5 Jan 2004 18:14:14 -0500 Received: from kweetal.tue.nl ([131.155.3.6]:49420 "EHLO kweetal.tue.nl") by vger.kernel.org with ESMTP id S266018AbUAEXNo (ORCPT ); Mon, 5 Jan 2004 18:13:44 -0500 Date: Tue, 6 Jan 2004 00:13:26 +0100 From: Andries Brouwer To: Linus Torvalds Cc: Andries Brouwer , Daniel Jacobowitz , Rob Love , rob@landley.net, Pascal Schmidt , linux-kernel@vger.kernel.org, Greg KH Subject: Re: udev and devfs - The final word Message-ID: <20040106001326.A1128@pclin040.win.tue.nl> References: <20040104142111.A11279@pclin040.win.tue.nl> <20040104230104.A11439@pclin040.win.tue.nl> <20040105030737.GA29964@nevyn.them.org> <20040105132756.A975@pclin040.win.tue.nl> <20040105205228.A1092@pclin040.win.tue.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from torvalds@osdl.org on Mon, Jan 05, 2004 at 12:38:54PM -0800 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1757 Lines: 45 On Mon, Jan 05, 2004 at 12:38:54PM -0800, Linus Torvalds wrote: > Have you even _tried_ udev? Yes, and it works reasonably well. I have version 012 here. Some flaws will be fixed in 013 or so. Some difficulties are of a more fundamental type, not so easy to fix. But udev is an entirely different discussion. Some other time. > In particular, the kernel should never have policy encoded in it, and > naming of a device is about pretty much nothing _but_ policy. Of course. But this is not about naming. The kernel invents device numbers, and user space names. Now compare our setups: dev_t lbt_devno(void) { return random(); } dev_t aeb_devno(char *s) { dev_t d = hash(s); while (inuse(d)) d++; return d; } An earlier fragment of the discussion was concerned with the fact that random(); is a bad idea. Something reproducible is better. Let us abbreviate the above function f. Some driver determines that a disk has serial number A809ADGC. Another driver determines that some device was produced by HP but otherwise has no opinion. A third driver has no stable information at all about the device. They assign device numbers f("A809ADGC"), f("HP"), f(""). What is the result? Yes, device numbers are cookies, but a reasonable attempt has been made to make the device numbers stable. No guarantees anywhere - this is best effort. Better than no effort. And this information helps udev. It may make a callout superfluous, or even give udev information that cannot be obtained from userspace. Andries - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/