Commit 27f203f6 authored by Al Viro's avatar Al Viro

untangle fsnotify_d_instantiate() a bit

First of all, don't bother calling it if inode is NULL -
that makes inode argument unused.  Moreover, do it *before*
dropping ->d_lock, not right after that (and don't bother
grabbing ->d_lock in it, of course).
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 34d0d19d
...@@ -1750,8 +1750,9 @@ static void __d_instantiate(struct dentry *dentry, struct inode *inode) ...@@ -1750,8 +1750,9 @@ static void __d_instantiate(struct dentry *dentry, struct inode *inode)
raw_write_seqcount_begin(&dentry->d_seq); raw_write_seqcount_begin(&dentry->d_seq);
__d_set_inode_and_type(dentry, inode, add_flags); __d_set_inode_and_type(dentry, inode, add_flags);
raw_write_seqcount_end(&dentry->d_seq); raw_write_seqcount_end(&dentry->d_seq);
if (inode)
__fsnotify_d_instantiate(dentry);
spin_unlock(&dentry->d_lock); spin_unlock(&dentry->d_lock);
fsnotify_d_instantiate(dentry, inode);
} }
/** /**
......
...@@ -16,15 +16,6 @@ ...@@ -16,15 +16,6 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/bug.h> #include <linux/bug.h>
/*
* fsnotify_d_instantiate - instantiate a dentry for inode
*/
static inline void fsnotify_d_instantiate(struct dentry *dentry,
struct inode *inode)
{
__fsnotify_d_instantiate(dentry, inode);
}
/* Notify this dentry's parent about a child's events. */ /* Notify this dentry's parent about a child's events. */
static inline int fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask) static inline int fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask)
{ {
......
...@@ -293,14 +293,9 @@ static inline void __fsnotify_update_dcache_flags(struct dentry *dentry) ...@@ -293,14 +293,9 @@ static inline void __fsnotify_update_dcache_flags(struct dentry *dentry)
/* /*
* fsnotify_d_instantiate - instantiate a dentry for inode * fsnotify_d_instantiate - instantiate a dentry for inode
*/ */
static inline void __fsnotify_d_instantiate(struct dentry *dentry, struct inode *inode) static inline void __fsnotify_d_instantiate(struct dentry *dentry)
{ {
if (!inode)
return;
spin_lock(&dentry->d_lock);
__fsnotify_update_dcache_flags(dentry); __fsnotify_update_dcache_flags(dentry);
spin_unlock(&dentry->d_lock);
} }
/* called from fsnotify listeners, such as fanotify or dnotify */ /* called from fsnotify listeners, such as fanotify or dnotify */
...@@ -399,7 +394,7 @@ static inline void __fsnotify_vfsmount_delete(struct vfsmount *mnt) ...@@ -399,7 +394,7 @@ static inline void __fsnotify_vfsmount_delete(struct vfsmount *mnt)
static inline void __fsnotify_update_dcache_flags(struct dentry *dentry) static inline void __fsnotify_update_dcache_flags(struct dentry *dentry)
{} {}
static inline void __fsnotify_d_instantiate(struct dentry *dentry, struct inode *inode) static inline void __fsnotify_d_instantiate(struct dentry *dentry)
{} {}
static inline u32 fsnotify_get_cookie(void) static inline u32 fsnotify_get_cookie(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment