ubifs_compress(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 and UBIFS_COMPR_NONE is returned in compr_type. like, that's how you know no compression happened. track it. iykyk πŸ’…

🌈 SEE ALSO 🌈

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