Author: aschnell Date: Thu Nov 6 17:37:07 2008 New Revision: 53010 URL: http://svn.opensuse.org/viewcvs/yast?rev=53010&view=rev Log: - changed FreeCylAfter to suit me (hope I have that stuff right now) Modified: trunk/storage/storage/src/include/ep-dialogs.ycp trunk/storage/storage/src/modules/Storage.ycp Modified: trunk/storage/storage/src/include/ep-dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-dialogs.ycp?rev=53010&r1=53009&r2=53010&view=diff ============================================================================== --- trunk/storage/storage/src/include/ep-dialogs.ycp (original) +++ trunk/storage/storage/src/include/ep-dialogs.ycp Thu Nov 6 17:37:07 2008 @@ -623,7 +623,7 @@ heading = sformat(_("Resize Partition %1"), device); min_size_k = Integer::Max([ min_size_k, cyl_size / 1024 ]); - max_size_k = (cyl_size * free_cyl_after) / 1024; + max_size_k = size_k + (cyl_size * free_cyl_after) / 1024; } break; Modified: trunk/storage/storage/src/modules/Storage.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/Storage.ycp?rev=53010&r1=53009&r2=53010&view=diff ============================================================================== --- trunk/storage/storage/src/modules/Storage.ycp (original) +++ trunk/storage/storage/src/modules/Storage.ycp Thu Nov 6 17:37:07 2008 @@ -22,7 +22,6 @@ * $Id$ */ { - module "Storage"; textdomain "storage"; @@ -44,6 +43,7 @@ import "ProductFeatures"; import "Stage"; import "String"; + import "Region"; import "Hotplug"; import "LibStorage"; @@ -4590,40 +4590,34 @@ return( ret ); } -global define integer FreeCylAfter( map disk, map partition ) - ``{ + +global define integer FreeCylAfter(map disk, map partition) +{ integer ret = 0; + integer end_cyl = Region::End(partition["region"]:[]); integer next_used_cyl = disk["cyl_count"]:0; - integer cylinder = partition["region",0]:0; - if( haskey( partition, "orig_size_k" )) - { - cylinder = cylinder + partition["orig_size_k"]:0*1024/disk["cyl_size"]:1; - } - else - { - cylinder = cylinder + partition["region",1]:0; - } if( partition["type"]:`primary == `logical ) { map ext = filter( map part, disk["partitions"]:[], ``( part["type"]:`primary==`extended ))[0]:$[]; - next_used_cyl = ext["region",0]:0+ext["region",1]:0; + next_used_cyl = Region::Length(ext["region"]:[]); } - if( cylinder < next_used_cyl ) + if( end_cyl < next_used_cyl ) { foreach(map part, disk["partitions"]:[], ``{ integer start = part["region",0]:0; - if( start >= cylinder && start < next_used_cyl ) + if( start >= end_cyl && start < next_used_cyl ) { next_used_cyl = start; } }); - } - if( next_used_cyl >= cylinder ) - ret = next_used_cyl-cylinder; - y2milestone( "FreeCylAfter cyl:%1 ret:%2", cylinder, ret ); - return( ret ); - } + } + if( next_used_cyl >= end_cyl ) + ret = next_used_cyl - end_cyl; + y2milestone("FreeCylAfter end_cyl:%1 ret:%2", end_cyl, ret); + return ret; +} + global define boolean CheckNextCreated( map disk, list region ) ``{ -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org