aboutsummaryrefslogtreecommitdiffstats
path: root/security/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/inode.c')
-rw-r--r--security/inode.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/security/inode.c b/security/inode.c
index acc6cf0d7900..efea5a605466 100644
--- a/security/inode.c
+++ b/security/inode.c
@@ -20,8 +20,7 @@
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/namei.h> 21#include <linux/namei.h>
22#include <linux/security.h> 22#include <linux/security.h>
23 23#include <linux/magic.h>
24#define SECURITYFS_MAGIC 0x73636673
25 24
26static struct vfsmount *mount; 25static struct vfsmount *mount;
27static int mount_count; 26static int mount_count;
@@ -190,7 +189,7 @@ static int create_by_name(const char *name, mode_t mode,
190 * @name: a pointer to a string containing the name of the file to create. 189 * @name: a pointer to a string containing the name of the file to create.
191 * @mode: the permission that the file should have 190 * @mode: the permission that the file should have
192 * @parent: a pointer to the parent dentry for this file. This should be a 191 * @parent: a pointer to the parent dentry for this file. This should be a
193 * directory dentry if set. If this paramater is NULL, then the 192 * directory dentry if set. If this parameter is %NULL, then the
194 * file will be created in the root of the securityfs filesystem. 193 * file will be created in the root of the securityfs filesystem.
195 * @data: a pointer to something that the caller will want to get to later 194 * @data: a pointer to something that the caller will want to get to later
196 * on. The inode.i_private pointer will point to this value on 195 * on. The inode.i_private pointer will point to this value on
@@ -199,18 +198,18 @@ static int create_by_name(const char *name, mode_t mode,
199 * this file. 198 * this file.
200 * 199 *
201 * This is the basic "create a file" function for securityfs. It allows for a 200 * This is the basic "create a file" function for securityfs. It allows for a
202 * wide range of flexibility in createing a file, or a directory (if you 201 * wide range of flexibility in creating a file, or a directory (if you
203 * want to create a directory, the securityfs_create_dir() function is 202 * want to create a directory, the securityfs_create_dir() function is
204 * recommended to be used instead.) 203 * recommended to be used instead).
205 * 204 *
206 * This function will return a pointer to a dentry if it succeeds. This 205 * This function returns a pointer to a dentry if it succeeds. This
207 * pointer must be passed to the securityfs_remove() function when the file is 206 * pointer must be passed to the securityfs_remove() function when the file is
208 * to be removed (no automatic cleanup happens if your module is unloaded, 207 * to be removed (no automatic cleanup happens if your module is unloaded,
209 * you are responsible here.) If an error occurs, NULL will be returned. 208 * you are responsible here). If an error occurs, %NULL is returned.
210 * 209 *
211 * If securityfs is not enabled in the kernel, the value -ENODEV will be 210 * If securityfs is not enabled in the kernel, the value %-ENODEV is
212 * returned. It is not wise to check for this value, but rather, check for 211 * returned. It is not wise to check for this value, but rather, check for
213 * NULL or !NULL instead as to eliminate the need for #ifdef in the calling 212 * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling
214 * code. 213 * code.
215 */ 214 */
216struct dentry *securityfs_create_file(const char *name, mode_t mode, 215struct dentry *securityfs_create_file(const char *name, mode_t mode,
@@ -252,19 +251,19 @@ EXPORT_SYMBOL_GPL(securityfs_create_file);
252 * @name: a pointer to a string containing the name of the directory to 251 * @name: a pointer to a string containing the name of the directory to
253 * create. 252 * create.
254 * @parent: a pointer to the parent dentry for this file. This should be a 253 * @parent: a pointer to the parent dentry for this file. This should be a
255 * directory dentry if set. If this paramater is NULL, then the 254 * directory dentry if set. If this parameter is %NULL, then the
256 * directory will be created in the root of the securityfs filesystem. 255 * directory will be created in the root of the securityfs filesystem.
257 * 256 *
258 * This function creates a directory in securityfs with the given name. 257 * This function creates a directory in securityfs with the given @name.
259 * 258 *
260 * This function will return a pointer to a dentry if it succeeds. This 259 * This function returns a pointer to a dentry if it succeeds. This
261 * pointer must be passed to the securityfs_remove() function when the file is 260 * pointer must be passed to the securityfs_remove() function when the file is
262 * to be removed (no automatic cleanup happens if your module is unloaded, 261 * to be removed (no automatic cleanup happens if your module is unloaded,
263 * you are responsible here.) If an error occurs, NULL will be returned. 262 * you are responsible here). If an error occurs, %NULL will be returned.
264 * 263 *
265 * If securityfs is not enabled in the kernel, the value -ENODEV will be 264 * If securityfs is not enabled in the kernel, the value %-ENODEV is
266 * returned. It is not wise to check for this value, but rather, check for 265 * returned. It is not wise to check for this value, but rather, check for
267 * NULL or !NULL instead as to eliminate the need for #ifdef in the calling 266 * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling
268 * code. 267 * code.
269 */ 268 */
270struct dentry *securityfs_create_dir(const char *name, struct dentry *parent) 269struct dentry *securityfs_create_dir(const char *name, struct dentry *parent)
@@ -278,16 +277,15 @@ EXPORT_SYMBOL_GPL(securityfs_create_dir);
278/** 277/**
279 * securityfs_remove - removes a file or directory from the securityfs filesystem 278 * securityfs_remove - removes a file or directory from the securityfs filesystem
280 * 279 *
281 * @dentry: a pointer to a the dentry of the file or directory to be 280 * @dentry: a pointer to a the dentry of the file or directory to be removed.
282 * removed.
283 * 281 *
284 * This function removes a file or directory in securityfs that was previously 282 * This function removes a file or directory in securityfs that was previously
285 * created with a call to another securityfs function (like 283 * created with a call to another securityfs function (like
286 * securityfs_create_file() or variants thereof.) 284 * securityfs_create_file() or variants thereof.)
287 * 285 *
288 * This function is required to be called in order for the file to be 286 * This function is required to be called in order for the file to be
289 * removed, no automatic cleanup of files will happen when a module is 287 * removed. No automatic cleanup of files will happen when a module is
290 * removed, you are responsible here. 288 * removed; you are responsible here.
291 */ 289 */
292void securityfs_remove(struct dentry *dentry) 290void securityfs_remove(struct dentry *dentry)
293{ 291{