statvfs suggestion
Jim Meyering
jim@meyering.net
Wed Sep 17 12:00:00 GMT 2003
Ulrich Drepper <drepper@redhat.com> wrote:
> Jim Meyering wrote:
>> What do you think about changing internal_statvfs.c so that it first
>> reads/saves all entries from /proc/mounts without stat'ing each
>> corresponding directory? Then it can stop if any mount point matches
>> the name of the file.
>
> This really is no solution. The name passed to statvfs need not be the
> actual mount point. And what about fstatvfs where we don't have a name?
>
> I added some code which cuts down on the number of stats by comparing
> another value we know must match: the filesystem name.
>
> While doing this, though, I found that adding additional tests for the
> name comparison isn't any more work so I added this as well. It's no
> solution, but it might help in one situation or another. The result is
> in CVS.
Thanks for doing that. IMHO any change that converts an O(N^2)
process into an O(N) one is more than a partial solution :-)
More information about the Libc-hacker
mailing list