[PATCH 095/437] security: convert to read/write iterators

Jens Axboe
2024-04-11T15:34:25Z

security/inode.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/security/inode.c b/security/inode.c
index 9e7cde913667..81a7b43a0009 100644
--- a/security/inode.c
+++ b/security/inode.c
@@ -315,15 +315,14 @@ EXPORT_SYMBOL_GPL(securityfs_remove);

#ifdef CONFIG_SECURITY
static struct dentry *lsm_dentry;
-static ssize_t lsm_read(struct file *filp, char __user *buf, size_t count,
- loff_t *ppos)
+static ssize_t lsm_read(struct kiocb *iocb, struct iov_iter *to)
{
- return simple_read_from_buffer(buf, count, ppos, lsm_names,
- strlen(lsm_names));
+ return simple_copy_to_iter(lsm_names, &iocb->ki_pos, strlen(lsm_names),
+ to);
}

static const struct file_operations lsm_ops = {
- .read = lsm_read,
+ .read_iter = lsm_read,
.llseek = generic_file_llseek,
};
#endif
--
2.43.0