gfs2: Make statistics unsigned, suitable for use with do_div()

None of these statistics can meaningfully be negative, and the
numerator for do_div() must have the type u64.  The generic
implementation of do_div() used on some 32-bit architectures asserts
that, resulting in a compiler error in gfs2_rgrp_congested().

Fixes: 0166b197c2 ("GFS2: Average in only non-zero round-trip times ...")

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Acked-by: Andreas Gruenbacher <agruenba@redhat.com>
This commit is contained in:
Ben Hutchings
2015-08-27 12:51:45 -05:00
committed by Bob Peterson
parent 88ffbf3e03
commit 4d207133e9
4 changed files with 24 additions and 24 deletions

View File

@@ -1862,11 +1862,11 @@ static bool gfs2_rgrp_congested(const struct gfs2_rgrpd *rgd, int loops)
const struct gfs2_glock *gl = rgd->rd_gl;
const struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
struct gfs2_lkstats *st;
s64 r_dcount, l_dcount;
s64 l_srttb, a_srttb = 0;
u64 r_dcount, l_dcount;
u64 l_srttb, a_srttb = 0;
s64 srttb_diff;
s64 sqr_diff;
s64 var;
u64 sqr_diff;
u64 var;
int cpu, nonzero = 0;
preempt_disable();