allow ->read_iter on debugfs
Hi Greg,
in my filesystem set_fs removel series I convert the seq_file interface to be iov_iter based. It turns out debugfs needs this little patch to proxy read_iter as well. Let me know if you are ok with me queueing this up with the rest of the series.
PATCH 1/1 debugfs: add a proxy stub for ->read_iter
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.
--- fs/debugfs/file.c | 6 ++++++ 1 file changed, 6 insertions(+)
fs/debugfs/file.c +6 -0
@@ -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)
Signature · 1 line
2.26.2
Re: [PATCH] debugfs: add a proxy stub for ->read_iter
Quoted 7 lines · Christoph Hellwig
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_fileto be switch to ->read_iter.Reported-by Jon Hunter <[email protected]>Signed-off-by Christoph Hellwig <[email protected]>
Jon Hunter
Tested-byRe: [PATCH] debugfs: add a proxy stub for ->read_iter
Quoted 11 lines · Greg KH
Quoted 7 lines · Christoph Hellwig
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_fileto be switch to ->read_iter.Reported-by Jon Hunter <[email protected]>Signed-off-by Christoph Hellwig <[email protected]>
Cheers
Jon
Signature · 1 line
nvpublic
Greg KH
maintainerQuoted 8 lines · Christoph Hellwig
Hi Greg,
in my filesystem
set_fsremovel series I convert theseq_fileinterface to beiov_iterbased. It turns out debugfs needs this little patch to proxyread_iteras well. Let me know if you are ok with me queueing this up with the rest of the series.
No objection from me, please do so!
thanks,
greg k-h