diff options
Diffstat (limited to 'fs/gfs2/lock_dlm.c')
-rw-r--r-- | fs/gfs2/lock_dlm.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/fs/gfs2/lock_dlm.c b/fs/gfs2/lock_dlm.c index 1c09425b45fd..6e493aee28f8 100644 --- a/fs/gfs2/lock_dlm.c +++ b/fs/gfs2/lock_dlm.c | |||
@@ -146,15 +146,13 @@ static u32 make_flags(const u32 lkid, const unsigned int gfs_flags, | |||
146 | return lkf; | 146 | return lkf; |
147 | } | 147 | } |
148 | 148 | ||
149 | static unsigned int gdlm_lock(struct gfs2_glock *gl, | 149 | static int gdlm_lock(struct gfs2_glock *gl, unsigned int req_state, |
150 | unsigned int req_state, unsigned int flags) | 150 | unsigned int flags) |
151 | { | 151 | { |
152 | struct lm_lockstruct *ls = &gl->gl_sbd->sd_lockstruct; | 152 | struct lm_lockstruct *ls = &gl->gl_sbd->sd_lockstruct; |
153 | int error; | ||
154 | int req; | 153 | int req; |
155 | u32 lkf; | 154 | u32 lkf; |
156 | 155 | ||
157 | gl->gl_req = req_state; | ||
158 | req = make_mode(req_state); | 156 | req = make_mode(req_state); |
159 | lkf = make_flags(gl->gl_lksb.sb_lkid, flags, req); | 157 | lkf = make_flags(gl->gl_lksb.sb_lkid, flags, req); |
160 | 158 | ||
@@ -162,13 +160,8 @@ static unsigned int gdlm_lock(struct gfs2_glock *gl, | |||
162 | * Submit the actual lock request. | 160 | * Submit the actual lock request. |
163 | */ | 161 | */ |
164 | 162 | ||
165 | error = dlm_lock(ls->ls_dlm, req, &gl->gl_lksb, lkf, gl->gl_strname, | 163 | return dlm_lock(ls->ls_dlm, req, &gl->gl_lksb, lkf, gl->gl_strname, |
166 | GDLM_STRNAME_BYTES - 1, 0, gdlm_ast, gl, gdlm_bast); | 164 | GDLM_STRNAME_BYTES - 1, 0, gdlm_ast, gl, gdlm_bast); |
167 | if (error == -EAGAIN) | ||
168 | return 0; | ||
169 | if (error) | ||
170 | return LM_OUT_ERROR; | ||
171 | return LM_OUT_ASYNC; | ||
172 | } | 165 | } |
173 | 166 | ||
174 | static void gdlm_put_lock(struct kmem_cache *cachep, struct gfs2_glock *gl) | 167 | static void gdlm_put_lock(struct kmem_cache *cachep, struct gfs2_glock *gl) |