[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1227802849.4454.1765.camel@twins>
Date: Thu, 27 Nov 2008 17:20:49 +0100
From: Peter Zijlstra <a.p.zijlstra@...llo.nl>
To: Eric Paris <eparis@...hat.com>
Cc: linux-kernel@...r.kernel.org, malware-list@...ts.printk.net,
viro@...iv.linux.org.uk, akpm@...ux-foundation.org,
alan@...rguk.ukuu.org.uk, arjan@...radead.org, hch@...radead.org
Subject: Re: [PATCH -v3 5/8] fsnotify: unified filesystem notification
backend
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists