staging/lustre/llite: use READ, WRITE around ll_rw_stats_tally()
authorJohn L. Hammond <john.hammond@intel.com>
Mon, 22 Jul 2013 16:06:24 +0000 (00:06 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Jul 2013 19:37:40 +0000 (12:37 -0700)
In vvp_io_write_start() the stats function ll_rw_stats_tally() was
incorrectly called with a rw argument of 0. Correct this and use the
macros READ and WRITE in and around ll_rw_stats_tally() for clarity.

Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3384
Lustre-change: http://review.whamcloud.com/6447
Signed-off-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/llite/lproc_llite.c
drivers/staging/lustre/lustre/llite/vvp_io.c

index 5c7368c358a0f1aa434ad6d7e272f7d80d9c7bc8..a7b12fdd76b142ffad670495899b98f5ba306aae 100644 (file)
@@ -1303,8 +1303,9 @@ static int ll_rw_offset_stats_seq_show(struct seq_file *seq, void *v)
        /* 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',
+                       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,
@@ -1315,8 +1316,9 @@ static int ll_rw_offset_stats_seq_show(struct seq_file *seq, void *v)
        /* 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',
+                       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,
index bbd6351e1f556095152b9abc94c98a48adb7c957..20eac2fd63c3ee3b9691b12c93dc54492136c575 100644 (file)
@@ -525,7 +525,7 @@ out:
                        io->ci_continue = 0;
                io->ci_nob += result;
                ll_rw_stats_tally(ll_i2sbi(inode), current->pid,
-                                 cio->cui_fd, pos, result, 0);
+                                 cio->cui_fd, pos, result, READ);
                result = 0;
        }
        return result;
@@ -580,7 +580,7 @@ static int vvp_io_write_start(const struct lu_env *env,
                        io->ci_continue = 0;
                io->ci_nob += result;
                ll_rw_stats_tally(ll_i2sbi(inode), current->pid,
-                                 cio->cui_fd, pos, result, 0);
+                                 cio->cui_fd, pos, result, WRITE);
                result = 0;
        }
        RETURN(result);