new helper: file_inode(file)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -496,7 +496,7 @@ static long snd_info_entry_ioctl(struct file *file, unsigned int cmd,
|
||||
|
||||
static int snd_info_entry_mmap(struct file *file, struct vm_area_struct *vma)
|
||||
{
|
||||
struct inode *inode = file->f_path.dentry->d_inode;
|
||||
struct inode *inode = file_inode(file);
|
||||
struct snd_info_private_data *data;
|
||||
struct snd_info_entry *entry;
|
||||
|
||||
|
@@ -1586,7 +1586,7 @@ static struct file *snd_pcm_file_fd(int fd, int *fput_needed)
|
||||
file = fget_light(fd, fput_needed);
|
||||
if (!file)
|
||||
return NULL;
|
||||
inode = file->f_path.dentry->d_inode;
|
||||
inode = file_inode(file);
|
||||
if (!S_ISCHR(inode->i_mode) ||
|
||||
imajor(inode) != snd_major) {
|
||||
fput_light(file, *fput_needed);
|
||||
|
@@ -642,7 +642,7 @@ static int mixer_ioctl(unsigned int cmd, unsigned long arg)
|
||||
|
||||
static long dev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
int minor = iminor(file->f_path.dentry->d_inode);
|
||||
int minor = iminor(file_inode(file));
|
||||
int ret;
|
||||
|
||||
if (cmd == OSS_GETVERSION) {
|
||||
@@ -1012,7 +1012,7 @@ static int dsp_write(const char __user *buf, size_t len)
|
||||
|
||||
static ssize_t dev_read(struct file *file, char __user *buf, size_t count, loff_t *off)
|
||||
{
|
||||
int minor = iminor(file->f_path.dentry->d_inode);
|
||||
int minor = iminor(file_inode(file));
|
||||
if (minor == dev.dsp_minor)
|
||||
return dsp_read(buf, count);
|
||||
else
|
||||
@@ -1021,7 +1021,7 @@ static ssize_t dev_read(struct file *file, char __user *buf, size_t count, loff_
|
||||
|
||||
static ssize_t dev_write(struct file *file, const char __user *buf, size_t count, loff_t *off)
|
||||
{
|
||||
int minor = iminor(file->f_path.dentry->d_inode);
|
||||
int minor = iminor(file_inode(file));
|
||||
if (minor == dev.dsp_minor)
|
||||
return dsp_write(buf, count);
|
||||
else
|
||||
|
@@ -143,7 +143,7 @@ static int get_mixer_levels(void __user * arg)
|
||||
|
||||
static ssize_t sound_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
|
||||
{
|
||||
int dev = iminor(file->f_path.dentry->d_inode);
|
||||
int dev = iminor(file_inode(file));
|
||||
int ret = -EINVAL;
|
||||
|
||||
/*
|
||||
@@ -176,7 +176,7 @@ static ssize_t sound_read(struct file *file, char __user *buf, size_t count, lof
|
||||
|
||||
static ssize_t sound_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
|
||||
{
|
||||
int dev = iminor(file->f_path.dentry->d_inode);
|
||||
int dev = iminor(file_inode(file));
|
||||
int ret = -EINVAL;
|
||||
|
||||
mutex_lock(&soundcard_mutex);
|
||||
@@ -333,7 +333,7 @@ static int sound_mixer_ioctl(int mixdev, unsigned int cmd, void __user *arg)
|
||||
static long sound_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
int len = 0, dtype;
|
||||
int dev = iminor(file->f_dentry->d_inode);
|
||||
int dev = iminor(file_inode(file));
|
||||
long ret = -EINVAL;
|
||||
void __user *p = (void __user *)arg;
|
||||
|
||||
@@ -406,7 +406,7 @@ static long sound_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||
|
||||
static unsigned int sound_poll(struct file *file, poll_table * wait)
|
||||
{
|
||||
struct inode *inode = file->f_path.dentry->d_inode;
|
||||
struct inode *inode = file_inode(file);
|
||||
int dev = iminor(inode);
|
||||
|
||||
DEB(printk("sound_poll(dev=%d)\n", dev));
|
||||
@@ -431,7 +431,7 @@ static int sound_mmap(struct file *file, struct vm_area_struct *vma)
|
||||
int dev_class;
|
||||
unsigned long size;
|
||||
struct dma_buffparms *dmap = NULL;
|
||||
int dev = iminor(file->f_path.dentry->d_inode);
|
||||
int dev = iminor(file_inode(file));
|
||||
|
||||
dev_class = dev & 0x0f;
|
||||
dev >>= 4;
|
||||
|
@@ -19,7 +19,7 @@ static int do_mod_firmware_load(const char *fn, char **fp)
|
||||
printk(KERN_INFO "Unable to load '%s'.\n", fn);
|
||||
return 0;
|
||||
}
|
||||
l = i_size_read(filp->f_path.dentry->d_inode);
|
||||
l = i_size_read(file_inode(filp));
|
||||
if (l <= 0 || l > 131072)
|
||||
{
|
||||
printk(KERN_INFO "Invalid firmware '%s'\n", fn);
|
||||
|
Reference in New Issue
Block a user