Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 05 Feb 2004 11:02:47 +0100
From:      Poul-Henning Kamp <phk@phk.freebsd.dk>
To:        current@freebsd.org
Subject:   HEADSUP:  disk_*(9) API change mega-patch
Message-ID:  <39982.1075975367@critter.freebsd.dk>

next in thread | raw e-mail | index | archive | help

This is a mostly mechanical and largely untested patch, so please test
carefully if you have the necessary hardware.

Kernel patch:
	http://phk.freebsd.dk/patch/disk.patch

Man-page update:
	http://phk.freebsd.dk/patch/disk_man.patch

Patch version: 2004-02-05.1

This patch changes the disk_*(9) API so that ownership of the "struct
disk" is moved from the device drivers to GEOM.  This removes a lot
of trouble from the disk_destroy(9) handling, which should be robust
with this patch.

After this change the API works as follows:

	allocated struct disk with disk_alloc(), store pointer in softc.
	populate fields, including d_unit and d_flags which were
	previous arguments to disk_create().
	call disk_create() with the pointer.

	call disk_destroy() to signal that the device has disappeared.
	NB: do not access struct disk in the driver anymore!
	return any outstanding requests with suitable error.

At the same time: eliminate unused arguments from disk_create(9)

Reverse sense of DISKFLAG_NOGIANT, to DISKFLAG_NEEDSGIANT.

Two weeks review

-- 
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?39982.1075975367>