From owner-freebsd-current@FreeBSD.ORG Thu Mar 10 06:32:42 2005 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 0686A16A4CE for ; Thu, 10 Mar 2005 06:32:42 +0000 (GMT) Received: from critter.freebsd.dk (f170.freebsd.dk [212.242.86.170]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4F3BE43D2D for ; Thu, 10 Mar 2005 06:32:41 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.13.1/8.13.1) with ESMTP id j2A6Wdpd006252; Thu, 10 Mar 2005 07:32:40 +0100 (CET) (envelope-from phk@critter.freebsd.dk) To: Andrey Chernov From: "Poul-Henning Kamp" In-Reply-To: Your message of "Thu, 10 Mar 2005 09:24:11 +0300." <20050310062410.GA27497@nagual.pp.ru> Date: Thu, 10 Mar 2005 07:32:39 +0100 Message-ID: <6251.1110436359@critter.freebsd.dk> Sender: phk@critter.freebsd.dk cc: current@FreeBSD.ORG Subject: Re: [TEST(/review)] major/minor/devname fix 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: Thu, 10 Mar 2005 06:32:42 -0000 In message <20050310062410.GA27497@nagual.pp.ru>, Andrey Chernov writes: >On Wed, Mar 09, 2005 at 10:40:18PM +0100, Poul-Henning Kamp wrote: >> +dev_t >> +dev2udev(struct cdev *x) >> +{ >> + if (x == NULL) >> + return (NODEV); >> + return (x->si_inode ^ devfs_random()); >> +} > >... > >> + dp = devfs_itod(ud ^ devfs_random()); > > >Why you try to use randomization here instead of sequental ordering (or >reversing/shifting it)? In such small number of bits there is a big >probability of collisions may occurse. There is no risk of collision, look at what devfs_random() does. -- 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.