Review/Test: Pseudo-device unit number management patch

From: Poul-Henning Kamp <phk_at_phk.freebsd.dk>
Date: Fri, 06 Feb 2004 22:38:44 +0100
http://phk.freebsd.dk/patch/pseudo.patch

This patch adds a couple of functions for pseudodrivers to use for
implementing cloning in a manner we will be able to lock down
(shortly).

Basically what happens is that pseudo drivers get a way to ask for
"give me the dev_t with this unit number" or alternatively "give
me a dev_t with the lowest guaranteed free unit number" (there are
a lot of non-POLA in the value of this number, just live with it
for now!)

Managing the unit number space this way removes the need to use
rman(9) and greatly simplifies the code in the drivers because
even using rman(9) they still needed to manage their dev_t's too.

I have taken the if_tun, if_tap and nmdm drivers through the mill,
partly because they (ab)used makedev(), but mostly because together
they represent three different problems for device-cloning:

	if_tun is the plain case: just give me a device.
	if_tap has two kinds of devices, with a flag for device type.
	nmdm has paired devices (a'la pty).

I would appreciate if people would test these devices work _as
previously_ with this patch in place.

If nothing crops up, I plan to commit this patch in two weeks time.

Poul-Henning


-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk_at_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.
Received on Fri Feb 06 2004 - 12:38:48 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:42 UTC