if (S_ISREG(mode)) {
if (IS_ENABLED(CONFIG_BLOCK) &&
io_bdev_nowait(file->f_inode->i_sb->s_bdev) &&
- file->f_op != &io_uring_fops)
+ !io_is_uring_fops(file))
return true;
return false;
}
trace_io_uring_file_get(req->ctx, req, req->cqe.user_data, fd);
/* we don't allow fixed io_uring files */
- if (file && file->f_op == &io_uring_fops)
+ if (file && io_is_uring_fops(file))
io_req_track_inflight(req);
return file;
}
* handle it just fine, but there's still no point in allowing
* a ring fd as it doesn't support regular read/write anyway.
*/
- if (file->f_op == &io_uring_fops) {
+ if (io_is_uring_fops(file)) {
fput(file);
goto fail;
}
struct io_fixed_file *file_slot;
int ret;
- if (file->f_op == &io_uring_fops)
+ if (io_is_uring_fops(file))
return -EBADF;
if (!ctx->file_data)
return -ENXIO;
* still no point in allowing a ring fd as it doesn't
* support regular read/write anyway.
*/
- if (file->f_op == &io_uring_fops) {
+ if (io_is_uring_fops(file)) {
fput(file);
err = -EBADF;
break;
file = fget(fd);
if (!file) {
return -EBADF;
- } else if (file->f_op != &io_uring_fops) {
+ } else if (!io_is_uring_fops(file)) {
fput(file);
return -EOPNOTSUPP;
}
return -EBADF;
ret = -EOPNOTSUPP;
- if (unlikely(f.file->f_op != &io_uring_fops))
+ if (unlikely(!io_is_uring_fops(f.file)))
goto out_fput;
ret = -ENXIO;
return -EBADF;
ret = -EOPNOTSUPP;
- if (f.file->f_op != &io_uring_fops)
+ if (!io_is_uring_fops(f.file))
goto out_fput;
ctx = f.file->private_data;