Bug 816642 - Avoid fragmenting cache files, r=jduell
☠☠ backed out by 6d1462fbb539 ☠ ☠
authorMichal Novotny <michal.novotny@gmail.com>
Fri, 30 Nov 2012 18:56:25 +0100
changeset 114616 944c97dabc33f06406bdb3f0cfb0f4dd89388dce
parent 114615 133c704dbcc68e7f573d3664f4e2107e2e4f2090
child 114617 9252522aab902d063792370a7be66a538391f361
push id23926
push userryanvm@gmail.com
push dateSat, 01 Dec 2012 15:27:30 +0000
treeherdermozilla-central@ecdf0e332f17 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjduell
bugs816642
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 816642 - Avoid fragmenting cache files, r=jduell
netwerk/cache/nsDiskCacheBlockFile.cpp
--- a/netwerk/cache/nsDiskCacheBlockFile.cpp
+++ b/netwerk/cache/nsDiskCacheBlockFile.cpp
@@ -381,18 +381,17 @@ nsDiskCacheBlockFile::Write(int32_t offs
         } else {
             // Grow quickly between 1MB to 20MB
             if (mFileSize)
                 while(mFileSize < upTo)
                     mFileSize *= 2;
             mFileSize = clamped(mFileSize, minPreallocate, maxPreallocate);
         }
         mFileSize = NS_MIN(mFileSize, maxFileSize);
-        //  Appears to cause bug 617123?  Disabled for now.
-        //mozilla::fallocate(mFD, mFileSize);
+        mozilla::fallocate(mFD, mFileSize);
     }
     if (PR_Seek(mFD, offset, PR_SEEK_SET) != offset)
         return false;
     return PR_Write(mFD, buf, amount) == amount;
 }
 
 size_t
 nsDiskCacheBlockFile::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf)