Commit 3beed235 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

io_uring: remove io_req_ffs_set

Just checking the flag directly makes it a lot more obvious what is
going on here.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20230620113235.920399-5-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent b57c7cd1
...@@ -424,7 +424,7 @@ static void io_prep_async_work(struct io_kiocb *req) ...@@ -424,7 +424,7 @@ static void io_prep_async_work(struct io_kiocb *req)
if (req->flags & REQ_F_FORCE_ASYNC) if (req->flags & REQ_F_FORCE_ASYNC)
req->work.flags |= IO_WQ_WORK_CONCURRENT; 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; req->flags |= io_file_get_flags(req->file) << REQ_F_SUPPORT_NOWAIT_BIT;
if (req->file && (req->flags & REQ_F_ISREG)) { if (req->file && (req->flags & REQ_F_ISREG)) {
......
...@@ -57,11 +57,6 @@ struct file *io_file_get_normal(struct io_kiocb *req, int fd); ...@@ -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, struct file *io_file_get_fixed(struct io_kiocb *req, int fd,
unsigned issue_flags); 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); void __io_req_task_work_add(struct io_kiocb *req, unsigned flags);
bool io_is_uring_fops(struct file *file); bool io_is_uring_fops(struct file *file);
bool io_alloc_async_data(struct io_kiocb *req); bool io_alloc_async_data(struct io_kiocb *req);
......
...@@ -666,7 +666,7 @@ static int io_rw_init_file(struct io_kiocb *req, fmode_t mode) ...@@ -666,7 +666,7 @@ static int io_rw_init_file(struct io_kiocb *req, fmode_t mode)
if (unlikely(!file || !(file->f_mode & mode))) if (unlikely(!file || !(file->f_mode & mode)))
return -EBADF; 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; req->flags |= io_file_get_flags(file) << REQ_F_SUPPORT_NOWAIT_BIT;
kiocb->ki_flags = file->f_iocb_flags; kiocb->ki_flags = file->f_iocb_flags;
......
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