Also change the type for offset to long long since that's what is
expected by io_prep_pread.
Latency measurement for t/io_uring is actually broken on 32-bit builds
because iocb->data and io_event->data are 32-bit void pointers. So it is
not possible to fit both fileno and clock_index in there.
On a 32-bit build with 4-byte longs, the following warnings appear:
t/io_uring.c: In function ‘prep_more_ios_aio’:
t/io_uring.c:666:44: error: left shift count >= width of type [-Werror=shift-count-overflow]
666 | data |= ((unsigned long) s->clock_index << 32);
| ^~
t/io_uring.c: In function ‘reap_events_aio’:
t/io_uring.c:688:27: error: right shift count >= width of type [-Werror=shift-count-overflow]
688 | int clock_index = data >> 32;
| ^~
Explicitly specify 64-bit types to resolve these warnings.
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
#ifdef CONFIG_LIBAIO
static int prep_more_ios_aio(struct submitter *s, int max_ios, struct iocb *iocbs)
{
- unsigned long offset, data;
+ uint64_t data;
+ long long offset;
struct file *f;
unsigned index;
long r;
data = f->fileno;
if (stats && stats_running)
- data |= ((unsigned long) s->clock_index << 32);
+ data |= (((uint64_t) s->clock_index) << 32);
iocb->data = (void *) (uintptr_t) data;
index++;
}
int reaped = 0;
while (evs) {
- unsigned long data = (uintptr_t) events[reaped].data;
+ uint64_t data = (uintptr_t) events[reaped].data;
struct file *f = &s->files[data & 0xffffffff];
f->pending_ios--;