diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2016-04-14 19:40:56 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2016-05-02 19:47:26 -0400 |
commit | 0568d705b0087751f0c085c0a665aa3e954c810d (patch) | |
tree | be004775897eae9809cfb341135aab59c7f949c5 /fs/dcache.c | |
parent | 1936386ea96591c27ae4b70caef9591c41e6290f (diff) |
__d_add(): don't drop/regain ->d_lock
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/dcache.c')
-rw-r--r-- | fs/dcache.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/fs/dcache.c b/fs/dcache.c index 4962a7b4384e..20394fb6f967 100644 --- a/fs/dcache.c +++ b/fs/dcache.c | |||
@@ -2366,11 +2366,19 @@ EXPORT_SYMBOL(d_rehash); | |||
2366 | 2366 | ||
2367 | static inline void __d_add(struct dentry *dentry, struct inode *inode) | 2367 | static inline void __d_add(struct dentry *dentry, struct inode *inode) |
2368 | { | 2368 | { |
2369 | spin_lock(&dentry->d_lock); | ||
2369 | if (inode) { | 2370 | if (inode) { |
2370 | __d_instantiate(dentry, inode); | 2371 | unsigned add_flags = d_flags_for_inode(inode); |
2372 | hlist_add_head(&dentry->d_u.d_alias, &inode->i_dentry); | ||
2373 | raw_write_seqcount_begin(&dentry->d_seq); | ||
2374 | __d_set_inode_and_type(dentry, inode, add_flags); | ||
2375 | raw_write_seqcount_end(&dentry->d_seq); | ||
2376 | __fsnotify_d_instantiate(dentry); | ||
2377 | } | ||
2378 | _d_rehash(dentry); | ||
2379 | spin_unlock(&dentry->d_lock); | ||
2380 | if (inode) | ||
2371 | spin_unlock(&inode->i_lock); | 2381 | spin_unlock(&inode->i_lock); |
2372 | } | ||
2373 | d_rehash(dentry); | ||
2374 | } | 2382 | } |
2375 | 2383 | ||
2376 | /** | 2384 | /** |