Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <axboe@kernel.dk>

+8 -8
+8 -8
io_uring/io_uring.c
··· 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 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 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 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 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 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 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 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;