Whamcloud - gitweb
new tag 2.6.92
[fs/lustre-release.git] / lustre / llite / vvp_dev.c
index 8b9e09a..1e3f8db 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2012, 2013, Intel Corporation.
+ * Copyright (c) 2012, 2014, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
 
 #define DEBUG_SUBSYSTEM S_LLITE
 
-#ifndef __KERNEL__
-# error This file is kernel only.
-#endif
 
 #include <obd.h>
-#include <lustre_lite.h>
-
+#include "llite_internal.h"
 #include "vvp_internal.h"
 
 /*****************************************************************************
@@ -61,7 +57,7 @@
  * "llite_" (var. "ll_") prefix.
  */
 
-struct kmem_cache *vvp_thread_kmem;
+static struct kmem_cache *vvp_thread_kmem;
 static struct kmem_cache *vvp_session_kmem;
 static struct lu_kmem_descr vvp_caches[] = {
         {
@@ -84,7 +80,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_IO);
+       OBD_SLAB_ALLOC_PTR_GFP(info, vvp_thread_kmem, GFP_NOFS);
        if (info == NULL)
                info = ERR_PTR(-ENOMEM);
        return info;
@@ -102,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_IO);
+       OBD_SLAB_ALLOC_PTR_GFP(session, vvp_session_kmem, GFP_NOFS);
        if (session == NULL)
                session = ERR_PTR(-ENOMEM);
        return session;
@@ -245,13 +241,8 @@ int cl_sb_fini(struct super_block *sb)
                 CERROR("Cannot cleanup cl-stack due to memory shortage.\n");
                 result = PTR_ERR(env);
         }
-        /*
-         * If mount failed (sbi->ll_cl == NULL), and this there are no other
-         * mounts, stop device types manually (this usually happens
-         * automatically when last device is destroyed).
-         */
-        lu_types_stop();
-        RETURN(result);
+
+       RETURN(result);
 }
 
 /****************************************************************************
@@ -303,7 +294,7 @@ static loff_t vvp_pgcache_id_pack(struct vvp_pgcache_id *id)
 }
 
 static int vvp_pgcache_obj_get(cfs_hash_t *hs, cfs_hash_bd_t *bd,
-                               cfs_hlist_node_t *hnode, void *data)
+                              struct hlist_node *hnode, void *data)
 {
         struct vvp_pgcache_id   *id  = data;
         struct lu_object_header *hdr = cfs_hash_object(hs, hnode);
@@ -397,7 +388,7 @@ static loff_t vvp_pgcache_find(const struct lu_env *env,
 } while(0)
 
 static void vvp_pgcache_page_show(const struct lu_env *env,
-                                  struct seq_file *seq, struct cl_page *page)
+                                 struct seq_file *seq, struct cl_page *page)
 {
        struct ccc_page *cpg;
        struct page      *vmpage;
@@ -416,14 +407,14 @@ static void vvp_pgcache_page_show(const struct lu_env *env,
                   PFID(ll_inode2fid(vmpage->mapping->host)),
                   vmpage->mapping->host, vmpage->index,
                   page_count(vmpage));
-        has_flags = 0;
-        seq_page_flag(seq, vmpage, locked, has_flags);
-        seq_page_flag(seq, vmpage, error, has_flags);
-        seq_page_flag(seq, vmpage, referenced, has_flags);
-        seq_page_flag(seq, vmpage, uptodate, has_flags);
-        seq_page_flag(seq, vmpage, dirty, has_flags);
-        seq_page_flag(seq, vmpage, writeback, has_flags);
-        seq_printf(seq, "%s]\n", has_flags ? "" : "-");
+       has_flags = 0;
+       seq_page_flag(seq, vmpage, locked, has_flags);
+       seq_page_flag(seq, vmpage, error, has_flags);
+       seq_page_flag(seq, vmpage, referenced, has_flags);
+       seq_page_flag(seq, vmpage, uptodate, has_flags);
+       seq_page_flag(seq, vmpage, dirty, has_flags);
+       seq_page_flag(seq, vmpage, writeback, has_flags);
+       seq_printf(seq, "%s]\n", has_flags ? "" : "-");
 }
 
 static int vvp_pgcache_show(struct seq_file *f, void *v)
@@ -530,20 +521,19 @@ static struct seq_operations vvp_pgcache_ops = {
 
 static int vvp_dump_pgcache_seq_open(struct inode *inode, struct file *filp)
 {
-        struct proc_dir_entry *dp  = PDE(inode);
-        struct ll_sb_info     *sbi = dp->data;
-        struct seq_file       *seq;
-        int                    result;
-
-        result = seq_open(filp, &vvp_pgcache_ops);
-        if (result == 0) {
-                seq = filp->private_data;
-                seq->private = sbi;
-        }
-        return result;
+       struct ll_sb_info       *sbi = PDE_DATA(inode);
+       struct seq_file         *seq;
+       int                     result;
+
+       result = seq_open(filp, &vvp_pgcache_ops);
+       if (result == 0) {
+               seq = filp->private_data;
+               seq->private = sbi;
+       }
+       return result;
 }
 
-struct file_operations vvp_dump_pgcache_file_ops = {
+const struct file_operations vvp_dump_pgcache_file_ops = {
         .owner   = THIS_MODULE,
         .open    = vvp_dump_pgcache_seq_open,
         .read    = seq_read,