diff options
author | Jim Meyering <meyering@redhat.com> | 2008-09-22 22:42:12 +0200 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2008-09-27 00:10:08 +0200 |
commit | 24412edeaf556a96a5ee122851de7c3e37726bdb (patch) | |
tree | 54240c2ae7944434cb6ef9ed2ff69ba6c964c78b /tests/rm/r-3 | |
parent | a5111af33ea6a5d27c3f7ab67afdb2a5884c38b6 (diff) | |
download | coreutils-24412edeaf556a96a5ee122851de7c3e37726bdb.tar.xz |
rm -r: avoid O(n^2) performance for a directory with very many entries
This enhancement works around a problem that is specific to at least
ext3 and ext4 file systems. With them, it would take hours to remove
a two-million-entry directory. RAM-backed file systems (tmpfs) are
not affected, since there is no seek penalty.
* remove.c (rm_malloc, rm_free, compare_ino): New functions.
(dirent_count, preprocess_dir): New function.
[struct readdir_data]: New struct.
(remove_cwd_entries): Call preprocess_dir.
* tests/rm/ext3-perf: New file. Test for the performance fix.
* NEWS: mention the new feature
Diffstat (limited to 'tests/rm/r-3')
0 files changed, 0 insertions, 0 deletions