1DEBUGFS_CREATE_FILE_(9) The debugfs filesystem DEBUGFS_CREATE_FILE_(9)
2
3
4
6 debugfs_create_file_size - create a file in the debugfs filesystem
7
9 struct dentry * debugfs_create_file_size(const char * name,
10 umode_t mode,
11 struct dentry * parent,
12 void * data,
13 const struct file_operations * fops,
14 loff_t file_size);
15
17 name
18 a pointer to a string containing the name of the file to create.
19
20 mode
21 the permission that the file should have.
22
23 parent
24 a pointer to the parent dentry for this file. This should be a
25 directory dentry if set. If this parameter is NULL, then the file
26 will be created in the root of the debugfs filesystem.
27
28 data
29 a pointer to something that the caller will want to get to later
30 on. The inode.i_private pointer will point to this value on the
31 open call.
32
33 fops
34 a pointer to a struct file_operations that should be used for this
35 file.
36
37 file_size
38 initial file size
39
41 This is the basic “create a file” function for debugfs. It allows for a
42 wide range of flexibility in creating a file, or a directory (if you
43 want to create a directory, the debugfs_create_dir function is
44 recommended to be used instead.)
45
46 This function will return a pointer to a dentry if it succeeds. This
47 pointer must be passed to the debugfs_remove function when the file is
48 to be removed (no automatic cleanup happens if your module is unloaded,
49 you are responsible here.) If an error occurs, NULL will be returned.
50
51 If debugfs is not enabled in the kernel, the value -ENODEV will be
52 returned.
53
55Kernel Hackers Manual 2.6. June 2019 DEBUGFS_CREATE_FILE_(9)