From f6debcc8c2884c60a1d694e35089c2950cccb946 Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Thu, 30 Oct 2014 16:45:36 -0400 Subject: 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) --- src/mongo/util/file_allocator.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 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__) -- cgit v1.2.1