t/io_uring: fix 32-bit build warnings
authorVincent Fu <vincent.fu@samsung.com>
Tue, 21 Dec 2021 16:07:58 +0000 (11:07 -0500)
committerVincent Fu <vincent.fu@samsung.com>
Thu, 23 Dec 2021 20:55:20 +0000 (15:55 -0500)
commit8310c57050e7c89a1454cbf7732e81ba83d668d7
treeb82e423a58a5f63e6b30c85a4773bcee55107162
parent2fe224d8b49e759138fa68b519161257dc1ce600
t/io_uring: fix 32-bit build warnings

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>
t/io_uring.c