Whamcloud - gitweb
LU-3384 llite: use READ, WRITE around ll_rw_stats_tally()
[fs/lustre-release.git] / lustre / llite / lproc_llite.c
index 51bbda4..d63745d 100644 (file)
@@ -740,23 +740,6 @@ static int ll_rd_sbi_flags(char *page, char **start, off_t off,
        return rc;
 }
 
-static int ll_rd_unstable_stats(char *page, char **start, off_t off,
-                             int count, int *eof, void *data)
-{
-       struct super_block      *sb    = data;
-       struct ll_sb_info       *sbi   = ll_s2sbi(sb);
-       struct cl_client_cache  *cache = &sbi->ll_cache;
-       int pages, mb, rc;
-
-       pages = cfs_atomic_read(&cache->ccc_unstable_nr);
-       mb    = (pages * CFS_PAGE_SIZE) >> 20;
-
-       rc = snprintf(page, count, "unstable_pages: %8d\n"
-                                  "unstable_mb:    %8d\n", pages, mb);
-
-       return rc;
-}
-
 static struct lprocfs_vars lprocfs_llite_obd_vars[] = {
         { "uuid",         ll_rd_sb_uuid,          0, 0 },
         //{ "mntpt_path",   ll_rd_path,             0, 0 },
@@ -788,7 +771,6 @@ static struct lprocfs_vars lprocfs_llite_obd_vars[] = {
         { "lazystatfs",       ll_rd_lazystatfs, ll_wr_lazystatfs, 0 },
         { "max_easize",       ll_rd_maxea_size, 0, 0 },
        { "sbi_flags",        ll_rd_sbi_flags, 0, 0 },
-       { "unstable_stats",   ll_rd_unstable_stats, 0, 0},
         { 0 }
 };
 
@@ -1326,30 +1308,34 @@ static int ll_rw_offset_stats_seq_show(struct seq_file *seq, void *v)
         seq_printf(seq, "%3s %10s %14s %14s %17s %17s %14s\n",
                    "R/W", "PID", "RANGE START", "RANGE END",
                    "SMALLEST EXTENT", "LARGEST EXTENT", "OFFSET");
-        /* We stored the discontiguous offsets here; print them first */
-        for(i = 0; i < LL_OFFSET_HIST_MAX; i++) {
-                if (offset[i].rw_pid != 0)
-                        seq_printf(seq,"%3c %10d %14Lu %14Lu %17lu %17lu %14Lu",
-                                   offset[i].rw_op ? 'W' : 'R',
-                                   offset[i].rw_pid,
-                                   offset[i].rw_range_start,
-                                   offset[i].rw_range_end,
-                                   (unsigned long)offset[i].rw_smallest_extent,
-                                   (unsigned long)offset[i].rw_largest_extent,
-                                   offset[i].rw_offset);
-        }
-        /* Then print the current offsets for each process */
-        for(i = 0; i < LL_PROCESS_HIST_MAX; i++) {
-                if (process[i].rw_pid != 0)
-                        seq_printf(seq,"%3c %10d %14Lu %14Lu %17lu %17lu %14Lu",
-                                   process[i].rw_op ? 'W' : 'R',
-                                   process[i].rw_pid,
-                                   process[i].rw_range_start,
-                                   process[i].rw_last_file_pos,
-                                   (unsigned long)process[i].rw_smallest_extent,
-                                   (unsigned long)process[i].rw_largest_extent,
-                                   process[i].rw_offset);
-        }
+
+       /* We stored the discontiguous offsets here; print them first */
+       for (i = 0; i < LL_OFFSET_HIST_MAX; i++) {
+               if (offset[i].rw_pid != 0)
+                       seq_printf(seq,
+                                  "%3c %10d %14Lu %14Lu %17lu %17lu %14Lu",
+                                  offset[i].rw_op == READ ? 'R' : 'W',
+                                  offset[i].rw_pid,
+                                  offset[i].rw_range_start,
+                                  offset[i].rw_range_end,
+                                  (unsigned long)offset[i].rw_smallest_extent,
+                                  (unsigned long)offset[i].rw_largest_extent,
+                                  offset[i].rw_offset);
+       }
+
+       /* Then print the current offsets for each process */
+       for (i = 0; i < LL_PROCESS_HIST_MAX; i++) {
+               if (process[i].rw_pid != 0)
+                       seq_printf(seq,
+                                  "%3c %10d %14Lu %14Lu %17lu %17lu %14Lu",
+                                  process[i].rw_op == READ ? 'R' : 'W',
+                                  process[i].rw_pid,
+                                  process[i].rw_range_start,
+                                  process[i].rw_last_file_pos,
+                                  (unsigned long)process[i].rw_smallest_extent,
+                                  (unsigned long)process[i].rw_largest_extent,
+                                  process[i].rw_offset);
+       }
        spin_unlock(&sbi->ll_process_lock);
 
        return 0;