diff options
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/fs/namei.c b/fs/namei.c index 25e4ab4ce8b7..b69f6ebadb95 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -271,6 +271,23 @@ int vfs_permission(struct nameidata *nd, int mask) | |||
271 | return permission(nd->dentry->d_inode, mask, nd); | 271 | return permission(nd->dentry->d_inode, mask, nd); |
272 | } | 272 | } |
273 | 273 | ||
274 | /** | ||
275 | * file_permission - check for additional access rights to a given file | ||
276 | * @file: file to check access rights for | ||
277 | * @mask: right to check for (%MAY_READ, %MAY_WRITE, %MAY_EXEC) | ||
278 | * | ||
279 | * Used to check for read/write/execute permissions on an already opened | ||
280 | * file. | ||
281 | * | ||
282 | * Note: | ||
283 | * Do not use this function in new code. All access checks should | ||
284 | * be done using vfs_permission(). | ||
285 | */ | ||
286 | int file_permission(struct file *file, int mask) | ||
287 | { | ||
288 | return permission(file->f_dentry->d_inode, mask, NULL); | ||
289 | } | ||
290 | |||
274 | /* | 291 | /* |
275 | * get_write_access() gets write permission for a file. | 292 | * get_write_access() gets write permission for a file. |
276 | * put_write_access() releases this write permission. | 293 | * put_write_access() releases this write permission. |
@@ -2551,6 +2568,7 @@ EXPORT_SYMBOL(path_release); | |||
2551 | EXPORT_SYMBOL(path_walk); | 2568 | EXPORT_SYMBOL(path_walk); |
2552 | EXPORT_SYMBOL(permission); | 2569 | EXPORT_SYMBOL(permission); |
2553 | EXPORT_SYMBOL(vfs_permission); | 2570 | EXPORT_SYMBOL(vfs_permission); |
2571 | EXPORT_SYMBOL(file_permission); | ||
2554 | EXPORT_SYMBOL(unlock_rename); | 2572 | EXPORT_SYMBOL(unlock_rename); |
2555 | EXPORT_SYMBOL(vfs_create); | 2573 | EXPORT_SYMBOL(vfs_create); |
2556 | EXPORT_SYMBOL(vfs_follow_link); | 2574 | EXPORT_SYMBOL(vfs_follow_link); |