securityfs_create_dir(9)
π securityfs_create_dir(9) β the Kernel API Manual moment
okay so bestie, welcome to securityfs_create_dir(9) from the Kernel API Manual. yes we're in kernel land. yes there will be dentries. no you cannot just mkdir and go home. let's get into it π«Ά
β¨ NAME β¨
securityfs_create_dir β literally creates a directory inside the securityfs filesystem. that's the whole vibe. iconic behaviour, honestly π
πΈ SYNOPSIS πΈ
struct dentry * securityfs_create_dir (const char *name , struct dentry *parent );
look at her. one pointer in, two args, struct dentry * coming back out. main character signature ngl β¨
π¦ ARGUMENTS π¦
nameβ a pointer to a string holding the name of the directory you wanna create. just the name. that's it. that's the girl πparentβ a pointer to the parent dentry for this file. bestie, this should be a directory dentry if you set it. and if this parameter isNULL, then your directory gets created in the root of the securityfs filesystem instead. soNULL= "put me at the top, idc" π
π DESCRIPTION π
so this function creates a directory in securityfs with the given name. simple. slay. no cap.
this function returns a pointer to a dentry if it succeeds. important part, listen up π¨: that pointer must be passed to the securityfs_remove function when the file is to be removed. and no β there is no automatic cleanup if your module gets unloaded. you are responsible here. you. personally. the accountability is giving very much main character energy π
if an error occurs, the function will return the error value (via ERR_PTR). so like, check your returns, bestie, fr fr π
lowkey crucial: if securityfs is not enabled in the kernel, the value-ENODEVis returned. so if you're getting-ENODEVand spiralling, that's why π
π₯ SEE ALSO π₯
- Kernel file
./security/inode.c securityfs_create_dentry(9)securityfs_create_file(9)securityfs_create_symlink(9)securityfs_remove(9)
go read the whole friend group, they all hang out together π§
π the cute sign-off π
this lil page lives at ./security in the source tree, and it's dated October 2026 β yes, from the future, we don't ask questions π°οΈβ¨ and the header said securityfs_create_dir(9) from the Kernel API Manual, which you already knew because you're a scholar and a genius. periodt. π
π¦ 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