This is needed by drivers/media/dvb-core/dvbdev.c and was added in:
commit e84f9e57b90ca89664d733a7cef19aa7ccd832f3
Author: Al Viro <[email protected]>
Date:   Sun Sep 22 14:17:15 2013 -0400

    consolidate the reassignments of ->f_op in ->open() instances

Signed-off-by: Hauke Mehrtens <[email protected]>
---
 backport/backport-include/linux/fs.h |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/backport/backport-include/linux/fs.h 
b/backport/backport-include/linux/fs.h
index 9de5109..9874f81 100644
--- a/backport/backport-include/linux/fs.h
+++ b/backport/backport-include/linux/fs.h
@@ -38,4 +38,18 @@ extern ssize_t simple_write_to_buffer(void *to, size_t 
available, loff_t *ppos,
                const void __user *from, size_t count);
 #endif
 
+#ifndef replace_fops
+/*
+ * This one is to be used *ONLY* from ->open() instances.
+ * fops must be non-NULL, pinned down *and* module dependencies
+ * should be sufficient to pin the caller down as well.
+ */
+#define replace_fops(f, fops) \
+       do {    \
+               struct file *__file = (f); \
+               fops_put(__file->f_op); \
+               BUG_ON(!(__file->f_op = (fops))); \
+       } while(0)
+#endif /* replace_fops */
+
 #endif /* _COMPAT_LINUX_FS_H */
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe backports" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to