tech-userlevel archive

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

Re: db(3) removal and lastlogx

On Fri, Jun 08, 2012 at 10:38:56PM +0200, Joerg Sonnenberger wrote:
> > I think your access scheme is:
> > 
> > Most accesses are writes, so the code must read the file header first
> > to verify the magic etc.
> > So the header could contain the offest to the first block as well.
> > It can then read the required entry before writing it back, if the
> > read value was all-zero it must write out the two marker bytes.
> Actually, the other way around. First write the entry and then check if
> the marker bytes are set.

You can save the read of the marker bytes by checking that the entry
itself is non-zero. So you only need to read the part of the disk
containing the markers for new entries.

Hmmm.... how big a uid can you save on a 1k/8k ffs filesystem?
(ie how big do the triple-indirect blocks go).
You might have a uid limit below 2^32.

And, if someone does create a large uid you do have a very large (if
sparse) file.


David Laight:

Home | Main Index | Thread Index | Old Index