Whamcloud - gitweb
Revert "b=17471 change conf_param syntax to match set_param"
[fs/lustre-release.git] / lustre / lov / lproc_lov.c
index 44a35cd..d9d3d91 100644 (file)
@@ -62,7 +62,7 @@ static int lov_wr_stripesize(struct file *file, const char *buffer,
         struct lov_desc *desc;
         __u64 val;
         int rc;
-
+        
         LASSERT(dev != NULL);
         desc = &dev->u.lov.desc;
         rc = lprocfs_write_u64_helper(buffer, count, &val);
@@ -93,7 +93,7 @@ static int lov_wr_stripeoffset(struct file *file, const char *buffer,
         struct lov_desc *desc;
         __u64 val;
         int rc;
-
+        
         LASSERT(dev != NULL);
         desc = &dev->u.lov.desc;
         rc = lprocfs_write_u64_helper(buffer, count, &val);
@@ -122,7 +122,7 @@ static int lov_wr_stripetype(struct file *file, const char *buffer,
         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);
@@ -153,7 +153,7 @@ static int lov_wr_stripecount(struct file *file, const char *buffer,
         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);
@@ -202,7 +202,7 @@ static int lov_rd_desc_uuid(char *page, char **start, off_t off, int count,
         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)
 {
@@ -212,9 +212,8 @@ static int lov_rd_qos_priofree(char *page, char **start, off_t off, int count,
         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) >> 8);
 }
 
 static int lov_wr_qos_priofree(struct file *file, const char *buffer,
@@ -230,12 +229,9 @@ 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;
@@ -251,7 +247,7 @@ static int lov_rd_qos_thresholdrr(char *page, char **start, off_t off,
         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) >> 8);
 }
 
 static int lov_wr_qos_thresholdrr(struct file *file, const char *buffer,
@@ -270,7 +266,7 @@ 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;
 }
@@ -338,8 +334,8 @@ static void *lov_tgt_seq_next(struct seq_file *p, void *v, loff_t *pos)
 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");
 }