Whamcloud - gitweb
LU-3313 tests: Skip sanityn test_51b
[fs/lustre-release.git] / lustre / osd-ldiskfs / osd_lproc.c
index e3539a8..251a97c 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);
 
@@ -228,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",
-                                  0644, &osd_brw_stats_fops, osd);
+               result = lprocfs_seq_create(osd->od_proc_entry, "brw_stats",
+                                           0644, &osd_brw_stats_fops, osd);
         } else
                 result = -ENOMEM;
 
@@ -388,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)
 {
@@ -411,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)
@@ -444,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)
 {
@@ -492,18 +515,16 @@ 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     },
-#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 },
@@ -518,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 }
 };