From owner-freebsd-geom@FreeBSD.ORG Fri Mar 26 03:32:53 2004 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 26C5116A4CF; Fri, 26 Mar 2004 03:32:53 -0800 (PST) Received: from darkness.comp.waw.pl (unknown [195.117.238.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id C15DE43D41; Fri, 26 Mar 2004 03:32:52 -0800 (PST) (envelope-from pjd@darkness.comp.waw.pl) Received: by darkness.comp.waw.pl (Postfix, from userid 1009) id CAB65ACAF8; Fri, 26 Mar 2004 12:32:51 +0100 (CET) Date: Fri, 26 Mar 2004 12:32:51 +0100 From: Pawel Jakub Dawidek To: Poul-Henning Kamp Message-ID: <20040326113251.GE8930@darkness.comp.waw.pl> References: <20040326110046.GD8930@darkness.comp.waw.pl> <1621.1080299892@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="JViz224v3YRbOSfM" Content-Disposition: inline In-Reply-To: <1621.1080299892@critter.freebsd.dk> User-Agent: Mutt/1.4.2i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 5.2.1-RC2 i386 cc: geom@FreeBSD.org cc: Lukas Ertl Subject: Re: Problem with g_unload_class() X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2004 11:32:53 -0000 --JViz224v3YRbOSfM Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 =3D3D EBUSY; +>=20 +> 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 =3D=3D NULL) { hh->error =3D 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. --=20 Pawel Jakub Dawidek http://www.FreeBSD.org pjd@FreeBSD.org http://garage.freebsd.pl FreeBSD committer Am I Evil? Yes, I Am! --JViz224v3YRbOSfM Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAZBTjForvXbEpPzQRAt3dAJ42uGB8rJoCtMlMZ3Wg1+2Dd/tY5ACfRemC 3he1mtBNDoDuLHst59BQaoI= =SYni -----END PGP SIGNATURE----- --JViz224v3YRbOSfM--