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-405-axboe@kernel.dk>
Date: Thu, 11 Apr 2024 09:19:04 -0600
From: Jens Axboe <axboe@...nel.dk>
To: linux-kernel@...r.kernel.org
Cc: Jens Axboe <axboe@...nel.dk>
Subject: [PATCH 404/437] infiniband/core: convert to read/write iterators

Signed-off-by: Jens Axboe <axboe@...nel.dk>
---
 drivers/infiniband/core/ucma.c        |  3 ++-
 drivers/infiniband/core/user_mad.c    |  6 ++++--
 drivers/infiniband/core/uverbs_main.c | 11 +++++++----
 3 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c
index 5f5ad8faf86e..b9aa99083dd9 100644
--- a/drivers/infiniband/core/ucma.c
+++ b/drivers/infiniband/core/ucma.c
@@ -1746,6 +1746,7 @@ static ssize_t ucma_write(struct file *filp, const char __user *buf,
 
 	return ret;
 }
+FOPS_WRITE_ITER_HELPER(ucma_write);
 
 static __poll_t ucma_poll(struct file *filp, struct poll_table_struct *wait)
 {
@@ -1815,7 +1816,7 @@ static const struct file_operations ucma_fops = {
 	.owner 	 = THIS_MODULE,
 	.open 	 = ucma_open,
 	.release = ucma_close,
-	.write	 = ucma_write,
+	.write_iter = ucma_write_iter,
 	.poll    = ucma_poll,
 	.llseek	 = no_llseek,
 };
diff --git a/drivers/infiniband/core/user_mad.c b/drivers/infiniband/core/user_mad.c
index f5feca7fa9b9..dcb065c3d8c5 100644
--- a/drivers/infiniband/core/user_mad.c
+++ b/drivers/infiniband/core/user_mad.c
@@ -429,6 +429,7 @@ static ssize_t ib_umad_read(struct file *filp, char __user *buf,
 	}
 	return ret;
 }
+FOPS_READ_ITER_HELPER(ib_umad_read);
 
 static int copy_rmpp_mad(struct ib_mad_send_buf *msg, const char __user *buf)
 {
@@ -660,6 +661,7 @@ static ssize_t ib_umad_write(struct file *filp, const char __user *buf,
 	kfree(packet);
 	return ret;
 }
+FOPS_WRITE_ITER_HELPER(ib_umad_write);
 
 static __poll_t ib_umad_poll(struct file *filp, struct poll_table_struct *wait)
 {
@@ -1064,8 +1066,8 @@ static int ib_umad_close(struct inode *inode, struct file *filp)
 
 static const struct file_operations umad_fops = {
 	.owner		= THIS_MODULE,
-	.read		= ib_umad_read,
-	.write		= ib_umad_write,
+	.read_iter	= ib_umad_read_iter,
+	.write_iter	= ib_umad_write_iter,
 	.poll		= ib_umad_poll,
 	.unlocked_ioctl = ib_umad_ioctl,
 #ifdef CONFIG_COMPAT
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
index 495d5a5d0373..7834a30e182b 100644
--- a/drivers/infiniband/core/uverbs_main.c
+++ b/drivers/infiniband/core/uverbs_main.c
@@ -285,6 +285,7 @@ static ssize_t ib_uverbs_async_event_read(struct file *filp, char __user *buf,
 	return ib_uverbs_event_read(&file->ev_queue, filp, buf, count, pos,
 				    sizeof(struct ib_uverbs_async_event_desc));
 }
+FOPS_READ_ITER_HELPER(ib_uverbs_async_event_read);
 
 static ssize_t ib_uverbs_comp_event_read(struct file *filp, char __user *buf,
 					 size_t count, loff_t *pos)
@@ -296,6 +297,7 @@ static ssize_t ib_uverbs_comp_event_read(struct file *filp, char __user *buf,
 				    pos,
 				    sizeof(struct ib_uverbs_comp_event_desc));
 }
+FOPS_READ_ITER_HELPER(ib_uverbs_comp_event_read);
 
 static __poll_t ib_uverbs_event_poll(struct ib_uverbs_event_queue *ev_queue,
 					 struct file *filp,
@@ -349,7 +351,7 @@ static int ib_uverbs_comp_event_fasync(int fd, struct file *filp, int on)
 
 const struct file_operations uverbs_event_fops = {
 	.owner	 = THIS_MODULE,
-	.read	 = ib_uverbs_comp_event_read,
+	.read_iter = ib_uverbs_comp_event_read_iter,
 	.poll    = ib_uverbs_comp_event_poll,
 	.release = uverbs_uobject_fd_release,
 	.fasync  = ib_uverbs_comp_event_fasync,
@@ -358,7 +360,7 @@ const struct file_operations uverbs_event_fops = {
 
 const struct file_operations uverbs_async_event_fops = {
 	.owner	 = THIS_MODULE,
-	.read	 = ib_uverbs_async_event_read,
+	.read_iter = ib_uverbs_async_event_read_iter,
 	.poll    = ib_uverbs_async_event_poll,
 	.release = uverbs_async_event_release,
 	.fasync  = ib_uverbs_async_event_fasync,
@@ -684,6 +686,7 @@ static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf,
 	srcu_read_unlock(&file->device->disassociate_srcu, srcu_key);
 	return (ret) ? : count;
 }
+FOPS_WRITE_ITER_HELPER(ib_uverbs_write);
 
 static const struct vm_operations_struct rdma_umap_ops;
 
@@ -988,7 +991,7 @@ static int ib_uverbs_close(struct inode *inode, struct file *filp)
 
 static const struct file_operations uverbs_fops = {
 	.owner	 = THIS_MODULE,
-	.write	 = ib_uverbs_write,
+	.write_iter = ib_uverbs_write_iter,
 	.open	 = ib_uverbs_open,
 	.release = ib_uverbs_close,
 	.llseek	 = no_llseek,
@@ -998,7 +1001,7 @@ static const struct file_operations uverbs_fops = {
 
 static const struct file_operations uverbs_mmap_fops = {
 	.owner	 = THIS_MODULE,
-	.write	 = ib_uverbs_write,
+	.write_iter = ib_uverbs_write_iter,
 	.mmap    = ib_uverbs_mmap,
 	.open	 = ib_uverbs_open,
 	.release = ib_uverbs_close,
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