Whamcloud - gitweb
LU-10171 lmv: avoid gratuitous 64-bit modulus
[fs/lustre-release.git] / lustre / mdc / lproc_mdc.c
index e2efa79..1530dd1 100644 (file)
@@ -222,9 +222,10 @@ static ssize_t contention_seconds_store(struct kobject *kobj,
 }
 LUSTRE_RW_ATTR(contention_seconds);
 
+LUSTRE_ATTR(mds_conn_uuid, 0444, conn_uuid_show, NULL);
 LUSTRE_RO_ATTR(conn_uuid);
 
-LUSTRE_WO_ATTR(ping);
+LUSTRE_RW_ATTR(ping);
 
 static int mdc_cached_mb_seq_show(struct seq_file *m, void *v)
 {
@@ -325,7 +326,6 @@ static ssize_t mdc_rpc_stats_seq_write(struct file *file,
        return len;
 }
 
-#define pct(a, b) (b ? a * 100 / b : 0)
 static int mdc_rpc_stats_seq_show(struct seq_file *seq, void *v)
 {
        struct obd_device *dev = seq->private;
@@ -361,7 +361,7 @@ static int mdc_rpc_stats_seq_show(struct seq_file *seq, void *v)
 
                read_cum += r;
                write_cum += w;
-               seq_printf(seq, "%d:\t\t%10lu %3lu %3lu   | %10lu %3lu %3lu\n",
+               seq_printf(seq, "%d:\t\t%10lu %3u %3u   | %10lu %3u %3u\n",
                           1 << i, r, pct(r, read_tot),
                           pct(read_cum, read_tot), w,
                           pct(w, write_tot),
@@ -385,7 +385,7 @@ static int mdc_rpc_stats_seq_show(struct seq_file *seq, void *v)
 
                read_cum += r;
                write_cum += w;
-               seq_printf(seq, "%d:\t\t%10lu %3lu %3lu   | %10lu %3lu %3lu\n",
+               seq_printf(seq, "%d:\t\t%10lu %3u %3u   | %10lu %3u %3u\n",
                           i, r, pct(r, read_tot), pct(read_cum, read_tot), w,
                           pct(w, write_tot), pct(write_cum, write_tot));
                if (read_cum == read_tot && write_cum == write_tot)
@@ -407,7 +407,7 @@ static int mdc_rpc_stats_seq_show(struct seq_file *seq, void *v)
 
                read_cum += r;
                write_cum += w;
-               seq_printf(seq, "%d:\t\t%10lu %3lu %3lu   | %10lu %3lu %3lu\n",
+               seq_printf(seq, "%d:\t\t%10lu %3u %3u   | %10lu %3u %3u\n",
                           (i == 0) ? 0 : 1 << (i - 1),
                           r, pct(r, read_tot), pct(read_cum, read_tot),
                           w, pct(w, write_tot), pct(write_cum, write_tot));
@@ -418,7 +418,6 @@ static int mdc_rpc_stats_seq_show(struct seq_file *seq, void *v)
 
        return 0;
 }
-#undef pct
 LPROC_SEQ_FOPS(mdc_rpc_stats);
 
 static int mdc_stats_seq_show(struct seq_file *seq, void *v)
@@ -526,6 +525,7 @@ static struct attribute *mdc_attrs[] = {
        &lustre_attr_max_rpcs_in_flight.attr,
        &lustre_attr_max_mod_rpcs_in_flight.attr,
        &lustre_attr_contention_seconds.attr,
+       &lustre_attr_mds_conn_uuid.attr,
        &lustre_attr_conn_uuid.attr,
        &lustre_attr_ping.attr,
        NULL,