From 2fe8e6b91fc5bb6eb998fdf07b6296c1f17c4c6e Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Wed, 19 Sep 2001 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 2001-09-19 --- port/chan.c | 12 ++++++++---- port/portdat.h | 1 + port/sysfile.c | 5 ++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/port/chan.c b/port/chan.c index 10489f6c53b6a2f65f1c5d43f23501235011370a..8cc86b022aaa8744c1f76fe6d05d245953ee79f9 100644 --- a/port/chan.c +++ b/port/chan.c @@ -426,8 +426,6 @@ cmount(Chan **newp, Chan *old, int flag, char *spec) if(QTDIR & (old->qid.type^(*newp)->qid.type)) error(Emount); -if((*newp)->umh) /* should not happen */ - print("cmount newp extra umh\n"); if(old->umh) print("cmount old extra umh\n"); @@ -436,9 +434,8 @@ if(old->umh) if((old->qid.type&QTDIR)==0 && order != MREPL) error(Emount); - mh = nil; - domount(newp, &mh); new = *newp; + mh = new->umh; /* * Not allowed to bind when the old directory @@ -1078,6 +1075,13 @@ namec(char *aname, int amode, int omode, ulong perm) domount(&c, nil); break; + case Abind: + m = nil; + if(!nomount) + domount(&c, &m); + c->umh = m; + break; + case Aremove: case Aopen: Open: diff --git a/port/portdat.h b/port/portdat.h index ecb9fb81594135e7af803a39c412016d611e29cc..ad2299cd94a516e0a08d22b549d61937ba395391 100644 --- a/port/portdat.h +++ b/port/portdat.h @@ -103,6 +103,7 @@ struct Sargs enum { Aaccess, /* as in stat, wstat */ + Abind, /* for left-hand-side of bind */ Atodir, /* as in chdir */ Aopen, /* for i/o */ Amount, /* to be mounted or mounted upon */ diff --git a/port/sysfile.c b/port/sysfile.c index e42c607a1183cc73d43b1e8cccfca6cc2c2ef5d7..fc7463fc31df9ac6cc01123424d3292c7c92880a 100644 --- a/port/sysfile.c +++ b/port/sysfile.c @@ -719,11 +719,10 @@ bindmount(int ismount, int fd, int afd, char* arg0, char* arg1, ulong flag, char if(ac) cclose(ac); cclose(bc); - } - else { + }else{ bogus.spec = 0; validaddr((ulong)arg0, 1, 0); - c0 = namec(arg0, Amount, 0, 0); + c0 = namec(arg0, Abind, 0, 0); } if(waserror()){