提交 f9de332e 编写于 作者: O Oliver Neukum 提交者: Greg Kroah-Hartman

USB: Remove BKL from lseek implementations

Replace it by
mutex_lock(&file->f_dentry->d_inode->i_mutex);
following the example of the generic method
Signed-off-by: NOliver Neukum <oliver@neukum.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 063e20eb
...@@ -675,7 +675,7 @@ static loff_t usb_device_lseek(struct file *file, loff_t offset, int orig) ...@@ -675,7 +675,7 @@ static loff_t usb_device_lseek(struct file *file, loff_t offset, int orig)
{ {
loff_t ret; loff_t ret;
lock_kernel(); mutex_lock(&file->f_dentry->d_inode->i_mutex);
switch (orig) { switch (orig) {
case 0: case 0:
...@@ -691,7 +691,7 @@ static loff_t usb_device_lseek(struct file *file, loff_t offset, int orig) ...@@ -691,7 +691,7 @@ static loff_t usb_device_lseek(struct file *file, loff_t offset, int orig)
ret = -EINVAL; ret = -EINVAL;
} }
unlock_kernel(); mutex_unlock(&file->f_dentry->d_inode->i_mutex);
return ret; return ret;
} }
......
...@@ -122,7 +122,7 @@ static loff_t usbdev_lseek(struct file *file, loff_t offset, int orig) ...@@ -122,7 +122,7 @@ static loff_t usbdev_lseek(struct file *file, loff_t offset, int orig)
{ {
loff_t ret; loff_t ret;
lock_kernel(); mutex_lock(&file->f_dentry->d_inode->i_mutex);
switch (orig) { switch (orig) {
case 0: case 0:
...@@ -138,7 +138,7 @@ static loff_t usbdev_lseek(struct file *file, loff_t offset, int orig) ...@@ -138,7 +138,7 @@ static loff_t usbdev_lseek(struct file *file, loff_t offset, int orig)
ret = -EINVAL; ret = -EINVAL;
} }
unlock_kernel(); mutex_unlock(&file->f_dentry->d_inode->i_mutex);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册