diff --git a/sys/compat/linuxkpi/common/include/linux/shrinker.h b/sys/compat/linuxkpi/common/include/linux/shrinker.h index 39ea35f0a862..04e96a12c4bd 100644 --- a/sys/compat/linuxkpi/common/include/linux/shrinker.h +++ b/sys/compat/linuxkpi/common/include/linux/shrinker.h @@ -51,8 +51,10 @@ struct shrinker { int linuxkpi_register_shrinker(struct shrinker *s); void linuxkpi_unregister_shrinker(struct shrinker *s); +void linuxkpi_synchronize_shrinkers(void); #define register_shrinker(s) linuxkpi_register_shrinker(s) #define unregister_shrinker(s) linuxkpi_unregister_shrinker(s) +#define synchronize_shrinkers() linuxkpi_synchronize_shrinkers() #endif /* _LINUXKPI_LINUX_SHRINKER_H_ */ diff --git a/sys/compat/linuxkpi/common/src/linux_shrinker.c b/sys/compat/linuxkpi/common/src/linux_shrinker.c index b48e491a4e2f..227ef3261cb3 100644 --- a/sys/compat/linuxkpi/common/src/linux_shrinker.c +++ b/sys/compat/linuxkpi/common/src/linux_shrinker.c @@ -64,6 +64,14 @@ linuxkpi_unregister_shrinker(struct shrinker *s) sx_xunlock(&sx_shrinker); } +void +linuxkpi_synchronize_shrinkers(void) +{ + + sx_xlock(&sx_shrinker); + sx_xunlock(&sx_shrinker); +} + #define SHRINKER_BATCH 512 static void