On Sun, 13 Apr 2008 11:50:07 -0300 Thiago Galesi [off-list ref] wrote:
This patch removes lock_kernel(), unlock_kernel() usage in fbmem.c and replaces it with a mutex
It isn't that simple, alas.
vfs_ioctl() runs lock_kernel() prior to calling fb_ioctl(), so the
lock_kernel()s in fb_compat_ioctl() are actually providing exclusion against
fb_ioctl(). Your patch would break that.
A suitable fix might be to do
__fb_ioctl(...)
{
<copy fb_ioctl() into here>
}
fb_ioctl(...)
{
mutex_lock(&info->hwlock);
__fb_ioctl(...);
mutex_unlock(&info->hwlock);
}
and then change fb_compat_ioctl() to call __fb_ioctl(). All the other
callers of fb_ioctl() would need to be reviewed - see if they need to take
the mutex then call __fb_ioctl(), or they might be OK as they are, calling
fb_ioctl().
Then we can switch fb_fops over to
.ioctl = NULL,
.unlocked_ioctl = fb_ioctl,
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone