compat: add file_inode()
authorHauke Mehrtens <hauke@hauke-m.de>
Wed, 27 Feb 2013 23:54:58 +0000 (00:54 +0100)
committerLuis R. Rodriguez <mcgrof@do-not-panic.com>
Thu, 28 Feb 2013 00:06:21 +0000 (16:06 -0800)
This adds a backport for file_inode().

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
include/linux/compat-3.9.h

index ff1b38620b009ff354a9ea7c25d7dd7860219e88..26e6f57c63d829ff33dd5c696cee9f67551acb4a 100644 (file)
@@ -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 <viro@zeniv.linux.org.uk>
+ * 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 */