Problem with g_unload_class()

Pawel Jakub Dawidek pjd at FreeBSD.org
Fri Mar 26 03:32:53 PST 2004


On Fri, Mar 26, 2004 at 12:18:12PM +0100, Poul-Henning Kamp wrote:
+> >My idea is to use LIST_FOREACH_SAFE() macro, like I did in my old patch:
+> >
+> >	http://people.freebsd.org/~pjd/patches/geom_subr.c.11.patch
+> >
+> >And maybe we should add:
+> >
+> >	if (!LIST_EMPTY(&mp->geom))
+> >		error =3D EBUSY;
+> 
+> But that is exactly the "silly" scenario I would like to avoid: Now
+> you have removed some of the geom instances an you have nuked the
+> taste and config function and then you give up and leave the class
+> still loaded.

Or we can just remove all this code and leave only this:

	/*
	 * We allow unloading if we have no geoms, or a class
	 * method we can use to get rid of them.
	 */
	if (!LIST_EMPTY(&mp->geom) && mp->destroy_geom == NULL) {
		hh->error = EOPNOTSUPP;
		return;
	}

+> We may need to move to a "can?/commit!" like two-phase protocol.
+> (see geom_stripe for another place where this is used)

My geom_stripe?
Anyway this will be a big change.

-- 
Pawel Jakub Dawidek                       http://www.FreeBSD.org
pjd at FreeBSD.org                           http://garage.freebsd.pl
FreeBSD committer                         Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-geom/attachments/20040326/c6f2f1bb/attachment.bin


More information about the freebsd-geom mailing list