Whamcloud - gitweb
LU-6138 lfsck: NOT hold reference on pre-loaded object
[fs/lustre-release.git] / lustre / lod / lproc_lod.c
index 08c5673..f9f84c0 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright  2008 Sun Microsystems, Inc. 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/
@@ -47,7 +47,7 @@
  * called by Linux kernel's procfs.
  */
 
-#ifdef LPROCFS
+#ifdef CONFIG_PROC_FS
 
 /**
  * Show default stripe size.
@@ -514,6 +514,9 @@ lod_qos_maxage_seq_write(struct file *file, const char *buffer,
        sprintf(str, "%smaxage=%d", PARAM_OSP, val);
        lustre_cfg_bufs_set_string(&bufs, 1, str);
        lcfg = lustre_cfg_new(LCFG_PARAM, &bufs);
+       if (lcfg == NULL)
+               return -ENOMEM;
+
        lod_getref(&lod->lod_ost_descs);
        lod_foreach_ost(lod, i) {
                next = &OST_TGT(lod,i)->ltd_ost->dd_lu_dev;
@@ -705,7 +708,7 @@ lod_lmv_failout_seq_write(struct file *file, const char *buffer,
 }
 LPROC_SEQ_FOPS(lod_lmv_failout);
 
-static struct lprocfs_seq_vars lprocfs_lod_obd_vars[] = {
+static struct lprocfs_vars lprocfs_lod_obd_vars[] = {
        { .name =       "uuid",
          .fops =       &lod_uuid_fops          },
        { .name =       "stripesize",
@@ -730,17 +733,17 @@ static struct lprocfs_seq_vars lprocfs_lod_obd_vars[] = {
          .fops =       &lod_qos_maxage_fops    },
        { .name =       "lmv_failout",
          .fops =       &lod_lmv_failout_fops   },
-       { 0 }
+       { NULL }
 };
 
-static struct lprocfs_seq_vars lprocfs_lod_osd_vars[] = {
+static struct lprocfs_vars lprocfs_lod_osd_vars[] = {
        { "blocksize",          &lod_dt_blksize_fops            },
        { "kbytestotal",        &lod_dt_kbytestotal_fops        },
        { "kbytesfree",         &lod_dt_kbytesfree_fops         },
        { "kbytesavail",        &lod_dt_kbytesavail_fops        },
        { "filestotal",         &lod_dt_filestotal_fops         },
        { "filesfree",          &lod_dt_filesfree_fops          },
-       { 0 }
+       { NULL }
 };
 
 static const struct file_operations lod_proc_target_fops = {
@@ -774,8 +777,8 @@ int lod_procfs_init(struct lod_device *lod)
                RETURN(rc);
        }
 
-       rc = lprocfs_seq_add_vars(obd->obd_proc_entry, lprocfs_lod_osd_vars,
-                                 &lod->lod_dt_dev);
+       rc = lprocfs_add_vars(obd->obd_proc_entry, lprocfs_lod_osd_vars,
+                             &lod->lod_dt_dev);
        if (rc) {
                CERROR("%s: cannot setup procfs entry: %d\n",
                       obd->obd_name, rc);
@@ -790,9 +793,9 @@ int lod_procfs_init(struct lod_device *lod)
                GOTO(out, rc);
        }
 
-       lod->lod_pool_proc_entry = lprocfs_seq_register("pools",
-                                                       obd->obd_proc_entry,
-                                                       NULL, NULL);
+       lod->lod_pool_proc_entry = lprocfs_register("pools",
+                                                   obd->obd_proc_entry,
+                                                   NULL, NULL);
        if (IS_ERR(lod->lod_pool_proc_entry)) {
                rc = PTR_ERR(lod->lod_pool_proc_entry);
                lod->lod_pool_proc_entry = NULL;
@@ -847,5 +850,5 @@ void lod_procfs_fini(struct lod_device *lod)
        lprocfs_obd_cleanup(obd);
 }
 
-#endif /* LPROCFS */
+#endif /* CONFIG_PROC_FS */