[PATCH 341/437] s390: cio: convert to read/write iterators

Jens Axboe
2024-04-11T15:41:07Z

drivers/s390/cio/cio_inject.c | 11 ++++++-----
drivers/s390/cio/qdio_debug.c | 12 ++++++------
2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/drivers/s390/cio/cio_inject.c b/drivers/s390/cio/cio_inject.c
index 8613fa937237..33ccd36098b3 100644
--- a/drivers/s390/cio/cio_inject.c
+++ b/drivers/s390/cio/cio_inject.c
@@ -123,15 +123,16 @@ static ssize_t crw_inject_write(struct file *file, const char __user *buf,

return lbuf;
}
+FOPS_WRITE_ITER_HELPER(crw_inject_write);

/* Debugfs write handler for inject_enable node*/
-static ssize_t enable_inject_write(struct file *file, const char __user *buf,
- size_t lbuf, loff_t *ppos)
+static ssize_t enable_inject_write(struct kiocb *iocb, struct iov_iter *from)
{
+ size_t lbuf = iov_iter_count(from);
unsigned long en = 0;
int rc;

- rc = kstrtoul_from_user(buf, lbuf, 10, &en);
+ rc = kstrtoul_from_iter(from, lbuf, 10, &en);
if (rc)
return rc;

@@ -149,12 +150,12 @@ static ssize_t enable_inject_write(struct file *file, const char __user *buf,

static const struct file_operations crw_fops = {
.owner = THIS_MODULE,
- .write = crw_inject_write,
+ .write_iter = crw_inject_write_iter,
};

static const struct file_operations cio_en_fops = {
.owner = THIS_MODULE,
- .write = enable_inject_write,
+ .write_iter = enable_inject_write,
};

static int __init cio_inject_init(void)
diff --git a/drivers/s390/cio/qdio_debug.c b/drivers/s390/cio/qdio_debug.c
index 1a9714af51e4..0c9f84c5197f 100644
--- a/drivers/s390/cio/qdio_debug.c
+++ b/drivers/s390/cio/qdio_debug.c
@@ -234,11 +234,11 @@ static int qperf_show(struct seq_file *m, void *v)
return 0;
}

-static ssize_t qperf_seq_write(struct file *file, const char __user *ubuf,
- size_t count, loff_t *off)
+static ssize_t qperf_seq_write(struct kiocb *iocb, struct iov_iter *from)
{
- struct seq_file *seq = file->private_data;
+ struct seq_file *seq = iocb->ki_filp->private_data;
struct qdio_irq *irq_ptr = seq->private;
+ size_t count = iov_iter_count(from);
struct qdio_q *q;
unsigned long val;
int ret, i;
@@ -246,7 +246,7 @@ static ssize_t qperf_seq_write(struct file *file, const char __user *ubuf,
if (!irq_ptr)
return 0;

- ret = kstrtoul_from_user(ubuf, count, 10, &val);
+ ret = kstrtoul_from_iter(from, count, 10, &val);
if (ret)
return ret;

@@ -275,8 +275,8 @@ static int qperf_seq_open(struct inode *inode, struct file *filp)
static const struct file_operations debugfs_perf_fops = {
.owner = THIS_MODULE,
.open = qperf_seq_open,
- .read = seq_read,
- .write = qperf_seq_write,
+ .read_iter = seq_read_iter,
+ .write_iter = qperf_seq_write,
.llseek = seq_lseek,
.release = single_release,
};
--
2.43.0