Actually, I think by the birthday paradox there's a 50% chance of a collision
after generating 2^16 random numbers - but that assumes you're only ever
regenerating the generation number for one particular file.
get_random_bytes is pretty expensive, but there's some quicker versions used
for TCP sequence number generation which are probably worth looking at
(secure_tcp_sequence_number). UFS gets around it by assigning generation
numbers at mkfs time and incrementing (or using a cheap RNG) it from there.
J
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/