Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crushtool: set type 0 name "device" for --build option #6824

Merged
merged 2 commits into from Dec 31, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/crush/CrushCompiler.cc
Expand Up @@ -213,7 +213,7 @@ int CrushCompiler::decompile(ostream &out)
for (int i=0; n; i++) {
const char *name = crush.get_type_name(i);
if (!name) {
if (i == 0) out << "type 0 device\n";
if (i == 0) out << "type 0 osd\n";
continue;
}
n--;
Expand Down
2 changes: 1 addition & 1 deletion src/test/cli/crushtool/arg-order-checks.t
Expand Up @@ -79,7 +79,7 @@
device 24 osd.24

# types
type 0 device
type 0 osd
type 1 node
type 2 rack
type 3 root
Expand Down
2 changes: 1 addition & 1 deletion src/test/cli/crushtool/build.t
Expand Up @@ -36,7 +36,7 @@
device 0 osd.0

# types
type 0 device
type 0 osd
type 1 root

# buckets
Expand Down
1 change: 1 addition & 0 deletions src/tools/crushtool.cc
Expand Up @@ -617,6 +617,7 @@ int main(int argc, const char **argv)
crush.set_item_name(i, "osd." + stringify(i));
}

crush.set_type_name(0, "osd");
int type = 1;
for (vector<layer_t>::iterator p = layers.begin(); p != layers.end(); ++p, type++) {
layer_t &l = *p;
Expand Down