At Fri, 19 Mar 2021 00:04:28 -0700, John Nemeth <[email protected]> wrote: Subject: Re: still a problem with gpt(8) reading from LVM volumes? (was: problems with GPT (and maybe dkctl wedges) on LVM volumes) > > One of the projects I have in mind is to replace the data > structure. One good thing about the program is that all manipulation > of the data structure is done through access routines and is > appropriately contained in map.c and map.h. One thing that is > slowing me down is thinking of an appropriate data structure for > tracking allocated space (the current method gets this pretty much > for free). One tradional way to do this would be to use a bitmap, > but with the size of modern disks, that is completely infeasible. > Note that whatever method is chosen must be able to handle duplicate > allocations (i.e. overlapping partitions).
Hi John, I have done some work in the past couple of years with code that deals with what I think are sometimes called "extents" or "intervals". The code I worked on was primarily merging and diffing and searching sets of extents. Another application of extents is in calendar scheduling. Anyway I have some small example bits of Go code here: https://github.com/robohack/experiments/blob/master/t-interval-complement.go https://github.com/robohack/experiments/blob/master/t-interval-complement_test.go I also copied some code from stackoverflow to play with: https://github.com/robohack/experiments/blob/master/tintervals-merge.py -- Greg A. Woods <[email protected]> Kelowna, BC +1 250 762-7675 RoboHack <[email protected]> Planix, Inc. <[email protected]> Avoncote Farms <[email protected]>
pgpGgb2m4wtXQ.pgp
Description: OpenPGP Digital Signature
