Since kstrtol needs a null-terminor string so we
back to use simple_strtol in prealloc patches.
Lustre-change: https://review.whamcloud.com/28553
Lustre-commit:
685ef61f0fb9849e3f7a32c4ebf2980d3300afb0
Signed-off-by: Yang Sheng <yang.sheng@intel.com>
Change-Id: I331308d830fbeef9c00156bb8c14b43651d66420
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Alexey Lyashkov <c17817@cray.com>
Signed-off-by: Minh Diep <minh.diep@intel.com>
Reviewed-on: https://review.whamcloud.com/29733
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
/*
* The routine scans buddy structures (not bitmap!) from given order
* to max order and tries to find big enough chunk to satisfy the req
-@@ -2301,6 +2321,93 @@ static const struct seq_operations ext4_
+@@ -2301,6 +2321,90 @@ static const struct seq_operations ext4_
.show = ext4_mb_seq_groups_show,
};
+ cur = str;
+ end = str + cnt;
+ while (cur < end) {
-+ int rc;
+ while ((cur < end) && (*cur == ' '))
+ cur++;
-+ rc = kstrtol(cur, 0, &value);
-+ if (rc != 0)
-+ return -EINVAL;
++ value = simple_strtol(cur, &cur, 0);
+ if (value == 0)
+ break;
+ if (value <= prev)
/*
* The routine scans buddy structures (not bitmap!) from given order
* to max order and tries to find big enough chunk to satisfy the req
-@@ -2301,6 +2321,93 @@ static const struct seq_operations ext4_
+@@ -2301,6 +2321,90 @@ static const struct seq_operations ext4_
.show = ext4_mb_seq_groups_show,
};
+ cur = str;
+ end = str + cnt;
+ while (cur < end) {
-+ int rc;
+ while ((cur < end) && (*cur == ' '))
+ cur++;
-+ rc = kstrtol(cur, 0, &value);
-+ if (rc != 0)
-+ return -EINVAL;
++ value = simple_strtol(cur, &cur, 0);
+ if (value == 0)
+ break;
+ if (value <= prev)
/*
* The routine scans buddy structures (not bitmap!) from given order
* to max order and tries to find big enough chunk to satisfy the req
-@@ -2285,6 +2304,93 @@ static const struct seq_operations ext4_
+@@ -2285,6 +2304,90 @@ static const struct seq_operations ext4_
.show = ext4_mb_seq_groups_show,
};
+ cur = str;
+ end = str + cnt;
+ while (cur < end) {
-+ int rc;
+ while ((cur < end) && (*cur == ' '))
+ cur++;
-+ rc = kstrtol(cur, 0, &value);
-+ if (rc != 0)
-+ return -EINVAL;
++ value = simple_strtol(cur, &cur, 0);
+ if (value == 0)
+ break;
+ if (value <= prev)
/*
* The routine scans buddy structures (not bitmap!) from given order
* to max order and tries to find big enough chunk to satisfy the req
-@@ -2263,6 +2282,91 @@ static const struct seq_operations ext4_
+@@ -2263,6 +2282,88 @@ static const struct seq_operations ext4_
.show = ext4_mb_seq_groups_show,
};
+ cur = str;
+ end = str + cnt;
+ while (cur < end) {
-+ int rc;
+ while ((cur < end) && (*cur == ' '))
+ cur++;
-+ rc = kstrtol(cur, 0, &value);
-+ if (rc != 0)
-+ return -EINVAL;
++ value = simple_strtol(cur, &cur, 0);
+ if (value == 0)
+ break;
+ if (value <= prev)