@@ -31,4 +31,15 @@ static inline struct dentry *batadv_file_dentry(const struct file *file)
#endif /* < KERNEL_VERSION(4, 6, 0) */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)
+
+static inline int batadv_stream_open(struct inode *inode, struct file *filp)
+{
+ return nonseekable_open(inode, filp);
+}
+
+#define stream_open batadv_stream_open
+
+#endif /* < KERNEL_VERSION(5, 2, 0) */
+
#endif /* _NET_BATMAN_ADV_COMPAT_LINUX_FS_H_ */
@@ -65,7 +65,7 @@ static int batadv_socket_open(struct inode *inode, struct file *file)
batadv_debugfs_deprecated(file, "");
- nonseekable_open(inode, file);
+ stream_open(inode, file);
socket_client = kmalloc(sizeof(*socket_client), GFP_KERNEL);
if (!socket_client) {
@@ -90,7 +90,7 @@ static int batadv_log_open(struct inode *inode, struct file *file)
batadv_debugfs_deprecated(file,
"Use tracepoint batadv:batadv_dbg instead\n");
- nonseekable_open(inode, file);
+ stream_open(inode, file);
file->private_data = inode->i_private;
return 0;
}