diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2016-03-09 18:05:42 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2016-03-14 00:17:32 -0400 |
commit | de689f5e366373682e95059e9b89d981187e4544 (patch) | |
tree | b9116bb43a5699087b7e3c06602881a90c94a9a1 /fs/dcache.c | |
parent | 27f203f655a2e1dab66598a5b19afb637c587f0b (diff) |
don't bother with __d_instantiate(dentry, NULL)
it's a no-op - bumping ->d_seq is pointless there.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/dcache.c')
-rw-r--r-- | fs/dcache.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/fs/dcache.c b/fs/dcache.c index 244fd2487fe9..57da4127ea04 100644 --- a/fs/dcache.c +++ b/fs/dcache.c | |||
@@ -1745,13 +1745,11 @@ static void __d_instantiate(struct dentry *dentry, struct inode *inode) | |||
1745 | unsigned add_flags = d_flags_for_inode(inode); | 1745 | unsigned add_flags = d_flags_for_inode(inode); |
1746 | 1746 | ||
1747 | spin_lock(&dentry->d_lock); | 1747 | spin_lock(&dentry->d_lock); |
1748 | if (inode) | 1748 | hlist_add_head(&dentry->d_u.d_alias, &inode->i_dentry); |
1749 | hlist_add_head(&dentry->d_u.d_alias, &inode->i_dentry); | ||
1750 | raw_write_seqcount_begin(&dentry->d_seq); | 1749 | raw_write_seqcount_begin(&dentry->d_seq); |
1751 | __d_set_inode_and_type(dentry, inode, add_flags); | 1750 | __d_set_inode_and_type(dentry, inode, add_flags); |
1752 | raw_write_seqcount_end(&dentry->d_seq); | 1751 | raw_write_seqcount_end(&dentry->d_seq); |
1753 | if (inode) | 1752 | __fsnotify_d_instantiate(dentry); |
1754 | __fsnotify_d_instantiate(dentry); | ||
1755 | spin_unlock(&dentry->d_lock); | 1753 | spin_unlock(&dentry->d_lock); |
1756 | } | 1754 | } |
1757 | 1755 | ||
@@ -1773,11 +1771,11 @@ static void __d_instantiate(struct dentry *dentry, struct inode *inode) | |||
1773 | void d_instantiate(struct dentry *entry, struct inode * inode) | 1771 | void d_instantiate(struct dentry *entry, struct inode * inode) |
1774 | { | 1772 | { |
1775 | BUG_ON(!hlist_unhashed(&entry->d_u.d_alias)); | 1773 | BUG_ON(!hlist_unhashed(&entry->d_u.d_alias)); |
1776 | if (inode) | 1774 | if (inode) { |
1777 | spin_lock(&inode->i_lock); | 1775 | spin_lock(&inode->i_lock); |
1778 | __d_instantiate(entry, inode); | 1776 | __d_instantiate(entry, inode); |
1779 | if (inode) | ||
1780 | spin_unlock(&inode->i_lock); | 1777 | spin_unlock(&inode->i_lock); |
1778 | } | ||
1781 | security_d_instantiate(entry, inode); | 1779 | security_d_instantiate(entry, inode); |
1782 | } | 1780 | } |
1783 | EXPORT_SYMBOL(d_instantiate); | 1781 | EXPORT_SYMBOL(d_instantiate); |
@@ -2764,10 +2762,9 @@ struct dentry *d_splice_alias(struct inode *inode, struct dentry *dentry) | |||
2764 | 2762 | ||
2765 | BUG_ON(!d_unhashed(dentry)); | 2763 | BUG_ON(!d_unhashed(dentry)); |
2766 | 2764 | ||
2767 | if (!inode) { | 2765 | if (!inode) |
2768 | __d_instantiate(dentry, NULL); | ||
2769 | goto out; | 2766 | goto out; |
2770 | } | 2767 | |
2771 | spin_lock(&inode->i_lock); | 2768 | spin_lock(&inode->i_lock); |
2772 | if (S_ISDIR(inode->i_mode)) { | 2769 | if (S_ISDIR(inode->i_mode)) { |
2773 | struct dentry *new = __d_find_any_alias(inode); | 2770 | struct dentry *new = __d_find_any_alias(inode); |