aboutsummaryrefslogtreecommitdiff
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@linaro.org>2016-04-21 12:06:25 +0800
committerAlex Shi <alex.shi@linaro.org>2016-04-21 12:06:25 +0800
commit2bf7955152a0544342fcaed28930748cc68392ae (patch)
treed6900b5e4330d173b94fac3cbe2188eba2673771 /include/linux/fs.h
parentad592b70ae97800d4f5bf535d45a680649e2789e (diff)
parent8c9aef03d3b540b6885e7534a885ea25f62dd9ed (diff)
Merge tag 'v4.4.8' into linux-linaro-lsk-v4.4lsk-v4.4-16.04
This is the 4.4.8 stable release
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 22c5a0cf16e3..ab3d8d9bb3ef 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1207,6 +1207,16 @@ static inline struct inode *file_inode(const struct file *f)
return f->f_inode;
}
+static inline struct dentry *file_dentry(const struct file *file)
+{
+ struct dentry *dentry = file->f_path.dentry;
+
+ if (unlikely(dentry->d_flags & DCACHE_OP_REAL))
+ return dentry->d_op->d_real(dentry, file_inode(file));
+ else
+ return dentry;
+}
+
static inline int locks_lock_file_wait(struct file *filp, struct file_lock *fl)
{
return locks_lock_inode_wait(file_inode(filp), fl);