diff options
author | Jim Meyering <meyering@redhat.com> | 2012-02-13 12:05:40 +0100 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2012-02-18 10:26:10 +0100 |
commit | 8ca2b9659d4fae1d968b8bd4e00fcee7d9d75356 (patch) | |
tree | 82ce84f87ffee64ccc196b91da4f5080b375d7a5 /bootstrap | |
parent | 9f237a03c039eb9d71a16e93119dc1fc56152dd6 (diff) | |
download | coreutils-8ca2b9659d4fae1d968b8bd4e00fcee7d9d75356.tar.xz |
ls: cache ACL- and CAP-querying syscall failures
Like the optimization to avoid always-failing getfilecon calls,
this change avoids always-failing queries for whether a file has
a nontrivial ACL and for whether a file has certain "capabilities".
When such a query fails for one file (indicating no support), we know it
will always fail that way for the affected device. With this change, we
have thus eliminated nearly all failing-unsupported getxattr syscalls.
* src/ls.c (has_capability) [!HAVE_CAP]: Set errno to ENOTSUP.
(errno_unsupported): Expand the list of E* errno values to match
that of lib/acl-internal.h's ACL_NOT_WELL_SUPPORTED macro.
(file_has_acl_cache, has_capability_cache): New functions.
(gobble_file): Use them in place of non-caching ones.
* NEWS (Improvements): Mention it.
Suggested by Sven Breuner in
http://thread.gmane.org/gmane.comp.gnu.coreutils.general/2187
While eliminating most getfilecon calls saved about 33%,
eliminating these other calls can save almost all of the
remaining ~67% cost, on some remote file systems.
Diffstat (limited to 'bootstrap')
0 files changed, 0 insertions, 0 deletions