diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2020-04-21 10:24:48 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2020-04-21 10:24:48 +0000 |
commit | 5e1798ade1c5590289982770ebfc66f81500c84c (patch) | |
tree | b8d4469a8fd55d765a1e7cd7d6363ceba63e92fb /storage | |
parent | 693c666d37d1edb50759dde4d06c4833ebb00386 (diff) |
GC unused code.
Diffstat (limited to 'storage')
-rw-r--r-- | storage/src/vespa/storage/tools/CMakeLists.txt | 7 | ||||
-rw-r--r-- | storage/src/vespa/storage/tools/statfs.cpp | 67 |
2 files changed, 0 insertions, 74 deletions
diff --git a/storage/src/vespa/storage/tools/CMakeLists.txt b/storage/src/vespa/storage/tools/CMakeLists.txt index 3a00573cdd8..828f5f35f47 100644 --- a/storage/src/vespa/storage/tools/CMakeLists.txt +++ b/storage/src/vespa/storage/tools/CMakeLists.txt @@ -31,10 +31,3 @@ vespa_add_executable(storage_storage-cmd_app AFTER storage_storageconfig ) -vespa_add_executable(storage_statfs_app - SOURCES - statfs.cpp - DEPENDS - AFTER - storage_storageconfig -) diff --git a/storage/src/vespa/storage/tools/statfs.cpp b/storage/src/vespa/storage/tools/statfs.cpp deleted file mode 100644 index cc90b77e91d..00000000000 --- a/storage/src/vespa/storage/tools/statfs.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -#include <iostream> -#include <sys/vfs.h> -#include <vespa/vespalib/util/programoptions.h> -#include <vespa/vespalib/io/fileutil.h> - -struct Options : public vespalib::ProgramOptions { - bool showSyntaxPage; - std::string _filename; - - Options(int argc, const char* const* argv); - ~Options(); -}; - -Options::Options(int argc, const char* const* argv) - : vespalib::ProgramOptions(argc, argv), - showSyntaxPage(false) -{ - setSyntaxMessage( - "Utility program for checking output of statfs." - ); - addOption("h help", showSyntaxPage, false, - "Shows this help page"); - addArgument("file", _filename, "File to use when calling statfs()"); -} -Options::~Options() {} - - -int main(int argc, char** argv) { - Options o(argc, argv); - o.parse(); - - if (o.showSyntaxPage) { - o.writeSyntaxPage(std::cerr); - exit(1); - } - - if (!vespalib::fileExists(o._filename)) { - std::cerr << "Cannot use statfs on non-existing file '" << o._filename - << "'.\n"; - exit(1); - } - - struct statfs buf; - if (statfs(o._filename.c_str(), &buf) == 0) { - std::cerr << "f_type " << buf.f_type << "\n" - << "f_bsize " << buf.f_bsize << "\n" - << "f_blocks " << buf.f_blocks << "\n" - << "f_bfree " << buf.f_bfree << "\n" - << "f_bavail " << buf.f_bavail << "\n" - << "f_files " << buf.f_files << "\n" - << "f_ffree " << buf.f_ffree << "\n" - << "f_namelen " << buf.f_namelen << "\n"; - - uint64_t available = buf.f_bavail; - uint64_t total = buf.f_blocks; - available *= buf.f_bsize; - total *= buf.f_bsize; - - std::cerr << "\nAvailable " << available << " of total " << total - << "\n" << (100.0 * (total - available) / (double) total) - << " % full\n"; - } else { - std::cerr << "statfs() failed: " << errno << "\n"; - } -} |