[PATCH 072/437] kernel/fail_function: convert to read/write iterators

From: Jens Axboe
Date: Thu Apr 11 2024 - 11:55:14 EST


Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
---
kernel/fail_function.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/kernel/fail_function.c b/kernel/fail_function.c
index d971a0189319..de35a346899c 100644
--- a/kernel/fail_function.c
+++ b/kernel/fail_function.c
@@ -233,9 +233,9 @@ static void fei_attr_remove_all(void)
}
}

-static ssize_t fei_write(struct file *file, const char __user *buffer,
- size_t count, loff_t *ppos)
+static ssize_t fei_write(struct kiocb *iocb, struct iov_iter *from)
{
+ size_t count = iov_iter_count(from);
struct fei_attr *attr;
unsigned long addr;
char *buf, *sym;
@@ -245,7 +245,7 @@ static ssize_t fei_write(struct file *file, const char __user *buffer,
if (count > KSYM_NAME_LEN)
count = KSYM_NAME_LEN;

- buf = memdup_user_nul(buffer, count);
+ buf = iterdup_nul(from, count);
if (IS_ERR(buf))
return PTR_ERR(buf);

@@ -306,8 +306,8 @@ static ssize_t fei_write(struct file *file, const char __user *buffer,

static const struct file_operations fei_ops = {
.open = fei_open,
- .read = seq_read,
- .write = fei_write,
+ .read_iter = seq_read_iter,
+ .write_iter = fei_write,
.llseek = seq_lseek,
.release = seq_release,
};
--
2.43.0