Whamcloud - gitweb
LU-4054 llog: don't leak llog handle in llog_cat_process_cb()
[fs/lustre-release.git] / lustre / osd-ldiskfs / osd_lproc.c
index 0f522d8..5171863 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, 2012, Intel Corporation.
+ * Copyright (c) 2011, 2013, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -63,7 +63,7 @@ void osd_brw_stats_update(struct osd_device *osd, struct osd_iobuf *iobuf)
         if (unlikely(nr_pages == 0))
                 return;
 
-        blocks_per_page = CFS_PAGE_SIZE >> osd_sb(osd)->s_blocksize_bits;
+       blocks_per_page = PAGE_CACHE_SIZE >> osd_sb(osd)->s_blocksize_bits;
 
         lprocfs_oh_tally_log2(&s->hist[BRW_R_PAGES+rw], nr_pages);
 
@@ -125,12 +125,12 @@ static void display_brw_stats(struct seq_file *seq, char *name, char *units,
 
 static void brw_stats_show(struct seq_file *seq, struct brw_stats *brw_stats)
 {
-        struct timeval now;
+       struct timeval now;
 
-        /* this sampling races with updates */
-        cfs_gettimeofday(&now);
-        seq_printf(seq, "snapshot_time:         %lu.%lu (secs.usecs)\n",
-                   now.tv_sec, now.tv_usec);
+       /* this sampling races with updates */
+       do_gettimeofday(&now);
+       seq_printf(seq, "snapshot_time:         %lu.%lu (secs.usecs)\n",
+                  now.tv_sec, now.tv_usec);
 
         display_brw_stats(seq, "pages per bulk r/w", "rpcs",
                           &brw_stats->hist[BRW_R_PAGES],
@@ -152,9 +152,9 @@ static void brw_stats_show(struct seq_file *seq, struct brw_stats *brw_stats)
                           &brw_stats->hist[BRW_R_RPC_HIST],
                           &brw_stats->hist[BRW_W_RPC_HIST], 0);
 
-        display_brw_stats(seq, "I/O time (1/1000s)", "ios",
-                          &brw_stats->hist[BRW_R_IO_TIME],
-                          &brw_stats->hist[BRW_W_IO_TIME], 1000 / CFS_HZ);
+       display_brw_stats(seq, "I/O time (1/1000s)", "ios",
+                         &brw_stats->hist[BRW_R_IO_TIME],
+                         &brw_stats->hist[BRW_W_IO_TIME], 1000 / HZ);
 
         display_brw_stats(seq, "disk I/O size", "ios",
                           &brw_stats->hist[BRW_R_DISK_IOSIZE],
@@ -442,6 +442,31 @@ static int lprocfs_osd_wr_auto_scrub(struct file *file, const char *buffer,
        return count;
 }
 
+static int lprocfs_osd_rd_track_declares_assert(char *page, char **start,
+                                               off_t off, int count,
+                                               int *eof, void *data)
+{
+       *eof = 1;
+
+       return snprintf(page, count, "%d\n", ldiskfs_track_declares_assert);
+}
+
+static int lprocfs_osd_wr_track_declares_assert(struct file *file,
+                                               const char *buffer,
+                                               unsigned long count, void *data)
+{
+       int     track_declares_assert;
+       int     rc;
+
+       rc = lprocfs_write_helper(buffer, count, &track_declares_assert);
+       if (rc != 0)
+               return rc;
+
+       ldiskfs_track_declares_assert = !!track_declares_assert;
+
+       return count;
+}
+
 static int lprocfs_osd_rd_oi_scrub(char *page, char **start, off_t off,
                                   int count, int *eof, void *data)
 {
@@ -490,12 +515,12 @@ int lprocfs_osd_wr_readcache(struct file *file, const char *buffer,
 }
 
 struct lprocfs_vars lprocfs_osd_obd_vars[] = {
-        { "blocksize",       lprocfs_osd_rd_blksize,     0, 0 },
-        { "kbytestotal",     lprocfs_osd_rd_kbytestotal, 0, 0 },
-        { "kbytesfree",      lprocfs_osd_rd_kbytesfree,  0, 0 },
-        { "kbytesavail",     lprocfs_osd_rd_kbytesavail, 0, 0 },
-        { "filestotal",      lprocfs_osd_rd_filestotal,  0, 0 },
-        { "filesfree",       lprocfs_osd_rd_filesfree,   0, 0 },
+       { "blocksize",          lprocfs_dt_rd_blksize,  0, 0 },
+       { "kbytestotal",        lprocfs_dt_rd_kbytestotal,      0, 0 },
+       { "kbytesfree",         lprocfs_dt_rd_kbytesfree,       0, 0 },
+       { "kbytesavail",        lprocfs_dt_rd_kbytesavail,      0, 0 },
+       { "filestotal",         lprocfs_dt_rd_filestotal,       0, 0 },
+       { "filesfree",          lprocfs_dt_rd_filesfree,        0, 0 },
         { "fstype",          lprocfs_osd_rd_fstype,      0, 0 },
         { "mntdev",          lprocfs_osd_rd_mntdev,      0, 0 },
        { "force_sync",      0, lprocfs_osd_wr_force_sync     },
@@ -514,6 +539,9 @@ struct lprocfs_vars lprocfs_osd_obd_vars[] = {
 
 struct lprocfs_vars lprocfs_osd_module_vars[] = {
         { "num_refs",        lprocfs_rd_numrefs,     0, 0 },
+       { "track_declares_assert",      lprocfs_osd_rd_track_declares_assert,
+                                       lprocfs_osd_wr_track_declares_assert,
+                                       0 },
         { 0 }
 };