diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-03-03 16:23:02 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-03-03 16:23:03 -0500 |
commit | 56a79b7b021bf1b08334e63c2c14b280e2dbf47a (patch) | |
tree | 0419233e6194f4f12073c9284852885aa8984bec /arch/x86/kernel | |
parent | 1c82315a12144cde732636e259d39e3ee81b3c5b (diff) | |
parent | dcf787f39162ce32ca325b3e784aba2d2444619a (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull more VFS bits from Al Viro:
"Unfortunately, it looks like xattr series will have to wait until the
next cycle ;-/
This pile contains 9p cleanups and fixes (races in v9fs_fid_add()
etc), fixup for nommu breakage in shmem.c, several cleanups and a bit
more file_inode() work"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
constify path_get/path_put and fs_struct.c stuff
fix nommu breakage in shmem.c
cache the value of file_inode() in struct file
9p: if v9fs_fid_lookup() gets to asking server, it'd better have hashed dentry
9p: make sure ->lookup() adds fid to the right dentry
9p: untangle ->lookup() a bit
9p: double iput() in ->lookup() if d_materialise_unique() fails
9p: v9fs_fid_add() can't fail now
v9fs: get rid of v9fs_dentry
9p: turn fid->dlist into hlist
9p: don't bother with private lock in ->d_fsdata; dentry->d_lock will do just fine
more file_inode() open-coded instances
selinux: opened file can't have NULL or negative ->f_path.dentry
(In the meantime, the hlist traversal macros have changed, so this
required a semantic conflict fixup for the newly hlistified fid->dlist)
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/msr.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c index 4929502c1372..ce130493b802 100644 --- a/arch/x86/kernel/msr.c +++ b/arch/x86/kernel/msr.c | |||
@@ -71,7 +71,7 @@ static ssize_t msr_read(struct file *file, char __user *buf, | |||
71 | u32 __user *tmp = (u32 __user *) buf; | 71 | u32 __user *tmp = (u32 __user *) buf; |
72 | u32 data[2]; | 72 | u32 data[2]; |
73 | u32 reg = *ppos; | 73 | u32 reg = *ppos; |
74 | int cpu = iminor(file->f_path.dentry->d_inode); | 74 | int cpu = iminor(file_inode(file)); |
75 | int err = 0; | 75 | int err = 0; |
76 | ssize_t bytes = 0; | 76 | ssize_t bytes = 0; |
77 | 77 | ||
@@ -99,7 +99,7 @@ static ssize_t msr_write(struct file *file, const char __user *buf, | |||
99 | const u32 __user *tmp = (const u32 __user *)buf; | 99 | const u32 __user *tmp = (const u32 __user *)buf; |
100 | u32 data[2]; | 100 | u32 data[2]; |
101 | u32 reg = *ppos; | 101 | u32 reg = *ppos; |
102 | int cpu = iminor(file->f_path.dentry->d_inode); | 102 | int cpu = iminor(file_inode(file)); |
103 | int err = 0; | 103 | int err = 0; |
104 | ssize_t bytes = 0; | 104 | ssize_t bytes = 0; |
105 | 105 | ||
@@ -125,7 +125,7 @@ static long msr_ioctl(struct file *file, unsigned int ioc, unsigned long arg) | |||
125 | { | 125 | { |
126 | u32 __user *uregs = (u32 __user *)arg; | 126 | u32 __user *uregs = (u32 __user *)arg; |
127 | u32 regs[8]; | 127 | u32 regs[8]; |
128 | int cpu = iminor(file->f_path.dentry->d_inode); | 128 | int cpu = iminor(file_inode(file)); |
129 | int err; | 129 | int err; |
130 | 130 | ||
131 | switch (ioc) { | 131 | switch (ioc) { |
@@ -171,13 +171,12 @@ static long msr_ioctl(struct file *file, unsigned int ioc, unsigned long arg) | |||
171 | 171 | ||
172 | static int msr_open(struct inode *inode, struct file *file) | 172 | static int msr_open(struct inode *inode, struct file *file) |
173 | { | 173 | { |
174 | unsigned int cpu; | 174 | unsigned int cpu = iminor(file_inode(file)); |
175 | struct cpuinfo_x86 *c; | 175 | struct cpuinfo_x86 *c; |
176 | 176 | ||
177 | if (!capable(CAP_SYS_RAWIO)) | 177 | if (!capable(CAP_SYS_RAWIO)) |
178 | return -EPERM; | 178 | return -EPERM; |
179 | 179 | ||
180 | cpu = iminor(file->f_path.dentry->d_inode); | ||
181 | if (cpu >= nr_cpu_ids || !cpu_online(cpu)) | 180 | if (cpu >= nr_cpu_ids || !cpu_online(cpu)) |
182 | return -ENXIO; /* No such CPU */ | 181 | return -ENXIO; /* No such CPU */ |
183 | 182 | ||