These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / staging / lustre / lustre / llite / vvp_dev.c
index fde41d7..d16d6cf 100644 (file)
@@ -40,7 +40,6 @@
 
 #define DEBUG_SUBSYSTEM S_LLITE
 
-
 #include "../include/obd.h"
 #include "../include/lustre_lite.h"
 #include "llite_internal.h"
@@ -80,7 +79,7 @@ static void *vvp_key_init(const struct lu_context *ctx,
 {
        struct vvp_thread_info *info;
 
-       OBD_SLAB_ALLOC_PTR_GFP(info, vvp_thread_kmem, GFP_NOFS);
+       info = kmem_cache_alloc(vvp_thread_kmem, GFP_NOFS | __GFP_ZERO);
        if (info == NULL)
                info = ERR_PTR(-ENOMEM);
        return info;
@@ -91,7 +90,7 @@ static void vvp_key_fini(const struct lu_context *ctx,
 {
        struct vvp_thread_info *info = data;
 
-       OBD_SLAB_FREE_PTR(info, vvp_thread_kmem);
+       kmem_cache_free(vvp_thread_kmem, info);
 }
 
 static void *vvp_session_key_init(const struct lu_context *ctx,
@@ -99,7 +98,7 @@ static void *vvp_session_key_init(const struct lu_context *ctx,
 {
        struct vvp_session *session;
 
-       OBD_SLAB_ALLOC_PTR_GFP(session, vvp_session_kmem, GFP_NOFS);
+       session = kmem_cache_alloc(vvp_session_kmem, GFP_NOFS | __GFP_ZERO);
        if (session == NULL)
                session = ERR_PTR(-ENOMEM);
        return session;
@@ -110,10 +109,9 @@ static void vvp_session_key_fini(const struct lu_context *ctx,
 {
        struct vvp_session *session = data;
 
-       OBD_SLAB_FREE_PTR(session, vvp_session_kmem);
+       kmem_cache_free(vvp_session_kmem, session);
 }
 
-
 struct lu_context_key vvp_key = {
        .lct_tags = LCT_CL_THREAD,
        .lct_init = vvp_key_init,
@@ -187,7 +185,6 @@ void vvp_global_fini(void)
        lu_kmem_fini(vvp_caches);
 }
 
-
 /*****************************************************************************
  *
  * mirror obd-devices into cl devices.
@@ -253,7 +250,7 @@ int cl_sb_fini(struct super_block *sb)
 
 /****************************************************************************
  *
- * /proc/fs/lustre/llite/$MNT/dump_page_cache
+ * debugfs/lustre/llite/$MNT/dump_page_cache
  *
  ****************************************************************************/
 
@@ -517,7 +514,7 @@ static void vvp_pgcache_stop(struct seq_file *f, void *v)
        /* Nothing to do */
 }
 
-static struct seq_operations vvp_pgcache_ops = {
+static const struct seq_operations vvp_pgcache_ops = {
        .start = vvp_pgcache_start,
        .next  = vvp_pgcache_next,
        .stop  = vvp_pgcache_stop,
@@ -526,16 +523,17 @@ static struct seq_operations vvp_pgcache_ops = {
 
 static int vvp_dump_pgcache_seq_open(struct inode *inode, struct file *filp)
 {
-       struct ll_sb_info     *sbi = PDE_DATA(inode);
-       struct seq_file       *seq;
-       int                 result;
+       struct seq_file *seq;
+       int rc;
 
-       result = seq_open(filp, &vvp_pgcache_ops);
-       if (result == 0) {
-               seq = filp->private_data;
-               seq->private = sbi;
-       }
-       return result;
+       rc = seq_open(filp, &vvp_pgcache_ops);
+       if (rc)
+               return rc;
+
+       seq = filp->private_data;
+       seq->private = inode->i_private;
+
+       return 0;
 }
 
 const struct file_operations vvp_dump_pgcache_file_ops = {