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

2000/0405/boot/bootcache.c (diff list | history)

2000/0405/sys/src/9/boot/bootcache.c:2,142001/0527/sys/src/9/boot/bootcache.c:2,16 (short | long)
2000/0405    
#include <libc.h> 
#include <../boot/boot.h> 
 
2001/0527    
uchar statbuf[STATMAX]; 
 
2000/0405    
int 
cache(int fd) 
{ 
	int argc, i, p[2]; 
	char *argv[5], bd[NAMELEN], buf[256], d[DIRLEN], partition[2*NAMELEN], *pp; 
2001/0527    
	char *argv[5], bd[32], buf[256], partition[64], *pp; 
2000/0405    
 
	if(stat("/cfs", d) < 0) 
2001/0527    
	if(stat("/cfs", statbuf, sizeof statbuf) < 0) 
2000/0405    
		return fd; 
 
	*partition = 0; 
2000/0405/sys/src/9/boot/bootcache.c:19,252001/0527/sys/src/9/boot/bootcache.c:21,27
2000/0405    
		for(i = 0; i < argc; i++){ 
			if(strcmp(argv[i], "off") == 0) 
				return fd; 
			else if(stat(argv[i], d) >= 0){ 
2001/0527    
			else if(stat(argv[i], statbuf, sizeof statbuf) >= 0){ 
2000/0405    
				strncpy(partition, argv[i], sizeof(partition)-1); 
				partition[sizeof(partition)-1] = 0; 
			} 
2000/0405/sys/src/9/boot/bootcache.c:38,492001/0527/sys/src/9/boot/bootcache.c:40,51
2000/0405    
			else if(strcmp("fs", &bd[i-2]) == 0) 
				bd[i-2] = 0; 
			sprint(partition, "%scache", bd); 
			if(stat(partition, d) < 0) 
2001/0527    
			if(stat(partition, statbuf, sizeof statbuf) < 0) 
2000/0405    
				*bd = 0; 
		} 
		if(*bd == 0){ 
			sprint(partition, "%scache", bootdisk); 
			if(stat(partition, d) < 0) 
2001/0527    
			if(stat(partition, statbuf, sizeof statbuf) < 0) 
2000/0405    
				return fd; 
		} 
	} 
2001/0527/sys/src/9/boot/bootcache.c:65,712001/0819/sys/src/9/boot/bootcache.c:65,71 (short | long)
2000/0405    
		if(fflag) 
			execl("/cfs", "bootcfs", "-rs", "-f", partition, 0); 
		else 
			execl("/cfs", "bootcfs", "-s", "-f", partition, 0); 
2001/0819    
			execl("/cfs", "bootcfs", "-ds", "-f", partition, 0); 
2000/0405    
		break; 
	default: 
		close(p[0]); 
2001/0819/sys/src/9/boot/bootcache.c:2,82001/0820/sys/src/9/boot/bootcache.c:2,8 (short | long)
2000/0405    
#include <libc.h> 
#include <../boot/boot.h> 
 
2001/0527    
uchar statbuf[STATMAX]; 
2001/0820    
uchar statbuf[Statsz]; 
2001/0527    
 
2000/0405    
int 
cache(int fd) 
2001/0819/sys/src/9/boot/bootcache.c:65,712001/0820/sys/src/9/boot/bootcache.c:65,71
2000/0405    
		if(fflag) 
			execl("/cfs", "bootcfs", "-rs", "-f", partition, 0); 
		else 
2001/0819    
			execl("/cfs", "bootcfs", "-ds", "-f", partition, 0); 
2001/0820    
			execl("/cfs", "bootcfs", "-s", "-f", partition, 0); 
2000/0405    
		break; 
	default: 
		close(p[0]); 
2001/0820/sys/src/9/boot/bootcache.c:17,232001/1117/sys/src/9/boot/bootcache.c:17,23 (short | long)
2000/0405    
 
	readfile("#e/cfs", buf, sizeof(buf)); 
	if(*buf){ 
		argc = getfields(buf, argv, 4, 1, " "); 
2001/1117    
		argc = tokenize(buf, argv, 4); 
2000/0405    
		for(i = 0; i < argc; i++){ 
			if(strcmp(argv[i], "off") == 0) 
				return fd; 
2001/1117/sys/src/9/boot/bootcache.c:10,162002/1130/sys/src/9/boot/bootcache.c:10,16 (short | long)
2000/0405    
	int argc, i, p[2]; 
2001/0527    
	char *argv[5], bd[32], buf[256], partition[64], *pp; 
2000/0405    
 
2001/0527    
	if(stat("/cfs", statbuf, sizeof statbuf) < 0) 
2002/1130    
	if(stat("/boot/cfs", statbuf, sizeof statbuf) < 0) 
2000/0405    
		return fd; 
 
	*partition = 0; 
2001/1117/sys/src/9/boot/bootcache.c:63,712002/1130/sys/src/9/boot/bootcache.c:63,71
2000/0405    
		dup(p[0], 1); 
		close(p[0]); 
		if(fflag) 
			execl("/cfs", "bootcfs", "-rs", "-f", partition, 0); 
2002/1130    
			execl("/boot/cfs", "bootcfs", "-rs", "-f", partition, 0); 
2000/0405    
		else 
2001/0820    
			execl("/cfs", "bootcfs", "-s", "-f", partition, 0); 
2002/1130    
			execl("/boot/cfs", "bootcfs", "-s", "-f", partition, 0); 
2000/0405    
		break; 
	default: 
		close(p[0]); 


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