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