summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2010-07-02 22:02:26 -0700
committerKent Overstreet <kent.overstreet@gmail.com>2010-07-02 22:02:26 -0700
commit87cc300dbb6cf8a28f14363d63c9417147918a75 (patch)
tree4907d7d300cb7c276dd00537fad1a751c06cf358
parent41ad07857ebb6da88d3777ab1e350a671e7fcb8c (diff)
downloadbcache-tools-87cc300dbb6cf8a28f14363d63c9417147918a75.tar.zst
file_offset_bits=64
-rw-r--r--bcache-test.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/bcache-test.c b/bcache-test.c
index f1f4278..1c1fe75 100644
--- a/bcache-test.c
+++ b/bcache-test.c
@@ -1,3 +1,4 @@
+#define _FILE_OFFSET_BITS 64
#define _XOPEN_SOURCE 500
#define _GNU_SOURCE
@@ -123,7 +124,7 @@ int main(int argc, char **argv)
{
bool walk = false, randsize = false, verbose = false, csum = false, destructive = false, log = false;
int fd1, fd2 = 0, logfd, direct = 0, nbytes = 4096, j;
- unsigned long size, i, offset = 0, done = 0;
+ unsigned long size, i, offset = 0, done = 0, unique = 0;
void *buf1 = NULL, *buf2 = NULL;
struct pagestuff *pages, *p;
unsigned char c[16];
@@ -216,8 +217,8 @@ int main(int argc, char **argv)
goto print;
}
} else
-print: printf("Loop %6li offset %9li sectors %3i, %6lu mb done\n",
- i, offset >> 9, nbytes >> 9, done >> 11);
+print: printf("Loop %6li offset %9li sectors %3i, %6lu mb done, %6lu mb unique\n",
+ i, offset >> 9, nbytes >> 9, done >> 11, unique >> 11);
done += nbytes >> 9;
@@ -247,6 +248,9 @@ print: printf("Loop %6li offset %9li sectors %3i, %6lu mb done\n",
4096))
goto bad;
+ if (!p->writecount && !p->readcount)
+ unique += 8;
+
writing ? p->writecount++ : p->readcount++;
}
if (writing)