[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ls -i inefficiency
From: |
Jim Meyering |
Subject: |
Re: ls -i inefficiency |
Date: |
Sun, 26 Feb 2006 11:04:38 +0100 |
Eric Blake <address@hidden> wrote:
> According to Jim Meyering on 2/25/2006 4:54 AM:
>> Thanks for the suggestion.
>> If this isn't too invasive, I'm interested.
>> I think `ls -i' (without some other option requiring stat info)
>> is used far less often than, say `ls -F', so it's harder to justify
>> adding much complexity to optimize for this relatively unusual case.
>
> And here's the patch. As a nice side effect, it also optimized 'ls -L' to
> avoid stat() (after all, dereferencing makes no sense when all you need is
> file names, and no information from the dereference).
>
> 2006-02-25 Eric Blake <address@hidden>
>
> * src/pwd.c (NOT_AN_INODE_NUMBER, D_INO): Move to ...
> * src/system.h: ... here, for use in ...
> * src/ls.c (main): ... here. Prefer dirent.d_ino to stat when
> possible.
> (gobble_file): Add inode argument.
> (print_dir): Pass inode if available.
> (usage): Remove inaccuracy.
Thank you.
I've applied that.