[PATCH 047/437] tracefs: convert to read/write iterators

Jens Axboe
2024-04-11T15:33:01Z

fs/tracefs/inode.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/fs/tracefs/inode.c b/fs/tracefs/inode.c
index 5545e6bf7d26..b1a9b5f10581 100644
--- a/fs/tracefs/inode.c
+++ b/fs/tracefs/inode.c
@@ -46,21 +46,19 @@ static void tracefs_free_inode(struct inode *inode)
kmem_cache_free(tracefs_inode_cachep, get_tracefs(inode));
}

-static ssize_t default_read_file(struct file *file, char __user *buf,
- size_t count, loff_t *ppos)
+static ssize_t default_read_file_iter(struct kiocb *iocb, struct iov_iter *to)
{
return 0;
}

-static ssize_t default_write_file(struct file *file, const char __user *buf,
- size_t count, loff_t *ppos)
+static ssize_t default_write_file_iter(struct kiocb *iocb, struct iov_iter *from)
{
- return count;
+ return iov_iter_count(from);
}

static const struct file_operations tracefs_file_operations = {
- .read = default_read_file,
- .write = default_write_file,
+ .read_iter = default_read_file_iter,
+ .write_iter = default_write_file_iter,
.open = simple_open,
.llseek = noop_llseek,
};
--
2.43.0