From 4bd9ed80c379d0f531a8fc8e8307dea36df0c8c0 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Tue, 28 Jul 2015 09:52:21 +0200 Subject: 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). --- sys/src/9/port/devshr.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'sys/src/9/port/devshr.c') 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(); -- cgit v1.2.3