[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:1.8.1.16) Gecko/20080708 Thunderbird/2.0.0.16 Mnenhy/0.7.5.666 |
-----BEGIN PGP SIGNED MESSAGE-----
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
-----BEGIN PGP SIGNATURE-----
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
iEYEARECAAYFAkjWmiEACgkQ84KuGfSFAYDFYACfXyxfLQ+gDR5H7yuUcUveo7aW
9GAAnj4GPsLFhJ3JoOrUXRWoXUQeyrxj
=fxsN
-----END PGP SIGNATURE-----
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: Why does -inum require stat(2)?,
Eric Blake <=