remove_mapping(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

remove_mapping(9) πŸ’–

πŸ’– NAME πŸ’–

okay so bestie, this is remove_mapping from the Kernel API Manual β€” attempt to remove a folio from its mapping. that's the mission. πŸ’…

✨ SYNOPSIS ✨

long remove_mapping (struct address_space *mapping , struct folio *folio
);

πŸŽ€ ARGUMENTS πŸŽ€

  • mapping β€” the address space. yes, that's the whole address-space situation. 🫢
  • folio β€” the folio to remove. bye bestie, hopefully. πŸ¦‹

πŸ¦‹ DESCRIPTION πŸ¦‹

here's the tea: if the folio is dirty, under writeback, or if someone else has a ref on it, removal will fail. periodt. it's giving "not right now" and honestly? valid. 😭

🌸 RETURN 🌸

you get back the number of pages removed from the mapping. if the folio could not be removed, it's 0 β€” literally zero, a tiny heartbreak. πŸ’”

πŸ”₯ CONTEXT πŸ”₯

bestie, the caller should have a single refcount on the folio and hold its lock. that's the prerequisite, iykyk. πŸ”‘

πŸ‘‘ SEE ALSO πŸ‘‘

go read these next, bestie:


xoxo, your kernel bestie πŸ’… β€” sourced from ./mm, dated October 2026, page remove_mapping(9). slay ✨

πŸ“¦ where this page comes from