Skip to content

Commit e5550a1

Browse files
committed
io_uring: use io_is_uring_fops() consistently
Convert the last spots that check for io_uring_fops to use the provided helper instead. Signed-off-by: Jens Axboe <[email protected]>
1 parent 17437f3 commit e5550a1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Diff for: io_uring/io_uring.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -2309,7 +2309,7 @@ static bool __io_file_supports_nowait(struct file *file, umode_t mode)
23092309
if (S_ISREG(mode)) {
23102310
if (IS_ENABLED(CONFIG_BLOCK) &&
23112311
io_bdev_nowait(file->f_inode->i_sb->s_bdev) &&
2312-
file->f_op != &io_uring_fops)
2312+
!io_is_uring_fops(file))
23132313
return true;
23142314
return false;
23152315
}
@@ -4857,7 +4857,7 @@ struct file *io_file_get_normal(struct io_kiocb *req, int fd)
48574857
trace_io_uring_file_get(req->ctx, req, req->cqe.user_data, fd);
48584858

48594859
/* we don't allow fixed io_uring files */
4860-
if (file && file->f_op == &io_uring_fops)
4860+
if (file && io_is_uring_fops(file))
48614861
io_req_track_inflight(req);
48624862
return file;
48634863
}
@@ -5949,7 +5949,7 @@ static int io_sqe_files_register(struct io_ring_ctx *ctx, void __user *arg,
59495949
* handle it just fine, but there's still no point in allowing
59505950
* a ring fd as it doesn't support regular read/write anyway.
59515951
*/
5952-
if (file->f_op == &io_uring_fops) {
5952+
if (io_is_uring_fops(file)) {
59535953
fput(file);
59545954
goto fail;
59555955
}
@@ -5996,7 +5996,7 @@ int io_install_fixed_file(struct io_kiocb *req, struct file *file,
59965996
struct io_fixed_file *file_slot;
59975997
int ret;
59985998

5999-
if (file->f_op == &io_uring_fops)
5999+
if (io_is_uring_fops(file))
60006000
return -EBADF;
60016001
if (!ctx->file_data)
60026002
return -ENXIO;
@@ -6096,7 +6096,7 @@ static int __io_sqe_files_update(struct io_ring_ctx *ctx,
60966096
* still no point in allowing a ring fd as it doesn't
60976097
* support regular read/write anyway.
60986098
*/
6099-
if (file->f_op == &io_uring_fops) {
6099+
if (io_is_uring_fops(file)) {
61006100
fput(file);
61016101
err = -EBADF;
61026102
break;
@@ -7416,7 +7416,7 @@ static int io_ring_add_registered_fd(struct io_uring_task *tctx, int fd,
74167416
file = fget(fd);
74177417
if (!file) {
74187418
return -EBADF;
7419-
} else if (file->f_op != &io_uring_fops) {
7419+
} else if (!io_is_uring_fops(file)) {
74207420
fput(file);
74217421
return -EOPNOTSUPP;
74227422
}
@@ -7677,7 +7677,7 @@ SYSCALL_DEFINE6(io_uring_enter, unsigned int, fd, u32, to_submit,
76777677
return -EBADF;
76787678

76797679
ret = -EOPNOTSUPP;
7680-
if (unlikely(f.file->f_op != &io_uring_fops))
7680+
if (unlikely(!io_is_uring_fops(f.file)))
76817681
goto out_fput;
76827682

76837683
ret = -ENXIO;
@@ -8852,7 +8852,7 @@ SYSCALL_DEFINE4(io_uring_register, unsigned int, fd, unsigned int, opcode,
88528852
return -EBADF;
88538853

88548854
ret = -EOPNOTSUPP;
8855-
if (f.file->f_op != &io_uring_fops)
8855+
if (!io_is_uring_fops(f.file))
88568856
goto out_fput;
88578857

88588858
ctx = f.file->private_data;

0 commit comments

Comments
 (0)