Whamcloud - gitweb
LU-7861 osp: replace the hot spinlock with atomic trackers
[fs/lustre-release.git] / lustre / osp / lproc_osp.c
index 6dc9287..58fcb2d 100644 (file)
@@ -113,7 +113,7 @@ static int osp_syn_in_flight_seq_show(struct seq_file *m, void *data)
        if (osp == NULL)
                return -EINVAL;
 
-       seq_printf(m, "%u\n", osp->opd_syn_rpc_in_flight);
+       seq_printf(m, "%u\n", atomic_read(&osp->opd_syn_rpc_in_flight));
        return 0;
 }
 LPROC_SEQ_FOPS_RO(osp_syn_in_flight);
@@ -134,7 +134,7 @@ static int osp_syn_in_prog_seq_show(struct seq_file *m, void *data)
        if (osp == NULL)
                return -EINVAL;
 
-       seq_printf(m, "%u\n", osp->opd_syn_rpc_in_progress);
+       seq_printf(m, "%u\n", atomic_read(&osp->opd_syn_rpc_in_progress));
        return 0;
 }
 LPROC_SEQ_FOPS_RO(osp_syn_in_prog);
@@ -155,7 +155,7 @@ static int osp_syn_changes_seq_show(struct seq_file *m, void *data)
        if (osp == NULL)
                return -EINVAL;
 
-       seq_printf(m, "%lu\n", osp->opd_syn_changes);
+       seq_printf(m, "%u\n", atomic_read(&osp->opd_syn_changes));
        return 0;
 }
 
@@ -639,8 +639,9 @@ static int osp_destroys_in_flight_seq_show(struct seq_file *m, void *data)
        if (osp == NULL)
                return -EINVAL;
 
-       seq_printf(m, "%lu\n",
-                  osp->opd_syn_rpc_in_progress + osp->opd_syn_changes);
+       seq_printf(m, "%u\n",
+                  atomic_read(&osp->opd_syn_rpc_in_progress) +
+                  atomic_read(&osp->opd_syn_changes));
        return 0;
 }
 LPROC_SEQ_FOPS_RO(osp_destroys_in_flight);