aboutsummaryrefslogtreecommitdiff
path: root/gnu/usr.bin/patch/util.h
diff options
context:
space:
mode:
authorKirk McKusick <mckusick@FreeBSD.org>2026-11-20 23:34:00 +0000
committerKirk McKusick <mckusick@FreeBSD.org>2026-11-20 23:35:40 +0000
commite5904908677ffb8c659d1b1bac90a51140709ef1 (patch)
tree381261666d08bb69aa516fedc6ed618a8b4024d0 /gnu/usr.bin/patch/util.h
parent84090d7b56484b7c6061c641cbc1d38421dd8ec6 (diff)
ext2fs: Multi-block allocator with extent tree support and allocation lifecycle state machineHEADmain
The idea is to have an allocator that makes better use of the locality information and is better suited for extents. It is similar to what Linux calls a multiblock allocator in a paper from 2005. The Linux code was not inspected or used in this implementation. Implement ext2_alloc_run() — a multi-block physical allocator that reserves a contiguous physical block run and returns it via a context-based state machine: ALLOCATED -> MAPPED -> PUBLISHED -> ROLLED_BACK ext2_alloc_run() enforces the reserved-block policy using struct ucred *cred (NOCRED panics under INVARIANTS). Callers include ext2_alloc() and ext4_new_blocks() for block allocation. ext4_ext_split() uses scalar ext2_rollback_unpublished() for metadata block cleanup (no context arrays). ext4_ext_insert_extent() handles MAPPED -> PUBLISHED state transitions with the context on extent insertion success. The allocation context tracks only essential state: physical run (start + length) lifecycle state (4 values) accounting_applied (needed for ALLOCATED -> ROLLED_BACK) The new conservative reallocation algorithm is better suited for extents which makes the code somewhat easier to adapt to newer features like journaling. Note: poolside/laguna-s-2.1:free AI was used to help in the implementation of this algorithm. It was instructed specifically NOT to take code from Linux. Its code was used as a starting point; numerous changes were made to get this existing implementation. Submitted by: Pedro Giffuni <pfg@freebsd.org> Reviewed by: Kirk McKusick Tested by: Peter Holm Differential Revision: https://reviews.freebsd.org/D59866 MFC-after: 2 weeks
Diffstat (limited to 'gnu/usr.bin/patch/util.h')
0 files changed, 0 insertions, 0 deletions