diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-07-28 09:52:21 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-07-28 09:52:21 +0200 |
commit | 4bd9ed80c379d0f531a8fc8e8307dea36df0c8c0 (patch) | |
tree | c3dee1e6b67aff6d8ae53c93c1bd48ee2d638693 /sys/src/9/port/devshr.c | |
parent | 311a99e23b2f1adcf01a91db3e551dc1dda9f61a (diff) |
kernel: export mntattach() from devmnt.c avoiding bogus struct passing and special case in namec()
we already export mntauth() and mntversion(), so why not stop
being sneaky and just export mntattach() so bindmount() and
devshr can just call it directly with proper arguments being
checked.
we can also avoid handling #M attach specially in namec()
by having the devmnt's attach function do error(Enoattach).
Diffstat (limited to 'sys/src/9/port/devshr.c')
-rw-r--r-- | sys/src/9/port/devshr.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/sys/src/9/port/devshr.c b/sys/src/9/port/devshr.c index e959261cb..03a79bc8a 100644 --- a/sys/src/9/port/devshr.c +++ b/sys/src/9/port/devshr.c @@ -724,12 +724,6 @@ shrwrite(Chan *c, void *va, long n, vlong) Chan *bc, *c0; Mhead *h; Mount *m; - struct{ - Chan *chan; - Chan *authchan; - char *spec; - int flags; - }bogus; if(up->pgrp->noattach) error(Enoattach); @@ -758,11 +752,7 @@ shrwrite(Chan *c, void *va, long n, vlong) cclose(bc); nexterror(); } - bogus.flags = 0; - bogus.chan = bc; - bogus.authchan = nil; - bogus.spec = aname; - c0 = devtab[devno('M', 0)]->attach((char*)&bogus); + c0 = mntattach(bc, nil, aname, 0); poperror(); cclose(bc); poperror(); |