inotify: use fsnotify group lock helpers
inotify inode marks pin the inode so there is no need to set the FSNOTIFY_GROUP_NOFS flag. Link: https://lore.kernel.org/r/20220422120327.3459282-8-amir73il@gmail.com Suggested-by: Jan Kara <jack@suse.cz> Link: https://lore.kernel.org/r/20220321112310.vpr7oxro2xkz5llh@quack3.lan/ Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
This commit is contained in:
parent
43b245a788
commit
642054b870
@ -640,13 +640,13 @@ static int inotify_update_watch(struct fsnotify_group *group, struct inode *inod
|
|||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
mutex_lock(&group->mark_mutex);
|
fsnotify_group_lock(group);
|
||||||
/* try to update and existing watch with the new arg */
|
/* try to update and existing watch with the new arg */
|
||||||
ret = inotify_update_existing_watch(group, inode, arg);
|
ret = inotify_update_existing_watch(group, inode, arg);
|
||||||
/* no mark present, try to add a new one */
|
/* no mark present, try to add a new one */
|
||||||
if (ret == -ENOENT)
|
if (ret == -ENOENT)
|
||||||
ret = inotify_new_watch(group, inode, arg);
|
ret = inotify_new_watch(group, inode, arg);
|
||||||
mutex_unlock(&group->mark_mutex);
|
fsnotify_group_unlock(group);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user