Subject: Re: pkg/31944
To: Jason Thorpe <>
From: Christos Zoulas <>
List: netbsd-bugs
Date: 03/07/2006 13:20:56
On Mar 7,  8:33am, (Jason Thorpe) wrote:
-- Subject: Re: pkg/31944

| On Mar 7, 2006, at 7:36 AM, Christos Zoulas wrote:
| > Right, but it does not matter. The probability that the same  
| > generation
| > number gets allocated to the same inode is miniscule.
| Would using a random generation number be better?

Using a linear congruent random jenerator would be cheap and easy, but I
not sure if it is going to be a lot better (and you have to make sure that
the cycle frequency is > 2^32 - 1). But the real issue is why does tmpfs
need a generation number? It should be able to do:

	nnode->tn_id = tmp->tm_nodes_last++;

in the inode-reuse case to get a unique inode # anyway. With inodes being
64_bit this will take a long time to run out. Even if it does run out,
you can start using the generation number then. Is 2^96 good enough now?

	nnode->tn_id = tmp->tm_nodes_last++;
	if (tmp->tm_nodes_last == 0)

and in tempfs_getattr:

	va.va_gen = tmp->tm_gen_last;