To ease code porting from Linux
Signed-off-by: Sascha Hauer <[email protected]>
---
fs/fs.c | 1 +
include/linux/fs.h | 5 +++++
2 files changed, 6 insertions(+)
diff --git a/fs/fs.c b/fs/fs.c
index 2a4d78c9d7..5bfc6f8b78 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -2423,6 +2423,7 @@ DIR *opendir(const char *pathname)
}
file.f_path.dentry = dir;
+ file.f_inode = d_inode(dir);
file.f_op = dir->d_inode->i_fop;
d = xzalloc(sizeof(*d));
diff --git a/include/linux/fs.h b/include/linux/fs.h
index e2a69890f0..a29fd8fe4a 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -253,6 +253,11 @@ struct super_operations {
void (*destroy_inode)(struct inode *);
};
+static inline struct inode *file_inode(const struct file *f)
+{
+ return f->f_inode;
+}
+
/*
* Inode flags - they have no relation to superblock flags now
*/
--
2.19.0
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox