Skip to content

Commit caec5eb

Browse files
committed
io_uring: rely solely on FMODE_NOWAIT
Now that we have both sockets and block devices setting FMODE_NOWAIT appropriately, we can get rid of all the odd special casing in __io_file_supports_nowait() and rely soley on FMODE_NOWAIT and O_NONBLOCK rather than special case sockets and (in particular) bdevs. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent e9833d8 commit caec5eb

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

io_uring/io_uring.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1758,34 +1758,13 @@ static void io_iopoll_req_issued(struct io_kiocb *req, unsigned int issue_flags)
17581758
}
17591759
}
17601760

1761-
static bool io_bdev_nowait(struct block_device *bdev)
1762-
{
1763-
return !bdev || bdev_nowait(bdev);
1764-
}
1765-
17661761
/*
17671762
* If we tracked the file through the SCM inflight mechanism, we could support
17681763
* any file. For now, just ensure that anything potentially problematic is done
17691764
* inline.
17701765
*/
17711766
static bool __io_file_supports_nowait(struct file *file, umode_t mode)
17721767
{
1773-
if (S_ISBLK(mode)) {
1774-
if (IS_ENABLED(CONFIG_BLOCK) &&
1775-
io_bdev_nowait(I_BDEV(file->f_mapping->host)))
1776-
return true;
1777-
return false;
1778-
}
1779-
if (S_ISSOCK(mode))
1780-
return true;
1781-
if (S_ISREG(mode)) {
1782-
if (IS_ENABLED(CONFIG_BLOCK) &&
1783-
io_bdev_nowait(file->f_inode->i_sb->s_bdev) &&
1784-
!io_is_uring_fops(file))
1785-
return true;
1786-
return false;
1787-
}
1788-
17891768
/* any ->read/write should understand O_NONBLOCK */
17901769
if (file->f_flags & O_NONBLOCK)
17911770
return true;

0 commit comments

Comments
 (0)