public inbox for [email protected]
 help / color / mirror / Atom feed
From: Christoph Hellwig <[email protected]>
To: Jens Axboe <[email protected]>
Cc: Pavel Begunkov <[email protected]>, [email protected]
Subject: [PATCH 1/8] io_uring: remove __io_file_supports_nowait
Date: Tue, 20 Jun 2023 13:32:28 +0200	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

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 <[email protected]>
---
 io_uring/io_uring.c | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index f181876e415b9a..7e735724940f7f 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1766,19 +1766,6 @@ static void io_iopoll_req_issued(struct io_kiocb *req, unsigned int issue_flags)
 	}
 }
 
-/*
- * 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.
- */
-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
@@ -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;
 }
-- 
2.39.2


  reply	other threads:[~2023-06-20 11:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-20 11:32 io_uring req flags cleanups Christoph Hellwig
2023-06-20 11:32 ` Christoph Hellwig [this message]
2023-06-20 11:32 ` [PATCH 2/8] io_uring: remove the mode variable in io_file_get_flags Christoph Hellwig
2023-06-20 11:32 ` [PATCH 3/8] io_uring: remove a confusing comment above io_file_get_flags Christoph Hellwig
2023-06-20 11:32 ` [PATCH 4/8] io_uring: remove io_req_ffs_set Christoph Hellwig
2023-06-20 11:32 ` [PATCH 5/8] io_uring: return REQ_F_ flags from io_file_get_flags Christoph Hellwig
2023-06-20 11:32 ` [PATCH 6/8] io_uring: use io_file_from_index in __io_sync_cancel Christoph Hellwig
2023-06-20 11:32 ` [PATCH 7/8] io_uring: use io_file_from_index in io_msg_grab_file Christoph Hellwig
2023-06-20 11:32 ` [PATCH 8/8] io_uring: add helpers to decode the fixed file file_ptr Christoph Hellwig
2023-06-20 15:36 ` io_uring req flags cleanups Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox