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.
This commit is contained in:
parent
fe39388250
commit
f99b9cae6a
1 changed files with 6 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue