From 3269a5e07acfadd8788294a29a45c9aa4963213c Mon Sep 17 00:00:00 2001 From: Eric Milkie Date: Wed, 19 Feb 2014 14:48:12 -0500 Subject: SERVER-8412 clean up intmax_t --- src/mongo/db/dbcommands.cpp | 4 ++-- src/mongo/db/repair_database.cpp | 10 +++++----- src/mongo/db/repl/oplog.cpp | 2 +- src/mongo/util/file.cpp | 6 +++--- src/mongo/util/file.h | 3 +-- 5 files changed, 12 insertions(+), 13 deletions(-) (limited to 'src/mongo') diff --git a/src/mongo/db/dbcommands.cpp b/src/mongo/db/dbcommands.cpp index 158c3f83df0..89e0bc84572 100644 --- a/src/mongo/db/dbcommands.cpp +++ b/src/mongo/db/dbcommands.cpp @@ -599,12 +599,12 @@ namespace mongo { vector< BSONObj > dbInfos; set seen; - boost::intmax_t totalSize = 0; + intmax_t totalSize = 0; for ( vector< string >::iterator i = dbNames.begin(); i != dbNames.end(); ++i ) { BSONObjBuilder b; b.append( "name", *i ); - boost::intmax_t size = dbSize( i->c_str() ); + intmax_t size = dbSize( i->c_str() ); b.append( "sizeOnDisk", (double) size ); totalSize += size; diff --git a/src/mongo/db/repair_database.cpp b/src/mongo/db/repair_database.cpp index df22ec051fb..bc4c8b70141 100644 --- a/src/mongo/db/repair_database.cpp +++ b/src/mongo/db/repair_database.cpp @@ -128,11 +128,11 @@ namespace mongo { _applyOpToDataFiles( database, renamer, true ); } - boost::intmax_t dbSize( const string& database ) { + intmax_t dbSize( const string& database ) { class SizeAccumulator : public FileOp { public: SizeAccumulator() : totalSize_( 0 ) {} - boost::intmax_t size() const { + intmax_t size() const { return totalSize_; } private: @@ -145,7 +145,7 @@ namespace mongo { virtual const char *op() const { return "checking size"; } - boost::intmax_t totalSize_; + intmax_t totalSize_; }; SizeAccumulator sa; _applyOpToDataFiles( database, sa ); @@ -287,8 +287,8 @@ namespace mongo { getDur().syncDataAndTruncateJournal(); // Must be done before and after repair - boost::intmax_t totalSize = dbSize( dbName ); - boost::intmax_t freeSize = File::freeSpace(storageGlobalParams.repairpath); + intmax_t totalSize = dbSize( dbName ); + intmax_t freeSize = File::freeSpace(storageGlobalParams.repairpath); if ( freeSize > -1 && freeSize < totalSize ) { return Status( ErrorCodes::OutOfDiskSpace, diff --git a/src/mongo/db/repl/oplog.cpp b/src/mongo/db/repl/oplog.cpp index 6b7a4d2d96f..4efeba07f0d 100644 --- a/src/mongo/db/repl/oplog.cpp +++ b/src/mongo/db/repl/oplog.cpp @@ -431,7 +431,7 @@ namespace mongo { sz = (256-64) * 1024 * 1024; #else sz = 990.0 * 1024 * 1024; - boost::intmax_t free = + intmax_t free = File::freeSpace(storageGlobalParams.dbpath); //-1 if call not supported. double fivePct = free * 0.05; if ( fivePct > sz ) diff --git a/src/mongo/util/file.cpp b/src/mongo/util/file.cpp index 4ca4d305fdb..2a6022e80d0 100644 --- a/src/mongo/util/file.cpp +++ b/src/mongo/util/file.cpp @@ -49,7 +49,7 @@ namespace mongo { _handle = INVALID_HANDLE_VALUE; } - boost::intmax_t File::freeSpace(const std::string& path) { + intmax_t File::freeSpace(const std::string& path) { ULARGE_INTEGER avail; if (GetDiskFreeSpaceExW(toWideString(path.c_str()).c_str(), &avail, // bytes available to caller @@ -187,10 +187,10 @@ namespace mongo { _fd = -1; } - boost::intmax_t File::freeSpace(const std::string& path) { + intmax_t File::freeSpace(const std::string& path) { struct statvfs info; if (statvfs(path.c_str(), &info) == 0) { - return static_cast(info.f_bavail) * info.f_frsize; + return static_cast(info.f_bavail) * info.f_frsize; } log() << "In File::freeSpace(), statvfs for '" << path << "' failed with " << errnoWithDescription() << std::endl; diff --git a/src/mongo/util/file.h b/src/mongo/util/file.h index 074b5f4d87a..f3dffc88d1f 100644 --- a/src/mongo/util/file.h +++ b/src/mongo/util/file.h @@ -17,7 +17,6 @@ #pragma once -#include #include #include "mongo/platform/basic.h" @@ -44,7 +43,7 @@ namespace mongo { void truncate(fileofs size); void write(fileofs o, const char* data, unsigned len); - static boost::intmax_t freeSpace(const std::string& path); + static intmax_t freeSpace(const std::string& path); private: bool _bad; -- cgit v1.2.1