diff --git a/sys/compat/linuxkpi/common/include/linux/fs.h b/sys/compat/linuxkpi/common/include/linux/fs.h --- a/sys/compat/linuxkpi/common/include/linux/fs.h +++ b/sys/compat/linuxkpi/common/include/linux/fs.h @@ -265,6 +265,7 @@ } struct linux_file * linux67_get_file_rcu(struct linux_file **f); +struct linux_file * get_file_active(struct linux_file **f); #if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 60700 #define get_file_rcu(f) linux67_get_file_rcu(f) #else diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -1121,6 +1121,20 @@ } } +struct linux_file * +get_file_active(struct linux_file **f) +{ + struct linux_file *file1; + + rcu_read_lock(); + file1 = __get_file_rcu(f); + rcu_read_unlock(); + if (IS_ERR(file1)) + file1 = NULL; + + return (file1); +} + static void linux_file_kqfilter_detach(struct knote *kn) {