io_uring: optimise io_req_init() sqe flags checks
authorPavel Begunkov <asml.silence@gmail.com>
Wed, 15 Sep 2021 11:03:38 +0000 (12:03 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 19 Oct 2021 11:49:53 +0000 (05:49 -0600)
commit68fe256aadc0db70cb27132a6f5583819794d867
tree59891dbcdfa1ccee6706f980f6ac31bcd4294deb
parenta3f349071eb0ae2aa18ac2da55060865d8190cf0
io_uring: optimise io_req_init() sqe flags checks

IOSQE_IO_DRAIN is quite marginal and we don't care too much about
IOSQE_BUFFER_SELECT. Save to ifs and hide both of them under
SQE_VALID_FLAGS check. Now we first check whether it uses a "safe"
subset, i.e. without DRAIN and BUFFER_SELECT, and only if it's not
true we test the rest of the flags.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/dccfb9ab2ab0969a2d8dc59af88fa0ce44eeb1d5.1631703764.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c