tracefs_create_instance_dir(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

tracefs_create_instance_dir β€” bestie, this is the function that creates the tracing instances directory, and it's kind of a big deal πŸŽ€

(also hi, you're reading a page from the Kernel API Manual, welcome to the cool part of the docs)

🌸 SYNOPSIS 🌸

struct dentry * tracefs_create_instance_dir (const char *name , struct dentry *parent , int (*mkdir)(const char *name) , int (*rmdir)(const char *name) );

πŸ’… ARGUMENTS πŸ’…

  • name β€” the name of the instances directory you're creating. Name it something cute, or don't, it's your kernel.
  • parent β€” the parent directory where the instances directory is gonna live. Like, its home base.
  • mkdir β€” the function that gets called whenever a mkdir is performed. You're handing over the keys, no cap.
  • rmdir β€” the function that gets called whenever a rmdir is performed. The cleanup crew, basically.

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so here's the tea: only ONE instances directory is allowed. That's it. One. Don't try to make more, it's not that kind of party.

The instances directory is lowkey special because it lets userspace do mkdir and rmdir on its own. And when one of those happens? The inode locks get released, and the methods you passed in (mkdir and rmdir) get called without locks, with the name of the directory being created within the instances directory. So no deadlock drama, we love to see it.

And the return value? It hands you back the dentry of the instances directory. That's the whole point, slay. πŸ’…

πŸ”₯ SEE ALSO πŸ”₯


And that's the vibe check, bestie! This iconic little page is brought to you by ./fs/tracefs, dated October 2026, and it's literally called tracefs_create_instance_dir(9). Go forth and create exactly one instance directory, ily πŸ«ΆπŸ’–

πŸ“¦ where this page comes from