Whamcloud - gitweb
LU-13288 llite: Find account_page_dirtied on module init
[fs/lustre-release.git] / lustre / llite / vvp_dev.c
index d36aed3..bec0f9e 100644 (file)
@@ -40,6 +40,7 @@
 #include <obd.h>
 #include "llite_internal.h"
 #include "vvp_internal.h"
+#include <linux/kallsyms.h>
 
 /*****************************************************************************
  *
@@ -281,6 +282,15 @@ int vvp_global_init(void)
        if (rc != 0)
                goto out_kmem;
 
+#ifndef HAVE_ACCOUNT_PAGE_DIRTIED_EXPORT
+       /*
+        * Kernel v5.2-5678-gac1c3e4 no longer exports account_page_dirtied
+        */
+       vvp_account_page_dirtied = (void *)
+               kallsyms_lookup_name("account_page_dirtied");
+       BUG_ON(!vvp_account_page_dirtied);
+#endif
+
        return 0;
 
 out_kmem: