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

1991/0417/port/sysfile.c (diff list | history)

1991/0411/sys/src/9/port/sysfile.c:227,2341991/0417/sys/src/9/port/sysfile.c:227,236 (short | long | prev | next)
Debugging: acquire both locks during read and write.
rsc Fri Mar 4 17:11:43 2005
1990/1009    
	c = fdtochan(arg[0], OREAD); 
1990/1004    
	validaddr(arg[1], arg[2], 1); 
1991/0411    
	qlock(&c->rdl); 
1991/0417    
	qlock(&c->wrl);		/* BUG BUG BUG */ 
1990/0227    
	if(waserror()){ 
1991/0411    
		qunlock(&c->rdl); 
1991/0417    
		qunlock(&c->wrl);		/* BUG BUG BUG */ 
1990/0227    
		nexterror(); 
	} 
	n = arg[2]; 
1991/0411/sys/src/9/port/sysfile.c:243,2481991/0417/sys/src/9/port/sysfile.c:245,251
1991/0411    
		n = (*devtab[c->type].read)(c, (void*)arg[1], n, c->offset); 
1990/0227    
	c->offset += n; 
1991/0411    
	qunlock(&c->rdl); 
1991/0417    
	qunlock(&c->wrl);		/* BUG BUG BUG */ 
1990/0227    
	return n; 
} 
 
1991/0411/sys/src/9/port/sysfile.c:254,2611991/0417/sys/src/9/port/sysfile.c:257,266
1990/0227    
 
1990/1009    
	c = fdtochan(arg[0], OWRITE); 
1990/0227    
	validaddr(arg[1], arg[2], 0); 
1991/0417    
	qlock(&c->rdl);		/* BUG BUG BUG */ 
1991/0411    
	qlock(&c->wrl); 
1990/0227    
	if(waserror()){ 
1991/0417    
		qunlock(&c->rdl);		/* BUG BUG BUG */ 
1991/0411    
		qunlock(&c->wrl); 
1990/0227    
		nexterror(); 
	} 
1991/0411/sys/src/9/port/sysfile.c:263,2681991/0417/sys/src/9/port/sysfile.c:268,274
1990/11211    
		error(Eisdir); 
1991/0411    
	n = (*devtab[c->type].write)(c, (void*)arg[1], arg[2], c->offset); 
1990/0227    
	c->offset += n; 
1991/0417    
	qunlock(&c->rdl);		/* BUG BUG BUG */ 
1991/0411    
	qunlock(&c->wrl); 
1990/0227    
	return n; 
} 


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