lkml.org 
[lkml]   [2020]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] debugfs: add a proxy stub for ->read_iter
Date
debugfs registrations typically go through a set of proxy ops to deal
with refcounting, which need to support every method that can be
supported. Add ->read_iter to the proxy ops to prepare for seq_file to
be switch to ->read_iter.

Reported-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
fs/debugfs/file.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c
index 8ba32c2feb1b73..dcd7bdaf67417f 100644
--- a/fs/debugfs/file.c
+++ b/fs/debugfs/file.c
@@ -231,6 +231,10 @@ FULL_PROXY_FUNC(read, ssize_t, filp,
loff_t *ppos),
ARGS(filp, buf, size, ppos));

+FULL_PROXY_FUNC(read_iter, ssize_t, iocb->ki_filp,
+ PROTO(struct kiocb *iocb, struct iov_iter *iter),
+ ARGS(iocb, iter));
+
FULL_PROXY_FUNC(write, ssize_t, filp,
PROTO(struct file *filp, const char __user *buf, size_t size,
loff_t *ppos),
@@ -286,6 +290,8 @@ static void __full_proxy_fops_init(struct file_operations *proxy_fops,
proxy_fops->llseek = full_proxy_llseek;
if (real_fops->read)
proxy_fops->read = full_proxy_read;
+ if (real_fops->read_iter)
+ proxy_fops->read_iter = full_proxy_read_iter;
if (real_fops->write)
proxy_fops->write = full_proxy_write;
if (real_fops->poll)
--
2.26.2
\
 
 \ /
  Last update: 2020-07-13 09:43    [W:0.042 / U:0.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site