From: Jan Kara <jack@suse.cz>
To: Christoph Hellwig <hch@lst.de>
Cc: viro@zeniv.linux.org.uk, axboe@kernel.dk,
Milosz Tanski <milosz@adfin.com>,
Goldwyn Rodrigues <rgoldwyn@suse.com>,
mgorman@suse.de, Volker.Lendecke@sernet.de,
linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org
Subject: Re: [PATCH 4/4] block_dev: support RFW_NOWAIT on block device nodes
Date: Thu, 24 Aug 2017 16:39:23 +0200 [thread overview]
Message-ID: <20170824143923.GD8969@quack2.suse.cz> (raw)
In-Reply-To: <20170822161712.11716-5-hch@lst.de>
On Tue 22-08-17 18:17:12, Christoph Hellwig wrote:
> All support is already there in the generic code, we just need to wire
> it up.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Looks good. You can add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/block_dev.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/fs/block_dev.c b/fs/block_dev.c
> index 9941dc8342df..ea21d18d8e79 100644
> --- a/fs/block_dev.c
> +++ b/fs/block_dev.c
> @@ -1739,6 +1739,8 @@ static int blkdev_open(struct inode * inode, struct file * filp)
> */
> filp->f_flags |= O_LARGEFILE;
>
> + filp->f_mode |= FMODE_NOWAIT;
> +
> if (filp->f_flags & O_NDELAY)
> filp->f_mode |= FMODE_NDELAY;
> 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)
> return -ENOSPC;
>
> + if ((iocb->ki_flags & (IOCB_NOWAIT | IOCB_DIRECT)) == IOCB_NOWAIT)
> + return -EOPNOTSUPP;
> +
> iov_iter_truncate(from, size - iocb->ki_pos);
>
> blk_start_plug(&plug);
> --
> 2.11.0
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2017-08-24 14:39 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-22 16:17 non-blocking buffered reads V4 Christoph Hellwig
2017-08-22 16:17 ` [PATCH 1/4] fs: pass iocb to do_generic_file_read Christoph Hellwig
2017-08-24 14:23 ` Jan Kara
2017-08-22 16:17 ` [PATCH 2/4] fs: support IOCB_NOWAIT in generic_file_buffered_read Christoph Hellwig
2017-08-24 14:31 ` Jan Kara
2017-08-25 7:36 ` Christoph Hellwig
2017-08-22 16:17 ` [PATCH 3/4] fs: support RWF_NOWAIT for buffered reads Christoph Hellwig
2017-08-24 14:38 ` Jan Kara
2017-08-22 16:17 ` [PATCH 4/4] block_dev: support RFW_NOWAIT on block device nodes Christoph Hellwig
2017-08-24 14:39 ` Jan Kara [this message]
-- strict thread matches above, loose matches on Subject: below --
2017-08-29 14:13 non-blocking buffered reads V5 Christoph Hellwig
2017-08-29 14:13 ` [PATCH 4/4] block_dev: support RFW_NOWAIT on block device nodes Christoph Hellwig
2017-07-06 15:30 non-blockling buffered reads V3 Christoph Hellwig
2017-07-06 15:30 ` [PATCH 4/4] block_dev: support RFW_NOWAIT on block device nodes Christoph Hellwig
2017-07-07 20:03 ` kbuild test robot
2017-07-07 20:17 ` kbuild test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170824143923.GD8969@quack2.suse.cz \
--to=jack@suse.cz \
--cc=Volker.Lendecke@sernet.de \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=milosz@adfin.com \
--cc=rgoldwyn@suse.com \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.