lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240411153126.16201-231-axboe@kernel.dk>
Date: Thu, 11 Apr 2024 09:16:10 -0600
From: Jens Axboe <axboe@...nel.dk>
To: linux-kernel@...r.kernel.org
Cc: Jens Axboe <axboe@...nel.dk>
Subject: [PATCH 230/437] drivers/nvme: convert to read/write iterators

Signed-off-by: Jens Axboe <axboe@...nel.dk>
---
 drivers/nvme/host/fabrics.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c
index 1f0ea1f32d22..6d0251cc4bf3 100644
--- a/drivers/nvme/host/fabrics.c
+++ b/drivers/nvme/host/fabrics.c
@@ -1326,10 +1326,10 @@ static const struct class nvmf_class = {
 static struct device *nvmf_device;
 static DEFINE_MUTEX(nvmf_dev_mutex);
 
-static ssize_t nvmf_dev_write(struct file *file, const char __user *ubuf,
-		size_t count, loff_t *pos)
+static ssize_t nvmf_dev_write(struct kiocb *iocb, struct iov_iter *from)
 {
-	struct seq_file *seq_file = file->private_data;
+	struct seq_file *seq_file = iocb->ki_filp->private_data;
+	size_t count = iov_iter_count(from);
 	struct nvme_ctrl *ctrl;
 	const char *buf;
 	int ret = 0;
@@ -1337,7 +1337,7 @@ static ssize_t nvmf_dev_write(struct file *file, const char __user *ubuf,
 	if (count > PAGE_SIZE)
 		return -ENOMEM;
 
-	buf = memdup_user_nul(ubuf, count);
+	buf = iterdup_nul(from, count);
 	if (IS_ERR(buf))
 		return PTR_ERR(buf);
 
@@ -1422,8 +1422,8 @@ static int nvmf_dev_release(struct inode *inode, struct file *file)
 
 static const struct file_operations nvmf_dev_fops = {
 	.owner		= THIS_MODULE,
-	.write		= nvmf_dev_write,
-	.read		= seq_read,
+	.write_iter	= nvmf_dev_write,
+	.read_iter	= seq_read_iter,
 	.open		= nvmf_dev_open,
 	.release	= nvmf_dev_release,
 };
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