Repository navigation
uucore: share replace_link's atomic replace - #15122
abendrothj wants to merge 2 commits into
Conversation
Merging this PR will degrade performance by 2.92%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | three_39_bit_primes |
583.2 ms | 719.2 ms | -18.9% |
| ❌ |
hostname_ip_lookup[100000] |
169.5 µs | 177.3 µs | -4.38% |
| ⚡ | five_38_bit_primes |
1.6 s | 1.5 s | +4.42% |
| ⚡ |
cksum_crc |
33.6 ms | 32.6 ms | +3.25% |
| ⚡ |
cksum_default |
33.9 ms | 32.8 ms | +3.13% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing abendrothj:uucore-replace-entry-at (f5b87ae) with main (6292c03)
Footnotes
-
306 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
c7045d6 to
b872c65
Compare
b872c65 to
5d10e9b
Compare
Move the temporary name and renameat logic of replace_link into replace_entry_at, which creates the entry through a callback relative to an open directory, so other callers can replace entries the same way. The parent is now opened with DirFd::open_anchor, so ln -sf replacing a link in a directory with write and search but no read permission works, as it does with GNU, instead of failing with EACCES.
5d10e9b to
f5b87ae
Compare
replace_linkcreates a temporary link and renames it over the target. The temporary-name andrenameatpart moves intoreplace_entry_at, which creates the entry through a callback relative to an open directory, so mv can replace special files and directory entries the same way.The parent is now opened with
DirFd::open_anchor, soln -sfandcp -sfreplacing an entry in a directory with write and search but no read permission work, as with GNU 9.12, instead of failing with EACCES. Running out of temporary names reports a translated error.Closes #15112