Commit 53108d47 authored by Jens Axboe's avatar Jens Axboe

io_uring: only hash regular files for async work execution

We hash regular files to avoid having multiple threads hammer on the
inode mutex, but it should not be needed on other types of files
(like sockets).
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 4a0a7a18
...@@ -581,6 +581,8 @@ static inline bool io_prep_async_work(struct io_kiocb *req, ...@@ -581,6 +581,8 @@ static inline bool io_prep_async_work(struct io_kiocb *req,
switch (req->sqe->opcode) { switch (req->sqe->opcode) {
case IORING_OP_WRITEV: case IORING_OP_WRITEV:
case IORING_OP_WRITE_FIXED: case IORING_OP_WRITE_FIXED:
/* only regular files should be hashed for writes */
if (req->flags & REQ_F_ISREG)
do_hashed = true; do_hashed = true;
/* fall-through */ /* fall-through */
case IORING_OP_READV: case IORING_OP_READV:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment