Date: Thu, 10 Mar 2005 07:32:39 +0100 From: "Poul-Henning Kamp" <phk@phk.freebsd.dk> To: Andrey Chernov <ache@nagual.pp.ru> Cc: current@FreeBSD.ORG Subject: Re: [TEST(/review)] major/minor/devname fix Message-ID: <6251.1110436359@critter.freebsd.dk> In-Reply-To: Your message of "Thu, 10 Mar 2005 09:24:11 %2B0300." <20050310062410.GA27497@nagual.pp.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6251.1110436359>