mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2025-01-10 16:20:59 +00:00
Merge pull request #636 from swt2c/macos_upload_failures
Fix intermittent upload failures on macOS
This commit is contained in:
commit
7c5fba9890
@ -1908,7 +1908,7 @@ size_t FdManager::SetEnsureFreeDiskSpace(size_t size)
|
||||
return old;
|
||||
}
|
||||
|
||||
fsblkcnt_t FdManager::GetFreeDiskSpace(const char* path)
|
||||
uint64_t FdManager::GetFreeDiskSpace(const char* path)
|
||||
{
|
||||
struct statvfs vfsbuf;
|
||||
string ctoppath;
|
||||
@ -1930,12 +1930,12 @@ fsblkcnt_t FdManager::GetFreeDiskSpace(const char* path)
|
||||
S3FS_PRN_ERR("could not get vfs stat by errno(%d)", errno);
|
||||
return 0;
|
||||
}
|
||||
return (vfsbuf.f_bavail * vfsbuf.f_bsize);
|
||||
return (vfsbuf.f_bavail * vfsbuf.f_frsize);
|
||||
}
|
||||
|
||||
bool FdManager::IsSafeDiskSpace(const char* path, size_t size)
|
||||
{
|
||||
fsblkcnt_t fsize = FdManager::GetFreeDiskSpace(path);
|
||||
uint64_t fsize = FdManager::GetFreeDiskSpace(path);
|
||||
return ((size + FdManager::GetEnsureFreeDiskSpace()) <= fsize);
|
||||
}
|
||||
|
||||
|
@ -194,7 +194,7 @@ class FdManager
|
||||
fdent_map_t fent;
|
||||
|
||||
private:
|
||||
static fsblkcnt_t GetFreeDiskSpace(const char* path);
|
||||
static uint64_t GetFreeDiskSpace(const char* path);
|
||||
void CleanupCacheDirInternal(const std::string &path = "");
|
||||
|
||||
public:
|
||||
|
Loading…
Reference in New Issue
Block a user