Skip to contentSkip to conversation

allow ->read_iter on debugfs

PATCH In review Christoph Hellwig 3 participants 5 messages Jul 13, 2020 Driver core

lore
Share & tools
lore
#0 lore raw

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.

#1 lore raw

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
index 8ba32c2feb1b73..dcd7bdaf67417f 100644
@@ -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
maintainer Acked-by on v1 1/1
#2 lore raw

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_file to be switch to ->read_iter.

Tested-by
#3 lore raw

Re: [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_file to be switch to ->read_iter.

Cheers
Jon

Signature · 1 line
nvpublic
maintainer
#4 lore raw
In reply to Christoph Hellwig
Quoted 8 lines · Christoph Hellwig

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.

No objection from me, please do so!

thanks,

greg k-h