Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
commit 5f1eed5f847d704173fda62c8703e5794398e073 Author: Sven Eckelmann sven@narfation.org Date: Tue Oct 30 22:01:22 2018 +0100
batman-adv: Add compat for genl_dump_check_consistent
The commit 0a833c29d896 ("genetlink: fix genlmsg_nlhdr()") removed the family parameter for genl_dump_check_consistent. It is actually not needed because batman-adv doesn't use userspace headers and a dummy family with hdrsize 0 can be used for these kernel versions.
Signed-off-by: Sven Eckelmann sven@narfation.org
5f1eed5f847d704173fda62c8703e5794398e073 compat-include/{linux/fs.h => net/genetlink.h} | 29 +++++++++++++------------- 1 file changed, 14 insertions(+), 15 deletions(-)
diff --git a/compat-include/linux/fs.h b/compat-include/net/genetlink.h similarity index 60% copy from compat-include/linux/fs.h copy to compat-include/net/genetlink.h index e0d6f7c..026500c 100644 --- a/compat-include/linux/fs.h +++ b/compat-include/net/genetlink.h @@ -19,28 +19,27 @@ * of the Linux kernel. */
-#ifndef _NET_BATMAN_ADV_COMPAT_LINUX_FS_H_ -#define _NET_BATMAN_ADV_COMPAT_LINUX_FS_H_ +#ifndef _NET_BATMAN_ADV_COMPAT_NET_GENETLINK_H_ +#define _NET_BATMAN_ADV_COMPAT_NET_GENETLINK_H_
#include <linux/version.h> -#include_next <linux/fs.h> +#include_next <net/genetlink.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
-static inline struct dentry *batadv_file_dentry(const struct file *file) +static inline +void batadv_genl_dump_check_consistent(struct netlink_callback *cb, + void *user_hdr) { - struct dentry *dentry = file->f_path.dentry; + struct genl_family genl_family = { + .hdrsize = 0, + };
-#ifdef DCACHE_OP_REAL - if (unlikely(dentry->d_flags & DCACHE_OP_REAL)) - return dentry->d_op->d_real(dentry, file_inode(file)); -#endif - - return dentry; + genl_dump_check_consistent(cb, user_hdr, &genl_family); }
-#define file_dentry batadv_file_dentry +#define genl_dump_check_consistent batadv_genl_dump_check_consistent
-#endif /* < KERNEL_VERSION(4, 6, 0) */ +#endif /* < KERNEL_VERSION(4, 15, 0) */
-#endif /* _NET_BATMAN_ADV_COMPAT_LINUX_FS_H_ */ +#endif /* _NET_BATMAN_ADV_COMPAT_NET_GENETLINK_H_ */