[PATCH 193/437] scsi: qedi: convert to read/write iterators
From: Jens Axboe
Date: Thu Apr 11 2024 - 12:22:34 EST
Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
---
drivers/scsi/qedi/qedi_dbg.h | 6 +++---
drivers/scsi/qedi/qedi_debugfs.c | 20 ++++++++++++++++----
2 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/drivers/scsi/qedi/qedi_dbg.h b/drivers/scsi/qedi/qedi_dbg.h
index fdda12ef13b0..2b05de656aa8 100644
--- a/drivers/scsi/qedi/qedi_dbg.h
+++ b/drivers/scsi/qedi/qedi_dbg.h
@@ -114,8 +114,8 @@ struct qedi_debugfs_ops {
{ \
.owner = THIS_MODULE, \
.open = simple_open, \
- .read = drv##_dbg_##ops##_cmd_read, \
- .write = drv##_dbg_##ops##_cmd_write \
+ .read_iter = drv##_dbg_##ops##_cmd_read, \
+ .write_iter = drv##_dbg_##ops##_cmd_write \
}
/* Used for debugfs sequential files */
@@ -123,7 +123,7 @@ struct qedi_debugfs_ops {
{ \
.owner = THIS_MODULE, \
.open = drv##_dbg_##ops##_open, \
- .read = seq_read, \
+ .read_iter = seq_read_iter, \
.llseek = seq_lseek, \
.release = single_release, \
}
diff --git a/drivers/scsi/qedi/qedi_debugfs.c b/drivers/scsi/qedi/qedi_debugfs.c
index 8deb2001dc2f..28fbbea694d5 100644
--- a/drivers/scsi/qedi/qedi_debugfs.c
+++ b/drivers/scsi/qedi/qedi_debugfs.c
@@ -91,8 +91,8 @@ const struct qedi_debugfs_ops qedi_debugfs_ops[] = {
};
static ssize_t
-qedi_dbg_do_not_recover_cmd_write(struct file *filp, const char __user *buffer,
- size_t count, loff_t *ppos)
+__qedi_dbg_do_not_recover_cmd_write(struct file *filp, const char __user *buffer,
+ size_t count, loff_t *ppos)
{
size_t cnt = 0;
struct qedi_dbg_ctx *qedi_dbg =
@@ -117,8 +117,14 @@ qedi_dbg_do_not_recover_cmd_write(struct file *filp, const char __user *buffer,
}
static ssize_t
-qedi_dbg_do_not_recover_cmd_read(struct file *filp, char __user *buffer,
- size_t count, loff_t *ppos)
+qedi_dbg_do_not_recover_cmd_write(struct kiocb *iocb, struct iov_iter *from)
+{
+ return vfs_write_iter(iocb, from, __qedi_dbg_do_not_recover_cmd_write);
+}
+
+static ssize_t
+__qedi_dbg_do_not_recover_cmd_read(struct file *filp, char __user *buffer,
+ size_t count, loff_t *ppos)
{
size_t cnt = 0;
@@ -131,6 +137,12 @@ qedi_dbg_do_not_recover_cmd_read(struct file *filp, char __user *buffer,
return cnt;
}
+static ssize_t
+qedi_dbg_do_not_recover_cmd_read(struct kiocb *iocb, struct iov_iter *to)
+{
+ return vfs_read_iter(iocb, to, __qedi_dbg_do_not_recover_cmd_read);
+}
+
static int
qedi_gbl_ctx_show(struct seq_file *s, void *unused)
{
--
2.43.0