debugfs_create_bool(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ debugfs_create_bool(9) ✨

okay so this is a page from the Kernel API Manual bestie, and it's literally all about one little function that makes a debugfs file that reads and writes a boolean. yes. a bool. true or false. that's the whole vibe. πŸ’…


🌸 NAME 🌸

debugfs_create_bool β€” creates a debugfs file that's used to read and write a boolean value πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

void debugfs_create_bool (const char *name , umode_t mode , struct
dentry *parent , bool *value );

that's it. that's the signature. four args, no drama, no cap. ✨


πŸ’– ARGUMENTS πŸ’–

okay bestie let's go through these one by one, don't skip, i'm watching πŸ‘€

  • name β€” a pointer to a string containing the name of the file to create. like, what you're gonna call it. that's the name. iconic behavior honestly.
  • mode β€” the permission that the file should have. it's a umode_t, so you know it's the real perms deal πŸ”₯
  • parent β€” a pointer to the parent dentry for this file. this should be a directory dentry if set. and if this parameter is NULL, then the file gets created in the root of the debugfs filesystem. so like, NULL = main character energy, goes straight to the top 🫢
  • value β€” a pointer to the variable that the file should read to and write from. so the file and your variable are literally in a situationship. reading and writing. together. πŸ’œ

🌈 DESCRIPTION 🌈

so what does it actually do? okay so β€” this function creates a file in debugfs with the given name, and that file contains the value of the variable value. simple. clean. slay.

and if the mode variable is so set, it can be read from, and written to. so depending on how you set mode, your lil file is either read-only, write-only, both, whatever β€” the mode decides, not me. periodt. ⭐

πŸ’€ quick reminder: value is a bool *, so it's pointing at an actual bool. not an int, not a char, not your vibes. a bool.

🧚 SEE ALSO 🧚

like, if you're obsessed with this one (and why wouldn't you be), there's a whole friend group. also the kernel file is ./fs/debugfs/file.c β€” go look, iykyk πŸ“‚


and that's the page!! πŸŽ€ source is ./fs/debugfs, version/date stamp says October 2026, and the whole thing is filed under debugfs_create_bool(9) β€” mwah, go forth and make bools, bestie πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from