Browse Source

Plan 9 from Bell Labs 2007-01-03

David du Colombier 17 years ago
parent
commit
f066e7ea8a

+ 9 - 9
dist/replica/_plan9.db

@@ -7379,7 +7379,7 @@ sys/man/1/secstore - 664 sys sys 1113743328 3772
 sys/man/1/sed - 664 sys sys 944959674 6884
 sys/man/1/seq - 664 sys sys 1063855680 1131
 sys/man/1/size - 664 sys sys 944959674 393
-sys/man/1/sleep - 664 sys sys 944959673 389
+sys/man/1/sleep - 664 sys sys 1167774352 420
 sys/man/1/sort - 664 sys sys 1113743328 4719
 sys/man/1/spell - 664 sys sys 1113743329 1876
 sys/man/1/spin - 664 sys sys 1142177238 7246
@@ -7594,13 +7594,13 @@ sys/man/3/pnp - 664 sys sys 1088560895 4547
 sys/man/3/proc - 664 sys sys 1138458595 12062
 sys/man/3/root - 664 sys sys 1046958450 632
 sys/man/3/rtc - 664 sys sys 954378857 667
-sys/man/3/sd - 664 sys sys 1018386776 4805
+sys/man/3/sd - 664 sys sys 1167774768 5652
 sys/man/3/segment - 664 sys sys 1017423721 2378
 sys/man/3/srv - 664 sys sys 958419690 1470
 sys/man/3/ssl - 664 sys sys 1018386776 3413
 sys/man/3/tls - 664 sys sys 1045501496 7018
 sys/man/3/uart - 664 sys sys 1138191356 2003
-sys/man/3/usb - 664 sys sys 1164149393 6960
+sys/man/3/usb - 664 sys sys 1167774741 7052
 sys/man/3/vga - 664 sys sys 1131301005 4957
 sys/man/4 - 20000000775 sys sys 1128556957 0
 sys/man/4/0intro - 664 sys sys 944959699 472
@@ -8042,11 +8042,11 @@ sys/src/9/pc/realmode.c - 664 sys sys 1139667044 2678
 sys/src/9/pc/rebootcode.s - 664 sys sys 1015014522 988
 sys/src/9/pc/screen.c - 664 sys sys 1136336092 13971
 sys/src/9/pc/screen.h - 664 sys sys 1147023549 4256
-sys/src/9/pc/sd53c8xx.c - 664 sys sys 1149280015 55135
+sys/src/9/pc/sd53c8xx.c - 664 sys sys 1167774852 55161
 sys/src/9/pc/sd53c8xx.n - 664 sys sys 1131290556 12657
-sys/src/9/pc/sdata.c - 664 sys sys 1161230658 52692
-sys/src/9/pc/sdmv50xx.c - 664 sys sys 1164645014 25841
-sys/src/9/pc/sdmylex.c - 664 sys sys 1133068062 27806
+sys/src/9/pc/sdata.c - 664 sys sys 1167774860 52718
+sys/src/9/pc/sdmv50xx.c - 664 sys sys 1167774867 25865
+sys/src/9/pc/sdmylex.c - 664 sys sys 1167774835 27902
 sys/src/9/pc/sdscsi.c - 664 sys sys 1158889425 7241
 sys/src/9/pc/trap.c - 664 sys sys 1135487942 21257
 sys/src/9/pc/uartaxp.c - 664 sys sys 1166247784 18879
@@ -8110,7 +8110,7 @@ sys/src/9/port/devpipe.c - 664 sys sys 1077055016 5825
 sys/src/9/port/devpnp.c - 664 sys sys 1088560907 13624
 sys/src/9/port/devproc.c - 664 sys sys 1142086847 28500
 sys/src/9/port/devroot.c - 664 sys sys 1146151714 4242
-sys/src/9/port/devsd.c - 664 sys sys 1155995769 30859
+sys/src/9/port/devsd.c - 664 sys sys 1167774805 31099
 sys/src/9/port/devsdp.c - 664 sys sys 1057323393 44800
 sys/src/9/port/devsegment.c - 664 sys sys 1131289891 9610
 sys/src/9/port/devsrv.c - 664 sys sys 1165810571 5711
