Plan 9 from Bell Labs’s /usr/web/sources/contrib/uriel/changes/2005/1119/35

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


Add -d flag for bargraph.
 [jmk] --rw-rw-r-- M 107020 glenda sys 15346 Nov 19 21:03 sys/src/cmd/venti/dat.h
	/n/sourcesdump/2005/1119/plan9/sys/src/cmd/venti/dat.h:502,504 - 
	/n/sourcesdump/2005/1120/plan9/sys/src/cmd/venti/dat.h:502,506
	  extern	int		readonly;		/* only allowed to read the disk data */
	  extern	Stats		stats;
	  extern	u8int		zeroScore[VtScoreSize];
	+ 
	+ extern	int		chattyzero;
 [jmk] --rw-rw-r-- M 107020 glenda sys 2213 Nov 19 21:03 sys/src/cmd/venti/fmtarenas.c
	/n/sourcesdump/2005/1119/plan9/sys/src/cmd/venti/fmtarenas.c:29,34 - 
	/n/sourcesdump/2005/1120/plan9/sys/src/cmd/venti/fmtarenas.c:29,37
	  	tabSize = 64 * 1024;		/* BUG: should be determine from number of arenas */
	  	zero = 1;
	  	ARGBEGIN{
	+ 	case 'd':
	+ 		chattyzero++;
	+ 		break;
	  	case 'a':
	  		asize = unittoull(ARGF());
	  		if(asize == TWID64)
 [jmk] --rw-rw-r-- M 107020 glenda sys 1326 Nov 19 21:03 sys/src/cmd/venti/fmtisect.c
	/n/sourcesdump/2005/1119/plan9/sys/src/cmd/venti/fmtisect.c:26,31 - 
	/n/sourcesdump/2005/1120/plan9/sys/src/cmd/venti/fmtisect.c:26,34
	  	setSize = 64 * 1024;
	  	zero = 1;
	  	ARGBEGIN{
	+ 	case 'd':
	+ 		chattyzero++;
	+ 		break;
	  	case 'b':
	  		blockSize = unittoull(ARGF());
	  		if(blockSize == ~0)
 [jmk] --rw-rw-r-- M 107020 glenda sys 877 Nov 19 21:03 sys/src/cmd/venti/zeropart.c
	/n/sourcesdump/2005/1119/plan9/sys/src/cmd/venti/zeropart.c:2,7 - 
	/n/sourcesdump/2005/1120/plan9/sys/src/cmd/venti/zeropart.c:2,13
	  #include "dat.h"
	  #include "fns.h"
	  
	+ int chattyzero;
	+ 
	+ enum
	+ {
	+ 	HugeIoSize = 2*1024*1024
	+ };
	  void
	  zeroPart(Part *part, int blockSize)
	  {
	/n/sourcesdump/2005/1119/plan9/sys/src/cmd/venti/zeropart.c:8,28 - 
	/n/sourcesdump/2005/1120/plan9/sys/src/cmd/venti/zeropart.c:14,42
	  	ZBlock *b;
	  	u64int addr;
	  	int w;
	+ 	int iosize;
	  
	+ 	iosize = HugeIoSize;
	+ {char *p = getenv("XXXIOSIZE"); if(p) iosize = atoi(p); assert(iosize>0);}
	  	fprint(2, "clearing the partition\n");
	  
	- 	b = allocZBlock(MaxIoSize, 1);
	+ 	b = allocZBlock(iosize, 1);
	  
	  	w = 0;
	- 	for(addr = PartBlank; addr + MaxIoSize <= part->size; addr += MaxIoSize){
	- 		if(!writePart(part, addr, b->data, MaxIoSize))
	+ 	for(addr = PartBlank; addr + iosize <= part->size; addr += iosize){
	+ 		if(!writePart(part, addr, b->data, iosize))
	  			fatal("can't initialize %s, writing block %d failed: %r", part->name, w);
	  		w++;
	+ 		if(chattyzero)
	+ 			print("%lld %lld\n", addr, part->size);
	  	}
	  
	- 	for(; addr + blockSize <= part->size; addr += blockSize)
	+ 	for(; addr + blockSize <= part->size; addr += blockSize){
	  		if(!writePart(part, addr, b->data, blockSize))
	  			fatal("can't initialize %s: %r", part->name);
	+ 		if(chattyzero)
	+ 			print("%lld %lld\n", addr, part->size);
	+ 	}
	  
	  	freeZBlock(b);
	  }


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].