Whamcloud - gitweb
LU-6084 ptlrpc: prevent request timeout grow due to recovery
[fs/lustre-release.git] / lustre / ptlrpc / nodemap_lproc.c
index f18d1b4..9f3b742 100644 (file)
@@ -21,6 +21,9 @@
  */
 /*
  * Copyright (C) 2013, Trustees of Indiana University
+ *
+ * Copyright (c) 2014, Intel Corporation.
+ *
  * Author: Joshua Walgenbach <jjw@iu.edu>
  */
 
@@ -201,8 +204,7 @@ static int nodemap_exports_show(struct seq_file *m, void *data)
  */
 static int nodemap_exports_open(struct inode *inode, struct file *file)
 {
-       struct proc_dir_entry   *dir = PDE(inode);
-       struct lu_nodemap       *nodemap = dir->data;
+       struct lu_nodemap       *nodemap = PDE_DATA(inode);
 
        return single_open(file, nodemap_exports_show, nodemap);
 }
@@ -880,7 +882,7 @@ out:
 LPROC_SEQ_FOPS_WO_TYPE(nodemap, del_nodemap_idmap);
 #endif /* NODEMAP_PROC_DEBUG */
 
-static struct lprocfs_seq_vars lprocfs_nm_module_vars[] = {
+static struct lprocfs_vars lprocfs_nm_module_vars[] = {
        {
                .name           = "active",
                .fops           = &nodemap_active_fops,
@@ -949,7 +951,7 @@ const struct file_operations nodemap_exports_fops = {
        .release                = single_release
 };
 
-static struct lprocfs_seq_vars lprocfs_nodemap_vars[] = {
+static struct lprocfs_vars lprocfs_nodemap_vars[] = {
        {
                .name           = "id",
                .fops           = &nodemap_id_fops,
@@ -987,7 +989,7 @@ static struct lprocfs_seq_vars lprocfs_nodemap_vars[] = {
        }
 };
 
-static struct lprocfs_seq_vars lprocfs_default_nodemap_vars[] = {
+static struct lprocfs_vars lprocfs_default_nodemap_vars[] = {
        {
                .name           = "id",
                .fops           = &nodemap_id_fops,
@@ -1026,18 +1028,16 @@ int nodemap_procfs_init(void)
 {
        int rc = 0;
 
-       proc_lustre_nodemap_root = lprocfs_seq_register(LUSTRE_NODEMAP_NAME,
-                                                       proc_lustre_root,
-                                                       lprocfs_nm_module_vars,
-                                                       NULL);
-
+       proc_lustre_nodemap_root = lprocfs_register(LUSTRE_NODEMAP_NAME,
+                                                   proc_lustre_root,
+                                                   lprocfs_nm_module_vars,
+                                                   NULL);
        if (IS_ERR(proc_lustre_nodemap_root)) {
                rc = PTR_ERR(proc_lustre_nodemap_root);
                CERROR("cannot create 'nodemap' directory: rc = %d\n",
                       rc);
                proc_lustre_nodemap_root = NULL;
        }
-
        return rc;
 }
 
@@ -1057,16 +1057,14 @@ int lprocfs_nodemap_register(const char *name,
 
        if (is_default)
                nodemap_proc_entry =
-                       lprocfs_seq_register(name,
-                                            proc_lustre_nodemap_root,
-                                            lprocfs_default_nodemap_vars,
-                                            nodemap);
+                       lprocfs_register(name, proc_lustre_nodemap_root,
+                                        lprocfs_default_nodemap_vars,
+                                        nodemap);
        else
                nodemap_proc_entry =
-                       lprocfs_seq_register(name,
-                                            proc_lustre_nodemap_root,
-                                            lprocfs_nodemap_vars,
-                                            nodemap);
+                       lprocfs_register(name, proc_lustre_nodemap_root,
+                                        lprocfs_nodemap_vars,
+                                        nodemap);
 
        if (IS_ERR(nodemap_proc_entry)) {
                rc = PTR_ERR(nodemap_proc_entry);