diff options
author | Bryan Schumaker <bjschuma@netapp.com> | 2010-09-22 09:50:35 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-09-22 09:50:35 -0400 |
commit | 63185942c5f138c62de16b4cbc7eee494a58fea8 (patch) | |
tree | 279f1dd93cc8d7805ef52a6ebb496d71d9cc3785 /fs/lockd/clntproc.c | |
parent | b4687da7fc5f741af7fee9b0248a2cf2ad9c4478 (diff) |
lockd: Remove BKL from the client
This patch removes all calls to lock_kernel() from the client. This patch
should be applied after the "fs/lock.c prepare for BKL removal" patch submitted
by Arnd Bergmann on September 18.
Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/lockd/clntproc.c')
-rw-r--r-- | fs/lockd/clntproc.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c index 7932c399fab4..47ea1e1925b8 100644 --- a/fs/lockd/clntproc.c +++ b/fs/lockd/clntproc.c | |||
@@ -166,7 +166,6 @@ int nlmclnt_proc(struct nlm_host *host, int cmd, struct file_lock *fl) | |||
166 | /* Set up the argument struct */ | 166 | /* Set up the argument struct */ |
167 | nlmclnt_setlockargs(call, fl); | 167 | nlmclnt_setlockargs(call, fl); |
168 | 168 | ||
169 | lock_kernel(); | ||
170 | if (IS_SETLK(cmd) || IS_SETLKW(cmd)) { | 169 | if (IS_SETLK(cmd) || IS_SETLKW(cmd)) { |
171 | if (fl->fl_type != F_UNLCK) { | 170 | if (fl->fl_type != F_UNLCK) { |
172 | call->a_args.block = IS_SETLKW(cmd) ? 1 : 0; | 171 | call->a_args.block = IS_SETLKW(cmd) ? 1 : 0; |
@@ -177,10 +176,8 @@ int nlmclnt_proc(struct nlm_host *host, int cmd, struct file_lock *fl) | |||
177 | status = nlmclnt_test(call, fl); | 176 | status = nlmclnt_test(call, fl); |
178 | else | 177 | else |
179 | status = -EINVAL; | 178 | status = -EINVAL; |
180 | |||
181 | fl->fl_ops->fl_release_private(fl); | 179 | fl->fl_ops->fl_release_private(fl); |
182 | fl->fl_ops = NULL; | 180 | fl->fl_ops = NULL; |
183 | unlock_kernel(); | ||
184 | 181 | ||
185 | dprintk("lockd: clnt proc returns %d\n", status); | 182 | dprintk("lockd: clnt proc returns %d\n", status); |
186 | return status; | 183 | return status; |
@@ -226,9 +223,7 @@ void nlm_release_call(struct nlm_rqst *call) | |||
226 | 223 | ||
227 | static void nlmclnt_rpc_release(void *data) | 224 | static void nlmclnt_rpc_release(void *data) |
228 | { | 225 | { |
229 | lock_kernel(); | ||
230 | nlm_release_call(data); | 226 | nlm_release_call(data); |
231 | unlock_kernel(); | ||
232 | } | 227 | } |
233 | 228 | ||
234 | static int nlm_wait_on_grace(wait_queue_head_t *queue) | 229 | static int nlm_wait_on_grace(wait_queue_head_t *queue) |
@@ -448,14 +443,18 @@ out: | |||
448 | 443 | ||
449 | static void nlmclnt_locks_copy_lock(struct file_lock *new, struct file_lock *fl) | 444 | static void nlmclnt_locks_copy_lock(struct file_lock *new, struct file_lock *fl) |
450 | { | 445 | { |
446 | spin_lock(&fl->fl_u.nfs_fl.owner->host->h_lock); | ||
451 | new->fl_u.nfs_fl.state = fl->fl_u.nfs_fl.state; | 447 | new->fl_u.nfs_fl.state = fl->fl_u.nfs_fl.state; |
452 | new->fl_u.nfs_fl.owner = nlm_get_lockowner(fl->fl_u.nfs_fl.owner); | 448 | new->fl_u.nfs_fl.owner = nlm_get_lockowner(fl->fl_u.nfs_fl.owner); |
453 | list_add_tail(&new->fl_u.nfs_fl.list, &fl->fl_u.nfs_fl.owner->host->h_granted); | 449 | list_add_tail(&new->fl_u.nfs_fl.list, &fl->fl_u.nfs_fl.owner->host->h_granted); |
450 | spin_unlock(&fl->fl_u.nfs_fl.owner->host->h_lock); | ||
454 | } | 451 | } |
455 | 452 | ||
456 | static void nlmclnt_locks_release_private(struct file_lock *fl) | 453 | static void nlmclnt_locks_release_private(struct file_lock *fl) |
457 | { | 454 | { |
455 | spin_lock(&fl->fl_u.nfs_fl.owner->host->h_lock); | ||
458 | list_del(&fl->fl_u.nfs_fl.list); | 456 | list_del(&fl->fl_u.nfs_fl.list); |
457 | spin_unlock(&fl->fl_u.nfs_fl.owner->host->h_lock); | ||
459 | nlm_put_lockowner(fl->fl_u.nfs_fl.owner); | 458 | nlm_put_lockowner(fl->fl_u.nfs_fl.owner); |
460 | } | 459 | } |
461 | 460 | ||
@@ -721,9 +720,7 @@ static void nlmclnt_unlock_callback(struct rpc_task *task, void *data) | |||
721 | die: | 720 | die: |
722 | return; | 721 | return; |
723 | retry_rebind: | 722 | retry_rebind: |
724 | lock_kernel(); | ||
725 | nlm_rebind_host(req->a_host); | 723 | nlm_rebind_host(req->a_host); |
726 | unlock_kernel(); | ||
727 | retry_unlock: | 724 | retry_unlock: |
728 | rpc_restart_call(task); | 725 | rpc_restart_call(task); |
729 | } | 726 | } |
@@ -801,9 +798,7 @@ retry_cancel: | |||
801 | /* Don't ever retry more than 3 times */ | 798 | /* Don't ever retry more than 3 times */ |
802 | if (req->a_retries++ >= NLMCLNT_MAX_RETRIES) | 799 | if (req->a_retries++ >= NLMCLNT_MAX_RETRIES) |
803 | goto die; | 800 | goto die; |
804 | lock_kernel(); | ||
805 | nlm_rebind_host(req->a_host); | 801 | nlm_rebind_host(req->a_host); |
806 | unlock_kernel(); | ||
807 | rpc_restart_call(task); | 802 | rpc_restart_call(task); |
808 | rpc_delay(task, 30 * HZ); | 803 | rpc_delay(task, 30 * HZ); |
809 | } | 804 | } |