Changeset 48009 in vbox for trunk/src/VBox/Main/src-server/linux
- Timestamp:
- Aug 23, 2013 7:38:52 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/linux/PerformanceLinux.cpp
r46328 r48009 226 226 { 227 227 struct statvfs stats; 228 const unsigned _MB = 1024 * 1024;229 228 230 229 if (statvfs(path, &stats) == -1) … … 234 233 } 235 234 uint64_t cbBlock = stats.f_frsize ? stats.f_frsize : stats.f_bsize; 236 *total = (ULONG)(cbBlock * stats.f_blocks / _ MB);237 *used = (ULONG)(cbBlock * (stats.f_blocks - stats.f_bfree) / _ MB);238 *available = (ULONG)(cbBlock * stats.f_bavail / _ MB);235 *total = (ULONG)(cbBlock * stats.f_blocks / _1M); 236 *used = (ULONG)(cbBlock * (stats.f_blocks - stats.f_bfree) / _1M); 237 *available = (ULONG)(cbBlock * stats.f_bavail / _1M); 239 238 240 239 return VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.