diff options
Diffstat (limited to 'fs/gfs2/locking')
-rw-r--r-- | fs/gfs2/locking/nolock/main.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/fs/gfs2/locking/nolock/main.c b/fs/gfs2/locking/nolock/main.c index 9398309f2810..ecd37371eba5 100644 --- a/fs/gfs2/locking/nolock/main.c +++ b/fs/gfs2/locking/nolock/main.c | |||
@@ -176,14 +176,13 @@ static void nolock_sync_lvb(lm_lock_t *lock, char *lvb) | |||
176 | static int nolock_plock_get(lm_lockspace_t *lockspace, struct lm_lockname *name, | 176 | static int nolock_plock_get(lm_lockspace_t *lockspace, struct lm_lockname *name, |
177 | struct file *file, struct file_lock *fl) | 177 | struct file *file, struct file_lock *fl) |
178 | { | 178 | { |
179 | struct file_lock *tmp; | 179 | struct file_lock tmp; |
180 | int ret; | ||
180 | 181 | ||
181 | lock_kernel(); | 182 | ret = posix_test_lock(file, fl, &tmp); |
182 | tmp = posix_test_lock(file, fl); | ||
183 | fl->fl_type = F_UNLCK; | 183 | fl->fl_type = F_UNLCK; |
184 | if (tmp) | 184 | if (ret) |
185 | memcpy(fl, tmp, sizeof(struct file_lock)); | 185 | memcpy(fl, &tmp, sizeof(struct file_lock)); |
186 | unlock_kernel(); | ||
187 | 186 | ||
188 | return 0; | 187 | return 0; |
189 | } | 188 | } |
@@ -192,9 +191,7 @@ static int nolock_plock(lm_lockspace_t *lockspace, struct lm_lockname *name, | |||
192 | struct file *file, int cmd, struct file_lock *fl) | 191 | struct file *file, int cmd, struct file_lock *fl) |
193 | { | 192 | { |
194 | int error; | 193 | int error; |
195 | lock_kernel(); | ||
196 | error = posix_lock_file_wait(file, fl); | 194 | error = posix_lock_file_wait(file, fl); |
197 | unlock_kernel(); | ||
198 | return error; | 195 | return error; |
199 | } | 196 | } |
200 | 197 | ||
@@ -202,9 +199,7 @@ static int nolock_punlock(lm_lockspace_t *lockspace, struct lm_lockname *name, | |||
202 | struct file *file, struct file_lock *fl) | 199 | struct file *file, struct file_lock *fl) |
203 | { | 200 | { |
204 | int error; | 201 | int error; |
205 | lock_kernel(); | ||
206 | error = posix_lock_file_wait(file, fl); | 202 | error = posix_lock_file_wait(file, fl); |
207 | unlock_kernel(); | ||
208 | return error; | 203 | return error; |
209 | } | 204 | } |
210 | 205 | ||