Browse Source

Plan 9 from Bell Labs 2006-04-17

David du Colombier 15 years ago
parent
commit
6ef050a7c5

+ 3 - 2
acme/bin/source/win/fs.c

@@ -46,7 +46,7 @@ fswrite(Req *r)
 {
 	static Event *e[4];
 	Event *ep;
-	int i, j, nb, wid, pid;
+	int i, j, ei, nb, wid, pid;
 	Rune rune;
 	char *s;
 	char tmp[UTFmax], *t;
@@ -97,8 +97,9 @@ fswrite(Req *r)
 		nb = j;
 		t[j] = '\0';
 	}
+	ei = nb>8192? 8192 : nb;
 	/* process bytes into runes, transferring terminal partial runes into next buffer */
-	for(i=j=0; i<nb && fullrune(ep->b+i, nb-i); i+=wid,j++)
+	for(i=j=0; i<ei && fullrune(ep->b+i, ei-i); i+=wid,j++)
 		wid = chartorune(&rune, ep->b+i);
 	memmove(tmp, ep->b+i, nb-i);
 	partial = nb-i;

+ 1 - 1
acme/bin/source/win/main.c

@@ -436,7 +436,7 @@ mainctl(void *v)
 			sprint(tmp, "#%lud", hostpt);
 			winsetaddr(w, tmp, 0);
 			write(w->data, e->b, e->nb);
-			pendingS += utfnlen(e->b, e->nb);
+			pendingS += e->nr;
 			break;
 	
 		case 'E':	/* write to tag or body; body happens due to sendit */

+ 6 - 6
dist/replica/_plan9.db

@@ -7,9 +7,9 @@
 386/9pc.gz - 664 sys sys 1141258202 668936
 386/9pccpu - 775 sys sys 1141258205 1583315
 386/9pccpu.gz - 664 sys sys 1141258206 561499
-386/9pcdisk - 775 sys sys 1141258210 2100897
+386/9pcdisk - 775 sys sys 1145192021 2106905
 386/9pcdisk.gz - 664 sys sys 1141258211 755785
-386/9pcf - 775 sys sys 1141258216 2446791
+386/9pcf - 775 sys sys 1145192013 2452775
 386/9pcf.gz - 664 sys sys 1141258217 910970
 386/9pxeload - 775 sys sys 1131317321 216948
 386/_9pcdisk.gz - 664 sys sys 1039764191 695837
@@ -683,8 +683,8 @@ acme/bin/source/mkwnew.c - 664 sys sys 1017680666 862
 acme/bin/source/spout.c - 664 sys sys 1015011255 1868
 acme/bin/source/win - 20000000775 sys sys 1015011255 0
 acme/bin/source/win/dat.h - 664 sys sys 1017679345 1992
-acme/bin/source/win/fs.c - 664 sys sys 1045503982 2713
-acme/bin/source/win/main.c - 664 sys sys 1143126825 12447
+acme/bin/source/win/fs.c - 664 sys sys 1145192656 2743
+acme/bin/source/win/main.c - 664 sys sys 1145192657 12432
 acme/bin/source/win/mkfile - 664 sys sys 1046654934 309
 acme/bin/source/win/pipe.c - 664 sys sys 1104430371 2802
 acme/bin/source/win/util.c - 664 sys sys 1017679346 1169
@@ -5749,7 +5749,7 @@ sys/games - 20000000775 sys sys 952648872 0
 sys/games/lib - 20000000775 sys sys 952648879 0
 sys/games/lib/4scores - 10000000666 sys sys 1118680448 0
 sys/games/lib/5scores - 10000000666 sys sys 1118680453 0
-sys/games/lib/fortunes - 664 sys sys 1143777872 258440
+sys/games/lib/fortunes - 664 sys sys 1145163827 258572
 sys/games/lib/mahjongg - 20000000775 sys sys 1095792278 0
 sys/games/lib/mahjongg/backgrounds - 20000000775 sys sys 1095792293 0
 sys/games/lib/mahjongg/backgrounds/default.bit - 664 sys sys 1095792293 346803
@@ -9277,7 +9277,7 @@ sys/src/cmd/9nfs/nametest.c - 664 sys sys 1015090372 1723
 sys/src/cmd/9nfs/nfs.c - 664 sys sys 1131293679 9526
 sys/src/cmd/9nfs/nfs.h - 664 sys sys 1015090372 642
 sys/src/cmd/9nfs/nfsmount.c - 664 sys sys 1071498520 6142
-sys/src/cmd/9nfs/nfsserver.c - 664 sys sys 1040952455 15576
+sys/src/cmd/9nfs/nfsserver.c - 664 sys sys 1145192364 15772
 sys/src/cmd/9nfs/pcnfsd.c - 664 sys sys 1017337815 3964
 sys/src/cmd/9nfs/portmapper.c - 664 sys sys 1040952456 3179
 sys/src/cmd/9nfs/rpc.c - 664 sys sys 1017337815 5293

+ 6 - 6
dist/replica/plan9.db

@@ -7,9 +7,9 @@
 386/9pc.gz - 664 sys sys 1141258202 668936
 386/9pccpu - 775 sys sys 1141258205 1583315
 386/9pccpu.gz - 664 sys sys 1141258206 561499
-386/9pcdisk - 775 sys sys 1141258210 2100897
+386/9pcdisk - 775 sys sys 1145192021 2106905
 386/9pcdisk.gz - 664 sys sys 1141258211 755785
-386/9pcf - 775 sys sys 1141258216 2446791
+386/9pcf - 775 sys sys 1145192013 2452775
 386/9pcf.gz - 664 sys sys 1141258217 910970
 386/9pxeload - 775 sys sys 1131317321 216948
 386/_9pcdisk.gz - 664 sys sys 1039764191 695837
@@ -683,8 +683,8 @@ acme/bin/source/mkwnew.c - 664 sys sys 1017680666 862
 acme/bin/source/spout.c - 664 sys sys 1015011255 1868
 acme/bin/source/win - 20000000775 sys sys 1015011255 0
 acme/bin/source/win/dat.h - 664 sys sys 1017679345 1992
-acme/bin/source/win/fs.c - 664 sys sys 1045503982 2713
-acme/bin/source/win/main.c - 664 sys sys 1143126825 12447
+acme/bin/source/win/fs.c - 664 sys sys 1145192656 2743
+acme/bin/source/win/main.c - 664 sys sys 1145192657 12432
 acme/bin/source/win/mkfile - 664 sys sys 1046654934 309
 acme/bin/source/win/pipe.c - 664 sys sys 1104430371 2802
 acme/bin/source/win/util.c - 664 sys sys 1017679346 1169
@@ -5749,7 +5749,7 @@ sys/games - 20000000775 sys sys 952648872 0
 sys/games/lib - 20000000775 sys sys 952648879 0
 sys/games/lib/4scores - 10000000666 sys sys 1118680448 0
 sys/games/lib/5scores - 10000000666 sys sys 1118680453 0
-sys/games/lib/fortunes - 664 sys sys 1143777872 258440
+sys/games/lib/fortunes - 664 sys sys 1145163827 258572
 sys/games/lib/mahjongg - 20000000775 sys sys 1095792278 0
 sys/games/lib/mahjongg/backgrounds - 20000000775 sys sys 1095792293 0
 sys/games/lib/mahjongg/backgrounds/default.bit - 664 sys sys 1095792293 346803
@@ -9277,7 +9277,7 @@ sys/src/cmd/9nfs/nametest.c - 664 sys sys 1015090372 1723
 sys/src/cmd/9nfs/nfs.c - 664 sys sys 1131293679 9526
 sys/src/cmd/9nfs/nfs.h - 664 sys sys 1015090372 642
 sys/src/cmd/9nfs/nfsmount.c - 664 sys sys 1071498520 6142
-sys/src/cmd/9nfs/nfsserver.c - 664 sys sys 1040952455 15576
+sys/src/cmd/9nfs/nfsserver.c - 664 sys sys 1145192364 15772
 sys/src/cmd/9nfs/pcnfsd.c - 664 sys sys 1017337815 3964
 sys/src/cmd/9nfs/portmapper.c - 664 sys sys 1040952456 3179
 sys/src/cmd/9nfs/rpc.c - 664 sys sys 1017337815 5293

+ 6 - 0
dist/replica/plan9.log

@@ -29496,3 +29496,9 @@
 1145034019 3 c 386/bin/ndb/dnsdebug - 775 sys sys 1145033672 221818
 1145034019 4 c 386/bin/ndb/dnstcp - 775 sys sys 1145033672 220786
 1145035824 0 c sys/src/boot/pc/mkfile - 664 sys sys 1145035359 3116
+1145165460 0 c sys/games/lib/fortunes - 664 sys sys 1145163827 258572
+1145192467 0 c 386/9pcdisk - 775 sys sys 1145192021 2106905
+1145192467 1 c 386/9pcf - 775 sys sys 1145192013 2452775
+1145192467 2 c sys/src/cmd/9nfs/nfsserver.c - 664 sys sys 1145192364 15772
+1145194268 0 c acme/bin/source/win/fs.c - 664 sys sys 1145192656 2743
+1145194268 1 c acme/bin/source/win/main.c - 664 sys sys 1145192657 12432

+ 1 - 0
sys/games/lib/fortunes

@@ -4116,3 +4116,4 @@ You've got a syntax error somewhere in your code.  It could be around line 15.
 Lucent is the best place 4 me to work. (Please keep confidential)
 It might be comfortable, but so is lounging in a big enough pile of shite.  - jmk, about ioctl
 i'm sure ken said we had persistant objects: ''they're called files''  - boyd
+But macros are like having these high-powered band-aids, when what you want is not to be wounded in the first place.  - Steve Yegge

+ 10 - 5
sys/src/cmd/9nfs/nfsserver.c

@@ -629,17 +629,22 @@ static int
 nfsstatfs(int n, Rpccall *cmd, Rpccall *reply)
 {
 	uchar *dataptr = reply->results;
+	enum {
+		Xfersize = 2048,
+		Maxlong = (long)((1ULL<<31) - 1),
+		Maxfreeblks = Maxlong / Xfersize,
+	};
 
 	chat("statfs...");
 	showauth(&cmd->cred);
 	if(n != FHSIZE)
 		return garbage(reply, "bad count");
 	PLONG(NFS_OK);
-	PLONG(4096);	/* tsize */
-	PLONG(2048);	/* bsize */
-	PLONG(100000);	/* blocks */
-	PLONG(50000);	/* bfree */
-	PLONG(40000);	/* bavail */
+	PLONG(4096);		/* tsize (fs block size) */
+	PLONG(Xfersize);	/* bsize (optimal transfer size) */
+	PLONG(Maxfreeblks);	/* blocks in fs */
+	PLONG(Maxfreeblks);	/* bfree to root*/
+	PLONG(Maxfreeblks);	/* bavail (free to mortals) */
 	chat("OK\n");
 	/*conftime = 0;
 	readunixidmaps(config);*/