When writing to
/proc/fs/lustre/lov/<fsname>-mdtlov/{qos_prio_free,qos_threshold_rr},
the values read back are often one less than the values written.
This happens because internally the value is stored as a number from
0-255 but accessed by the user with 0-100. Integer truncation in the
storage and retrieval stages causes this to often show lower. Adding
255 to an internal step causes the bit-shift to "round up".
Signed-off-by: Matt Ezell <ezell@nics.utk.edu>
Change-Id: I3bb1bb4b048d40eb3882c7cb22799320f90496c7
Reviewed-on: http://review.whamcloud.com/1522
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lov = &dev->u.lov;
*eof = 1;
return snprintf(page, count, "%d%%\n",
- (lov->lov_qos.lq_prio_free * 100) >> 8);
+ (lov->lov_qos.lq_prio_free * 100 + 255) >> 8);
}
static int lov_wr_qos_priofree(struct file *file, const char *buffer,
lov = &dev->u.lov;
*eof = 1;
return snprintf(page, count, "%d%%\n",
- (lov->lov_qos.lq_threshold_rr * 100) >> 8);
+ (lov->lov_qos.lq_threshold_rr * 100 + 255) >> 8);
}
static int lov_wr_qos_thresholdrr(struct file *file, const char *buffer,