diff options
Diffstat (limited to 'fs/gfs2/lock_dlm.c')
-rw-r--r-- | fs/gfs2/lock_dlm.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/gfs2/lock_dlm.c b/fs/gfs2/lock_dlm.c index 46df988323bc..cdd0755d7823 100644 --- a/fs/gfs2/lock_dlm.c +++ b/fs/gfs2/lock_dlm.c | |||
@@ -21,6 +21,7 @@ static void gdlm_ast(void *arg) | |||
21 | { | 21 | { |
22 | struct gfs2_glock *gl = arg; | 22 | struct gfs2_glock *gl = arg; |
23 | unsigned ret = gl->gl_state; | 23 | unsigned ret = gl->gl_state; |
24 | struct gfs2_sbd *sdp = gl->gl_sbd; | ||
24 | 25 | ||
25 | BUG_ON(gl->gl_lksb.sb_flags & DLM_SBF_DEMOTED); | 26 | BUG_ON(gl->gl_lksb.sb_flags & DLM_SBF_DEMOTED); |
26 | 27 | ||
@@ -30,6 +31,8 @@ static void gdlm_ast(void *arg) | |||
30 | switch (gl->gl_lksb.sb_status) { | 31 | switch (gl->gl_lksb.sb_status) { |
31 | case -DLM_EUNLOCK: /* Unlocked, so glock can be freed */ | 32 | case -DLM_EUNLOCK: /* Unlocked, so glock can be freed */ |
32 | kmem_cache_free(gfs2_glock_cachep, gl); | 33 | kmem_cache_free(gfs2_glock_cachep, gl); |
34 | if (atomic_dec_and_test(&sdp->sd_glock_disposal)) | ||
35 | wake_up(&sdp->sd_glock_wait); | ||
33 | return; | 36 | return; |
34 | case -DLM_ECANCEL: /* Cancel while getting lock */ | 37 | case -DLM_ECANCEL: /* Cancel while getting lock */ |
35 | ret |= LM_OUT_CANCELED; | 38 | ret |= LM_OUT_CANCELED; |
@@ -167,7 +170,8 @@ static unsigned int gdlm_lock(struct gfs2_glock *gl, | |||
167 | static void gdlm_put_lock(struct kmem_cache *cachep, void *ptr) | 170 | static void gdlm_put_lock(struct kmem_cache *cachep, void *ptr) |
168 | { | 171 | { |
169 | struct gfs2_glock *gl = ptr; | 172 | struct gfs2_glock *gl = ptr; |
170 | struct lm_lockstruct *ls = &gl->gl_sbd->sd_lockstruct; | 173 | struct gfs2_sbd *sdp = gl->gl_sbd; |
174 | struct lm_lockstruct *ls = &sdp->sd_lockstruct; | ||
171 | int error; | 175 | int error; |
172 | 176 | ||
173 | if (gl->gl_lksb.sb_lkid == 0) { | 177 | if (gl->gl_lksb.sb_lkid == 0) { |
@@ -183,6 +187,7 @@ static void gdlm_put_lock(struct kmem_cache *cachep, void *ptr) | |||
183 | (unsigned long long)gl->gl_name.ln_number, error); | 187 | (unsigned long long)gl->gl_name.ln_number, error); |
184 | return; | 188 | return; |
185 | } | 189 | } |
190 | atomic_inc(&sdp->sd_glock_disposal); | ||
186 | } | 191 | } |
187 | 192 | ||
188 | static void gdlm_cancel(struct gfs2_glock *gl) | 193 | static void gdlm_cancel(struct gfs2_glock *gl) |