aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/dir.c
diff options
context:
space:
mode:
authorAl Viro <viro@ZenIV.linux.org.uk>2014-11-20 00:19:47 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2014-11-20 05:29:44 -0500
commit9265f1d0c7593e3e7e1e94a4a83a6dea34230a35 (patch)
tree5971e03e7b48769dd708d8fa7d11fb7334854a35 /fs/gfs2/dir.c
parent3cdcf63ed2d169c82d70a506f3569e484cd9e7a0 (diff)
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: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/dir.c')
-rw-r--r--fs/gfs2/dir.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c
index c247fed4a9a6..c5a34f09e228 100644
--- a/fs/gfs2/dir.c
+++ b/fs/gfs2/dir.c
@@ -370,11 +370,12 @@ static __be64 *gfs2_dir_get_hash_table(struct gfs2_inode *ip)
370 } 370 }
371 371
372 spin_lock(&inode->i_lock); 372 spin_lock(&inode->i_lock);
373 if (ip->i_hash_cache) 373 if (likely(!ip->i_hash_cache)) {
374 kvfree(hc);
375 else
376 ip->i_hash_cache = hc; 374 ip->i_hash_cache = hc;
375 hc = NULL;
376 }
377 spin_unlock(&inode->i_lock); 377 spin_unlock(&inode->i_lock);
378 kvfree(hc);
378 379
379 return ip->i_hash_cache; 380 return ip->i_hash_cache;
380} 381}