@@ -14188,7 +14188,7 @@ sys/src/cmd/venti/dat.h - 664 sys sys 1132452191 15346
 sys/src/cmd/venti/dcache.c - 664 sys sys 1019678878 7374
 sys/src/cmd/venti/dump.c - 664 sys sys 1068520313 1578
 sys/src/cmd/venti/dumparena.c - 664 sys sys 1019678878 6381
-sys/src/cmd/venti/dumpvacroots - 775 sys sys 1139839229 550
+sys/src/cmd/venti/dumpvacroots - 775 sys sys 1167777001 571
 sys/src/cmd/venti/findscore.c - 664 sys sys 1121977913 2605
 sys/src/cmd/venti/fmtarenas.c - 664 sys sys 1132452192 2213
 sys/src/cmd/venti/fmtindex.c - 664 sys sys 1138471072 2524

+ 9 - 9
dist/replica/plan9.db

@@ -7379,7 +7379,7 @@ sys/man/1/secstore - 664 sys sys 1113743328 3772
 sys/man/1/sed - 664 sys sys 944959674 6884
 sys/man/1/seq - 664 sys sys 1063855680 1131
 sys/man/1/size - 664 sys sys 944959674 393
-sys/man/1/sleep - 664 sys sys 944959673 389
+sys/man/1/sleep - 664 sys sys 1167774352 420
 sys/man/1/sort - 664 sys sys 1113743328 4719
 sys/man/1/spell - 664 sys sys 1113743329 1876
 sys/man/1/spin - 664 sys sys 1142177238 7246
@@ -7594,13 +7594,13 @@ sys/man/3/pnp - 664 sys sys 1088560895 4547
 sys/man/3/proc - 664 sys sys 1138458595 12062
 sys/man/3/root - 664 sys sys 1046958450 632
 sys/man/3/rtc - 664 sys sys 954378857 667
-sys/man/3/sd - 664 sys sys 1018386776 4805
+sys/man/3/sd - 664 sys sys 1167774768 5652
 sys/man/3/segment - 664 sys sys 1017423721 2378
 sys/man/3/srv - 664 sys sys 958419690 1470
 sys/man/3/ssl - 664 sys sys 1018386776 3413
 sys/man/3/tls - 664 sys sys 1045501496 7018
 sys/man/3/uart - 664 sys sys 1138191356 2003
-sys/man/3/usb - 664 sys sys 1164149393 6960
+sys/man/3/usb - 664 sys sys 1167774741 7052
 sys/man/3/vga - 664 sys sys 1131301005 4957
 sys/man/4 - 20000000775 sys sys 1128556957 0
 sys/man/4/0intro - 664 sys sys 944959699 472
@@ -8042,11 +8042,11 @@ sys/src/9/pc/realmode.c - 664 sys sys 1139667044 2678
 sys/src/9/pc/rebootcode.s - 664 sys sys 1015014522 988
 sys/src/9/pc/screen.c - 664 sys sys 1136336092 13971
 sys/src/9/pc/screen.h - 664 sys sys 1147023549 4256
-sys/src/9/pc/sd53c8xx.c - 664 sys sys 1149280015 55135
+sys/src/9/pc/sd53c8xx.c - 664 sys sys 1167774852 55161
 sys/src/9/pc/sd53c8xx.n - 664 sys sys 1131290556 12657
-sys/src/9/pc/sdata.c - 664 sys sys 1161230658 52692
-sys/src/9/pc/sdmv50xx.c - 664 sys sys 1164645014 25841
-sys/src/9/pc/sdmylex.c - 664 sys sys 1133068062 27806
+sys/src/9/pc/sdata.c - 664 sys sys 1167774860 52718
+sys/src/9/pc/sdmv50xx.c - 664 sys sys 1167774867 25865
+sys/src/9/pc/sdmylex.c - 664 sys sys 1167774835 27902
 sys/src/9/pc/sdscsi.c - 664 sys sys 1158889425 7241
 sys/src/9/pc/trap.c - 664 sys sys 1135487942 21257
 sys/src/9/pc/uartaxp.c - 664 sys sys 1166247784 18879
