debugfs_create_size_t(9)
π debugfs_create_size_t(9) β the Kernel API Manual, but make it make sense
okay so bestie, we're in the debugfs_create_size_t(9) page of the Kernel API Manual and this one is genuinely so simple you're gonna slay it. It's the little helper that gives you a debugfs file wired straight to a size_t variable. reads it, writes it, no cap. π
β¨ NAME β¨
debugfs_create_size_t β create a debugfs file that is used to read and write an size_t value π¦
like. that's the whole assignment. one file, one size_t, they're in a situationship and it's iconic.
πΈ SYNOPSIS πΈ
void debugfs_create_size_t (const char *name , umode_t mode , struct
dentry *parent , size_t *value );
four arguments, that's it, you got this π
π ARGUMENTS π
nameβ a pointer to a string containing the name of the file to create. yeah bestie, this is literally just what your debugfs file is gonna be called. pick something cute (or, y'know, descriptive, whatever works). β¨modeβ the permission that the file should have. the vibe check for who gets to touch your file. πparentβ a pointer to the parent dentry for this file. This should be a directory dentry if set. If this parameter isNULL, then the file will be created in the root of the debugfs filesystem. so like... set it and your file lives in its little directory home, or passNULLand it's just rawdogging it in the debugfs root. periodt. πvalueβ a pointer to the variable that the file should read to and write from. this is your actualsize_t, the main character. the file reads from it, the file writes to it, and it's literally that simple. π
π₯ SEE ALSO π₯
okay so there's a whole friend group here, and you should fr fr go meet them:
Kernel file ./fs/debugfs/file.c β like the source file, the origin story, go read it iykyk π
debugfs_file_get(9)debugfs_file_put(9)debugfs_enter_cancellation(9)debugfs_leave_cancellation(9)debugfs_create_u8(9)debugfs_create_u16(9)debugfs_create_u32(9)debugfs_create_u64(9)debugfs_create_ulong(9)debugfs_create_x8(9)debugfs_create_x16(9)debugfs_create_x32(9)debugfs_create_x64(9)debugfs_create_atomic_t(9)debugfs_create_bool(9)debugfs_create_str(9)debugfs_create_blob(9)debugfs_create_u32_array(9)debugfs_print_regs32(9)debugfs_create_regset32(9)debugfs_create_devm_seqfile(9)
it's giving "found family" honestly. go say hi. π«Ά
bestie reminder: this page is from ./fs/debugfs, dated October 2026 β so if you're reading it in the past, no you're not. π
anyway that's the whole page, go forth and create your little size_t file, you're gonna eat π
β¨πΈ
π¦ 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