aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2010-07-07 16:55:17 -0400
committerArnd Bergmann <arnd@arndb.de>2010-10-15 09:53:34 -0400
commitab91261f5c43f196ec7ff1d113847b87b7606b26 (patch)
treeba368bdd2156e3e6671be4bc1c0933fa5fad51b9
parent6038f373a3dc1f1c26496e60b6c40b164716f07e (diff)
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>
-rw-r--r--fs/read_write.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/read_write.c b/fs/read_write.c
index 74e36586e4d3..fd09f6166ccf 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -124,7 +124,7 @@ loff_t default_llseek(struct file *file, loff_t offset, int origin)
124{ 124{
125 loff_t retval; 125 loff_t retval;
126 126
127 lock_kernel(); 127 mutex_lock(&file->f_dentry->d_inode->i_mutex);
128 switch (origin) { 128 switch (origin) {
129 case SEEK_END: 129 case SEEK_END:
130 offset += i_size_read(file->f_path.dentry->d_inode); 130 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)
145 retval = offset; 145 retval = offset;
146 } 146 }
147out: 147out:
148 unlock_kernel(); 148 mutex_unlock(&file->f_dentry->d_inode->i_mutex);
149 return retval; 149 return retval;
150} 150}
151EXPORT_SYMBOL(default_llseek); 151EXPORT_SYMBOL(default_llseek);