diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2016-12-04 18:24:56 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2016-12-04 18:29:28 -0500 |
commit | 450630975da9e7dffe540753e169dc4da5fe7c29 (patch) | |
tree | 69e584ee757fa177d64db1c3c53d816bdab05afb /kernel | |
parent | e5517c2a5a49ed5e99047008629f1cd60246ea0e (diff) | |
download | op-kernel-dev-450630975da9e7dffe540753e169dc4da5fe7c29.zip op-kernel-dev-450630975da9e7dffe540753e169dc4da5fe7c29.tar.gz |
don't open-code file_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/audit_watch.c | 4 | ||||
-rw-r--r-- | kernel/events/core.c | 2 | ||||
-rw-r--r-- | kernel/locking/qspinlock_stat.h | 12 |
3 files changed, 5 insertions, 13 deletions
diff --git a/kernel/audit_watch.c b/kernel/audit_watch.c index 0d302a8..99401ef 100644 --- a/kernel/audit_watch.c +++ b/kernel/audit_watch.c @@ -548,8 +548,8 @@ int audit_exe_compare(struct task_struct *tsk, struct audit_fsnotify_mark *mark) exe_file = get_task_exe_file(tsk); if (!exe_file) return 0; - ino = exe_file->f_inode->i_ino; - dev = exe_file->f_inode->i_sb->s_dev; + ino = file_inode(exe_file)->i_ino; + dev = file_inode(exe_file)->i_sb->s_dev; fput(exe_file); return audit_mark_compare(mark, ino, dev); } diff --git a/kernel/events/core.c b/kernel/events/core.c index 6ee1feb..5134a1c 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -6701,7 +6701,7 @@ static bool perf_addr_filter_match(struct perf_addr_filter *filter, struct file *file, unsigned long offset, unsigned long size) { - if (filter->inode != file->f_inode) + if (filter->inode != file_inode(file)) return false; if (filter->offset > offset + size) diff --git a/kernel/locking/qspinlock_stat.h b/kernel/locking/qspinlock_stat.h index eb0a599..e852be4 100644 --- a/kernel/locking/qspinlock_stat.h +++ b/kernel/locking/qspinlock_stat.h @@ -108,11 +108,7 @@ static ssize_t qstat_read(struct file *file, char __user *user_buf, /* * Get the counter ID stored in file->f_inode->i_private */ - if (!file->f_inode) { - WARN_ON_ONCE(1); - return -EBADF; - } - counter = (long)(file->f_inode->i_private); + counter = (long)file_inode(file)->i_private; if (counter >= qstat_num) return -EBADF; @@ -177,11 +173,7 @@ static ssize_t qstat_write(struct file *file, const char __user *user_buf, /* * Get the counter ID stored in file->f_inode->i_private */ - if (!file->f_inode) { - WARN_ON_ONCE(1); - return -EBADF; - } - if ((long)(file->f_inode->i_private) != qstat_reset_cnts) + if ((long)file_inode(file)->i_private != qstat_reset_cnts) return count; for_each_possible_cpu(cpu) { |