add function to partition.cpp to return max file size to mtp responder

Change-Id: If8114b5eac741db6c512fb35cb48e3825c2ff098
This commit is contained in:
bigbiff
2014-11-26 20:36:07 -05:00
committed by Dees Troy
parent 253368a072
commit 7cb4c3322b
8 changed files with 36 additions and 6 deletions
+25
View File
@@ -2035,3 +2035,28 @@ void TWPartition::Recreate_AndSec_Folder(void) {
PartitionManager.UnMount_By_Path(Symlink_Mount_Point, true);
}
}
uint64_t TWPartition::Get_Max_FileSize() {
uint64_t maxFileSize = 0;
const uint64_t constGB = (uint64_t) 1024 * 1024 * 1024;
const uint64_t constTB = (uint64_t) constGB * 1024;
const uint64_t constPB = (uint64_t) constTB * 1024;
const uint64_t constEB = (uint64_t) constPB * 1024;
if (Current_File_System == "ext4")
maxFileSize = 16 * constTB; //16 TB
else if (Current_File_System == "vfat")
maxFileSize = 4 * constGB; //4 GB
else if (Current_File_System == "ntfs")
maxFileSize = 256 * constTB; //256 TB
if (Current_File_System == "exfat")
maxFileSize = 16 * constPB; //16 PB
else if (Current_File_System == "ext3")
maxFileSize = 2 * constTB; //2 TB
else if (Current_File_System == "f2fs")
maxFileSize = 3.94 * constTB; //3.94 TB
else
maxFileSize = 100000000L;
return maxFileSize - 1;
}