Bug 795478 - Remove blizzard fudge from xpcom io code. r=bsmedberg
authorDoug Turner <dougt@dougt.org>
Mon, 01 Oct 2012 20:44:47 -0700
changeset 115156 ba388025ede9aa7321034c903fc36002ba791e87
parent 115155 c1ac587a1ccbdc793b5bcdbd7ae27ab80aa0298f
child 115157 bae96aa5f1adb4c04801db0ad7bd71569c026830
push id1708
push userakeybl@mozilla.com
push dateMon, 19 Nov 2012 21:10:21 +0000
treeherdermozilla-beta@27b14fe50103 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs795478
milestone18.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 795478 - Remove blizzard fudge from xpcom io code. r=bsmedberg
xpcom/io/nsLocalFileUnix.cpp
--- a/xpcom/io/nsLocalFileUnix.cpp
+++ b/xpcom/io/nsLocalFileUnix.cpp
@@ -1222,22 +1222,18 @@ nsLocalFile::GetDiskSpaceAvailable(int64
 
     if (STATFS(mPath.get(), &fs_buf) < 0) {
         // The call to STATFS failed.
 #ifdef DEBUG
         printf("ERROR: GetDiskSpaceAvailable: STATFS call FAILED. \n");
 #endif
         return NS_ERROR_FAILURE;
     }
-    /* 
-     * The number of bytes free == The number of free blocks available to
-     * a non-superuser, minus one as a fudge factor, multiplied by the size
-     * of the aforementioned blocks.
-     */
-    *aDiskSpaceAvailable = (int64_t)fs_buf.F_BSIZE * (fs_buf.f_bavail - 1);
+
+    *aDiskSpaceAvailable = (int64_t) fs_buf.F_BSIZE * fs_buf.f_bavail;
 
 #ifdef DEBUG_DISK_SPACE
     printf("DiskSpaceAvailable: %lu bytes\n",
          *aDiskSpaceAvailable);
 #endif
 
 #if defined(USE_LINUX_QUOTACTL)