diff options
author | Jim Meyering <meyering@redhat.com> | 2012-02-11 12:36:57 +0100 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2012-02-18 10:26:10 +0100 |
commit | 9f237a03c039eb9d71a16e93119dc1fc56152dd6 (patch) | |
tree | 6b7f2ebf983cbd35781290f222b95b07244eeafd /TODO | |
parent | d55d3dd5886c146547482c9f45ac653c1ebe9237 (diff) | |
download | coreutils-9f237a03c039eb9d71a16e93119dc1fc56152dd6.tar.xz |
ls: optimize for when getfilecon would often fail (~33% perf. gain)
On systems or file systems without SELinux support, all getfilecon
and lgetfilecon calls would fail due to lack of support. We can non-
invasively cache such failure (on most recently accessed device) and
avoid the vast majority of the failing underlying getxattr syscalls.
* src/ls.c (errno_unsupported): New function.
(selinux_challenged_device): New file-scoped global.
(getfilecon_cache, lgetfilecon_cache): New error-caching wrapper
functions.
(gobble_file): Use the caching wrappers, for when many *getfilecon
calls would fail with ENOTSUP or EOPNOTSUPP.
Suggested by Sven Breuner in
http://thread.gmane.org/gmane.comp.gnu.coreutils.general/2187
Improved-by: Pádraig Brady.
Diffstat (limited to 'TODO')
0 files changed, 0 insertions, 0 deletions