bug-parted
[Top][All Lists]
Advanced

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

Re: resizing containerpartition and keeping startpoint intact


From: B.Hakvoort
Subject: Re: resizing containerpartition and keeping startpoint intact
Date: Wed, 24 Nov 2004 21:15:13 +0100

On Tue, 2004-11-23 at 20:30 +0100, B.Hakvoort wrote:
> On Tue, 2004-11-23 at 08:51 +1100, Andrew Clausen wrote:
> > You want something like this:
> > 
> > PedGeometry* min_geom = ped_geometry_new (dev, start, len);
> > PedGeometry* max_geom = ped_geometry_new (dev, start, dev->length - start);
> > constraint = ped_constraint_new_from_min_max (min_geom, max_geom);
> > 
> Looks good! i'll try it tonight :)
> 
Hmmz.. this works, but afaics it basicly creates a very exact constraint
and doesn't round to a cyclinder boundary. I've solved it in my own
hackisch way like this:

---------------------------------------------------------
constraint = ped_constraint_any( device );
                                                                        
ped_disk_set_partition_geom ( disk, c_partition, constraint,
new_start, new_end ) ;

ped_constraint_destroy ( constraint );
                                
ped_geometry_set_start ( & c_partition ->geom, new_start ) ;
constraint = ped_constraint_exact ( & c_partition ->geom ) ;
---------------------------------------------------------------

The resulting constraint quarantees a fixed start and an endpoint thats
rounded on a cylinderboundary. Although functional, i cannot escape the
feeling this can be done in a more efficient way..

Looking forward to the mass of replies :P

Bart

-- 
www.titanium-it.nl --- Open Minded Open Source
www.heavenisopen.com <-----Another Source





reply via email to

[Prev in Thread] Current Thread [Next in Thread]