eventfs_create_dir(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– eventfs_create_dir(9) β€” Kernel API Manual πŸ’–

okay bestie, welcome to eventfs_create_dir(9) from the Kernel API Manual. it's giving kernel-internals but make it cute. let's slay this ✨

🌸 NAME 🌸

eventfs_create_dir β€” create the eventfs_inode for this directory. no cap, that's the whole name vibe.

✨ SYNOPSIS ✨

struct eventfs_inode * eventfs_create_dir (const char *name , struct
eventfs_inode *parent , const struct eventfs_entry *entries , int size ,
void *data );

πŸŽ€ ARGUMENTS πŸŽ€

  • name β€” the name of the directory to create.
  • parent β€” the eventfs_inode of the parent directory.
  • entries β€” a list of entries that represent the files under this directory.
  • size β€” the number of entries.
  • data β€” the default data to pass to the files (an entry may override it).

πŸ’… DESCRIPTION πŸ’…

okay so this function creates the descriptor that represents a directory in eventfs. that descriptor is an eventfs_inode, and it's returned to be used to create other children underneath. main character energy fr fr. πŸ‘‘

The entries is an array of eventfs_entry structures which has:

const char               *name eventfs_callback        callback;

The name is the name of the file, and the callback is a pointer to a function that will be called when the file is referenced (either by lookup or by reading a directory). The callback is of the prototype:

int callback(const char *name, umode_t *mode, void **data, const struct
file_operations **fops);

When a file needs to be created, this callback will be called with:

  • name = the name of the file being created (so that the same callback may be used for multiple files).
  • mode = a place to set the file's mode
  • data = A pointer to data, and the callback may replace it, which will cause the file created to pass the new data to the open call.
  • fops = the fops to use for the created file.
NB. callback is called while holding internal locks of the eventfs system. The callback must not call any code that might also call into the tracefs or eventfs system or it will risk creating a deadlock. πŸ’€ this is the serious part, bestie β€” do not play with it.

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./fs/tracefs/event_inode.c and these icons: lookup_file(9), lookup_dir_entry(9), eventfs_d_release(9), lookup_file_dentry(9), eventfs_root_lookup(9), eventfs_create_events_dir(9), eventfs_remove_rec(9), eventfs_remove_dir(9), eventfs_remove_events_dir(9).


that's the page, bestie 🫢 β€” source/version is ./fs/tracefs, date is October 2026, and the title is eventfs_create_dir(9). periodt βœ¨πŸ’…

πŸ“¦ where this page comes from