summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2014-10-30 16:45:36 -0400
committerRamon Fernandez <ramon.fernandez@mongodb.com>2015-03-12 17:56:06 -0400
commitf6debcc8c2884c60a1d694e35089c2950cccb946 (patch)
tree43e1d752184a552bbc20c17f070f1623b60b1666
parent6b06804ca2a2d0bb292eb58510eb0f2808e879a4 (diff)
downloadmongo-f6debcc8c2884c60a1d694e35089c2950cccb946.tar.gz
SERVER-15907 Use ftuncate rather than fallocate on linux tmpfs
This means we don't use any ram for unused portions of files. (cherry picked from commit a2c27b34b811d73a42ddecab20e9f8cb6348a1a3)
-rw-r--r--src/mongo/util/file_allocator.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mongo/util/file_allocator.cpp b/src/mongo/util/file_allocator.cpp
index b8fb7bf78d9..f476ed25a9a 100644
--- a/src/mongo/util/file_allocator.cpp
+++ b/src/mongo/util/file_allocator.cpp
@@ -162,8 +162,11 @@ namespace mongo {
#if defined(__linux__)
// these are from <linux/magic.h> but that isn't available on all systems
# define NFS_SUPER_MAGIC 0x6969
+# define TMPFS_MAGIC 0x01021994
- return (fs_stats.f_type == NFS_SUPER_MAGIC);
+ return (fs_stats.f_type == NFS_SUPER_MAGIC)
+ || (fs_stats.f_type == TMPFS_MAGIC)
+ ;
#elif defined(__freebsd__)