[PATCH 090/437] landlock: convert to read/write iterators

Jens Axboe posted 437 patches 1 year, 8 months ago
[PATCH 090/437] landlock: convert to read/write iterators
Posted by Jens Axboe 1 year, 8 months ago
Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
 security/landlock/syscalls.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/security/landlock/syscalls.c b/security/landlock/syscalls.c
index 6788e73b6681..9a79b90f4dc9 100644
--- a/security/landlock/syscalls.c
+++ b/security/landlock/syscalls.c
@@ -122,21 +122,12 @@ static int fop_ruleset_release(struct inode *const inode,
 	return 0;
 }
 
-static ssize_t fop_dummy_read(struct file *const filp, char __user *const buf,
-			      const size_t size, loff_t *const ppos)
+static ssize_t fop_dummy_iter(struct kiocb *iocb, struct iov_iter *iov)
 {
 	/* Dummy handler to enable FMODE_CAN_READ. */
 	return -EINVAL;
 }
 
-static ssize_t fop_dummy_write(struct file *const filp,
-			       const char __user *const buf, const size_t size,
-			       loff_t *const ppos)
-{
-	/* Dummy handler to enable FMODE_CAN_WRITE. */
-	return -EINVAL;
-}
-
 /*
  * A ruleset file descriptor enables to build a ruleset by adding (i.e.
  * writing) rule after rule, without relying on the task's context.  This
@@ -145,8 +136,8 @@ static ssize_t fop_dummy_write(struct file *const filp,
  */
 static const struct file_operations ruleset_fops = {
 	.release = fop_ruleset_release,
-	.read = fop_dummy_read,
-	.write = fop_dummy_write,
+	.read_iter = fop_dummy_iter,
+	.write_iter = fop_dummy_iter,
 };
 
 #define LANDLOCK_ABI_VERSION 4
-- 
2.43.0