summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-02-11 12:35:44 +0000
committerphk <phk@FreeBSD.org>2003-02-11 12:35:44 +0000
commit6fa71cfe58aadc6bd4daa240f286f6b2313dcbc0 (patch)
tree5cd996dd9bceb66499bf0b44e654ad795b9443fb /sys
parentffd10d59c3c9a2788c9f1c96020d99248adab687 (diff)
downloadFreeBSD-src-6fa71cfe58aadc6bd4daa240f286f6b2313dcbc0.zip
FreeBSD-src-6fa71cfe58aadc6bd4daa240f286f6b2313dcbc0.tar.gz
Mark our provider with G_PF_CANDELETE in the cases where this is actually
the case.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/md/md.c22
1 files changed, 14 insertions, 8 deletions
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
OpenPOWER on IntegriCloud