debugfs_change_name(9)
π debugfs_change_name β like, the Kernel API Manual (section 9) page, bestie
okay so picture this: you're deep in debugfs and you want a thing to have a different name. not a new thing. same thing. new name. that's this function. it's giving rebrand era, and honestly? iconic. β¨
π SYNOPSIS
int debugfs_change_name (struct dentry *dentry , const char *fmt , ...
);
like yes, it's int, it takes a struct dentry *, a const char * format, and then a lil ... tail of variable arguments. we love an ellipsis. she contains multitudes. π
πΈ ARGUMENTS
dentryβ thedentryof an object that's getting renamed. this is the glow-up target, the main character, the one whose name is about to change. no cap.fmtβ the format for the new name. so yeah, it's printf-style coded, which means...is doing real work here....β variable arguments. the supporting cast. the vibes. β¨
π¦ DESCRIPTION
okay so here's the tea π΅: this function renames a file/directory in debugfs. that's literally it, that's the whole assignment, and she ate.
but bestie, listen to the caveat because it matters: the target must not exist for the rename to succeed. like if something's already chilling at that name, the rename does not go through. no dupe names, not today. π«
and the return values, because we're paying attention:
- it'll return
0on success π (the good ending) - and
-E...on failure π (the error family, expressed as-E...β that's exactly how the page puts it, don't come for me)
π«Ά also, important: if debugfs is not enabled in the kernel, the value-ENODEVwill be returned. so if you're getting-ENODEVand you're like "???" β that's your answer. she's not even built in.
π SEE ALSO
- Kernel file
./fs/debugfs/inode.cβ go read the source, iykyk, the source is always the vibe check debugfs_lookup(9)debugfs_create_file_unsafe(9)debugfs_create_file_size(9)debugfs_create_dir(9)debugfs_create_automount(9)debugfs_create_symlink(9)debugfs_remove(9)debugfs_lookup_and_remove(9)debugfs_initialized(9)
like that's the whole friend group right there. a whole squad of debugfs besties. π
mwah π and that's the page! brought to you by the manual debugfs_change_name(9), filed under Kernel API Manual, living in source ./fs/debugfs, dated October 2026. go forth and rename responsibly, bestie β and remember, the target must not already exist. 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