Hi,
I've tried out the CVS version of findutils+gnulib, and it does indeed
seem to fix the problem with inode-less filesystems, in addition to
using noticably less system time.
I've also found that the -xdev option of find no longer works: it
outputs just a single line for the base directory.
Looking at the strace, there's still a possibility for an optimization
on systems which have both O_DIRECTORY and O_NOFOLLOW.
This:
lstat64("foo", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
open("foo", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 5
fstat64(5, {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
Could be replaced with this:
open("foo", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_NOFOLLOW) = 5
fstat64(5, {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
since the lstat becomes unnecessary, once the open is sure to fail on
anything non-directory.
Miklos