Re: [RFC,PATCH] use rcu for fasync_lock

OGAWA Hirofumi
2003-12-21T18:39:56Z

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>