shithub: gefs

Download patch

ref: 1b59639fe367093de90247cfcd95de634a9a22f3
parent: 11f9df0ac2980f77023e3a59e581faccf83d69ba
author: Ori Bernstein <[email protected]>
date: Sat May 27 21:20:49 EDT 2023

fsbench: fix warnings

--- a/test/fsbench.c
+++ b/test/fsbench.c
@@ -5,7 +5,7 @@
 
 int mainstacksize = 2*1024*1024;
 typedef struct Bench Bench;
-
+#define IOUNIT	32*1024
 enum {
 	KiB	= 1024ULL,
 	MiB	= 1024ULL*KiB,
@@ -134,7 +134,7 @@
 	if(b->id == -1)
 		snprint(path, sizeof(path), "%s", b->s0);
 	else if(b->i1 != 0)
-		snprint(path, sizeof(path), "%s.%d", b->s0, b->id % b->i1);
+		snprint(path, sizeof(path), "%s.%lld", b->s0, b->id % b->i1);
 	else
 		snprint(path, sizeof(path), "%s.%d", b->s0, b->id);
 	if((fd = open(path, OREAD)) == -1)
@@ -159,7 +159,7 @@
 	if(b->id == -1)
 		snprint(path, sizeof(path), "%s", b->s0);
 	else if(b->i1 != 0)
-		snprint(path, sizeof(path), "%s.%d", b->s0, b->id % b->i1);
+		snprint(path, sizeof(path), "%s.%lld", b->s0, b->id % b->i1);
 	else
 		snprint(path, sizeof(path), "%s.%d", b->s0, b->id);
 	if((fd = open(path, OREAD)) == -1)
@@ -181,7 +181,6 @@
 {
 	char buf[64];
 	Bench bb;
-	vlong r;
 
 	bb = *b;
 	if(b->id >= b->i1)
@@ -204,7 +203,7 @@
 	if(b->id == -1)
 		snprint(path, sizeof(path), "%s", b->s0);
 	else if(b->i1 != 0)
-		snprint(path, sizeof(path), "%s.%d", b->s0, b->id % b->i1);
+		snprint(path, sizeof(path), "%s.%lld", b->s0, b->id % b->i1);
 	else
 		snprint(path, sizeof(path), "%s.%d", b->s0, b->id);
 	if((fd = open(path, OREAD)) == -1)
@@ -296,7 +295,7 @@
 	int i, fd;
 
 	for(i = 0; i < b->reps; i++){
-		snprint(buf, sizeof(buf), "%s%d", b->s0, vrand(b->i0));
+		snprint(buf, sizeof(buf), "%s%lld", b->s0, vrand(b->i0));
 		if((fd = open(buf, OREAD)) == -1)
 			sysfatal("open: %r");
 		if(b->i0)