mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-07 13:43:51 +00:00
block_dev: support RFW_NOWAIT on block device nodes
All support is already there in the generic code, we just need to wire it up. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
91f9943e1c
commit
c35fc7a5ab
@ -1739,6 +1739,8 @@ static int blkdev_open(struct inode * inode, struct file * filp)
|
|||||||
*/
|
*/
|
||||||
filp->f_flags |= O_LARGEFILE;
|
filp->f_flags |= O_LARGEFILE;
|
||||||
|
|
||||||
|
filp->f_mode |= FMODE_NOWAIT;
|
||||||
|
|
||||||
if (filp->f_flags & O_NDELAY)
|
if (filp->f_flags & O_NDELAY)
|
||||||
filp->f_mode |= FMODE_NDELAY;
|
filp->f_mode |= FMODE_NDELAY;
|
||||||
if (filp->f_flags & O_EXCL)
|
if (filp->f_flags & O_EXCL)
|
||||||
@ -1891,6 +1893,9 @@ ssize_t blkdev_write_iter(struct kiocb *iocb, struct iov_iter *from)
|
|||||||
if (iocb->ki_pos >= size)
|
if (iocb->ki_pos >= size)
|
||||||
return -ENOSPC;
|
return -ENOSPC;
|
||||||
|
|
||||||
|
if ((iocb->ki_flags & (IOCB_NOWAIT | IOCB_DIRECT)) == IOCB_NOWAIT)
|
||||||
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
iov_iter_truncate(from, size - iocb->ki_pos);
|
iov_iter_truncate(from, size - iocb->ki_pos);
|
||||||
|
|
||||||
blk_start_plug(&plug);
|
blk_start_plug(&plug);
|
||||||
|
Loading…
Reference in New Issue
Block a user