[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220829115212.4006109-1-xianting.tian@linux.alibaba.com>
Date: Mon, 29 Aug 2022 19:52:12 +0800
From: Xianting Tian <xianting.tian@...ux.alibaba.com>
To: viro@...iv.linux.org.uk
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
Xianting Tian <xianting.tian@...ux.alibaba.com>
Subject: [PATCH] seq_file: use iov_iter_ubuf() to simplify the code
use iov_iter_ubuf() instead of iov_iter_init() to simplify the code
Signed-off-by: Xianting Tian <xianting.tian@...ux.alibaba.com>
---
fs/seq_file.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/seq_file.c b/fs/seq_file.c
index 9456a2032224..6af66161576a 100644
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -150,13 +150,12 @@ static int traverse(struct seq_file *m, loff_t offset)
*/
ssize_t seq_read(struct file *file, char __user *buf, size_t size, loff_t *ppos)
{
- struct iovec iov = { .iov_base = buf, .iov_len = size};
struct kiocb kiocb;
struct iov_iter iter;
ssize_t ret;
init_sync_kiocb(&kiocb, file);
- iov_iter_init(&iter, READ, &iov, 1, size);
+ iov_iter_ubuf(&iter, READ, buf, size);
kiocb.ki_pos = *ppos;
ret = seq_read_iter(&kiocb, &iter);
--
2.17.1
Powered by blists - more mailing lists