From 7ea205fbf513452edc3f680120dab47a7e52f433 Mon Sep 17 00:00:00 2001 From: Amit Shah Date: Mon, 20 Apr 2009 18:19:31 +0530 Subject: Fix test for chunk-writing case A few runs that resulted in bad timings for chunk-sized writes led Jan Kara and Mike Galbraith to discuss why it might be so and Mike spotted the error in the code -- we allocated a buffer of the size of the file instead of the size of the chunk -- in my case, 4G instead of 4K. Thanks Mike. Signed-off-by: Amit Shah --- test-file-zero-alloc-speed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-file-zero-alloc-speed.c b/test-file-zero-alloc-speed.c index 4954976..dcfc3b1 100644 --- a/test-file-zero-alloc-speed.c +++ b/test-file-zero-alloc-speed.c @@ -178,7 +178,7 @@ int do_write_chunks(char *target, int *fd, off_t len, size_t data) unsigned long long remain = len; char *zeros; - zeros = calloc(1, len); + zeros = calloc(1, data); printf("%llu-sized chunk run time:\n", data); gettimeofday(&tv1, NULL); -- cgit