Skip to content

Commit

Permalink
gfs2: A minor "sbstats" cleanup
Browse files Browse the repository at this point in the history
It seems cleaner to avoid the temporary value here.

Signed-off-by: Andreas Gruenbacher <[email protected]>
Signed-off-by: Bob Peterson <[email protected]>
  • Loading branch information
Andreas Gruenbacher authored and AstralBob committed Sep 3, 2015
1 parent c9ea8c8 commit 8f7e0a8
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions fs/gfs2/glock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1727,7 +1727,6 @@ static int gfs2_sbstats_seq_show(struct seq_file *seq, void *iter_ptr)
loff_t pos = *(loff_t *)iter_ptr;
unsigned index = pos >> 3;
unsigned subindex = pos & 0x07;
u64 value;
int i;

if (index == 0 && subindex != 0)
Expand All @@ -1738,12 +1737,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;
Expand Down

0 comments on commit 8f7e0a8

Please sign in to comment.