@@ -8110,7 +8110,7 @@ sys/src/9/port/devpipe.c - 664 sys sys 1077055016 5825
 sys/src/9/port/devpnp.c - 664 sys sys 1088560907 13624
 sys/src/9/port/devproc.c - 664 sys sys 1142086847 28500
 sys/src/9/port/devroot.c - 664 sys sys 1146151714 4242
-sys/src/9/port/devsd.c - 664 sys sys 1155995769 30859
+sys/src/9/port/devsd.c - 664 sys sys 1167774805 31099
 sys/src/9/port/devsdp.c - 664 sys sys 1057323393 44800
 sys/src/9/port/devsegment.c - 664 sys sys 1131289891 9610
 sys/src/9/port/devsrv.c - 664 sys sys 1165810571 5711
@@ -14188,7 +14188,7 @@ sys/src/cmd/venti/dat.h - 664 sys sys 1132452191 15346
 sys/src/cmd/venti/dcache.c - 664 sys sys 1019678878 7374
 sys/src/cmd/venti/dump.c - 664 sys sys 1068520313 1578
 sys/src/cmd/venti/dumparena.c - 664 sys sys 1019678878 6381
-sys/src/cmd/venti/dumpvacroots - 775 sys sys 1139839229 550
+sys/src/cmd/venti/dumpvacroots - 775 sys sys 1167777001 571
 sys/src/cmd/venti/findscore.c - 664 sys sys 1121977913 2605
 sys/src/cmd/venti/fmtarenas.c - 664 sys sys 1132452192 2213
 sys/src/cmd/venti/fmtindex.c - 664 sys sys 1138471072 2524

+ 9 - 0
dist/replica/plan9.log

@@ -46934,3 +46934,12 @@
 1167453005 0 c 386/bin/replica/applychanges - 775 sys sys 1167451365 98591
 1167453005 1 c 386/bin/replica/compactdb - 775 sys sys 1167451365 78478
 1167453005 2 c 386/bin/replica/updatedb - 775 sys sys 1167451365 95926
+1167775206 0 c sys/man/1/sleep - 664 sys sys 1167774352 420
+1167775206 1 c sys/man/3/sd - 664 sys sys 1167774768 5652
+1167775206 2 c sys/man/3/usb - 664 sys sys 1167774741 7052
+1167775206 3 c sys/src/9/pc/sd53c8xx.c - 664 sys sys 1167774852 55161
+1167775206 4 c sys/src/9/pc/sdata.c - 664 sys sys 1167774860 52718
+1167775206 5 c sys/src/9/pc/sdmylex.c - 664 sys sys 1167774835 27902
+1167775206 6 c sys/src/9/pc/sdmv50xx.c - 664 sys sys 1167774867 25865
+1167775206 7 c sys/src/9/port/devsd.c - 664 sys sys 1167774805 31099
+1167777006 0 c sys/src/cmd/venti/dumpvacroots - 775 sys sys 1167777001 571

+ 2 - 0
sys/man/1/sleep

@@ -9,6 +9,8 @@ sleep \- suspend execution for an interval
 suspends execution for
 .I time
 seconds.
+.I Time
+may be floating-point.
 .SH EXAMPLES
 Execute a command
 100 seconds hence.

+ 54 - 9
sys/man/3/sd

@@ -5,6 +5,7 @@ sd \- storage device interface
 .nf
 .B bind #S /dev
 
+.B /dev/sdctl
 .BI /dev/sd Cu /ctl
 .BI /dev/sd Cu /raw
 .BI /dev/sd Cu /data
@@ -176,18 +177,61 @@ This is used by programs such as
 .IR scuzz (8)
 to manipulate devices that do not fit the simple storage model
 or for maintenance purposes.
-The following steps may be used to execute a command
-.IP
-\- Write the command to the
+The following steps may be taken to execute a command
+.IP \- 3
+Write the command to the
 .I raw
 file;
-.IP
-\- Read or write data associated with the command, according to the direction of the transfer.
-.IP
-\- Read the
+.IP \-
+Read or write data associated with the command, according to the direction of the transfer.
+.IP \-
+Read the
 .I raw
 file to retrieve the status of the command,
 returned as a text integer.
