ubifs_compress(9)
π ubifs_compress(9) β the Kernel API Manual, but make it make sense β¨
okay bestie, this page lives in the Kernel API Manual and it's all about ubifs_compress β like, the queen of squishing data down to size ππ¦
β¨ NAME β¨
ubifs_compress β compress data ποΈπ
πΈ SYNOPSIS πΈ
void ubifs_compress (const struct ubifs_info *c , const void *in_buf ,
int in_len , void *out_buf , int *out_len , int *compr_type );
π ARGUMENTS π
cβ the UBIFS file-system description object, aka the whole vibe check context for the filesystem π«in_bufβ the data you actually wanna compress πin_lenβ how long that data is, in bytes πout_bufβ the output buffer where the compressed data is supposed to land π¬out_lenβ the output buffer length gets returned right here, so it's an out-param, not a suggestion πcompr_typeβ on the way in, it's the type of compression to use; on the way out, it's the compression type that actually got used π (yes, it's a glow-up-in-place situation)
π DESCRIPTION π
so this function takes your input buffer in_buf of length in_len, does its little compression thing, and stores the result in the output buffer out_buf, with the resulting length going into out_len. iconic behavior, truly β¨
but here's the thing β if the input buffer does not compress (like, it just refuses to get smaller π), it's simply copied to the out_buf instead. no drama. and the exact same thing happens if compr_type is UBIFS_COMPR_NONE, or if a compression error occurred. so it always gives you something back, periodt π«Ά
π¨ note bestie: if the input buffer was not compressed, it gets copied to the output buffer andUBIFS_COMPR_NONEis returned incompr_type. like, that's how you know no compression happened. track it. iykyk π
π SEE ALSO π
- the kernel file
./fs/ubifs/compress.c ubifs_compress_folio(9)ubifs_decompress(9)ubifs_decompress_folio(9)compr_init(9)compr_exit(9)ubifs_compressors_init(9)ubifs_compressors_exit(9)
go read those too, they're lowkey all part of the same friend group π§π
and that's the whole page, bestie!! it's from ./fs/ubifs, dated October 2026, and it's literally titled ubifs_compress(9) β slay, no cap, ate and left no crumbs ππβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms