~kris/9p

9hist

2fe8e6b91fc5bb6eb998fdf07b6296c1f17c4c6e — David du Colombier 25 years ago 409231a
Plan 9 from Bell Labs 2001-09-19
3 files changed, 11 insertions(+), 7 deletions(-)

M port/chan.c
M port/portdat.h
M port/sysfile.c
M port/chan.c => port/chan.c +8 -4
@@ 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:

M port/portdat.h => port/portdat.h +1 -0
@@ 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 */

M port/sysfile.c => port/sysfile.c +2 -3
@@ 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()){