iommufd_ctx_from_file(9)
β¨ 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 π₯
- Kernel file:
./drivers/iommu/iommufd/main.c iommufd_ctx_get(9)iommufd_ctx_from_fd(9)iommufd_ctx_put(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms