From fffc4284806fbbc64e18231034702ee03b6e7135 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Thu, 28 Feb 2013 00:54:58 +0100 Subject: [PATCH] compat: add file_inode() This adds a backport for file_inode(). Signed-off-by: Hauke Mehrtens Signed-off-by: Luis R. Rodriguez --- include/linux/compat-3.9.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/linux/compat-3.9.h b/include/linux/compat-3.9.h index ff1b38620b00..26e6f57c63d8 100644 --- a/include/linux/compat-3.9.h +++ b/include/linux/compat-3.9.h @@ -121,6 +121,20 @@ static inline void idr_preload_end(void) #define tty_flip_buffer_push(port) tty_flip_buffer_push((port)->tty) #define tty_insert_flip_string(port, chars, size) tty_insert_flip_string((port)->tty, chars, size) +/** + * backport of: + * + * commit 496ad9aa8ef448058e36ca7a787c61f2e63f0f54 + * Author: Al Viro + * Date: Wed Jan 23 17:07:38 2013 -0500 + * + * new helper: file_inode(file) + */ +static inline struct inode *file_inode(struct file *f) +{ + return f->f_path.dentry->d_inode; +} + #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)) */ #endif /* LINUX_3_9_COMPAT_H */ -- 2.30.2