summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEric Milkie <milkie@10gen.com>2014-02-19 14:48:12 -0500
committerEric Milkie <milkie@10gen.com>2014-02-19 15:44:41 -0500
commit3269a5e07acfadd8788294a29a45c9aa4963213c (patch)
tree4c3c6d7f985368845085364e69e24d5320dd1f2d /src
parent7824eac06e596d26165744229c3121af55305534 (diff)
downloadmongo-3269a5e07acfadd8788294a29a45c9aa4963213c.tar.gz
SERVER-8412 clean up intmax_t
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/dbcommands.cpp4
-rw-r--r--src/mongo/db/repair_database.cpp10
-rw-r--r--src/mongo/db/repl/oplog.cpp2
-rw-r--r--src/mongo/util/file.cpp6
-rw-r--r--src/mongo/util/file.h3
5 files changed, 12 insertions, 13 deletions
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<string> 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<boost::intmax_t>(info.f_bavail) * info.f_frsize;
+ return static_cast<intmax_t>(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 <boost/cstdint.hpp>
#include <string>
#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;