aboutsummaryrefslogtreecommitdiffstats
path: root/io_uring/io_uring.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2023-06-20 13:32:28 +0200
committerJens Axboe <axboe@kernel.dk>2023-06-20 09:36:21 -0600
commitb9a6c9459a5aec7bfd9b763554d15148367f1806 (patch)
treee4ada2e4738f9c68726b8a9259bed59aa3f76da3 /io_uring/io_uring.c
parent4826c59453b3b4677d6bf72814e7ababdea86949 (diff)
downloadlinux-b9a6c9459a5aec7bfd9b763554d15148367f1806.tar.gz
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>
Diffstat (limited to 'io_uring/io_uring.c')
-rw-r--r--io_uring/io_uring.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index f181876e415b9..7e735724940f7 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1771,19 +1771,6 @@ static void io_iopoll_req_issued(struct io_kiocb *req, unsigned int issue_flags)
* any file. For now, just ensure that anything potentially problematic is done
* inline.
*/
-static bool __io_file_supports_nowait(struct file *file, umode_t mode)
-{
- /* any ->read/write should understand O_NONBLOCK */
- if (file->f_flags & O_NONBLOCK)
- return true;
- return file->f_mode & FMODE_NOWAIT;
-}
-
-/*
- * If we tracked the file through the SCM inflight mechanism, we could support
- * any file. For now, just ensure that anything potentially problematic is done
- * inline.
- */
unsigned int io_file_get_flags(struct file *file)
{
umode_t mode = file_inode(file)->i_mode;
@@ -1791,7 +1778,7 @@ unsigned int io_file_get_flags(struct file *file)
if (S_ISREG(mode))
res |= FFS_ISREG;
- if (__io_file_supports_nowait(file, mode))
+ if ((file->f_flags & O_NONBLOCK) || (file->f_mode & FMODE_NOWAIT))
res |= FFS_NOWAIT;
return res;
}