__add_badblock_range(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… __add_badblock_range β€” no cap, the kernel manpage

okay so bestie, welcome to the Kernel API Manual, section 9, and the function we're stanning today is __add_badblock_range. lowercase name, double underscore, main character energy fr fr πŸŽ€


✨ NAME ✨

__add_badblock_range β€” converts a physical address range into bad sectors. that's it, that's the whole vibe πŸ¦‹


🌸 SYNOPSIS 🌸

void __add_badblock_range (struct badblocks *bb, u64 ns_offset, u64 len);

she returns void, she takes three things, she does not miss πŸ”₯


🧚 ARGUMENTS 🧚

  • bb β€” the badblocks instance you're populating, aka the little bad-sector guest list you're adding names to πŸ’…
  • ns_offset β€” the namespace offset where the error range begins, and yes bestie it's measured in bytes πŸ“
  • len β€” how many bytes of badrange are getting added. the size of the problem, basically 😭

πŸ‘‘ DESCRIPTION πŸ‘‘

okay so here's the whole thing: this function assumes the range you hand it with (ns_offset, len) is already chilling inside the bounds of physical addresses for this namespace. like, it has to lie in the interval

[ns_start, ns_start + ns_size)

that's the assumption, that's the assignment, and it is not out here double-checking for you πŸ™ˆ it's giving "trust me bestie" energy, so make sure your range actually belongs there before you call her πŸ’–


🫢 SEE ALSO 🫢

  • Kernel file ./drivers/nvdimm/badrange.c β€” go read the source, iykyk πŸ“–
  • nvdimm_badblocks_populate(9) β€” her friend, also iconic ⭐

so yeah, that's the whole page, no notes πŸ’€

and for the cute sign-off: this one comes from ./drivers/nvdimm, October 2026, and it literally says __add_badblock_range(9) right there in the corner like a little signature. slay, periodt πŸ’œπŸŒˆ

πŸ“¦ where this page comes from