[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Findutils-patches] [PATCH] Optimise away calls to stat if all we ne
Re: [Findutils-patches] [PATCH] Optimise away calls to stat if all we need is the inode number (bug #24342).
Sun, 08 Mar 2009 17:35:21 +0100
James Youngman wrote:
> +#24342: -inum predicate shoud use dirent.d_ino instead of stat.st_ino
> +(this is a performance bug).
You might want to mention that dirent.d_ino values are unreliable on some
systems (Linux, Solaris, *BSD get it wrong, but Cygwin gets it right).
The problem is with mount points. There, stat.st_ino does not always
match the corresponding dirent.d_ino. This is a problem even with the
latest Linux kernels.
On a related note, I still expect to fix ls -i not to print bogus numbers:
Subject: making GNU ls -i (--inode) work around the linux readdir bug
$ cd / && ls -1i |grep ' [hrt]$'
$ ls -1id h r t