summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/glock.c
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2012-11-14 19:47:37 +0100
committerSteven Whitehouse <swhiteho@redhat.com>2012-11-15 11:17:22 +0100
commit4e2f8849def738092ad6c0fc2b34737381bc9d26 (patch)
treedde6f02af206dcab6efe3b69f1ec7f2456500728 /fs/gfs2/glock.c
parentGFS2: only use lvb on glocks that need it (diff)
downloadlinux-4e2f8849def738092ad6c0fc2b34737381bc9d26.tar.xz
linux-4e2f8849def738092ad6c0fc2b34737381bc9d26.zip
GFS2: remove redundant lvb pointer
The lksb struct already contains a pointer to the lvb, so another directly from the glock struct is not needed. Signed-off-by: David Teigland <teigland@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/glock.c')
-rw-r--r--fs/gfs2/glock.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 2284de4d05ce..274b6bed5d67 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -108,7 +108,7 @@ static void gfs2_glock_dealloc(struct rcu_head *rcu)
if (gl->gl_ops->go_flags & GLOF_ASPACE) {
kmem_cache_free(gfs2_glock_aspace_cachep, gl);
} else {
- kfree(gl->gl_lvb);
+ kfree(gl->gl_lksb.sb_lvbptr);
kmem_cache_free(gfs2_glock_cachep, gl);
}
}
@@ -740,15 +740,13 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number,
return -ENOMEM;
memset(&gl->gl_lksb, 0, sizeof(struct dlm_lksb));
- gl->gl_lvb = NULL;
if (glops->go_flags & GLOF_LVB) {
- gl->gl_lvb = kzalloc(GFS2_MIN_LVB_SIZE, GFP_KERNEL);
- if (!gl->gl_lvb) {
+ gl->gl_lksb.sb_lvbptr = kzalloc(GFS2_MIN_LVB_SIZE, GFP_KERNEL);
+ if (!gl->gl_lksb.sb_lvbptr) {
kmem_cache_free(cachep, gl);
return -ENOMEM;
}
- gl->gl_lksb.sb_lvbptr = gl->gl_lvb;
}
atomic_inc(&sdp->sd_glock_disposal);
@@ -789,7 +787,7 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number,
tmp = search_bucket(hash, sdp, &name);
if (tmp) {
spin_unlock_bucket(hash);
- kfree(gl->gl_lvb);
+ kfree(gl->gl_lksb.sb_lvbptr);
kmem_cache_free(cachep, gl);
atomic_dec(&sdp->sd_glock_disposal);
gl = tmp;