mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 18:39:59 +00:00
vfs: don't use BKL in default_llseek
There are currently 191 users of default_llseek. Nine of these are in device drivers that use the big kernel lock. None of these ever touch file->f_pos outside of llseek or file_pos_write. Consequently, we never rely on the BKL in the default_llseek function and can replace that with i_mutex, which is also used in generic_file_llseek. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
parent
6038f373a3
commit
ab91261f5c
1 changed files with 2 additions and 2 deletions
|
@ -124,7 +124,7 @@ loff_t default_llseek(struct file *file, loff_t offset, int origin)
|
||||||
{
|
{
|
||||||
loff_t retval;
|
loff_t retval;
|
||||||
|
|
||||||
lock_kernel();
|
mutex_lock(&file->f_dentry->d_inode->i_mutex);
|
||||||
switch (origin) {
|
switch (origin) {
|
||||||
case SEEK_END:
|
case SEEK_END:
|
||||||
offset += i_size_read(file->f_path.dentry->d_inode);
|
offset += i_size_read(file->f_path.dentry->d_inode);
|
||||||
|
@ -145,7 +145,7 @@ loff_t default_llseek(struct file *file, loff_t offset, int origin)
|
||||||
retval = offset;
|
retval = offset;
|
||||||
}
|
}
|
||||||
out:
|
out:
|
||||||
unlock_kernel();
|
mutex_unlock(&file->f_dentry->d_inode->i_mutex);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(default_llseek);
|
EXPORT_SYMBOL(default_llseek);
|
||||||
|
|
Loading…
Reference in a new issue