linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] debugfs: Add proxy function for the mmap file operation
@ 2016-07-29 14:34 Liviu Dudau
  2016-07-29 17:35 ` Nicolai Stange
  0 siblings, 1 reply; 10+ messages in thread
From: Liviu Dudau @ 2016-07-29 14:34 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Brian Starkey, LKML, Nicolai Stange

Add proxy function for the mmap file_operations hook under the
full_proxy_fops structure. This is useful for providing a custom
mmap routine in a driver's debugfs implementation.

Cc: Nicolai Stange <nicstange@gmail.com>
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
---
 fs/debugfs/file.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c
index 592059f..d87148a 100644
--- a/fs/debugfs/file.c
+++ b/fs/debugfs/file.c
@@ -168,6 +168,10 @@ FULL_PROXY_FUNC(write, ssize_t, filp,
 			loff_t *ppos),
 		ARGS(filp, buf, size, ppos));
 
+FULL_PROXY_FUNC(mmap, int, filp,
+		PROTO(struct file *filp, struct vm_area_struct *vma),
+		ARGS(filp, vma));
+
 FULL_PROXY_FUNC(unlocked_ioctl, long, filp,
 		PROTO(struct file *filp, unsigned int cmd, unsigned long arg),
 		ARGS(filp, cmd, arg));
@@ -224,6 +228,8 @@ static void __full_proxy_fops_init(struct file_operations *proxy_fops,
 		proxy_fops->write = full_proxy_write;
 	if (real_fops->poll)
 		proxy_fops->poll = full_proxy_poll;
+	if (real_fops->mmap)
+		proxy_fops->mmap = full_proxy_mmap;
 	if (real_fops->unlocked_ioctl)
 		proxy_fops->unlocked_ioctl = full_proxy_unlocked_ioctl;
 }
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-09-01 14:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-29 14:34 [PATCH] debugfs: Add proxy function for the mmap file operation Liviu Dudau
2016-07-29 17:35 ` Nicolai Stange
2016-08-02 17:31   ` Nicolai Stange
2016-08-05 10:18     ` Brian Starkey
2016-08-05 11:11       ` Nicolai Stange
2016-08-31 13:07         ` Greg Kroah-Hartman
2016-08-31 15:23           ` Liviu Dudau
2016-09-01  6:19             ` Greg Kroah-Hartman
2016-09-01 12:50               ` Liviu Dudau
2016-09-01 14:43                 ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).