Skip to content

Commit

Permalink
Merge pull request #6824 from Sandy4999/wip-crushtool-build
Browse files Browse the repository at this point in the history
crushtool: set type 0 name "device" for --build option

Reviewed-by: Sage Weil <sage@redhat.com>
  • Loading branch information
liewegas committed Dec 31, 2015
2 parents d5b9767 + 4269263 commit a67f873
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/crush/CrushCompiler.cc
Expand Up @@ -215,7 +215,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 @@ -623,6 +623,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

0 comments on commit a67f873

Please sign in to comment.