提交 9265f1d0 编写于 作者: A Al Viro 提交者: Steven Whitehouse

GFS2: gfs2_dir_get_hash_table(): avoiding deferred vfree() is easy here...

vfree() is allowed under spinlock these days, but it's cheaper when
it doesn't step into deferred case and here it's very easy to avoid.
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
上级 3cdcf63e
...@@ -370,11 +370,12 @@ static __be64 *gfs2_dir_get_hash_table(struct gfs2_inode *ip) ...@@ -370,11 +370,12 @@ static __be64 *gfs2_dir_get_hash_table(struct gfs2_inode *ip)
} }
spin_lock(&inode->i_lock); spin_lock(&inode->i_lock);
if (ip->i_hash_cache) if (likely(!ip->i_hash_cache)) {
kvfree(hc);
else
ip->i_hash_cache = hc; ip->i_hash_cache = hc;
hc = NULL;
}
spin_unlock(&inode->i_lock); spin_unlock(&inode->i_lock);
kvfree(hc);
return ip->i_hash_cache; return ip->i_hash_cache;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册