You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
io: merge IoKind::WriteArc into IoKind::WriteShared #1003
WriteShared was introduced in #998 (replacing WriteRaw) so that a beatree write command holds an Arc to its BranchNode / LeafNode until the write completes. WriteArc is the older variant, used by bitbox for hash-table pages (bitbox/writeout.rs, write_ht).
Proposal
Implement AsRef<[u8; PAGE_SIZE]> for FatPage and drop WriteArc; an Arc<FatPage> then coerces to the WriteShared payload directly.
What this touches:
nomt/src/io/page_pool.rs: the AsRef<[u8; PAGE_SIZE]> impl for FatPage. BranchNode and LeafNode could then delegate to it instead of each converting the slice themselves.
nomt/src/io/mod.rs: remove the WriteArc variant and its arms in Debug and unwrap_buf.
nomt/src/io/linux.rs, nomt/src/io/unix.rs: remove the WriteArc arms in submission_entry / execute.
nomt/src/bitbox/writeout.rs (write_ht), the only WriteArc sender: switch to WriteShared.
Notes
WriteShared goes through a trait object, so hash-table page writes would gain one dynamic call per submission. That should be negligible next to the write itself, but it is worth a quick check with the benchmarks.
This is a pure refactor with no behaviour change. It was left out of hardening tests and fixes #998 to keep that PR limited to the ported hardening fixes.
Activity