Merge remote-tracking branch 'battery/for-next'
[deliverable/linux.git] / include / linux / fsnotify.h
index eed9e853a06f13c77506bc451262e83a99f1a332..b8bcc058e03147e39624609ae0a7331e978b0d58 100644 (file)
@@ -29,7 +29,11 @@ static inline int fsnotify_parent(struct path *path, struct dentry *dentry, __u3
 static inline int fsnotify_perm(struct file *file, int mask)
 {
        struct path *path = &file->f_path;
-       struct inode *inode = file_inode(file);
+       /*
+        * Do not use file_inode() here or anywhere in this file to get the
+        * inode.  That would break *notity on overlayfs.
+        */
+       struct inode *inode = path->dentry->d_inode;
        __u32 fsnotify_mask = 0;
        int ret;
 
@@ -173,7 +177,7 @@ static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry)
 static inline void fsnotify_access(struct file *file)
 {
        struct path *path = &file->f_path;
-       struct inode *inode = file_inode(file);
+       struct inode *inode = path->dentry->d_inode;
        __u32 mask = FS_ACCESS;
 
        if (S_ISDIR(inode->i_mode))
@@ -191,7 +195,7 @@ static inline void fsnotify_access(struct file *file)
 static inline void fsnotify_modify(struct file *file)
 {
        struct path *path = &file->f_path;
-       struct inode *inode = file_inode(file);
+       struct inode *inode = path->dentry->d_inode;
        __u32 mask = FS_MODIFY;
 
        if (S_ISDIR(inode->i_mode))
@@ -209,7 +213,7 @@ static inline void fsnotify_modify(struct file *file)
 static inline void fsnotify_open(struct file *file)
 {
        struct path *path = &file->f_path;
-       struct inode *inode = file_inode(file);
+       struct inode *inode = path->dentry->d_inode;
        __u32 mask = FS_OPEN;
 
        if (S_ISDIR(inode->i_mode))
@@ -225,7 +229,7 @@ static inline void fsnotify_open(struct file *file)
 static inline void fsnotify_close(struct file *file)
 {
        struct path *path = &file->f_path;
-       struct inode *inode = file_inode(file);
+       struct inode *inode = path->dentry->d_inode;
        fmode_t mode = file->f_mode;
        __u32 mask = (mode & FMODE_WRITE) ? FS_CLOSE_WRITE : FS_CLOSE_NOWRITE;
 
This page took 0.028023 seconds and 5 git commands to generate.