ENUM XZ_MODE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… enum xz_mode(9) β€” Kernel API Manual ✨

okay bestie, welcome to the glow-up of enum xz_mode, straight out of the Kernel API Manual at ./include/linux. bestie. it's giving "three modes, one enum, zero chill." let's get into it πŸŽ€


✨ NAME ✨

enum xz_mode β€” Operation mode. that's it, that's the whole vibe check πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

enum xz_mode {
    XZ_SINGLE ,
    XZ_PREALLOC ,
    XZ_DYNALLOC

};

look at her. three little constants, living their best lives, in that exact order, no notes πŸ’…


🌸 CONSTANTS 🌸

  • XZ_SINGLE β€” Single-call mode, aka the low-calorie option πŸ₯— she uses less RAM than the multi-call modes, because the LZMA2 dictionary does not need to be allocated as part of the decoder state. everything required is allocated at initialization, so xz_dec_run cannot return XZ_MEM_ERROR. no cap, she's lightweight and she knows it.
  • XZ_PREALLOC β€” Multi-call mode with a preallocated LZMA2 dictionary buffer ✨ all data structures get allocated at initialization, so xz_dec_run cannot return XZ_MEM_ERROR. pre-planned, pre-buffered, pre-slay πŸ’–
  • XZ_DYNALLOC β€” Multi-call mode, the spontaneous main character 🌈 the LZMA2 dictionary gets allocated once the required size has been parsed from the stream headers. and if that allocation fails? xz_dec_run will return XZ_MEM_ERROR. so like, she can fail, and that's just her truth 😭

🧚 DESCRIPTION 🧚

so here's the tea πŸ“: you can enable support for only a subset of the above modes at compile time by defining XZ_DEC_SINGLE, XZ_DEC_PREALLOC, or XZ_DEC_DYNALLOC. mix and match, chef's kiss, whatever your little heart desires πŸ’œ

the xz_dec kernel module is always compiled with support for all operation modes β€” she's the full package, no cuts πŸ”₯ but the preboot code may be built with fewer features to minimize code size. different stage of life, different priorities, iykyk πŸ’…


πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./include/linux/xz.h and honestly the whole friend group: enum xz_ret(9), struct xz_buf(9), xz_dec_init(9), xz_dec_run(9), xz_dec_reset(9), xz_dec_end(9), MicroLZMA decompressor(9), xz_dec_microlzma_alloc(9), xz_dec_microlzma_reset(9), xz_dec_microlzma_run(9), xz_dec_microlzma_end(9). go say hi to all of them, they're iconic 🫢


and that's the page, bestie πŸ’– brought to you from ./include/linux, dated October 2026, filed under enum xz_mode(9) in the Kernel API Manual. go forth and decode. periodt βœ¨πŸ‘‘

πŸ“¦ where this page comes from