lkml.org 
[lkml]   [2024]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 011/437] virtio_console: convert to read/write iterator helpers
Date
Add stub read/write iterators which just use the VFS helpers, and
kill the ->read() and ->write() usage.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
drivers/char/virtio_console.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index 035f89f1a251..154934eb9ae9 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -771,6 +771,7 @@ static ssize_t port_fops_read(struct file *filp, char __user *ubuf,

return fill_readbuf(port, ubuf, count, true);
}
+FOPS_READ_ITER_HELPER(port_fops_read);

static int wait_port_writable(struct port *port, bool nonblock)
{
@@ -844,6 +845,7 @@ static ssize_t port_fops_write(struct file *filp, const char __user *ubuf,
out:
return ret;
}
+FOPS_WRITE_ITER_HELPER(port_fops_write);

struct sg_list {
unsigned int n;
@@ -1087,8 +1089,8 @@ static int port_fops_fasync(int fd, struct file *filp, int mode)
static const struct file_operations port_fops = {
.owner = THIS_MODULE,
.open = port_fops_open,
- .read = port_fops_read,
- .write = port_fops_write,
+ .read_iter = port_fops_read_iter,
+ .write_iter = port_fops_write_iter,
.splice_write = port_fops_splice_write,
.poll = port_fops_poll,
.release = port_fops_release,
--
2.43.0

\
 
 \ /
  Last update: 2024-05-27 16:36    [W:1.093 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site