Skip to content

Commit 3beed23

Browse files
Christoph Hellwigaxboe
authored andcommitted
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: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20230620113235.920399-5-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent b57c7cd commit 3beed23

File tree

3 files changed

+2
-7
lines changed

3 files changed

+2
-7
lines changed

io_uring/io_uring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ static void io_prep_async_work(struct io_kiocb *req)
424424
if (req->flags & REQ_F_FORCE_ASYNC)
425425
req->work.flags |= IO_WQ_WORK_CONCURRENT;
426426

427-
if (req->file && !io_req_ffs_set(req))
427+
if (req->file && !(req->flags & REQ_F_FIXED_FILE))
428428
req->flags |= io_file_get_flags(req->file) << REQ_F_SUPPORT_NOWAIT_BIT;
429429

430430
if (req->file && (req->flags & REQ_F_ISREG)) {

io_uring/io_uring.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,6 @@ struct file *io_file_get_normal(struct io_kiocb *req, int fd);
5757
struct file *io_file_get_fixed(struct io_kiocb *req, int fd,
5858
unsigned issue_flags);
5959

60-
static inline bool io_req_ffs_set(struct io_kiocb *req)
61-
{
62-
return req->flags & REQ_F_FIXED_FILE;
63-
}
64-
6560
void __io_req_task_work_add(struct io_kiocb *req, unsigned flags);
6661
bool io_is_uring_fops(struct file *file);
6762
bool io_alloc_async_data(struct io_kiocb *req);

io_uring/rw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ static int io_rw_init_file(struct io_kiocb *req, fmode_t mode)
666666
if (unlikely(!file || !(file->f_mode & mode)))
667667
return -EBADF;
668668

669-
if (!io_req_ffs_set(req))
669+
if (!(req->flags & REQ_F_FIXED_FILE))
670670
req->flags |= io_file_get_flags(file) << REQ_F_SUPPORT_NOWAIT_BIT;
671671

672672
kiocb->ki_flags = file->f_iocb_flags;

0 commit comments

Comments
 (0)