Skip to content

Commit

Permalink
USB: Remove BKL from lseek implementations
Browse files Browse the repository at this point in the history
Replace it by
mutex_lock(&file->f_dentry->d_inode->i_mutex);
following the example of the generic method

Signed-off-by: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Oliver Neukum authored and Greg Kroah-Hartman committed Mar 2, 2010
1 parent 063e20e commit f9de332
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions drivers/usb/core/devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ static loff_t usb_device_lseek(struct file *file, loff_t offset, int orig)
{
loff_t ret;

lock_kernel();
mutex_lock(&file->f_dentry->d_inode->i_mutex);

switch (orig) {
case 0:
Expand All @@ -691,7 +691,7 @@ static loff_t usb_device_lseek(struct file *file, loff_t offset, int orig)
ret = -EINVAL;
}

unlock_kernel();
mutex_unlock(&file->f_dentry->d_inode->i_mutex);
return ret;
}

Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/core/devio.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ static loff_t usbdev_lseek(struct file *file, loff_t offset, int orig)
{
loff_t ret;

lock_kernel();
mutex_lock(&file->f_dentry->d_inode->i_mutex);

switch (orig) {
case 0:
Expand All @@ -138,7 +138,7 @@ static loff_t usbdev_lseek(struct file *file, loff_t offset, int orig)
ret = -EINVAL;
}

unlock_kernel();
mutex_unlock(&file->f_dentry->d_inode->i_mutex);
return ret;
}

Expand Down

0 comments on commit f9de332

Please sign in to comment.