summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2011-10-07 22:02:49 +0200
committerSage Weil <sage@newdream.net>2011-10-07 22:02:49 +0200
commit8ff1cbb5c91432cbbd14cb58cb2272dce499f404 (patch)
treebdef1124d9d8cc0edd111ab7d905a5cde7d47815
parentcrush: try _all_ bucket items when doing exhaustive search (diff)
downloadceph-8ff1cbb5c91432cbbd14cb58cb2272dce499f404.tar.xz
ceph-8ff1cbb5c91432cbbd14cb58cb2272dce499f404.zip
crushtool: add --force N
Signed-off-by: Sage Weil <sage@newdream.net>
-rw-r--r--src/crushtool.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/crushtool.cc b/src/crushtool.cc
index 63feab4aeff..ae4ce719d18 100644
--- a/src/crushtool.cc
+++ b/src/crushtool.cc
@@ -833,6 +833,7 @@ int main(int argc, const char **argv)
int num_rep = 2;
int min_x = 0, max_x = 10000-1;
int min_rule = 0, max_rule = 1000;
+ int force = -1;
map<int, int> device_weight;
vector<const char *> empty_args; // we use -c, don't confuse the generic arg parsing
@@ -918,6 +919,11 @@ int main(int argc, const char **argv)
exit(EXIT_FAILURE);
}
max_x = min_x;
+ } else if (ceph_argparse_withint(args, i, &force, &err, "--force", (char*)NULL)) {
+ if (!err.str().empty()) {
+ cerr << err.str() << std::endl;
+ exit(EXIT_FAILURE);
+ }
} else if (ceph_argparse_withint(args, i, &max_rule, &err, "--max_rule", (char*)NULL)) {
if (!err.str().empty()) {
cerr << err.str() << std::endl;
@@ -1222,7 +1228,7 @@ int main(int argc, const char **argv)
map<int,int> sizes;
for (int x = min_x; x <= max_x; x++) {
vector<int> out;
- crush.do_rule(r, x, out, num_rep, -1, weight);
+ crush.do_rule(r, x, out, num_rep, force, weight);
if (verbose)
cout << "rule " << r << " x " << x << " " << out << std::endl;
for (unsigned i = 0; i < out.size(); i++)