[gparted] Set device length to value from libparted



commit 4c0b514e22bc701f26cd1f2598716114efcc3bcb
Author: Curtis Gedak <gedakc gmail com>
Date:   Thu Mar 4 13:17:29 2010 -0700

    Set device length to value from libparted
    
    Previously this value was calculated to end on a cylinder
    boundary.  On today's larger hard drives, which simply emulate
    Cylinders/Heads/Sectors, some disk space might remain after the
    last cylinder.  This space would always be less than a full
    cylinder in size.  Now this space will be visible to the user.

 src/GParted_Core.cc |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc
index 2485f01..5f8906b 100644
--- a/src/GParted_Core.cc
+++ b/src/GParted_Core.cc
@@ -297,11 +297,11 @@ void GParted_Core::set_devices( std::vector<Device> & devices )
 			temp_device .add_paths( get_alternate_paths( temp_device .get_path() ) ) ;
 
 			temp_device .model 	=	lp_device ->model ;
+			temp_device .length 	=	lp_device ->length ;
 			temp_device .sector_size	=	lp_device ->sector_size ;
 			temp_device .heads 	=	lp_device ->bios_geom .heads ;
 			temp_device .sectors 	=	lp_device ->bios_geom .sectors ;
 			temp_device .cylinders	=	lp_device ->bios_geom .cylinders ;
-			temp_device .length 	=	temp_device .heads * temp_device .sectors * temp_device .cylinders ;
 			temp_device .cylsize 	=	temp_device .heads * temp_device .sectors ; 
 		
 			//make sure cylsize is at least 1 MiB



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