aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-03-03 16:23:02 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-03-03 16:23:03 -0500
commit56a79b7b021bf1b08334e63c2c14b280e2dbf47a (patch)
tree0419233e6194f4f12073c9284852885aa8984bec
parent1c82315a12144cde732636e259d39e3ee81b3c5b (diff)
parentdcf787f39162ce32ca325b3e784aba2d2444619a (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)
-rw-r--r--arch/s390/hypfs/inode.c6
-rw-r--r--arch/x86/kernel/msr.c9
-rw-r--r--drivers/staging/comedi/comedi_fops.c14
-rw-r--r--drivers/tty/tty_io.c16
-rw-r--r--fs/9p/fid.c54
-rw-r--r--fs/9p/fid.h22
-rw-r--r--fs/9p/vfs_dentry.c17
-rw-r--r--fs/9p/vfs_inode.c40
-rw-r--r--fs/9p/vfs_inode_dotl.c19
-rw-r--r--fs/ext4/indirect.c2
-rw-r--r--fs/f2fs/file.c6
-rw-r--r--fs/file_table.c2
-rw-r--r--fs/fs_struct.c6
-rw-r--r--fs/fuse/dev.c2
-rw-r--r--fs/fuse/file.c24
-rw-r--r--fs/internal.h2
-rw-r--r--fs/namei.c4
-rw-r--r--fs/open.c3
-rw-r--r--fs/seq_file.c2
-rw-r--r--include/linux/fs.h3
-rw-r--r--include/linux/fs_struct.h4
-rw-r--r--include/linux/path.h4
-rw-r--r--include/net/9p/client.h2
-rw-r--r--kernel/futex.c2
-rw-r--r--mm/shmem.c5
-rw-r--r--security/selinux/hooks.c9
26 files changed, 108 insertions, 171 deletions
diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c
index 280ded8b79ba..8538015ed4a0 100644
--- a/arch/s390/hypfs/inode.c
+++ b/arch/s390/hypfs/inode.c
@@ -171,12 +171,10 @@ static ssize_t hypfs_aio_write(struct kiocb *iocb, const struct iovec *iov,
171 unsigned long nr_segs, loff_t offset) 171 unsigned long nr_segs, loff_t offset)
172{ 172{
173 int rc; 173 int rc;
174 struct super_block *sb; 174 struct super_block *sb = file_inode(iocb->ki_filp)->i_sb;
175 struct hypfs_sb_info *fs_info; 175 struct hypfs_sb_info *fs_info = sb->s_fs_info;
176 size_t count = iov_length(iov, nr_segs); 176 size_t count = iov_length(iov, nr_segs);
177 177
178 sb = iocb->ki_filp->f_path.dentry->d_inode->i_sb;
179 fs_info = sb->s_fs_info;
180 /* 178 /*
181 * Currently we only allow one update per second for two reasons: 179 * Currently we only allow one update per second for two reasons:
182 * 1. diag 204 is VERY expensive 180 * 1. diag 204 is VERY expensive
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
172static int msr_open(struct inode *inode, struct file *file) 172static 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
diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index 195d56d8a1ee..e336b281b847 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -580,7 +580,7 @@ static int do_devinfo_ioctl(struct comedi_device *dev,
580 struct comedi_devinfo __user *arg, 580 struct comedi_devinfo __user *arg,
581 struct file *file) 581 struct file *file)
582{ 582{
583 const unsigned minor = iminor(file->f_dentry->d_inode); 583 const unsigned minor = iminor(file_inode(file));
584 struct comedi_file_info *info = comedi_file_info_from_minor(minor); 584 struct comedi_file_info *info = comedi_file_info_from_minor(minor);
585 struct comedi_subdevice *s; 585 struct comedi_subdevice *s;
586 struct comedi_devinfo devinfo; 586 struct comedi_devinfo devinfo;
@@ -1615,7 +1615,7 @@ static int do_poll_ioctl(struct comedi_device *dev, unsigned int arg,
1615static long comedi_unlocked_ioctl(struct file *file, unsigned int cmd, 1615static long comedi_unlocked_ioctl(struct file *file, unsigned int cmd,
1616 unsigned long arg) 1616 unsigned long arg)
1617{ 1617{
1618 const unsigned minor = iminor(file->f_dentry->d_inode); 1618 const unsigned minor = iminor(file_inode(file));
1619 struct comedi_file_info *info = comedi_file_info_from_minor(minor); 1619 struct comedi_file_info *info = comedi_file_info_from_minor(minor);
1620 struct comedi_device *dev = comedi_dev_from_file_info(info); 1620 struct comedi_device *dev = comedi_dev_from_file_info(info);
1621 int rc; 1621 int rc;
@@ -1743,7 +1743,7 @@ static struct vm_operations_struct comedi_vm_ops = {
1743 1743
1744static int comedi_mmap(struct file *file, struct vm_area_struct *vma) 1744static int comedi_mmap(struct file *file, struct vm_area_struct *vma)
1745{ 1745{
1746 const unsigned minor = iminor(file->f_dentry->d_inode); 1746 const unsigned minor = iminor(file_inode(file));
1747 struct comedi_file_info *info = comedi_file_info_from_minor(minor); 1747 struct comedi_file_info *info = comedi_file_info_from_minor(minor);
1748 struct comedi_device *dev = comedi_dev_from_file_info(info); 1748 struct comedi_device *dev = comedi_dev_from_file_info(info);
1749 struct comedi_subdevice *s; 1749 struct comedi_subdevice *s;
@@ -1823,7 +1823,7 @@ done:
1823static unsigned int comedi_poll(struct file *file, poll_table *wait) 1823static unsigned int comedi_poll(struct file *file, poll_table *wait)
1824{ 1824{
1825 unsigned int mask = 0; 1825 unsigned int mask = 0;
1826 const unsigned minor = iminor(file->f_dentry->d_inode); 1826 const unsigned minor = iminor(file_inode(file));
1827 struct comedi_file_info *info = comedi_file_info_from_minor(minor); 1827 struct comedi_file_info *info = comedi_file_info_from_minor(minor);
1828 struct comedi_device *dev = comedi_dev_from_file_info(info); 1828 struct comedi_device *dev = comedi_dev_from_file_info(info);
1829 struct comedi_subdevice *s; 1829 struct comedi_subdevice *s;
@@ -1869,7 +1869,7 @@ static ssize_t comedi_write(struct file *file, const char __user *buf,
1869 struct comedi_async *async; 1869 struct comedi_async *async;
1870 int n, m, count = 0, retval = 0; 1870 int n, m, count = 0, retval = 0;
1871 DECLARE_WAITQUEUE(wait, current); 1871 DECLARE_WAITQUEUE(wait, current);
1872 const unsigned minor = iminor(file->f_dentry->d_inode); 1872 const unsigned minor = iminor(file_inode(file));
1873 struct comedi_file_info *info = comedi_file_info_from_minor(minor); 1873 struct comedi_file_info *info = comedi_file_info_from_minor(minor);
1874 struct comedi_device *dev = comedi_dev_from_file_info(info); 1874 struct comedi_device *dev = comedi_dev_from_file_info(info);
1875 1875
@@ -1964,7 +1964,7 @@ static ssize_t comedi_read(struct file *file, char __user *buf, size_t nbytes,
1964 struct comedi_async *async; 1964 struct comedi_async *async;
1965 int n, m, count = 0, retval = 0; 1965 int n, m, count = 0, retval = 0;
1966 DECLARE_WAITQUEUE(wait, current); 1966 DECLARE_WAITQUEUE(wait, current);
1967 const unsigned minor = iminor(file->f_dentry->d_inode); 1967 const unsigned minor = iminor(file_inode(file));
1968 struct comedi_file_info *info = comedi_file_info_from_minor(minor); 1968 struct comedi_file_info *info = comedi_file_info_from_minor(minor);
1969 struct comedi_device *dev = comedi_dev_from_file_info(info);