[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why does -inum require stat(2)?

From: Eric Blake
Subject: Re: Why does -inum require stat(2)?
Date: Sun, 21 Sep 2008 13:01:53 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20080708 Thunderbird/ Mnenhy/

Hash: SHA1

[adding bug-gnulib, as this is an fts issue]

According to George Spelvin on 9/20/2008 3:36 PM:
> Looking for an inode that fsck complained about, I did a find,
> and noticed that it was statting every file name it found.
> Hunting through the code, I see that, in tree.c, pred_inum is marked
> NeedsStatInfo.  Is there a reason that struct dirent's d_ino field
> can't be used instead?  That would drastically reduce the cost of this
> predicate.
> (This would also benefit pred_samefile.)

This only works for systems where d_ino is reliable.  Even recent
GNU/Linux systems have been known to mis-report d_ino in the presence of
mount points; coreutils' 'ls -i' is still turning up issues ever since it
switched to using d_ino a couple years ago.  But yes, it would be nice if
gnulib's fts could optimize traversals that only need inode information.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


reply via email to

[Prev in Thread] Current Thread [Next in Thread]