Skip to content

Commit b9a6c94

Browse files
Christoph Hellwigaxboe
authored andcommitted
io_uring: remove __io_file_supports_nowait
Now that this only checks O_NONBLOCK and FMODE_NOWAIT, the helper is complete overkilļ, and the comments are confusing bordering to wrong. Just inline the check into the caller. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20230620113235.920399-2-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 4826c59 commit b9a6c94

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

io_uring/io_uring.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1766,19 +1766,6 @@ static void io_iopoll_req_issued(struct io_kiocb *req, unsigned int issue_flags)
17661766
}
17671767
}
17681768

1769-
/*
1770-
* If we tracked the file through the SCM inflight mechanism, we could support
1771-
* any file. For now, just ensure that anything potentially problematic is done
1772-
* inline.
1773-
*/
1774-
static bool __io_file_supports_nowait(struct file *file, umode_t mode)
1775-
{
1776-
/* any ->read/write should understand O_NONBLOCK */
1777-
if (file->f_flags & O_NONBLOCK)
1778-
return true;
1779-
return file->f_mode & FMODE_NOWAIT;
1780-
}
1781-
17821769
/*
17831770
* If we tracked the file through the SCM inflight mechanism, we could support
17841771
* any file. For now, just ensure that anything potentially problematic is done
@@ -1791,7 +1778,7 @@ unsigned int io_file_get_flags(struct file *file)
17911778

17921779
if (S_ISREG(mode))
17931780
res |= FFS_ISREG;
1794-
if (__io_file_supports_nowait(file, mode))
1781+
if ((file->f_flags & O_NONBLOCK) || (file->f_mode & FMODE_NOWAIT))
17951782
res |= FFS_NOWAIT;
17961783
return res;
17971784
}

0 commit comments

Comments
 (0)