iommufd_ctx_from_file(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

okay so bestie, this is iommufd_ctx_from_file(9) from the Kernel API Manual, and it literally acquires a reference to the iommufd context πŸ’–. That's the whole vibe: you hand it a file, it hands you a context reference (or an error, but we'll get there).

🌸 SYNOPSIS 🌸

struct iommufd_ctx * iommufd_ctx_from_file (struct file *file );

πŸŽ€ ARGUMENTS πŸŽ€

  • file β€” the file you're obtaining the reference from 🫢. That's it, that's the arg.

πŸ’… DESCRIPTION πŸ’…

So like, iommufd_ctx_from_file returns a pointer to the iommufd_ctx β€” slay β€” otherwise it returns ERR_PTR 😭. Important bestie: the struct file stays owned by the caller, so you still gotta do fput yourself. No sneaky ownership transfer, okay? πŸ™ˆ

And on success? The caller is responsible for calling iommufd_ctx_put. Periodt. Don't forget the cleanup, bestie πŸ’€.

πŸ”₯ SEE ALSO πŸ”₯


mwah πŸ’‹ this page is from ./drivers/iommu/iommufd, dated October 2026, and yes bestie it's iommufd_ctx_from_file(9) β€” byeeee 🫢✨

πŸ“¦ where this page comes from