summaryrefslogtreecommitdiff
path: root/sys/src/9/port/devshr.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2020-03-08 18:23:07 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2020-03-08 18:23:07 +0100
commitf99b9cae6a3dc5775a83b264d6041be8d5d416d6 (patch)
tree88b3939b5be0432495069ef767867838610f20a2 /sys/src/9/port/devshr.c
parentfe393882506834722eda40d94289133366f5a210 (diff)
devshr: unmount service on #σc/share/mount removal
when the control mountpoint side gets removed, close mount channel immediately. this is usefull for implementing automatic cleanup with ORCLOSE create mode.
Diffstat (limited to 'sys/src/9/port/devshr.c')
-rw-r--r--sys/src/9/port/devshr.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/src/9/port/devshr.c b/sys/src/9/port/devshr.c
index bc7677210..96e319221 100644
--- a/sys/src/9/port/devshr.c
+++ b/sys/src/9/port/devshr.c
@@ -554,6 +554,7 @@ shrremove(Chan *c)
Sch *sch;
Mpt *mpt;
Mhead *h;
+ Chan *bc;
sch = tosch(c);
if(waserror()){
@@ -593,6 +594,7 @@ shrremove(Chan *c)
qunlock(&shrslk);
break;
case Qcmpt:
+ bc = nil;
mpt = sch->mpt;
m = &mpt->m;
h = &shr->umh;
@@ -601,10 +603,14 @@ shrremove(Chan *c)
if(*ml == m){
*ml = m->next;
m->next = nil;
+ bc = m->to;
+ m->to = nil;
putmpt(mpt);
break;
}
wunlock(&h->lock);
+ if(bc != nil)
+ cclose(bc);
break;
}
poperror();