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 4/8] io_uring: remove io_req_ffs_set
Date: Tue, 20 Jun 2023 13:32:31 +0200	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

Just checking the flag directly makes it a lot more obvious what is
going on here.

Signed-off-by: Christoph Hellwig <[email protected]>
---
 io_uring/io_uring.c | 2 +-
 io_uring/io_uring.h | 5 -----
 io_uring/rw.c       | 2 +-
 3 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 79f3cabec5b934..0e0bdb6ac9a202 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -424,7 +424,7 @@ static void io_prep_async_work(struct io_kiocb *req)
 	if (req->flags & REQ_F_FORCE_ASYNC)
 		req->work.flags |= IO_WQ_WORK_CONCURRENT;
 
-	if (req->file && !io_req_ffs_set(req))
+	if (req->file && !(req->flags & REQ_F_FIXED_FILE))
 		req->flags |= io_file_get_flags(req->file) << REQ_F_SUPPORT_NOWAIT_BIT;
 
 	if (req->file && (req->flags & REQ_F_ISREG)) {
diff --git a/io_uring/io_uring.h b/io_uring/io_uring.h
index a937b4b75aee98..9718897133db59 100644
--- a/io_uring/io_uring.h
+++ b/io_uring/io_uring.h
@@ -57,11 +57,6 @@ struct file *io_file_get_normal(struct io_kiocb *req, int fd);
 struct file *io_file_get_fixed(struct io_kiocb *req, int fd,
 			       unsigned issue_flags);
 
-static inline bool io_req_ffs_set(struct io_kiocb *req)
-{
-	return req->flags & REQ_F_FIXED_FILE;
-}
-
 void __io_req_task_work_add(struct io_kiocb *req, unsigned flags);
 bool io_is_uring_fops(struct file *file);
 bool io_alloc_async_data(struct io_kiocb *req);
diff --git a/io_uring/rw.c b/io_uring/rw.c
index c23d8baf028769..1cf5742f2ae9cb 100644
--- a/io_uring/rw.c
+++ b/io_uring/rw.c
@@ -666,7 +666,7 @@ static int io_rw_init_file(struct io_kiocb *req, fmode_t mode)
 	if (unlikely(!file || !(file->f_mode & mode)))
 		return -EBADF;
 
-	if (!io_req_ffs_set(req))
+	if (!(req->flags & REQ_F_FIXED_FILE))
 		req->flags |= io_file_get_flags(file) << REQ_F_SUPPORT_NOWAIT_BIT;
 
 	kiocb->ki_flags = file->f_iocb_flags;
-- 
2.39.2


  parent 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 ` [PATCH 1/8] io_uring: remove __io_file_supports_nowait Christoph Hellwig
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 ` Christoph Hellwig [this message]
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