lkml.org 
[lkml]   [2003]   [Dec]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC,PATCH] use rcu for fasync_lock
From
Date
Manfred Spraul <manfred@colorfullife.com> writes:

> void kill_fasync(struct fasync_struct **fp, int sig, int band)
> {
> - read_lock(&fasync_lock);
> + rcu_read_lock();
> __kill_fasync(*fp, sig, band);
> - read_unlock(&fasync_lock);
> + rcu_read_unlock();
> }

Usually *fp is NULL, I think. So what about the following test?

void kill_fasync(struct fasync_struct **fp, int sig, int band)
{
if (*fp) {
rcu_read_lock();
__kill_fasync(*fp, sig, band);
rcu_read_unlock();
}
}

Or use inline function for testing *fp.
--
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:59    [W:0.409 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site