Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 82859
b: refs/heads/master
c: 2b06ac8
h: refs/heads/master
i:
  82857: 7c6131e
  82855: 609d54f
v: v3
  • Loading branch information
H. Peter Anvin authored and Ingo Molnar committed Feb 4, 2008
1 parent ebb3b13 commit 8b1e95c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2347d933b158932cf2b8aeebae3e5cc16b200bd1
refs/heads/master: 2b06ac867176d5d24757bda7e13f6255d6b96d7b
7 changes: 3 additions & 4 deletions trunk/arch/x86/kernel/cpuid.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ static void cpuid_smp_cpuid(void *cmd_block)
static loff_t cpuid_seek(struct file *file, loff_t offset, int orig)
{
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;
Expand All @@ -77,8 +77,7 @@ static loff_t cpuid_seek(struct file *file, loff_t offset, int orig)
default:
ret = -EINVAL;
}

unlock_kernel();
mutex_unlock(&inode->i_mutex);
return ret;
}

Expand Down
14 changes: 9 additions & 5 deletions trunk/arch/x86/kernel/msr.c
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -56,8 +57,11 @@ 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;
}

Expand Down

0 comments on commit 8b1e95c

Please sign in to comment.