Re: file ID redesign proposal

Ingo Molnar (mingo@pc7537.hil.siemens.at)
Wed, 26 Nov 1997 15:20:00 +0100 (MET)


On Wed, 26 Nov 1997, Alan Cox wrote:

> > NOTE: the only problem i see with this scheme (so far), are we required to
> > guarantee first-free-file-ID-allocation of file IDs?
>
> If you expect most code to work yet.

note that although the proposed scheme does not *guarantee* first-free
allocation, we can guarantee some kind of predictable allocation behavior,
the question is, how 'widely' applications assume first-free behavior.

1)

the scheme can guarantee either LIFO or FIFO allocation of IDs. Ie. we can
guarantee that in a typical case of:

close(0)
close(1)
close(2)
close(3)

we will get the following IDs:

open()==0
open()==1
open()==2
open()==3

_if_ no other (higher ID) file is freed inbetween.

2) stdin,stdout,stderr

we can workaround ID 0,1,2 in get_empty_filp() and put_empty_filp(), to
support 'legacy' behavior. The remaining IDs would have the 'new'
allocation behavior.

if we have 1) and 2), do we still break too many (good) applications?

-- mingo