struct lov_desc *desc;
__u64 val;
int rc;
-
+
LASSERT(dev != NULL);
desc = &dev->u.lov.desc;
rc = lprocfs_write_u64_helper(buffer, count, &val);
struct lov_desc *desc;
__u64 val;
int rc;
-
+
LASSERT(dev != NULL);
desc = &dev->u.lov.desc;
rc = lprocfs_write_u64_helper(buffer, count, &val);
struct obd_device *dev = (struct obd_device *)data;
struct lov_desc *desc;
int val, rc;
-
+
LASSERT(dev != NULL);
desc = &dev->u.lov.desc;
rc = lprocfs_write_helper(buffer, count, &val);
struct obd_device *dev = (struct obd_device *)data;
struct lov_desc *desc;
int val, rc;
-
+
LASSERT(dev != NULL);
desc = &dev->u.lov.desc;
rc = lprocfs_write_helper(buffer, count, &val);
return snprintf(page, count, "%s\n", lov->desc.ld_uuid.uuid);
}
-/* free priority (0-256): how badly user wants to choose empty osts */
+/* free priority (0-255): how badly user wants to choose empty osts */
static int lov_rd_qos_priofree(char *page, char **start, off_t off, int count,
int *eof, void *data)
{
LASSERT(dev != NULL);
lov = &dev->u.lov;
*eof = 1;
- /* Round the conversion; see below */
- return snprintf(page, count, "%d%%\n",
- (lov->lov_qos.lq_prio_free * 100 + 128) >> 8);
+ return snprintf(page, count, "%d%%\n",
+ (lov->lov_qos.lq_prio_free * 100 + 255) >> 8);
}
static int lov_wr_qos_priofree(struct file *file, const char *buffer,
if (rc)
return rc;
- if (val > 100 || val < 0)
+ if (val > 100)
return -EINVAL;
- /* We're converting a 0-100% range to 0-256.
- * Add some rounding so that when we convert back to %
- * for printout below, we end up with the original value */
- lov->lov_qos.lq_prio_free = ((val << 8) + 50) / 100;
+ lov->lov_qos.lq_prio_free = (val << 8) / 100;
lov->lov_qos.lq_dirty = 1;
lov->lov_qos.lq_reset = 1;
return count;
lov = &dev->u.lov;
*eof = 1;
return snprintf(page, count, "%d%%\n",
- ((lov->lov_qos.lq_threshold_rr * 100) + 128) >> 8);
+ (lov->lov_qos.lq_threshold_rr * 100 + 255) >> 8);
}
static int lov_wr_qos_thresholdrr(struct file *file, const char *buffer,
if (val > 100 || val < 0)
return -EINVAL;
- lov->lov_qos.lq_threshold_rr = ((val << 8) + 50) / 100;
+ lov->lov_qos.lq_threshold_rr = (val << 8) / 100;
lov->lov_qos.lq_dirty = 1;
return count;
}
static int lov_tgt_seq_show(struct seq_file *p, void *v)
{
struct lov_tgt_desc *tgt = v;
- return seq_printf(p, "%d: %s %sACTIVE\n", tgt->ltd_index,
- obd_uuid2str(&tgt->ltd_uuid),
+ return seq_printf(p, "%d: %s %sACTIVE\n", tgt->ltd_index,
+ obd_uuid2str(&tgt->ltd_uuid),
tgt->ltd_active ? "" : "IN");
}