mirror of
https://github.com/rvtr/TDT.git
synced 2025-10-31 13:51:07 -04:00
Use real free space if smaller than DSiWare limit
This commit is contained in:
parent
eed5dc867e
commit
0c0dcc3e5e
@ -512,6 +512,15 @@ unsigned long long getDsiSize()
|
|||||||
return 1024 * BYTES_PER_BLOCK;
|
return 1024 * BYTES_PER_BLOCK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned long long getDsiRealFree()
|
||||||
|
{
|
||||||
|
struct statvfs st;
|
||||||
|
if (statvfs(sdnandMode ? "sd:/" : "nand:/", &st) == 0)
|
||||||
|
return st.f_bsize * st.f_bavail;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned long long getDsiFree()
|
unsigned long long getDsiFree()
|
||||||
{
|
{
|
||||||
u32 blockSize = getDsiClusterSize();
|
u32 blockSize = getDsiClusterSize();
|
||||||
@ -530,16 +539,9 @@ unsigned long long getDsiFree()
|
|||||||
size -= appSize;
|
size -= appSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
return size;
|
unsigned long long realFree = getDsiRealFree();
|
||||||
}
|
|
||||||
|
|
||||||
unsigned long long getDsiRealFree()
|
return (realFree < size) ? realFree : size;
|
||||||
{
|
|
||||||
struct statvfs st;
|
|
||||||
if (statvfs(sdnandMode ? "sd:/" : "nand:/", &st) == 0)
|
|
||||||
return st.f_bsize * st.f_bavail;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 getDsiClusterSize()
|
u32 getDsiClusterSize()
|
||||||
|
|||||||
@ -41,8 +41,8 @@ unsigned long long getSDCardFree();
|
|||||||
|
|
||||||
//internal storage
|
//internal storage
|
||||||
unsigned long long getDsiSize();
|
unsigned long long getDsiSize();
|
||||||
unsigned long long getDsiFree();
|
|
||||||
unsigned long long getDsiRealFree();
|
unsigned long long getDsiRealFree();
|
||||||
|
unsigned long long getDsiFree();
|
||||||
u32 getDsiClusterSize();
|
u32 getDsiClusterSize();
|
||||||
#define getDsiUsed() (getDSIStorageSize() - getDSIStorageFree())
|
#define getDsiUsed() (getDSIStorageSize() - getDSIStorageFree())
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user