On Wed, Jan 10, 2024 at 11:38:02AM -0700, Jens Axboe wrote: > This originally came from the aio side, and it's laid out rather oddly. > The common case here is that we either get -EIOCBQUEUED from submitting > an async request, or that we complete the request correctly with the > given number of bytes. Handling the odd internal restart error codes > is not a common operation. > > Lay it out a bit more optimally that better explains the normal flow, > and switch to avoiding the indirect call completely as this is our > kiocb and we know the completion handler can only be one of two > possible variants. While at it, move it to where it belongs in the > file, with fellow end IO helpers. > > Outside of being easier to read, this also reduces the text size of the > function by 24 bytes for me on arm64. > > Signed-off-by: Jens Axboe <axboe@xxxxxxxxx> Looks good! Reviewed-by: Keith Busch <kbusch@xxxxxxxxxx>