debugfs_create_blob(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ NAME πŸŽ€

okay bestie, welcome to the debugfs_create_blob(9) page from the Kernel API Manual πŸ’– this one is all about debugfs_create_blob β€” the function that creates a debugfs file used to read and write a binary blob. slay.


✨ SYNOPSIS ✨

struct dentry * debugfs_create_blob (const char *name , umode_t mode ,
       struct dentry *parent , struct debugfs_blob_wrapper *blob );

🫢 ARGUMENTS 🫢

  • name β€” a pointer to a string containing the name of the file to create. like, the file's whole identity ✨
  • mode β€” the permission that the file should have. set the vibe check for who gets in πŸ’…
  • parent β€” a pointer to the parent dentry for this file. this should be a directory dentry if set. if this parameter is NULL, then the file will be created in the root of the debugfs filesystem. no parent? it goes straight to the root, main character behavior πŸ‘‘
  • blob β€” a pointer to a struct debugfs_blob_wrapper which contains a pointer to the blob data and the size of the data. the data and its size, wrapped up together 🎁

πŸ’… DESCRIPTION πŸ’…

This function creates a file in debugfs with the given name that exports blob->data as a binary blob. if the mode variable is set up to allow it, the file can be read from and written to. iconic.

This function will return a pointer to a dentry if it succeeds. that pointer must be passed to the debugfs_remove function when the file is to be removed β€” and no automatic cleanup happens if your module is unloaded, you are responsible here. yes, literally you. don't ghost your cleanup 😭

If an error occurs, ERR_PTR(-ERROR) will be returned.

If debugfs is not enabled in the kernel, the value ERR_PTR(-ENODEV) will be returned. noted, bestie 🫑


πŸ‘€ SEE ALSO πŸ‘€

Kernel file ./fs/debugfs/file.c is the hangout spot, and these besties are linked:


xoxo, bestie πŸ’– this page came from ./fs/debugfs, stamped October 2026, and it's literally debugfs_create_blob(9). periodt. πŸ¦‹

πŸ“¦ where this page comes from