* Each offset in the file has the ((test_case / 2) * FILE_SIZE) * + (offset / sizeof(int)) stored for every * sizeof(int) address. */
| 30 | * sizeof(int) address. |
| 31 | */ |
| 32 | static int verify_buf(int tc, void *buf, off_t off) |
| 33 | { |
| 34 | int i, u_in_buf = BS / sizeof(unsigned int); |
| 35 | unsigned int *ptr; |
| 36 | |
| 37 | off /= sizeof(unsigned int); |
| 38 | off += (tc / 2) * FILE_SIZE; |
| 39 | ptr = buf; |
| 40 | for (i = 0; i < u_in_buf; i++) { |
| 41 | if (off != *ptr) { |
| 42 | fprintf(stderr, "Found %u, wanted %llu\n", *ptr, |
| 43 | (unsigned long long) off); |
| 44 | return 1; |
| 45 | } |
| 46 | ptr++; |
| 47 | off++; |
| 48 | } |
| 49 | |
| 50 | return 0; |
| 51 | } |
| 52 | |
| 53 | static int fill_pattern(int tc) |
| 54 | { |