Whamcloud - gitweb
LU-2444 build: fix 'error handling' issues
[fs/lustre-release.git] / lustre / osd-ldiskfs / osd_lproc.c
index 9e99fb3..0f522d8 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) 2011, Whamcloud, Inc.
+ * Copyright (c) 2011, 2012, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -41,8 +41,6 @@
 #define DEBUG_SUBSYSTEM S_CLASS
 
 #include <lprocfs_status.h>
-#include <lu_time.h>
-
 #include <lustre/lustre_idl.h>
 
 #include "osd_internal.h"
@@ -195,7 +193,7 @@ static int osd_stats_init(struct osd_device *osd)
         ENTRY;
 
         for (i = 0; i < BRW_LAST; i++)
-                cfs_spin_lock_init(&osd->od_brw_stats.hist[i].oh_lock);
+               spin_lock_init(&osd->od_brw_stats.hist[i].oh_lock);
 
         osd->od_stats = lprocfs_alloc_stats(LPROC_OSD_LAST, 0);
         if (osd->od_stats != NULL) {
@@ -230,8 +228,8 @@ static int osd_stats_init(struct osd_device *osd)
                                      LPROCFS_CNTR_AVGMINMAX,
                                      "thandle closing", "usec");
 #endif
-                lprocfs_seq_create(osd->od_proc_entry, "brw_stats",
-                                   0444, &osd_brw_stats_fops, osd);
+               result = lprocfs_seq_create(osd->od_proc_entry, "brw_stats",
+                                           0644, &osd_brw_stats_fops, osd);
         } else
                 result = -ENOMEM;
 
@@ -239,14 +237,6 @@ out:
         RETURN(result);
 }
 
-static const char *osd_counter_names[] = {
-#if OSD_THANDLE_STATS
-        [LPROC_OSD_THANDLE_STARTING] = "thandle starting",
-        [LPROC_OSD_THANDLE_OPEN]     = "thandle open",
-        [LPROC_OSD_THANDLE_CLOSING]  = "thandle closing"
-#endif
-};
-
 int osd_procfs_init(struct osd_device *osd, const char *name)
 {
         struct lprocfs_static_vars lvars;
@@ -273,10 +263,6 @@ int osd_procfs_init(struct osd_device *osd, const char *name)
                 GOTO(out, rc);
         }
 
-        rc = lu_time_init(&osd->od_stats,
-                          osd->od_proc_entry,
-                          osd_counter_names, ARRAY_SIZE(osd_counter_names));
-
         rc = osd_stats_init(osd);
 
         EXIT;
@@ -288,8 +274,8 @@ out:
 
 int osd_procfs_fini(struct osd_device *osd)
 {
-        if (osd->od_stats)
-                lu_time_fini(&osd->od_stats);
+       if (osd->od_stats)
+               lprocfs_free_stats(&osd->od_stats);
 
         if (osd->od_proc_entry) {
                  lprocfs_remove(&osd->od_proc_entry);
@@ -298,19 +284,6 @@ int osd_procfs_fini(struct osd_device *osd)
         RETURN(0);
 }
 
-void osd_lprocfs_time_start(const struct lu_env *env)
-{
-        lu_lprocfs_time_start(env);
-}
-
-void osd_lprocfs_time_end(const struct lu_env *env, struct osd_device *osd,
-                          int idx)
-{
-        lu_lprocfs_time_end(env, osd->od_stats, idx);
-}
-
-
-
 static int lprocfs_osd_rd_fstype(char *page, char **start, off_t off, int count,
                                 int *eof, void *data)
 {
@@ -329,11 +302,9 @@ static int lprocfs_osd_rd_mntdev(char *page, char **start, off_t off, int count,
        if (unlikely(osd->od_mnt == NULL))
                 return -EINPROGRESS;
 
-       LASSERT(mnt_get_devname(osd->od_mnt));
        *eof = 1;
 
-       return snprintf(page, count, "%s\n",
-                       mnt_get_devname(osd->od_mnt));
+       return snprintf(page, count, "%s\n", osd->od_mntdev);
 }
 
 static int lprocfs_osd_rd_cache(char *page, char **start, off_t off,
@@ -417,7 +388,6 @@ static int lprocfs_osd_wr_force_sync(struct file *file, const char *buffer,
        return rc == 0 ? count : rc;
 }
 
-#ifdef HAVE_LDISKFS_PDO
 static int lprocfs_osd_rd_pdo(char *page, char **start, off_t off, int count,
                               int *eof, void *data)
 {
@@ -440,7 +410,6 @@ static int lprocfs_osd_wr_pdo(struct file *file, const char *buffer,
 
         return count;
 }
-#endif
 
 static int lprocfs_osd_rd_auto_scrub(char *page, char **start, off_t off,
                                     int count, int *eof, void *data)
@@ -530,9 +499,7 @@ struct lprocfs_vars lprocfs_osd_obd_vars[] = {
         { "fstype",          lprocfs_osd_rd_fstype,      0, 0 },
         { "mntdev",          lprocfs_osd_rd_mntdev,      0, 0 },
        { "force_sync",      0, lprocfs_osd_wr_force_sync     },
-#ifdef HAVE_LDISKFS_PDO
         { "pdo",             lprocfs_osd_rd_pdo, lprocfs_osd_wr_pdo, 0 },
-#endif
        { "auto_scrub",      lprocfs_osd_rd_auto_scrub,
                             lprocfs_osd_wr_auto_scrub,  0 },
        { "oi_scrub",        lprocfs_osd_rd_oi_scrub,    0, 0 },