plan 9 kernel history: overview | file list | diff list

1990/0321/port/chan.c (diff list | history)

1990/0303/sys/src/9/port/chan.c:149,1551990/0321/sys/src/9/port/chan.c:149,155 (short | long | prev | next)
1990/0227    
	Mtab *mt, *mz; 
	Mount *mnt, *omnt, *nmnt, *pmnt; 
	Pgrp *pg; 
	int isnew; 
1990/0321    
	int islast; 
1990/0227    
 
	if(CHDIR & (old->qid^new->qid)) 
		error(0, Emount); 
1990/0303/sys/src/9/port/chan.c:157,1661990/0321/sys/src/9/port/chan.c:157,171
1990/0227    
		error(0, Emount); 
 
	mz = 0; 
	isnew = 0; 
1990/0321    
	islast = 0; 
	mnt = 0; 
1990/0227    
	pg = u->p->pgrp; 
	lock(pg); 
	if(waserror()){ 
1990/0321    
		if(mnt){ 
			mnt->c = 0;	/* caller will close new */ 
			closemount(mnt); 
		} 
1990/0227    
		unlock(pg); 
		nexterror(); 
	} 
1990/0303/sys/src/9/port/chan.c:171,1881990/0321/sys/src/9/port/chan.c:176,193
1990/0227    
	for(i=0; i<pg->nmtab; i++,mt++){ 
		if(mt->c==0 && mz==0) 
			mz = mt; 
		else if(eqchan(mt->c, old, CHDIR|QPATH)) 
1990/0321    
		else if(eqchan(mt->c, old, CHDIR|QPATH)){ 
			mz = 0; 
1990/0227    
			goto Found; 
1990/0321    
		} 
1990/0227    
	} 
	isnew = 1; 
	if(mz == 0){ 
		if(i == conf.nmtab) 
			error(0, Enomount); 
		mz = &pg->mtab[i]; 
		pg->nmtab++; 
1990/0321    
		islast++; 
1990/0227    
	} 
	mz->mnt = 0; 
	mz->c = old; 
	mt = mz; 
 
    Found: 
1990/0303/sys/src/9/port/chan.c:244,2511990/0321/sys/src/9/port/chan.c:249,260
1990/0227    
	} 
 
	incref(new); 
	if(isnew) 
1990/0321    
	if(mz){ 
		mz->c = old; 
1990/0227    
		incref(old); 
1990/0321    
	} 
	if(islast) 
		pg->nmtab++; 
1990/0227    
	unlock(pg); 
	poperror(); 
	return mnt->mountid; 
1990/0303/sys/src/9/port/chan.c:286,2921990/0321/sys/src/9/port/chan.c:295,301
1990/0227    
    Found: 
	lock(pg); 
	if(!eqchan(mt->c, c, CHDIR|QPATH)){	/* table changed underfoot */ 
		print("domount: changed underfoot?\n"); 
1990/0321    
		pprint("domount: changed underfoot?\n"); 
1990/0227    
		unlock(pg); 
		return c; 
	} 
1990/0303/sys/src/9/port/chan.c:333,3391990/0321/sys/src/9/port/chan.c:342,348
1990/0227    
			goto Notfound; 
		} 
		if(c->mountid != mnt->mountid){ 
			print("walk: changed underfoot?\n"); 
1990/0321    
			pprint("walk: changed underfoot?\n"); 
1990/0227    
			unlock(pg); 
			goto Notfound; 
		} 
1990/0303/sys/src/9/port/chan.c:353,3581990/0321/sys/src/9/port/chan.c:362,368
1990/0227    
		if(!first) 
			close(c); 
		nc->mnt = mnt; 
1990/0321    
		nc->mountid = mnt->mountid; 
1990/0227    
		c = nc; 
		first = 0; 
		goto Again; 
1990/0303/sys/src/9/port/chan.c:391,3971990/0321/sys/src/9/port/chan.c:401,407
1990/0227    
	} 
	mnt = c->mnt; 
	if(c->mountid != mnt->mountid){ 
		print("createdir: changed underfoot?\n"); 
1990/0321    
		pprint("createdir: changed underfoot?\n"); 
1990/0227    
		error(0, Enocreate); 
	} 
	do{ 


source code copyright © 1990-2005 Lucent Technologies; see license
Plan 9 distribution
comments to russ cox (rsc@swtch.com)