diff options
Diffstat (limited to 'fs/sysfs/inode.c')
-rw-r--r-- | fs/sysfs/inode.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c index cffb1fd8ba33..0a12eb89cd32 100644 --- a/fs/sysfs/inode.c +++ b/fs/sysfs/inode.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/errno.h> | 19 | #include <linux/errno.h> |
20 | #include <linux/sched.h> | 20 | #include <linux/sched.h> |
21 | #include <linux/slab.h> | 21 | #include <linux/slab.h> |
22 | #include <linux/sysfs.h> | ||
22 | #include <linux/xattr.h> | 23 | #include <linux/xattr.h> |
23 | #include <linux/security.h> | 24 | #include <linux/security.h> |
24 | #include "sysfs.h" | 25 | #include "sysfs.h" |
@@ -348,13 +349,18 @@ int sysfs_hash_and_remove(struct sysfs_dirent *dir_sd, const void *ns, const cha | |||
348 | return -ENOENT; | 349 | return -ENOENT; |
349 | } | 350 | } |
350 | 351 | ||
351 | int sysfs_permission(struct inode *inode, int mask) | 352 | int sysfs_permission(struct inode *inode, int mask, unsigned int flags) |
352 | { | 353 | { |
353 | struct sysfs_dirent *sd = inode->i_private; | 354 | struct sysfs_dirent *sd; |
355 | |||
356 | if (flags & IPERM_FLAG_RCU) | ||
357 | return -ECHILD; | ||
358 | |||
359 | sd = inode->i_private; | ||
354 | 360 | ||
355 | mutex_lock(&sysfs_mutex); | 361 | mutex_lock(&sysfs_mutex); |
356 | sysfs_refresh_inode(sd, inode); | 362 | sysfs_refresh_inode(sd, inode); |
357 | mutex_unlock(&sysfs_mutex); | 363 | mutex_unlock(&sysfs_mutex); |
358 | 364 | ||
359 | return generic_permission(inode, mask, NULL); | 365 | return generic_permission(inode, mask, flags, NULL); |
360 | } | 366 | } |