mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
fs: provide rcu-walk aware permission i_ops
Signed-off-by: Nick Piggin <npiggin@kernel.dk>
This commit is contained in:
parent
34286d6662
commit
b74c79e993
60 changed files with 287 additions and 146 deletions
|
@ -348,13 +348,18 @@ int sysfs_hash_and_remove(struct sysfs_dirent *dir_sd, const void *ns, const cha
|
|||
return -ENOENT;
|
||||
}
|
||||
|
||||
int sysfs_permission(struct inode *inode, int mask)
|
||||
int sysfs_permission(struct inode *inode, int mask, unsigned int flags)
|
||||
{
|
||||
struct sysfs_dirent *sd = inode->i_private;
|
||||
struct sysfs_dirent *sd;
|
||||
|
||||
if (flags & IPERM_FLAG_RCU)
|
||||
return -ECHILD;
|
||||
|
||||
sd = inode->i_private;
|
||||
|
||||
mutex_lock(&sysfs_mutex);
|
||||
sysfs_refresh_inode(sd, inode);
|
||||
mutex_unlock(&sysfs_mutex);
|
||||
|
||||
return generic_permission(inode, mask, NULL);
|
||||
return generic_permission(inode, mask, flags, NULL);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue