| 18 | #define QUEUE_SIZE 2048 |
| 19 | |
| 20 | static void create_file(const char *file, size_t size) |
| 21 | { |
| 22 | ssize_t ret; |
| 23 | char *buf; |
| 24 | size_t idx; |
| 25 | int fd; |
| 26 | |
| 27 | buf = t_malloc(size); |
| 28 | for (idx = 0; idx < size; ++idx) { |
| 29 | /* write 0 or 1 */ |
| 30 | buf[idx] = (unsigned char)(idx & 0x01); |
| 31 | } |
| 32 | |
| 33 | fd = open(file, O_WRONLY | O_CREAT, 0644); |
| 34 | assert(fd >= 0); |
| 35 | |
| 36 | ret = write(fd, buf, size); |
| 37 | fsync(fd); |
| 38 | close(fd); |
| 39 | free(buf); |
| 40 | assert(ret == size); |
| 41 | } |
| 42 | |
| 43 | static int test_read(struct io_uring *ring, bool async, int blocksize) |
| 44 | { |