From 9db87ae6305386114006f4fef81aa7b896ae7fc4 Mon Sep 17 00:00:00 2001 From: TwinbornPlate75 <42514046+TwinbornPlate75@users.noreply.github.com> Date: Sun, 2 Nov 2025 21:30:12 +0800 Subject: [PATCH] kernel: Fix compilation (#520) The definiton of fsnotify_add_mark changed multiple times, once in 4.11-rc2, once in 6.9-rc1, so older kernels still need to fix. --- kernel/pkg_observer.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kernel/pkg_observer.c b/kernel/pkg_observer.c index ec593a4f..66f1ef18 100644 --- a/kernel/pkg_observer.c +++ b/kernel/pkg_observer.c @@ -70,8 +70,12 @@ static int add_mark_on_inode(struct inode *inode, u32 mask, fsnotify_init_mark(m, g); m->mask = mask; ret = fsnotify_add_inode_mark(m, inode, 0); +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) + fsnotify_init_mark(m, g); + m->mask = mask; + ret = fsnotify_add_mark(m, inode, NULL, 0); #else - fsnotify_init_mark(m, m_free); + fsnotify_init_mark(m, g, m_free); m->mask = mask; ret = fsnotify_add_mark(m, g, inode, NULL, 0); #endif