aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
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 /drivers
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)
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/comedi/comedi_fops.c14
-rw-r--r--drivers/tty/tty_io.c16
2 files changed, 13 insertions, 17 deletions
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); 1969 struct comedi_device *dev = comedi_dev_from_file_info(info);
1970 1970
@@ -2133,7 +2133,7 @@ ok:
2133 2133
2134static int comedi_fasync(int fd, struct file *file, int on) 2134static int comedi_fasync(int fd, struct file *file, int on)
2135{ 2135{
2136 const unsigned minor = iminor(file->f_dentry->d_inode); 2136 const unsigned minor = iminor(file_inode(file));
2137 struct comedi_device *dev = comedi_dev_from_minor(minor); 2137 struct comedi_device *dev = comedi_dev_from_minor(minor);
2138 2138
2139 if (!dev) 2139 if (!dev)
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index fd473639ab70..05400acbc456 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -960,11 +960,10 @@ static ssize_t tty_read(struct file *file, char __user *buf, size_t count,
960 loff_t *ppos) 960 loff_t *ppos)
961{ 961{
962 int i; 962 int i;
963 struct inode *inode = file->f_path.dentry->d_inode;
964 struct tty_struct *tty = file_tty(file); 963 struct tty_struct *tty = file_tty(file);
965 struct tty_ldisc *ld; 964 struct tty_ldisc *ld;
966 965
967 if (tty_paranoia_check(tty, inode, "tty_read")) 966 if (tty_paranoia_check(tty, file_inode(file), "tty_read"))
968 return -EIO; 967 return -EIO;
969 if (!tty || (test_bit(TTY_IO_ERROR, &tty->flags))) 968 if (!tty || (test_bit(TTY_IO_ERROR, &tty->flags)))
970 return -EIO; 969 return -EIO;
@@ -1132,12 +1131,11 @@ void tty_write_message(struct tty_struct *tty, char *msg)
1132static ssize_t tty_write(struct file *file, const char __user *buf, 1131static ssize_t tty_write(struct file *file, const char __user *buf,
1133 size_t count, loff_t *ppos) 1132 size_t count, loff_t *ppos)
1134{ 1133{
1135 struct inode *inode = file->f_path.dentry->d_inode;
1136 struct tty_struct *tty = file_tty(file); 1134 struct tty_struct *tty = file_tty(file);
1137 struct tty_ldisc *ld; 1135 struct tty_ldisc *ld;
1138 ssize_t ret; 1136 ssize_t ret;
1139 1137
1140 if (tty_paranoia_check(tty, inode, "tty_write")) 1138 if (tty_paranoia_check(tty, file_inode(file), "tty_write"))
1141 return -EIO; 1139 return -EIO;
1142 if (!tty || !tty->ops->write || 1140 if (!tty || !tty->ops->write ||
1143 (test_bit(TTY_IO_ERROR, &tty->flags))) 1141 (test_bit(TTY_IO_ERROR, &tty->flags)))
@@ -2047,7 +2045,7 @@ static unsigned int tty_poll(struct file *filp, poll_table *wait)
2047 struct tty_ldisc *ld; 2045 struct tty_ldisc *ld;
2048 int ret = 0; 2046 int ret = 0;
2049 2047
2050 if (tty_paranoia_check(tty, filp->f_path.dentry->d_inode, "tty_poll")) 2048 if (tty_paranoia_check(tty, file_inode(filp), "tty_poll"))
2051 return 0; 2049 return 0;
2052 2050
2053 ld = tty_ldisc_ref_wait(tty); 2051 ld = tty_ldisc_ref_wait(tty);
@@ -2063,7 +2061,7 @@ static int __tty_fasync(int fd, struct file *filp, int on)
2063 unsigned long flags; 2061 unsigned long flags;
2064 int retval = 0; 2062 int retval = 0;
2065 2063
2066 if (tty_paranoia_check(tty, filp->f_path.dentry->d_inode, "tty_fasync")) 2064 if (tty_paranoia_check(tty, file_inode(filp), "tty_fasync"))
2067 goto out; 2065 goto out;
2068 2066
2069 retval = fasync_helper(fd, filp, on, &tty->fasync); 2067 retval = fasync_helper(fd, filp, on, &tty->fasync);
@@ -2637,9 +2635,8 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
2637 void __user *p = (void __user *)arg; 2635 void __user *p = (void __user *)arg;
2638 int retval; 2636 int retval;
2639 struct tty_ldisc *ld; 2637 struct tty_ldisc *ld;
2640 struct inode *inode = file->f_dentry->d_inode;
2641 2638
2642 if (tty_paranoia_check(tty, inode, "tty_ioctl")) 2639 if (tty_paranoia_check(tty, file_inode(file), "tty_ioctl"))
2643 return -EINVAL; 2640 return -EINVAL;
2644 2641
2645 real_tty = tty_pair_get_tty(tty); 2642 real_tty = tty_pair_get_tty(tty);
@@ -2780,12 +2777,11 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
2780static long tty_compat_ioctl(struct file *file, unsigned int cmd, 2777static long tty_compat_ioctl(struct file *file, unsigned int cmd,
2781 unsigned long arg) 2778 unsigned long arg)
2782{ 2779{
2783 struct inode *inode = file->f_dentry->d_inode;
2784 struct tty_struct *tty = file_tty(file); 2780 struct tty_struct *tty = file_tty(file);
2785 struct tty_ldisc *ld; 2781 struct tty_ldisc *ld;
2786 int retval = -ENOIOCTLCMD; 2782 int retval = -ENOIOCTLCMD;
2787 2783
2788 if (tty_paranoia_check(tty, inode, "tty_ioctl")) 2784 if (tty_paranoia_check(tty, file_inode(file), "tty_ioctl"))
2789 return -EINVAL; 2785 return -EINVAL;
2790 2786
2791 if (tty->ops->compat_ioctl) { 2787 if (tty->ops->compat_ioctl) {