From: Igor Fedotov Date: Fri, 23 Nov 2018 11:57:52 +0000 (+0300) Subject: os/ceph-bluestore-tool: unify output for bluefs-bdev-expand command. X-Git-Tag: v13.2.5~53^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c098f5fc6ee88994b7f357c987382ef72deb6769;p=ceph.git os/ceph-bluestore-tool: unify output for bluefs-bdev-expand command. This commit is specific for pre-Nautilius releases (mimic & luminous) as we don't backport main device expansion feature. Which makes this mimic/luminous commit completely different from nautilus one. Signed-off-by: Igor Fedotov --- diff --git a/src/os/bluestore/bluestore_tool.cc b/src/os/bluestore/bluestore_tool.cc index a8ad208ab1dc..c8e834356abf 100644 --- a/src/os/bluestore/bluestore_tool.cc +++ b/src/os/bluestore/bluestore_tool.cc @@ -493,15 +493,15 @@ int main(int argc, char **argv) } else if (action == "bluefs-bdev-expand") { BlueFS *fs = open_bluefs(cct.get(), path, devs); - cout << "start:" << std::endl; fs->dump_block_extents(cout); + cout << "Expanding..." << std::endl; for (int devid : { BlueFS::BDEV_WAL, BlueFS::BDEV_DB }) { if (!fs->is_device(devid)) { continue; } if (!fs->is_device_expandable(devid)) { cout << devid - << " : can't be expanded." + << " : can't be expanded. Bypassing..." << std::endl; continue; } @@ -511,12 +511,14 @@ int main(int argc, char **argv) uint64_t end = before.range_end(); uint64_t size = fs->get_block_device_size(devid); if (end < size) { - cout << "expanding dev " << devid << " from 0x" << std::hex + cout << devid + <<" : expanding " << " from 0x" << std::hex << end << " to 0x" << size << std::dec << std::endl; fs->add_block_extent(devid, end, size-end); const char* path = find_device_path(devid, cct.get(), devs); if (path == nullptr) { - cerr << "Can't find device path for dev " << devid << std::endl; + cerr << devid + <<": can't find device path " << std::endl; continue; } bluestore_bdev_label_t label; @@ -533,8 +535,9 @@ int main(int argc, char **argv) << cpp_strerror(r) << std::endl; continue; } - cout << "dev " << devid << " size label updated to " - << size << std::endl; + cout << devid + <<" : size label updated to " << size + << std::endl; } } delete fs;