the drvctl framework. And call this new functionality from cgd(4),
the consumer of dksubr.c. We do this to allow gpt(8) to be able
to label cgd(4) disks. We also add in some DIOCGSECTORSIZE logic
and we ensure that the WEDGE ioctls are not called on either
uninitialised disks or disks which have not been opened for write
access.
for the patches!
I've lightly tested the basics: create cgd0 on vnd0d, initialize with
zeros, newfs /dev/cgd0a, mount, copy files on, unmount, drvctl -d
cgd0. Works fine. I also shutdown with a cgd0 configured: detached as
expected.
o expect the disk's start routine to return an int. If the
int is non-zero, we enqueue the request and try again
later.
o have a dk_start() routine which runs the request queue.
o have a dk_iodone() function which should be called by the
driver using the framwork from its iodone. dk_iodone will
retry the queue since presumably further progress may be
possible once a request is complete. It is required that
the underlying driver have the resources to keep at least
one transaction in flight at any time.
Modified cgd to:
o be able to keep one transaction in flight at any time
(almost) by keeping a buffer of size MAXPHYS in its softc
and use it.
We still need to make the cgd_cbufpool per device rather than global
and provide a low water mark for it.
Addresses PR: kern/24715
(at least according to the submitter.)