summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/mmap_v1/extent.cpp
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2015-06-20 00:22:50 -0400
committerMark Benvenuto <mark.benvenuto@mongodb.com>2015-06-20 10:56:02 -0400
commit9c2ed42daa8fbbef4a919c21ec564e2db55e8d60 (patch)
tree3814f79c10d7b490948d8cb7b112ac1dd41ceff1 /src/mongo/db/storage/mmap_v1/extent.cpp
parent01965cf52bce6976637ecb8f4a622aeb05ab256a (diff)
downloadmongo-9c2ed42daa8fbbef4a919c21ec564e2db55e8d60.tar.gz
SERVER-18579: Clang-Format - reformat code, no comment reflow
Diffstat (limited to 'src/mongo/db/storage/mmap_v1/extent.cpp')
-rw-r--r--src/mongo/db/storage/mmap_v1/extent.cpp124
1 files changed, 56 insertions, 68 deletions
diff --git a/src/mongo/db/storage/mmap_v1/extent.cpp b/src/mongo/db/storage/mmap_v1/extent.cpp
index 905e4d28a9e..7f6d41cde80 100644
--- a/src/mongo/db/storage/mmap_v1/extent.cpp
+++ b/src/mongo/db/storage/mmap_v1/extent.cpp
@@ -36,82 +36,70 @@
namespace mongo {
- using std::iostream;
- using std::string;
- using std::vector;
+using std::iostream;
+using std::string;
+using std::vector;
- BOOST_STATIC_ASSERT( sizeof(Extent)-4 == 48+128 );
+BOOST_STATIC_ASSERT(sizeof(Extent) - 4 == 48 + 128);
- BSONObj Extent::dump() const {
- return BSON( "loc" << myLoc.toString()
- << "xnext" << xnext.toString()
- << "xprev" << xprev.toString()
- << "nsdiag" << nsDiagnostic.toString()
- << "size" << length
- << "firstRecord"
- << firstRecord.toString()
- << "lastRecord" << lastRecord.toString() );
- }
+BSONObj Extent::dump() const {
+ return BSON("loc" << myLoc.toString() << "xnext" << xnext.toString() << "xprev"
+ << xprev.toString() << "nsdiag" << nsDiagnostic.toString() << "size" << length
+ << "firstRecord" << firstRecord.toString() << "lastRecord"
+ << lastRecord.toString());
+}
- void Extent::dump(iostream& s) const {
- s << " loc:" << myLoc.toString()
- << " xnext:" << xnext.toString()
- << " xprev:" << xprev.toString() << '\n';
- s << " nsdiag:" << nsDiagnostic.toString() << '\n';
- s << " size:" << length
- << " firstRecord:" << firstRecord.toString()
- << " lastRecord:" << lastRecord.toString() << '\n';
- }
+void Extent::dump(iostream& s) const {
+ s << " loc:" << myLoc.toString() << " xnext:" << xnext.toString()
+ << " xprev:" << xprev.toString() << '\n';
+ s << " nsdiag:" << nsDiagnostic.toString() << '\n';
+ s << " size:" << length << " firstRecord:" << firstRecord.toString()
+ << " lastRecord:" << lastRecord.toString() << '\n';
+}
- bool Extent::validates(const DiskLoc diskLoc, vector<string>* errors) const {
- bool extentOk = true;
- if (magic != extentSignature) {
- if (errors) {
- StringBuilder sb;
- sb << "bad extent signature " << integerToHex(magic)
- << " in extent " << diskLoc.toString();
- errors->push_back( sb.str() );
- }
- extentOk = false;
+bool Extent::validates(const DiskLoc diskLoc, vector<string>* errors) const {
+ bool extentOk = true;
+ if (magic != extentSignature) {
+ if (errors) {
+ StringBuilder sb;
+ sb << "bad extent signature " << integerToHex(magic) << " in extent "
+ << diskLoc.toString();
+ errors->push_back(sb.str());
}
- if (myLoc != diskLoc) {
- if (errors) {
- StringBuilder sb;
- sb << "extent " << diskLoc.toString()
- << " self-pointer is " << myLoc.toString();
- errors->push_back( sb.str() );
- }
- extentOk = false;
+ extentOk = false;
+ }
+ if (myLoc != diskLoc) {
+ if (errors) {
+ StringBuilder sb;
+ sb << "extent " << diskLoc.toString() << " self-pointer is " << myLoc.toString();
+ errors->push_back(sb.str());
}
- if (firstRecord.isNull() != lastRecord.isNull()) {
- if (errors) {
- StringBuilder sb;
- if (firstRecord.isNull()) {
- sb << "in extent " << diskLoc.toString()
- << ", firstRecord is null but lastRecord is "
- << lastRecord.toString();
- }
- else {
- sb << "in extent " << diskLoc.toString()
- << ", firstRecord is " << firstRecord.toString()
- << " but lastRecord is null";
- }
- errors->push_back( sb.str() );
+ extentOk = false;
+ }
+ if (firstRecord.isNull() != lastRecord.isNull()) {
+ if (errors) {
+ StringBuilder sb;
+ if (firstRecord.isNull()) {
+ sb << "in extent " << diskLoc.toString()
+ << ", firstRecord is null but lastRecord is " << lastRecord.toString();
+ } else {
+ sb << "in extent " << diskLoc.toString() << ", firstRecord is "
+ << firstRecord.toString() << " but lastRecord is null";
}
- extentOk = false;
+ errors->push_back(sb.str());
}
- static const int minSize = 0x1000;
- if (length < minSize) {
- if (errors) {
- StringBuilder sb;
- sb << "length of extent " << diskLoc.toString()
- << " is " << length
- << ", which is less than minimum length of " << minSize;
- errors->push_back( sb.str() );
- }
- extentOk = false;
+ extentOk = false;
+ }
+ static const int minSize = 0x1000;
+ if (length < minSize) {
+ if (errors) {
+ StringBuilder sb;
+ sb << "length of extent " << diskLoc.toString() << " is " << length
+ << ", which is less than minimum length of " << minSize;
+ errors->push_back(sb.str());
}
- return extentOk;
+ extentOk = false;
}
-
+ return extentOk;
+}
}