Skip to content

Commit 0e0d9a3

Browse files
kawasakiaxboe
authored andcommitted
t/verify-state.c: adjust to verify state format change
The previous commit modified the format of verify state files. To adjust to the change, add support of the new field "max_no_comps_per_file" and pass it to __thread_io_list_sz(). Also check the version number against the new version 4. Signed-off-by: Shin'ichiro Kawasaki <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 9abce42 commit 0e0d9a3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

t/verify-state.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ static void show_s(struct thread_io_list *s, unsigned int no_s)
2323
printf("Name:\t\t%s\n", s->name);
2424
printf("Completions:\t%llu\n", (unsigned long long) s->no_comps);
2525
printf("Depth:\t\t%llu\n", (unsigned long long) s->depth);
26+
printf("Max completions per file:\t\t%lu\n", (unsigned long) s->max_no_comps_per_file);
2627
printf("Number IOs:\t%llu\n", (unsigned long long) s->numberio);
2728
printf("Index:\t\t%llu\n", (unsigned long long) s->index);
2829

@@ -46,6 +47,7 @@ static void show(struct thread_io_list *s, size_t size)
4647

4748
s->no_comps = le64_to_cpu(s->no_comps);
4849
s->depth = le32_to_cpu(s->depth);
50+
s->max_no_comps_per_file = le32_to_cpu(s->max_no_comps_per_file);
4951
s->nofiles = le32_to_cpu(s->nofiles);
5052
s->numberio = le64_to_cpu(s->numberio);
5153
s->index = le64_to_cpu(s->index);
@@ -57,9 +59,9 @@ static void show(struct thread_io_list *s, size_t size)
5759

5860
show_s(s, no_s);
5961
no_s++;
60-
size -= __thread_io_list_sz(s->depth, s->nofiles);
62+
size -= __thread_io_list_sz(s->max_no_comps_per_file, s->nofiles);
6163
s = (struct thread_io_list *)((char *) s +
62-
__thread_io_list_sz(s->depth, s->nofiles));
64+
__thread_io_list_sz(s->max_no_comps_per_file, s->nofiles));
6365
} while (size != 0);
6466
}
6567

@@ -90,7 +92,7 @@ static void show_verify_state(void *buf, size_t size)
9092
return;
9193
}
9294

93-
if (hdr->version == 0x03)
95+
if (hdr->version == 0x04)
9496
show(s, size);
9597
else
9698
log_err("Unsupported version %d\n", (int) hdr->version);

0 commit comments

Comments
 (0)