diff options
Diffstat (limited to 'fs/gfs2/lock_dlm.c')
-rw-r--r-- | fs/gfs2/lock_dlm.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/fs/gfs2/lock_dlm.c b/fs/gfs2/lock_dlm.c index 6e493aee28f8..98c80d8c2a62 100644 --- a/fs/gfs2/lock_dlm.c +++ b/fs/gfs2/lock_dlm.c | |||
@@ -22,7 +22,6 @@ static void gdlm_ast(void *arg) | |||
22 | { | 22 | { |
23 | struct gfs2_glock *gl = arg; | 23 | struct gfs2_glock *gl = arg; |
24 | unsigned ret = gl->gl_state; | 24 | unsigned ret = gl->gl_state; |
25 | struct gfs2_sbd *sdp = gl->gl_sbd; | ||
26 | 25 | ||
27 | BUG_ON(gl->gl_lksb.sb_flags & DLM_SBF_DEMOTED); | 26 | BUG_ON(gl->gl_lksb.sb_flags & DLM_SBF_DEMOTED); |
28 | 27 | ||
@@ -31,12 +30,7 @@ static void gdlm_ast(void *arg) | |||
31 | 30 | ||
32 | switch (gl->gl_lksb.sb_status) { | 31 | switch (gl->gl_lksb.sb_status) { |
33 | case -DLM_EUNLOCK: /* Unlocked, so glock can be freed */ | 32 | case -DLM_EUNLOCK: /* Unlocked, so glock can be freed */ |
34 | if (gl->gl_ops->go_flags & GLOF_ASPACE) | 33 | gfs2_glock_free(gl); |
35 | kmem_cache_free(gfs2_glock_aspace_cachep, gl); | ||
36 | else | ||
37 | kmem_cache_free(gfs2_glock_cachep, gl); | ||
38 | if (atomic_dec_and_test(&sdp->sd_glock_disposal)) | ||
39 | wake_up(&sdp->sd_glock_wait); | ||
40 | return; | 34 | return; |
41 | case -DLM_ECANCEL: /* Cancel while getting lock */ | 35 | case -DLM_ECANCEL: /* Cancel while getting lock */ |
42 | ret |= LM_OUT_CANCELED; | 36 | ret |= LM_OUT_CANCELED; |
@@ -164,16 +158,14 @@ static int gdlm_lock(struct gfs2_glock *gl, unsigned int req_state, | |||
164 | GDLM_STRNAME_BYTES - 1, 0, gdlm_ast, gl, gdlm_bast); | 158 | GDLM_STRNAME_BYTES - 1, 0, gdlm_ast, gl, gdlm_bast); |
165 | } | 159 | } |
166 | 160 | ||
167 | static void gdlm_put_lock(struct kmem_cache *cachep, struct gfs2_glock *gl) | 161 | static void gdlm_put_lock(struct gfs2_glock *gl) |
168 | { | 162 | { |
169 | struct gfs2_sbd *sdp = gl->gl_sbd; | 163 | struct gfs2_sbd *sdp = gl->gl_sbd; |
170 | struct lm_lockstruct *ls = &sdp->sd_lockstruct; | 164 | struct lm_lockstruct *ls = &sdp->sd_lockstruct; |
171 | int error; | 165 | int error; |
172 | 166 | ||
173 | if (gl->gl_lksb.sb_lkid == 0) { | 167 | if (gl->gl_lksb.sb_lkid == 0) { |
174 | kmem_cache_free(cachep, gl); | 168 | gfs2_glock_free(gl); |
175 | if (atomic_dec_and_test(&sdp->sd_glock_disposal)) | ||
176 | wake_up(&sdp->sd_glock_wait); | ||
177 | return; | 169 | return; |
178 | } | 170 | } |
179 | 171 | ||