Re: Saving a File

From: Marko Mäkelä (msmakela_at_cc.hut.fi)
Date: 2001-09-20 14:53:23

Hello Ruud,

> My first question is: does anybody know how the 1581, 8250 and 90x0
> handle this situation?

Their REL files make use of super side sectors that contain pointers to
the actual side sectors.  You can apply the same principle to the BAM as
well.  Maintain a super-BAM (or several layers of super-BAMs) that contain
the number of free blocks in the sub-BAMs (or just one bit saying whether
at least one sector in that area is available).  When the allocation
status of a block needs to be changed, you just traverse this BAM tree
down and up.

You should maybe familiarize yourself with the B-tree data structure that
is commonly used in data base systems.  I've implemented a B-tree in C++
whose branching degree can be selected at compilation time.  It's used for
maintaining a hash table on disk.  It performs quite well, since all nodes
can typically be reached in at most 3 or 4 disk look-ups.  The root node
is always kept in memory, and the operating system usually keeps many of
the other nodes in its disk cache.  (Linux maintains a dynamically sized
disk cache by utilizing all memory that has not been explicitly allocated
by active processes.)

	Marko


       Message was sent through the cbm-hackers mailing list

Archive generated by hypermail 2.1.1.