]> git.samba.org - sfrench/cifs-2.6.git/blobdiff - arch/x86/kernel/msr.c
x86: use not_pci bitmap #5
[sfrench/cifs-2.6.git] / arch / x86 / kernel / msr.c
index bd82850e6519b8a51d2c2a68512a7b492d864229..4dfb4053005714bb222f19d821856ccb19cadd7a 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------- *
- *   
- *   Copyright 2000 H. Peter Anvin - All Rights Reserved
+ *
+ *   Copyright 2000-2008 H. Peter Anvin - All Rights Reserved
  *
  *   This program is free software; you can redistribute it and/or modify
  *   it under the terms of the GNU General Public License as published by
@@ -45,9 +45,10 @@ static struct class *msr_class;
 
 static loff_t msr_seek(struct file *file, loff_t offset, int orig)
 {
-       loff_t ret = -EINVAL;
+       loff_t ret;
+       struct inode *inode = file->f_mapping->host;
 
-       lock_kernel();
+       mutex_lock(&inode->i_mutex);
        switch (orig) {
        case 0:
                file->f_pos = offset;
@@ -56,13 +57,16 @@ static loff_t msr_seek(struct file *file, loff_t offset, int orig)
        case 1:
                file->f_pos += offset;
                ret = file->f_pos;
+               break;
+       default:
+               ret = -EINVAL;
        }
-       unlock_kernel();
+       mutex_unlock(&inode->i_mutex);
        return ret;
 }
 
-static ssize_t msr_read(struct file *file, char __user * buf,
-                       size_t count, loff_t * ppos)
+static ssize_t msr_read(struct file *file, char __user *buf,
+                       size_t count, loff_t *ppos)
 {
        u32 __user *tmp = (u32 __user *) buf;
        u32 data[2];