]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - mm/page-writeback.c
Merge branch 'for-4.2/writeback' of git://git.kernel.dk/linux-block
[karo-tx-linux.git] / mm / page-writeback.c
index e1514d5b4e9bf62b5ae3552fb6f35900776985d9..22cddd3e5de8433952e99438d3260ae9ff20bd8d 100644 (file)
@@ -768,7 +768,7 @@ static long long pos_ratio_polynom(unsigned long setpoint,
        long x;
 
        x = div64_s64(((s64)setpoint - (s64)dirty) << RATELIMIT_CALC_SHIFT,
-                   limit - setpoint + 1);
+                     (limit - setpoint) | 1);
        pos_ratio = x;
        pos_ratio = pos_ratio * x >> RATELIMIT_CALC_SHIFT;
        pos_ratio = pos_ratio * x >> RATELIMIT_CALC_SHIFT;
@@ -995,7 +995,7 @@ static void wb_position_ratio(struct dirty_throttle_control *dtc)
         * scale global setpoint to wb's:
         *      wb_setpoint = setpoint * wb_thresh / thresh
         */
-       x = div_u64((u64)wb_thresh << 16, dtc->thresh + 1);
+       x = div_u64((u64)wb_thresh << 16, dtc->thresh | 1);
        wb_setpoint = setpoint * (u64)x >> 16;
        /*
         * Use span=(8*write_bw) in single wb case as indicated by
@@ -1010,7 +1010,7 @@ static void wb_position_ratio(struct dirty_throttle_control *dtc)
 
        if (dtc->wb_dirty < x_intercept - span / 4) {
                pos_ratio = div64_u64(pos_ratio * (x_intercept - dtc->wb_dirty),
-                                     x_intercept - wb_setpoint + 1);
+                                     (x_intercept - wb_setpoint) | 1);
        } else
                pos_ratio /= 4;