Assign to duplicate FS_Limits (#787204)

Duplicate the assignment of file system size limits into
struct FS_Limits, matching the fixed values currently assigned to
struct FS members .MIN and .MAX.

Bug 787204 - Minimum and maximum size of the UDF partition/disk
This commit is contained in:
Mike Fleetwood 2018-01-11 23:21:56 +00:00 committed by Curtis Gedak
parent 04535c48b3
commit aea0070799
10 changed files with 20 additions and 4 deletions

View File

@ -131,6 +131,7 @@ FS btrfs::get_filesystem_support()
#endif
fs .MIN = 256 * MEBIBYTE ;
fs_limits.min_size = 256 * MEBIBYTE;
//Linux before version 3.2 fails when resizing btrfs file system
// to the same size.

View File

@ -161,7 +161,10 @@ FS ext2::get_filesystem_support()
if ( specific_type == FS_EXT2 ||
specific_type == FS_EXT3 ||
( specific_type == FS_EXT4 && ! have_64bit_feature ) )
{
fs.MAX = Utils::floor_size( 16 * TEBIBYTE - 4 * KIBIBYTE, MEBIBYTE );
fs_limits.max_size = Utils::floor_size( 16 * TEBIBYTE - 4 * KIBIBYTE, MEBIBYTE );
}
}
return fs ;

View File

@ -115,15 +115,19 @@ FS fat16::get_filesystem_support()
{
fs .MIN = 16 * MEBIBYTE ;
fs .MAX = (4096 - 1) * MEBIBYTE ; //Maximum seems to be just less than 4096 MiB
fs_limits.min_size = 16 * MEBIBYTE;
fs_limits.max_size = (4096 - 1) * MEBIBYTE; // Maximum seems to be just less than 4096 MiB.
}
else //FS_FAT32
{
fs .MIN = 33 * MEBIBYTE ; //Smaller file systems will cause windows scandisk to fail.
fs_limits.min_size = 33 * MEBIBYTE; // Smaller file systems will cause Windows' scandisk to fail.
// Maximum FAT32 volume size with 512 byte sectors is 2 TiB.
// * Wikipedia: File Allocation Table / FAT32
// https://en.wikipedia.org/wiki/File_Allocation_Table#FAT32
fs.MAX = 2 * TEBIBYTE;
fs_limits.max_size = 2 * TEBIBYTE;
}
return fs ;

View File

@ -46,7 +46,8 @@ FS hfs::get_filesystem_support()
fs .online_read = FS::GPARTED ;
fs .MAX = 2048 * MEBIBYTE ;
fs_limits.max_size = 2048 * MEBIBYTE;
return fs ;
}

View File

@ -69,7 +69,8 @@ FS jfs::get_filesystem_support()
#endif
fs .MIN = 16 * MEBIBYTE ;
fs_limits.min_size = 16 * MEBIBYTE;
return fs ;
}

View File

@ -67,6 +67,7 @@ FS nilfs2::get_filesystem_support()
//Minimum FS size is 128M+4K using mkfs.nilfs2 defaults
fs .MIN = 128 * MEBIBYTE + 4 * KIBIBYTE ;
fs_limits.min_size = 128 * MEBIBYTE + 4 * KIBIBYTE;
return fs ;
}

View File

@ -116,6 +116,7 @@ FS ntfs::get_filesystem_support()
// = (1 MiB) + (1 sector)
// For GParted this means 2 MiB because smallest GUI unit is MiB.
fs. MIN = 2 * MEBIBYTE;
fs_limits.min_size = 2 * MEBIBYTE;
return fs ;
}

View File

@ -72,7 +72,8 @@ FS reiserfs::get_filesystem_support()
//Actual minimum is at least 18 blocks larger than 32 MiB for the journal offset
fs .MIN = 34 * MEBIBYTE ;
fs_limits.min_size = 34 * MEBIBYTE;
return fs ;
}

View File

@ -66,6 +66,8 @@ FS udf::get_filesystem_support()
fs.MIN = MIN_UDF_BLOCKS * MIN_UDF_BLOCKSIZE;
fs.MAX = MAX_UDF_BLOCKS * MAX_UDF_BLOCKSIZE;
fs_limits.min_size = MIN_UDF_BLOCKS * MIN_UDF_BLOCKSIZE;
fs_limits.max_size = MAX_UDF_BLOCKS * MAX_UDF_BLOCKSIZE;
return fs;
}

View File

@ -80,7 +80,8 @@ FS xfs::get_filesystem_support()
#endif
fs .MIN = 32 * MEBIBYTE ;//official minsize = 16MB, but the smallest xfs_repair can handle is 32MB...
fs_limits.min_size = 32 * MEBIBYTE; // Official minsize = 16MB, but the smallest xfs_repair can handle is 32MB.
return fs ;
}