summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_subr.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-02-12 09:48:27 +0000
committerphk <phk@FreeBSD.org>2003-02-12 09:48:27 +0000
commitba1e23916c436c106d106479d222c01c78ab48cc (patch)
treea6bb6124e2519604d9c2ee50cd88dc79f946ada1 /sys/geom/geom_subr.c
parentebdd8469e14e1d5c89830106c362d469df95d5ed (diff)
downloadFreeBSD-src-ba1e23916c436c106d106479d222c01c78ab48cc.zip
FreeBSD-src-ba1e23916c436c106d106479d222c01c78ab48cc.tar.gz
Implement a handle for efficient implementation of perforations in
lower extremities. Setting bit 4 in debugflags (sysctl kern.geom.debugflags=16) will allow any open to succeed on rank#1 providers. This will generally correspond to the physical disk devices: ad0, da0, md0 etc. This fundamentally violates the mechanics of GEOMs autoconfiguration, and is only provided as a debugging facility, so obviously error reports on GEOM where this bit is or has been set will not be accepted.
Diffstat (limited to 'sys/geom/geom_subr.c')
-rw-r--r--sys/geom/geom_subr.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/geom/geom_subr.c b/sys/geom/geom_subr.c
index 237e199..e2209fc 100644
--- a/sys/geom/geom_subr.c
+++ b/sys/geom/geom_subr.c
@@ -418,14 +418,17 @@ g_access_rel(struct g_consumer *cp, int dcr, int dcw, int dce)
pp->acr, pp->acw, pp->ace,
pp, pp->name);
+ /* If foot-shooting is enabled, any open on rank#1 is OK */
+ if ((g_debugflags & 16) && pp->geom->rank == 1)
+ ;
/* If we try exclusive but already write: fail */
- if (dce > 0 && pw > 0)
+ else if (dce > 0 && pw > 0)
return (EPERM);
/* If we try write but already exclusive: fail */
- if (dcw > 0 && pe > 0)
+ else if (dcw > 0 && pe > 0)
return (EPERM);
/* If we try to open more but provider is error'ed: fail */
- if ((dcr > 0 || dcw > 0 || dce > 0) && pp->error != 0)
+ else if ((dcr > 0 || dcw > 0 || dce > 0) && pp->error != 0)
return (pp->error);
/* Ok then... */
OpenPOWER on IntegriCloud