X-Git-Url: http://git.vrable.net/?p=bluesky.git;a=blobdiff_plain;f=nfs3%2Fsynreadbench.c;h=908363fde0b99c0cbd0c215ed30de995b1f26a12;hp=1e749fae23b7ec2cc62ddcc9a052f590b702e559;hb=4ad919582a62923b80e9ac9ea3159938f628016e;hpb=3a63041232b22ef44618ceb4d34122c17af69214 diff --git a/nfs3/synreadbench.c b/nfs3/synreadbench.c index 1e749fa..908363f 100644 --- a/nfs3/synreadbench.c +++ b/nfs3/synreadbench.c @@ -312,12 +312,13 @@ static void submit_random_read(NFSConnection *nfs) if (read_size > (1 << 20)) { scale = read_size / (1 << 20); } + int filecount = bench_files->len; printf("Warming up file %d\n", warmup_counter); - if (warmup_counter >= bench_files->len * scale) + if (warmup_counter >= filecount * scale) return; bf = &g_array_index(bench_files, struct bench_file, - warmup_counter / scale); - send_read_request(nfs, bf->inum, (warmup_counter % scale) << 20, + warmup_counter % filecount); + send_read_request(nfs, bf->inum, (warmup_counter / filecount) << 20, read_size > (1 << 20) ? (1 << 20) : read_size); warmup_counter++; return;