A machine with a 20TB HDD failed the statvfs() call on /datastore
due to an overflow in the statvfs call (verified via strace).
We now use the 64 bit version "statvfs64" to fix the issue.
The returned "long long" of I2n::get_free_diskspace() is already 64 bit,
so it can handle sizes up to ~ 8.39 million TiB.
**/
long long get_free_diskspace(const std::string& path)
{
- struct statvfs sf;
+ struct statvfs64 sf;
int looplimit=10000;
int ret;
- while ( ((ret=statvfs(path.c_str(),&sf)) == -1) && (errno==EINTR) && looplimit > 0)
+ while ( ((ret=statvfs64(path.c_str(),&sf)) == -1) && (errno==EINTR) && looplimit > 0)
looplimit--;
if (ret==-1)