Whamcloud - gitweb
LU-6142 llite: use %pd to report dentry names.
[fs/lustre-release.git] / lustre / llite / vvp_dev.c
index 0ebe920..58efc98 100644 (file)
@@ -40,6 +40,7 @@
 #include <obd.h>
 #include "llite_internal.h"
 #include "vvp_internal.h"
+#include <linux/kallsyms.h>
 
 /*****************************************************************************
  *
@@ -265,6 +266,11 @@ struct lu_device_type vvp_device_type = {
         .ldt_ctx_tags = LCT_CL_THREAD
 };
 
+#ifndef HAVE_ACCOUNT_PAGE_DIRTIED_EXPORT
+unsigned int (*vvp_account_page_dirtied)(struct page *page,
+                                        struct address_space *mapping);
+#endif
+
 /**
  * A mutex serializing calls to vvp_inode_fini() under extreme memory
  * pressure, when environments cannot be allocated.
@@ -281,6 +287,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:
@@ -355,7 +370,7 @@ int cl_sb_fini(struct super_block *sb)
 
 /****************************************************************************
  *
- * /proc/fs/lustre/llite/$MNT/dump_page_cache
+ * debugfs/lustre/llite/$MNT/dump_page_cache
  *
  ****************************************************************************/
 
@@ -426,7 +441,7 @@ static struct page *vvp_pgcache_current(struct vvp_seq_private *priv)
 {
        struct lu_device *dev = &priv->vsp_sbi->ll_cl->cd_lu_dev;
 
-       while(1) {
+       while (1) {
                struct inode *inode;
                struct page *vmpage;
                int nr;
@@ -558,7 +573,7 @@ static void *vvp_pgcache_next(struct seq_file *f, void *v, loff_t *pos)
        struct vvp_seq_private *priv = f->private;
 
        WARN_ON(*pos != priv->vvp_prev_pos);
-
+       *pos += 1;
        priv->vvp_prev_pos = *pos;
        return vvp_pgcache_next_page(priv);
 }
@@ -583,7 +598,7 @@ static int vvp_dump_pgcache_seq_open(struct inode *inode, struct file *filp)
        if (!priv)
                return -ENOMEM;
 
-       priv->vsp_sbi = PDE_DATA(inode);
+       priv->vsp_sbi = inode->i_private;
        priv->vsp_env = cl_env_get(&priv->vsp_refcheck);
        priv->vsp_clob = NULL;
        memset(&priv->vvp_id, 0, sizeof(priv->vvp_id));