From 6fa71cfe58aadc6bd4daa240f286f6b2313dcbc0 Mon Sep 17 00:00:00 2001 From: phk Date: Tue, 11 Feb 2003 12:35:44 +0000 Subject: Mark our provider with G_PF_CANDELETE in the cases where this is actually the case. --- sys/dev/md/md.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'sys/dev/md') diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c index 65ae4de..75f76ee 100644 --- a/sys/dev/md/md.c +++ b/sys/dev/md/md.c @@ -782,11 +782,14 @@ mdcreate_malloc(struct md_ioctl *mdio) break; } } - if (!error) { - mdinit(sc); - } else + if (error) { mddestroy(sc, NULL); - return (error); + return (error); + } + mdinit(sc); + if (!(mdio->md_options & MD_RESERVE)) + sc->pp->flags |= G_PF_CANDELETE; + return (0); } @@ -989,11 +992,14 @@ mdcreate_swap(struct md_ioctl *mdio, struct thread *td) } } error = mdsetcred(sc, td->td_ucred); - if (error) + if (error) { mddestroy(sc, td); - else - mdinit(sc); - return (error); + return (error); + } + mdinit(sc); + if (!(mdio->md_options & MD_RESERVE)) + sc->pp->flags |= G_PF_CANDELETE; + return (0); } static int -- cgit v1.1