io_uring/napi: enable even with a timeout of 0
authorJens Axboe <axboe@kernel.dk>
Thu, 15 Feb 2024 22:30:33 +0000 (15:30 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 15 Feb 2024 22:37:28 +0000 (15:37 -0700)
commitb4ccc4dd1330a4d0db6aa4c6781631d1bab76c45
tree9af256544b80381afafd99e2f5982da896148424
parent871760eb7af57accc5402142154e64f21701fa16
io_uring/napi: enable even with a timeout of 0

1 usec is not as short as it used to be, and it makes sense to allow 0
for a busy poll timeout - this means just do one loop to check if we
have anything available. Add a separate ->napi_enabled to check if napi
has been enabled or not.

While at it, move the writing of the ctx napi values after we've copied
the old values back to userspace. This ensures that if the call fails,
we'll be in the same state as we were before, rather than some
indeterminate state.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/io_uring_types.h
io_uring/napi.c