MCPcopy Create free account
hub / github.com/axboe/liburing / verify_buf

Function verify_buf

test/file-verify.c:54–74  ·  view source on GitHub ↗

* Each offset in the file has the offset / sizeof(int) stored for every * sizeof(int) address. */

Source from the content-addressed store, hash-verified

52 * sizeof(int) address.
53 */
54static int verify_buf(void *buf, size_t size, off_t off, bool registered)
55{
56 int i, u_in_buf = size / sizeof(unsigned int);
57 unsigned int *ptr;
58
59 verify_buf_sync(buf, size, registered);
60
61 off /= sizeof(unsigned int);
62 ptr = buf;
63 for (i = 0; i < u_in_buf; i++) {
64 if (off != *ptr) {
65 fprintf(stderr, "Found %u, wanted %llu\n", *ptr,
66 (unsigned long long) off);
67 return 1;
68 }
69 ptr++;
70 off++;
71 }
72
73 return 0;
74}
75
76static int test_truncate(struct io_uring *ring, const char *fname, int buffered,
77 int vectored, int provide_buf)

Callers 2

test_truncateFunction · 0.70
testFunction · 0.70

Calls 1

verify_buf_syncFunction · 0.85

Tested by 1

test_truncateFunction · 0.56