+.LP
+Reading
+.B /dev/sdctl
+yields information about each controller,
+one line per controller.
+Writing `\fLconfig \fImessage\fR' to
+.B /dev/sdctl
+passes
+.I message
+to the legacy configuration machinery,
+used to set attributes such as IRQ, port and size.
+Writing `\fIctltype message\fR' to
+.B /dev/sdctl
+passes
+.I message
+to
+.IR ctltype 's
+.B wtopctl
+function with a nil
+.B sdev
+argument,
+where
+.I ctltype
+is a known controller type such as
+.B ata
+or
+.BR scsi .
+Writing `\fIctlletter message\fR' to
+.B /dev/sdctl
+passes
+.I message
+to
+.IR ctlletter 's
+.B wtopctl
+function with an
+.B sdev
+argument corresponding to the named controller,
+where
+.I ctlletter
+is a known controller letter such as
+.B C
+or
+.BR 0 .
 .SH SOURCE
 .B /sys/src/9/port/devsd.c
 .br
@@ -195,10 +239,11 @@ returned as a text integer.
 .SH SEE ALSO
 .IR scuzz (8)
 .SH BUGS
-.PP
 Still in development.
 .PP
-No LUNs.
+For (S)ATA drives,
+LUNs (logical unit numbers) are not merely ignored but are actively
+prevented from working except for INQUIRY commands.
 .PP
 The 4 controller limit for ATA(PI) is not enforced.
 .PP

+ 3 - 0
sys/man/3/usb

@@ -244,3 +244,6 @@ The notion that the endpoints themselves have a class and subclass
 is a distortion of the standard.
 It would be better to leave all handling of the notions of class to the
 user-level support programs, and remove it from the driver.
+.PP
+There may be a timing bug that makes disk accesses via UHCI much
+slower than necessary.

+ 2 - 1
sys/src/9/pc/sd53c8xx.c

@@ -2260,5 +2260,6 @@ SDifc sd53c8xxifc = {
 	scsibio,			/* bio */
 	nil,				/* probe */
 	nil,				/* clear */
-	nil,				/* stat */
+	nil,				/* rtopctl */
+	nil,				/* wtopctl */
 };

+ 2 - 1
sys/src/9/pc/sdata.c

@@ -2266,5 +2266,6 @@ SDifc sdataifc = {
 	scsibio,			/* bio */
 	ataprobew,			/* probe */
 	ataclear,			/* clear */
-	atastat,			/* stat */
+	atastat,			/* rtopctl */
+	nil,				/* wtopctl */
 };

+ 2 - 1
sys/src/9/pc/sdmv50xx.c

@@ -1315,9 +1315,10 @@ SDifc sdmv50xxifc = {
 	mv50wctl,			/* wctl */
 
 	scsibio,			/* bio */
-	nil,			/* probe */
+	nil,				/* probe */
 	mv50clear,			/* clear */
 	mv50rtopctl,			/* rtopctl */
+	nil,				/* wtopctl */
 };
 
 /*

+ 4 - 2
sys/src/9/pc/sdmylex.c

@@ -708,11 +708,12 @@ mylex32interrupt(Ureg*, void* arg)
 	 * and Imbl which means something completed.
 	 * There's one spurious interrupt left over from
 	 * initialisation, ignore it.
+	 * In order to share PCI IRQs, just ignore spurious interrupts.
 	 */
 	rinterrupt = inb(port+Rinterrupt);
 	rstatus = inb(port+Rstatus);
 	outb(port+Rcontrol, Rint);
-	if((rinterrupt & ~(Cmdc|Imbl)) != Intv && ctlr->spurious++)
+	if(0 && (rinterrupt & ~(Cmdc|Imbl)) != Intv && ctlr->spurious++)
 		print("%s: interrupt 0x%2.2ux\n",
 			ctlr->sdev->name, rinterrupt);
 	if((rinterrupt & Cmdc) && (rstatus & Cmdinv))
@@ -1245,5 +1246,6 @@ SDifc sdmylexifc = {
 	scsibio,			/* bio */
 	nil,				/* probe */
 	nil,				/* clear */
-	nil,				/* stat */
+	nil,				/* rtopctl */
+	nil,				/* wtopctl */
 };

+ 41 - 32
sys/src/9/port/devsd.c

@@ -191,7 +191,7 @@ sdinitpart(SDunit* unit)
 		unit->dev->ifc->online(unit);
 	if(unit->sectors){
 		sdaddpart(unit, "data", 0, unit->sectors);
-	
+
 		/*
 		 * Use partitions passed from boot program,
 		 * e.g.
@@ -207,14 +207,14 @@ sdinitpart(SDunit* unit)
 			nf = tokenize(p, f, nelem(f));
 			if(nf < 3)
 				continue;
-		
+
 			start = strtoul(f[1], 0, 0);
 			end = strtoul(f[2], 0, 0);
 			if(!waserror()){
 				sdaddpart(unit, f[0], start, end);
 				poperror();
 			}
-		}			
+		}
 	}
 
 	return 1;
@@ -224,7 +224,7 @@ static int
 sdindex(int idno)
 {
 	char *p;
-	
+
 	p = strchr(devletters, idno);
 	if(p == nil)
 		return -1;
@@ -329,10 +329,10 @@ sdadddevs(SDev *sdev)
 {
 	int i, j, id;
 	SDev *next;
-	
+
 	for(; sdev; sdev=next){
 		next = sdev->next;
-		
+
 		sdev->unit = (SDunit**)malloc(sdev->nunit * sizeof(SDunit*));
 		sdev->unitflg = (int*)malloc(sdev->nunit * sizeof(int));
 		if(sdev->unit == nil || sdev->unitflg == nil){
@@ -385,7 +385,7 @@ sd2gen(Chan* c, int i, Dir* dp)
 	rv = -1;
 	switch(i){
 	case Qctl:
-		mkqid(&q, QID(DEV(c->qid), UNIT(c->qid), PART(c->qid), Qctl), 
+		mkqid(&q, QID(DEV(c->qid), UNIT(c->qid), PART(c->qid), Qctl),
 			   unit->vers, QTFILE);
 		perm = &unit->ctlperm;
 		if(emptystr(perm->user)){
@@ -397,7 +397,7 @@ sd2gen(Chan* c, int i, Dir* dp)
 		break;
 
 	case Qraw:
-		mkqid(&q, QID(DEV(c->qid), UNIT(c->qid), PART(c->qid), Qraw), 
+		mkqid(&q, QID(DEV(c->qid), UNIT(c->qid), PART(c->qid), Qraw),
 			   unit->vers, QTFILE);
 		perm = &unit->rawperm;
 		if(emptystr(perm->user)){
@@ -411,7 +411,7 @@ sd2gen(Chan* c, int i, Dir* dp)
 	case Qpart:
 		pp = &unit->part[PART(c->qid)];
 		l = (pp->end - pp->start) * (vlong)unit->secsize;
-		mkqid(&q, QID(DEV(c->qid), UNIT(c->qid), PART(c->qid), Qpart), 
+		mkqid(&q, QID(DEV(c->qid), UNIT(c->qid), PART(c->qid), Qpart),
 			   unit->vers+pp->vers, QTFILE);
 		if(emptystr(pp->user))
 			kstrdup(&pp->user, eve);
@@ -419,7 +419,7 @@ sd2gen(Chan* c, int i, Dir* dp)
 		rv = 1;
 		break;
 	}
-	
+
 	decref(&sdev->r);
 	return rv;
 }
@@ -469,7 +469,7 @@ sdgen(Chan* c, char*, Dirtab*, int, int s, Dir* dp)
 				s -= devs[i]->nunit;
 			}
 		}
-		
+
 		if(i == nelem(devs)){
 			/* Run off the end of the list */
 			qunlock(&devslock);
@@ -504,7 +504,7 @@ sdgen(Chan* c, char*, Dirtab*, int, int s, Dir* dp)
 			devdir(c, q, up->genbuf, 0, eve, 0555, dp);
 			return 1;
 		}
-		
+
 		if((sdev = sdgetdev(DEV(c->qid))) == nil){
 			devdir(c, c->qid, "unavailable", 0, eve, 0, dp);
 			return 1;
@@ -544,7 +544,7 @@ sdgen(Chan* c, char*, Dirtab*, int, int s, Dir* dp)
 			return 0;
 		}
 		l = (pp->end - pp->start) * (vlong)unit->secsize;
-		mkqid(&q, QID(DEV(c->qid), UNIT(c->qid), i, Qpart), 
+		mkqid(&q, QID(DEV(c->qid), UNIT(c->qid), i, Qpart),
 			    unit->vers+pp->vers, QTFILE);
 		if(emptystr(pp->user))
 			kstrdup(&pp->user, eve);
@@ -868,7 +868,7 @@ sdsetsense(SDreq *r, int status, int key, int asc, int ascq)
 {
 	int len;
 	SDunit *unit;
-	
+
 	unit = r->unit;
 	unit->sense[2] = key;
 	unit->sense[12] = asc;
@@ -894,7 +894,7 @@ sdmodesense(SDreq *r, uchar *cmd, void *info, int ilen)
 {
 	int len;
 	uchar *data;
-	
+
 	/*
 	 * Fake a vendor-specific request with page code 0,
 	 * return the drive info.
@@ -924,11 +924,11 @@ sdfakescsi(SDreq *r, void *info, int ilen)
 	uchar *cmd, *p;
 	uvlong len;
 	SDunit *unit;
-	
+
 	cmd = r->cmd;
 	r->rlen = 0;
 	unit = r->unit;
-	
+
 	/*
 	 * Rewrite read(6)/write(6) into read(10)/write(10).
 	 */
@@ -955,14 +955,14 @@ sdfakescsi(SDreq *r, void *info, int ilen)
 	 */
 	if((cmd[1]>>5) && cmd[0] != 0x12)
 		return sdsetsense(r, SDcheck, 0x05, 0x25, 0);
-	
+
 	switch(cmd[0]){
 	default:
 		return sdsetsense(r, SDcheck, 0x05, 0x20, 0);
-	
+
 	case 0x00:	/* test unit ready */
 		return sdsetsense(r, SDok, 0, 0, 0);
-	
+
 	case 0x03:	/* request sense */
 		if(cmd[4] < sizeof unit->sense)
 			len = cmd[4];
@@ -973,7 +973,7 @@ sdfakescsi(SDreq *r, void *info, int ilen)
 			r->rlen = len;
 		}
 		return sdsetsense(r, SDok, 0, 0, 0);
-	
+
 	case 0x12:	/* inquiry */
 		if(cmd[4] < sizeof unit->inquiry)
 			len = cmd[4];
@@ -990,13 +990,13 @@ sdfakescsi(SDreq *r, void *info, int ilen)
 		 * nop for now, can use power management later.
 		 */
 		return sdsetsense(r, SDok, 0, 0, 0);
-	
+
 	case 0x25:	/* read capacity */
 		if((cmd[1] & 0x01) || cmd[2] || cmd[3])
 			return sdsetsense(r, SDcheck, 0x05, 0x24, 0);
 		if(r->data == nil || r->dlen < 8)
 			return sdsetsense(r, SDcheck, 0x05, 0x20, 1);
-		
+
 		/*
 		 * Read capacity returns the LBA of the last sector.
 		 */
@@ -1018,7 +1018,7 @@ sdfakescsi(SDreq *r, void *info, int ilen)
 		if((cmd[1] & 0x01) || cmd[2] || cmd[3])
 			return sdsetsense(r, SDcheck, 0x05, 0x24, 0);
 		if(r->data == nil || r->dlen < 8)
-			return sdsetsense(r, SDcheck, 0x05, 0x20, 1);	
+			return sdsetsense(r, SDcheck, 0x05, 0x20, 1);
 		/*
 		 * Read capcity returns the LBA of the last sector.
 		 */
@@ -1039,10 +1039,10 @@ sdfakescsi(SDreq *r, void *info, int ilen)
 		*p++ = len;
 		r->rlen = p - (uchar*)r->data;
 		return sdsetsense(r, SDok, 0, 0, 0);
-	
+
 	case 0x5A:	/* mode sense */
 		return sdmodesense(r, cmd, info, ilen);
-	
+
 	case 0x28:	/* read */
 	case 0x2A:	/* write */
 		return SDnostatus;
@@ -1192,6 +1192,10 @@ sdwrite(Chan* c, void* a, long n, vlong off)
 			free(cb);
 			break;
 		}
+		/*
+		 * "ata arg..." invokes sdifc[i]->wtopctl(nil, cb),
+		 * where sdifc[i]->name=="ata" and cb contains the args.
+		 */
 		ifc = nil;
 		sdev = nil;
 		for(i=0; sdifc[i]; i++){
@@ -1201,6 +1205,11 @@ sdwrite(Chan* c, void* a, long n, vlong off)
 				goto subtopctl;
 			}
 		}
+		/*
+		 * "sd1 arg..." invokes sdifc[i]->wtopctl(sdev, cb),
+		 * where sdifc[i] and sdev match controller letter "1",
+		 * and cb contains the args.
+		 */
 		if(f0[0]=='s' && f0[1]=='d' && f0[2] && f0[3] == 0){
 			if((sdev = sdgetdev(f0[2])) != nil){
 				ifc = sdev->ifc;
@@ -1208,7 +1217,7 @@ sdwrite(Chan* c, void* a, long n, vlong off)
 			}
 		}
 		error("unknown interface");
-	
+
 	subtopctl:
 		if(waserror()){
 			if(sdev)
@@ -1330,7 +1339,7 @@ sdwstat(Chan* c, uchar* dp, int n)
 	SDev *sdev;
 
 	if(c->qid.type & QTDIR)
-		error(Eperm); 
+		error(Eperm);
 
 	sdev = sdgetdev(DEV(c->qid));
 	if(sdev == nil)
@@ -1415,7 +1424,7 @@ configure(char* spec, DevConf* cf)
 static int
 unconfigure(char* spec)
 {
-	int i;	
+	int i;
 	SDev *sdev;
 	SDunit *unit;
 
@@ -1433,7 +1442,7 @@ unconfigure(char* spec)
 	}
 	devs[i] = nil;
 	qunlock(&devslock);
-	
+
 	/* make sure no interrupts arrive anymore before removing resources */
 	if(sdev->enabled && sdev->ifc->disable)
 		sdev->ifc->disable(sdev);
@@ -1507,7 +1516,7 @@ parseswitch(Confdata* cd, char* option)
 static void
 parsespec(Confdata* cd, char* option)
 {
-	if(strlen(option) > 1) 
+	if(strlen(option) > 1)
 		error(Ebadarg);
 	cd->spec = option;
 }
@@ -1617,4 +1626,4 @@ legacytopctl(Cmdbuf *cb)
 		error(Ebadarg);
 	sdconfig(cd.on, cd.spec, &cd.cf);
 }
-	
+

+ 13 - 9
sys/src/cmd/venti/dumpvacroots

@@ -1,15 +1,19 @@
 #!/bin/rc
-
-# this dumps all the vac scores ever stored to the venti server
+# dumpvacroots - dumps all the vac scores ever stored to the venti server
 # if nothing else, this illustrates that you have to control access
 # to the physical disks storing the archive!
 
-ventihttp=`{echo $venti | sed 's/^[a-z]+!([0-9\.]+)![a-z0-9]+$/\1/; s/^[a-z]+!([0-9\.]+)/\1/; s/$/:8000/'}
+ventihttp=`{echo $venti | sed 's/^[a-z]+!([0-9\.]+)![a-z0-9]+$/\1/
+		s/^[a-z]+!([0-9\.]+)/\1/; s/$/:80/'
+}
 
 hget http://$ventihttp/index | 
-awk '
- /^index=/ { blockSize=0+substr($3, 11); }
- /^arena=/ { arena=substr($1, 7); }
- /^	arena=/ { start=0+substr($5, 2)-blockSize; printf("venti/printarena -o %d %s\n", start, $3); }' |
-rc |
-sed -n 's/^(.*) 1$/vac:\1/p'
+	awk '
+ /^index=/ { blockSize=0+substr($3, 11) }
+ /^arena=/ { arena=substr($1, 7) }
+ /^	arena=/ {
+		start = (0+substr($5, 2))-blockSize
+		printf("venti/printarena -o %.0f %s\n", start, $3 "")
+}' |
+	rc |
+	sed -n 's/^(.*) 1$/vac:\1/p'