lkml.org 
[lkml]   [2008]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH -v3 5/8] fsnotify: unified filesystem notification backend
From
Date
On Tue, 2008-11-25 at 12:21 -0500, Eric Paris wrote:
> +int fsnotify_check_notif_queue(struct fsnotify_group *group)
> +{
> + mutex_lock(&group->notification_mutex);
> + if (!list_empty(&group->notification_list))
> + return 1;
> + mutex_unlock(&group->notification_mutex);
> + return 0;
> +}

> +void fsnotify_clear_notif(struct fsnotify_group *group)
> +{
> + struct fsnotify_event *event;
> +
> + while (fsnotify_check_notif_queue(group)) {
> + event = get_event_from_notif(group);
> + fsnotify_put_event(event);
> + /* fsnotify_check_notif_queue() took this lock */
> + mutex_unlock(&group->notification_mutex);
> + }
> +}

That is quite horrible, please just open code that to keep the locking
symmetric.



\
 
 \ /
  Last update: 2008-11-27 17:25    [W:1.491 / U:1.828 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site