On 7/25/22 6:33 PM, Pavel Begunkov wrote:
Don't double cast int -> ptr -> int in io_uring_prep_fallocate(), assign len directly. Signed-off-by: Pavel Begunkov <asml.silence@xxxxxxxxx> --- src/include/liburing.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
[...]
io_uring_prep_rw(IORING_OP_FALLOCATE, sqe, fd, - (const uintptr_t *) (unsigned long) len, - (unsigned int) mode, (__u64) offset); + 0, (unsigned int) mode, (__u64) offset);
nit: instead of 0 it's better to use NULL. No?
+ sqe->addr = (__u64) len;
This one looks simpler than a double cast. Reviewed-by: Ammar Faizi <ammarfaizi2@xxxxxxxxxxx> -- Ammar Faizi