Query unallocated space via libparted (#499202)

Update the implementation using libparted to set the file system size
and free space, thus allowing the unallocated space in the partition to
be calculated, for the following unmounted file systems:
    hfs, hfs+
(Requires libparted <= 2.4 or libparted >= 3.1, as the needed
functionality did not exist in libparted 3.0).

Bug #499202 - gparted does not see the difference if partition size
              differs from filesystem size
This commit is contained in:
Mike Fleetwood 2012-01-23 00:15:44 +00:00 committed by Curtis Gedak
parent e6290dbbcf
commit 30385cbd37
1 changed files with 2 additions and 1 deletions

View File

@ -1586,7 +1586,8 @@ void GParted_Core::LP_set_used_sectors( Partition & partition )
constraint = ped_file_system_get_resize_constraint( fs ) ;
if ( constraint )
{
partition .Set_Unused( partition .get_sector_length() - constraint ->min_size ) ;
partition .set_sector_usage( fs ->geom ->length,
fs ->geom ->length - constraint ->min_size ) ;
ped_constraint_destroy( constraint );
}