geom_dev.c (110517) | geom_dev.c (110523) |
---|---|
1/*- 2 * Copyright (c) 2002 Poul-Henning Kamp 3 * Copyright (c) 2002 Networks Associates Technology, Inc. 4 * All rights reserved. 5 * 6 * This software was developed for the FreeBSD Project by Poul-Henning Kamp 7 * and NAI Labs, the Security Research Division of Network Associates, Inc. 8 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the --- 18 unchanged lines hidden (view full) --- 27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * SUCH DAMAGE. 34 * | 1/*- 2 * Copyright (c) 2002 Poul-Henning Kamp 3 * Copyright (c) 2002 Networks Associates Technology, Inc. 4 * All rights reserved. 5 * 6 * This software was developed for the FreeBSD Project by Poul-Henning Kamp 7 * and NAI Labs, the Security Research Division of Network Associates, Inc. 8 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the --- 18 unchanged lines hidden (view full) --- 27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * SUCH DAMAGE. 34 * |
35 * $FreeBSD: head/sys/geom/geom_dev.c 110517 2003-02-07 21:09:51Z phk $ | 35 * $FreeBSD: head/sys/geom/geom_dev.c 110523 2003-02-07 23:08:24Z phk $ |
36 */ 37 38#include <sys/param.h> 39#include <sys/stdint.h> 40#include <sys/systm.h> 41#include <sys/malloc.h> 42#include <sys/kernel.h> 43#include <sys/conf.h> --- 381 unchanged lines hidden (view full) --- 425g_dev_orphan(struct g_consumer *cp) 426{ 427 struct g_geom *gp; 428 dev_t dev; 429 430 gp = cp->geom; 431 g_trace(G_T_TOPOLOGY, "g_dev_orphan(%p(%s))", cp, gp->name); 432 g_topology_assert(); | 36 */ 37 38#include <sys/param.h> 39#include <sys/stdint.h> 40#include <sys/systm.h> 41#include <sys/malloc.h> 42#include <sys/kernel.h> 43#include <sys/conf.h> --- 381 unchanged lines hidden (view full) --- 425g_dev_orphan(struct g_consumer *cp) 426{ 427 struct g_geom *gp; 428 dev_t dev; 429 430 gp = cp->geom; 431 g_trace(G_T_TOPOLOGY, "g_dev_orphan(%p(%s))", cp, gp->name); 432 g_topology_assert(); |
433 if (cp->biocount > 0) | 433 if (cp->stat.nop != cp->stat.nend) /* XXX ? */ |
434 return; 435 dev = gp->softc; 436 if (dev->si_flags & SI_DUMPDEV) 437 set_dumper(NULL); 438 /* XXX: we may need Giant for now */ 439 destroy_dev(dev); 440 if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0) 441 g_access_rel(cp, -cp->acr, -cp->acw, -cp->ace); 442 g_detach(cp); 443 g_destroy_consumer(cp); 444 g_destroy_geom(gp); 445} 446 447DECLARE_GEOM_CLASS(g_dev_class, g_dev); | 434 return; 435 dev = gp->softc; 436 if (dev->si_flags & SI_DUMPDEV) 437 set_dumper(NULL); 438 /* XXX: we may need Giant for now */ 439 destroy_dev(dev); 440 if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0) 441 g_access_rel(cp, -cp->acr, -cp->acw, -cp->ace); 442 g_detach(cp); 443 g_destroy_consumer(cp); 444 g_destroy_geom(gp); 445} 446 447DECLARE_GEOM_CLASS(g_dev_class, g_dev); |