hfi1_free_ctxt(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… hfi1_free_ctxt(9) β€” the Kernel API Manual, bestie edition πŸŽ€

Okay so we're in the kernel API manual today, and the star of the show is hfi1_free_ctxt(9). Buckle up, this one's a little one but she matters ✨


🌸 NAME 🌸

hfi1_free_ctxt β€” free context. That's it. That's the whole vibe. She frees the context πŸ’–


✨ SYNOPSIS ✨

void hfi1_free_ctxt (struct hfi1_ctxtdata *rcd );

Returns nothing (void, so no take-backs, no receipts), takes exactly one thing, and lives rent-free in your kernel code 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • rcd β€” pointer to an initialized rcd data structure. Not a maybe-initialized one, not a half-initialized one. An initialized one, bestie πŸ’…

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so here's the tea β˜• β€” this function is a wrapper, and she's the free function that matches hfi1_create_ctxtdata. They're a set. They come as a pair. Think of them as the two halves of a friendship bracelet, except one of them is deallocating memory 😭

When a context is done being used β€” and this goes for kernel or user contexts, both, no exceptions β€” this function gets called for the "final" put. And why is the put in quotes? Because it's the final one that matches the kref init from hfi1_create_ctxtdata. It's the closing bracket of the whole saga 🧚

The way that other users of the context work is they do a get/put sequence β€” a little borrow-and-return, very library book of them β€” to make sure that the structure isn't removed while it's still in use. So like, nobody yanks the rug out while somebody else is still standing on it. Basic manners, honestly πŸ‘‘

Lowkey the whole point: this is the last put. The one that actually lets the thing go. Everyone else is just get/put-ing politely in the background 🌈

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./drivers/infiniband/hw/hfi1/init.c β€” that's where she lives, go say hi 🏠

And the whole friend group, in the order the page gives them, fr fr:

Not me listing all of them β€” yes I am, because we keep every single one, that's the rule πŸ˜€πŸ’–


Sign-off time, and this is the cute part: this page comes to you from ./drivers/infiniband/hw/hfi1, dated October 2026, and she's filed under hfi1_free_ctxt(9) in the Kernel API Manual πŸŽ€βœ¨ Bye bestie, go put your refcounts back where you found them πŸ’œπŸ¦‹

πŸ“¦ where this page comes from