@@ -2309,7 +2309,7 @@ static bool __io_file_supports_nowait(struct file *file, umode_t mode)
2309
2309
if (S_ISREG (mode )) {
2310
2310
if (IS_ENABLED (CONFIG_BLOCK ) &&
2311
2311
io_bdev_nowait (file -> f_inode -> i_sb -> s_bdev ) &&
2312
- file -> f_op != & io_uring_fops )
2312
+ ! io_is_uring_fops ( file ) )
2313
2313
return true;
2314
2314
return false;
2315
2315
}
@@ -4857,7 +4857,7 @@ struct file *io_file_get_normal(struct io_kiocb *req, int fd)
4857
4857
trace_io_uring_file_get (req -> ctx , req , req -> cqe .user_data , fd );
4858
4858
4859
4859
/* 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 ) )
4861
4861
io_req_track_inflight (req );
4862
4862
return file ;
4863
4863
}
@@ -5949,7 +5949,7 @@ static int io_sqe_files_register(struct io_ring_ctx *ctx, void __user *arg,
5949
5949
* handle it just fine, but there's still no point in allowing
5950
5950
* a ring fd as it doesn't support regular read/write anyway.
5951
5951
*/
5952
- if (file -> f_op == & io_uring_fops ) {
5952
+ if (io_is_uring_fops ( file ) ) {
5953
5953
fput (file );
5954
5954
goto fail ;
5955
5955
}
@@ -5996,7 +5996,7 @@ int io_install_fixed_file(struct io_kiocb *req, struct file *file,
5996
5996
struct io_fixed_file * file_slot ;
5997
5997
int ret ;
5998
5998
5999
- if (file -> f_op == & io_uring_fops )
5999
+ if (io_is_uring_fops ( file ) )
6000
6000
return - EBADF ;
6001
6001
if (!ctx -> file_data )
6002
6002
return - ENXIO ;
@@ -6096,7 +6096,7 @@ static int __io_sqe_files_update(struct io_ring_ctx *ctx,
6096
6096
* still no point in allowing a ring fd as it doesn't
6097
6097
* support regular read/write anyway.
6098
6098
*/
6099
- if (file -> f_op == & io_uring_fops ) {
6099
+ if (io_is_uring_fops ( file ) ) {
6100
6100
fput (file );
6101
6101
err = - EBADF ;
6102
6102
break ;
@@ -7416,7 +7416,7 @@ static int io_ring_add_registered_fd(struct io_uring_task *tctx, int fd,
7416
7416
file = fget (fd );
7417
7417
if (!file ) {
7418
7418
return - EBADF ;
7419
- } else if (file -> f_op != & io_uring_fops ) {
7419
+ } else if (! io_is_uring_fops ( file ) ) {
7420
7420
fput (file );
7421
7421
return - EOPNOTSUPP ;
7422
7422
}
@@ -7677,7 +7677,7 @@ SYSCALL_DEFINE6(io_uring_enter, unsigned int, fd, u32, to_submit,
7677
7677
return - EBADF ;
7678
7678
7679
7679
ret = - EOPNOTSUPP ;
7680
- if (unlikely (f .file -> f_op != & io_uring_fops ))
7680
+ if (unlikely (! io_is_uring_fops ( f .file ) ))
7681
7681
goto out_fput ;
7682
7682
7683
7683
ret = - ENXIO ;
@@ -8852,7 +8852,7 @@ SYSCALL_DEFINE4(io_uring_register, unsigned int, fd, unsigned int, opcode,
8852
8852
return - EBADF ;
8853
8853
8854
8854
ret = - EOPNOTSUPP ;
8855
- if (f .file -> f_op != & io_uring_fops )
8855
+ if (! io_is_uring_fops ( f .file ) )
8856
8856
goto out_fput ;
8857
8857
8858
8858
ctx = f .file -> private_data ;
0 commit comments