new helper: file_inode(file)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -1864,9 +1864,9 @@ static int ipath_assign_port(struct file *fp,
|
||||
goto done_chk_sdma;
|
||||
}
|
||||
|
||||
i_minor = iminor(fp->f_path.dentry->d_inode) - IPATH_USER_MINOR_BASE;
|
||||
i_minor = iminor(file_inode(fp)) - IPATH_USER_MINOR_BASE;
|
||||
ipath_cdbg(VERBOSE, "open on dev %lx (minor %d)\n",
|
||||
(long)fp->f_path.dentry->d_inode->i_rdev, i_minor);
|
||||
(long)file_inode(fp)->i_rdev, i_minor);
|
||||
|
||||
if (i_minor)
|
||||
ret = find_free_port(i_minor - 1, fp, uinfo);
|
||||
|
@@ -113,7 +113,7 @@ static ssize_t atomic_counters_read(struct file *file, char __user *buf,
|
||||
struct infinipath_counters counters;
|
||||
struct ipath_devdata *dd;
|
||||
|
||||
dd = file->f_path.dentry->d_inode->i_private;
|
||||
dd = file_inode(file)->i_private;
|
||||
dd->ipath_f_read_counters(dd, &counters);
|
||||
|
||||
return simple_read_from_buffer(buf, count, ppos, &counters,
|
||||
@@ -154,7 +154,7 @@ static ssize_t flash_read(struct file *file, char __user *buf,
|
||||
goto bail;
|
||||
}
|
||||
|
||||
dd = file->f_path.dentry->d_inode->i_private;
|
||||
dd = file_inode(file)->i_private;
|
||||
if (ipath_eeprom_read(dd, pos, tmp, count)) {
|
||||
ipath_dev_err(dd, "failed to read from flash\n");
|
||||
ret = -ENXIO;
|
||||
@@ -207,7 +207,7 @@ static ssize_t flash_write(struct file *file, const char __user *buf,
|
||||
goto bail_tmp;
|
||||
}
|
||||
|
||||
dd = file->f_path.dentry->d_inode->i_private;
|
||||
dd = file_inode(file)->i_private;
|
||||
if (ipath_eeprom_write(dd, pos, tmp, count)) {
|
||||
ret = -ENXIO;
|
||||
ipath_dev_err(dd, "failed to write to flash\n");
|
||||
|
@@ -1524,7 +1524,7 @@ static int qib_assign_ctxt(struct file *fp, const struct qib_user_info *uinfo)
|
||||
}
|
||||
}
|
||||
|
||||
i_minor = iminor(fp->f_dentry->d_inode) - QIB_USER_MINOR_BASE;
|
||||
i_minor = iminor(file_inode(fp)) - QIB_USER_MINOR_BASE;
|
||||
if (i_minor)
|
||||
ret = find_free_ctxt(i_minor - 1, fp, uinfo);
|
||||
else
|
||||
|
@@ -45,7 +45,7 @@
|
||||
|
||||
static struct super_block *qib_super;
|
||||
|
||||
#define private2dd(file) ((file)->f_dentry->d_inode->i_private)
|
||||
#define private2dd(file) (file_inode(file)->i_private)
|
||||
|
||||
static int qibfs_mknod(struct inode *dir, struct dentry *dentry,
|
||||
umode_t mode, const struct file_operations *fops,
|
||||
@@ -171,7 +171,7 @@ static const struct file_operations cntr_ops[] = {
|
||||
};
|
||||
|
||||
/*
|
||||
* Could use file->f_dentry->d_inode->i_ino to figure out which file,
|
||||
* Could use file_inode(file)->i_ino to figure out which file,
|
||||
* instead of separate routine for each, but for now, this works...
|
||||
*/
|
||||
|
||||
|
Reference in New Issue
Block a user