lkml.org 
[lkml]   [2008]   [Oct]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: BKL still required for what functions?
> -	lock_kernel();
> +
> mutex_lock(&phone_lock);
> p = phone_device[minor];
> if (p)
> new_fops = fops_get(p->f_op);
> if (!new_fops) {
> mutex_unlock(&phone_lock);
> + lock_kernel();
> request_module("char-major-%d-%d", PHONE_MAJOR, minor);
> + unlock_kernel();
> mutex_lock(&phone_lock);
> p = phone_device[minor];
> if (p == NULL || (new_fops = fops_get(p->f_op)) == NULL)
> @@ -81,7 +83,6 @@ static int phone_open(struct inode *inode, struct
> file *file)
> fops_put(old_fops);
> end:
> mutex_unlock(&phone_lock);
> - unlock_kernel();
> return err;
> }

Looks like the BKL can go entirely there providing phone_device[] is
always rechecked back in the phone mutex, request_module is happy nowdays
without the BKL


\
 
 \ /
  Last update: 2008-10-07 20:17    [W:8.682 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site