提交 e77e4300 编写于 作者: A Al Viro

more open-coded file_inode() calls

Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 0b3fca1f
...@@ -101,7 +101,7 @@ static void show_faulting_vma(unsigned long address, char *buf) ...@@ -101,7 +101,7 @@ static void show_faulting_vma(unsigned long address, char *buf)
if (file) { if (file) {
struct path *path = &file->f_path; struct path *path = &file->f_path;
nm = d_path(path, buf, PAGE_SIZE - 1); nm = d_path(path, buf, PAGE_SIZE - 1);
inode = vma->vm_file->f_path.dentry->d_inode; inode = file_inode(vma->vm_file);
dev = inode->i_sb->s_dev; dev = inode->i_sb->s_dev;
ino = inode->i_ino; ino = inode->i_ino;
} }
......
...@@ -696,7 +696,7 @@ static long logger_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -696,7 +696,7 @@ static long logger_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
ret = -EBADF; ret = -EBADF;
break; break;
} }
if (!(in_egroup_p(file->f_dentry->d_inode->i_gid) || if (!(in_egroup_p(file_inode(file)->i_gid) ||
capable(CAP_SYSLOG))) { capable(CAP_SYSLOG))) {
ret = -EPERM; ret = -EPERM;
break; break;
......
...@@ -1330,7 +1330,7 @@ static int wait_for_gss_proxy(struct net *net, struct file *file) ...@@ -1330,7 +1330,7 @@ static int wait_for_gss_proxy(struct net *net, struct file *file)
static ssize_t write_gssp(struct file *file, const char __user *buf, static ssize_t write_gssp(struct file *file, const char __user *buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
struct net *net = PDE_DATA(file->f_path.dentry->d_inode); struct net *net = PDE_DATA(file_inode(file));
char tbuf[20]; char tbuf[20];
unsigned long i; unsigned long i;
int res; int res;
...@@ -1358,7 +1358,7 @@ static ssize_t write_gssp(struct file *file, const char __user *buf, ...@@ -1358,7 +1358,7 @@ static ssize_t write_gssp(struct file *file, const char __user *buf,
static ssize_t read_gssp(struct file *file, char __user *buf, static ssize_t read_gssp(struct file *file, char __user *buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
struct net *net = PDE_DATA(file->f_path.dentry->d_inode); struct net *net = PDE_DATA(file_inode(file));
unsigned long p = *ppos; unsigned long p = *ppos;
char tbuf[10]; char tbuf[10];
size_t len; size_t len;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册