[Cluster-devel] [PATCH] gfs2: A minor "sbstats" cleanup
Andreas Gruenbacher
andreas.gruenbacher at gmail.com
Wed Aug 26 14:19:24 UTC 2015
It seems cleaner to avoid the temporary value here.
Signed-off-by: Andreas Gruenbacher <agruenba at redhat.com>
---
fs/gfs2/glock.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 9b6e1a0..f6f51c6 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -1780,7 +1780,6 @@ static int gfs2_sbstats_seq_show(struct seq_file *seq, void *iter_ptr)
struct gfs2_sbd *sdp = gi->sdp;
unsigned index = gi->hash >> 3;
unsigned subindex = gi->hash & 0x07;
- u64 value;
int i;
if (index == 0 && subindex != 0)
@@ -1791,12 +1790,12 @@ static int gfs2_sbstats_seq_show(struct seq_file *seq, void *iter_ptr)
for_each_possible_cpu(i) {
const struct gfs2_pcpu_lkstats *lkstats = per_cpu_ptr(sdp->sd_lkstats, i);
- if (index == 0) {
- value = i;
- } else {
- value = lkstats->lkstats[index - 1].stats[subindex];
- }
- seq_printf(seq, " %15llu", (long long)value);
+
+ if (index == 0)
+ seq_printf(seq, " %15u", i);
+ else
+ seq_printf(seq, " %15llu", (unsigned long long)lkstats->
+ lkstats[index - 1].stats[subindex]);
}
seq_putc(seq, '\n');
return 0;
--
2.4.3
More information about the Cluster-devel
mailing list