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: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
}
spin_lock(&inode->i_lock);
- if (ip->i_hash_cache)
- kvfree(hc);
- else
+ if (likely(!ip->i_hash_cache)) {
ip->i_hash_cache = hc;
+ hc = NULL;
+ }
spin_unlock(&inode->i_lock);
+ kvfree(hc);
return ip->i_hash_cache;
}