[gparted] Query unallocated space via libparted (#499202)



commit 30385cbd3750e6a221f498e9ab3e74b9957b9671
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Mon Jan 23 00:15:44 2012 +0000

    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

 src/GParted_Core.cc |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc
index e7492b3..a6bc845 100644
--- a/src/GParted_Core.cc
+++ b/src/GParted_Core.cc
@@ -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 );
 				}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]