aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpuid.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-02-04 10:47:59 -0500
committerIngo Molnar <mingo@elte.hu>2008-02-04 10:47:59 -0500
commit2b06ac867176d5d24757bda7e13f6255d6b96d7b (patch)
tree3a9b1e802b46dfc494f50031e51d118724bf9fa6 /arch/x86/kernel/cpuid.c
parent2347d933b158932cf2b8aeebae3e5cc16b200bd1 (diff)
x86: cpuid, msr: use inode mutex instead of big kernel lock
Instead of grabbing the BKL on seek, use the inode mutex in the style of generic_file_llseek(). Signed-off-by: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/cpuid.c')
-rw-r--r--arch/x86/kernel/cpuid.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c
index c10ebc4b8e4b..288e7a6598ac 100644
--- a/arch/x86/kernel/cpuid.c
+++ b/arch/x86/kernel/cpuid.c
@@ -62,9 +62,9 @@ static void cpuid_smp_cpuid(void *cmd_block)
62static loff_t cpuid_seek(struct file *file, loff_t offset, int orig) 62static loff_t cpuid_seek(struct file *file, loff_t offset, int orig)
63{ 63{
64 loff_t ret; 64 loff_t ret;
65 struct inode *inode = file->f_mapping->host;
65 66
66 lock_kernel(); 67 mutex_lock(&inode->i_mutex);
67
68 switch (orig) { 68 switch (orig) {
69 case 0: 69 case 0:
70 file->f_pos = offset; 70 file->f_pos = offset;
@@ -77,8 +77,7 @@ static loff_t cpuid_seek(struct file *file, loff_t offset, int orig)
77 default: 77 default:
78 ret = -EINVAL; 78 ret = -EINVAL;
79 } 79 }
80 80 mutex_unlock(&inode->i_mutex);
81 unlock_kernel();
82 return ret; 81 return ret;
83} 82}
84 83