aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd
diff options
context:
space:
mode:
Diffstat (limited to 'fs/lockd')
-rw-r--r--fs/lockd/clntlock.c12
-rw-r--r--fs/lockd/clntproc.c44
-rw-r--r--fs/lockd/host.c53
-rw-r--r--fs/lockd/svc4proc.c2
-rw-r--r--fs/lockd/svclock.c20
-rw-r--r--fs/lockd/svcproc.c2
-rw-r--r--fs/lockd/svcshare.c2
-rw-r--r--fs/lockd/svcsubs.c2
-rw-r--r--fs/lockd/xdr.c8
-rw-r--r--fs/lockd/xdr4.c8
10 files changed, 79 insertions, 74 deletions
diff --git a/fs/lockd/clntlock.c b/fs/lockd/clntlock.c
index b85a0ad2cfb6..062707745162 100644
--- a/fs/lockd/clntlock.c
+++ b/fs/lockd/clntlock.c
@@ -36,7 +36,7 @@ struct nlm_wait {
36 struct nlm_host * b_host; 36 struct nlm_host * b_host;
37 struct file_lock * b_lock; /* local file lock */ 37 struct file_lock * b_lock; /* local file lock */
38 unsigned short b_reclaim; /* got to reclaim lock */ 38 unsigned short b_reclaim; /* got to reclaim lock */
39 u32 b_status; /* grant callback status */ 39 __be32 b_status; /* grant callback status */
40}; 40};
41 41
42static LIST_HEAD(nlm_blocked); 42static LIST_HEAD(nlm_blocked);
@@ -53,7 +53,7 @@ struct nlm_wait *nlmclnt_prepare_block(struct nlm_host *host, struct file_lock *
53 block->b_host = host; 53 block->b_host = host;
54 block->b_lock = fl; 54 block->b_lock = fl;
55 init_waitqueue_head(&block->b_wait); 55 init_waitqueue_head(&block->b_wait);
56 block->b_status = NLM_LCK_BLOCKED; 56 block->b_status = nlm_lck_blocked;
57 list_add(&block->b_list, &nlm_blocked); 57 list_add(&block->b_list, &nlm_blocked);
58 } 58 }
59 return block; 59 return block;
@@ -89,7 +89,7 @@ int nlmclnt_block(struct nlm_wait *block, struct nlm_rqst *req, long timeout)
89 * nlmclnt_lock for an explanation. 89 * nlmclnt_lock for an explanation.
90 */ 90 */
91 ret = wait_event_interruptible_timeout(block->b_wait, 91 ret = wait_event_interruptible_timeout(block->b_wait,
92 block->b_status != NLM_LCK_BLOCKED, 92 block->b_status != nlm_lck_blocked,
93 timeout); 93 timeout);
94 if (ret < 0) 94 if (ret < 0)
95 return -ERESTARTSYS; 95 return -ERESTARTSYS;
@@ -126,12 +126,12 @@ __be32 nlmclnt_grant(const struct sockaddr_in *addr, const struct nlm_lock *lock
126 continue; 126 continue;
127 if (!nlm_cmp_addr(&block->b_host->h_addr, addr)) 127 if (!nlm_cmp_addr(&block->b_host->h_addr, addr))
128 continue; 128 continue;
129 if (nfs_compare_fh(NFS_FH(fl_blocked->fl_file->f_dentry->d_inode) ,fh) != 0) 129 if (nfs_compare_fh(NFS_FH(fl_blocked->fl_file->f_path.dentry->d_inode) ,fh) != 0)
130 continue; 130 continue;
131 /* Alright, we found a lock. Set the return status 131 /* Alright, we found a lock. Set the return status
132 * and wake up the caller 132 * and wake up the caller
133 */ 133 */
134 block->b_status = NLM_LCK_GRANTED; 134 block->b_status = nlm_granted;
135 wake_up(&block->b_wait); 135 wake_up(&block->b_wait);
136 res = nlm_granted; 136 res = nlm_granted;
137 } 137 }
@@ -211,7 +211,7 @@ restart:
211 /* Now, wake up all processes that sleep on a blocked lock */ 211 /* Now, wake up all processes that sleep on a blocked lock */
212 list_for_each_entry(block, &nlm_blocked, b_list) { 212 list_for_each_entry(block, &nlm_blocked, b_list) {
213 if (block->b_host == host) { 213 if (block->b_host == host) {
214 block->b_status = NLM_LCK_DENIED_GRACE_PERIOD; 214 block->b_status = nlm_lck_denied_grace_period;
215 wake_up(&block->b_wait); 215 wake_up(&block->b_wait);
216 } 216 }
217 } 217 }
diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c
index 3d84f600b633..0b4acc1c5e7d 100644
--- a/fs/lockd/clntproc.c
+++ b/fs/lockd/clntproc.c
@@ -13,6 +13,7 @@
13#include <linux/nfs_fs.h> 13#include <linux/nfs_fs.h>
14#include <linux/utsname.h> 14#include <linux/utsname.h>
15#include <linux/smp_lock.h> 15#include <linux/smp_lock.h>
16#include <linux/freezer.h>
16#include <linux/sunrpc/clnt.h> 17#include <linux/sunrpc/clnt.h>
17#include <linux/sunrpc/svc.h> 18#include <linux/sunrpc/svc.h>
18#include <linux/lockd/lockd.h> 19#include <linux/lockd/lockd.h>
@@ -26,7 +27,7 @@
26static int nlmclnt_test(struct nlm_rqst *, struct file_lock *); 27static int nlmclnt_test(struct nlm_rqst *, struct file_lock *);
27static int nlmclnt_lock(struct nlm_rqst *, struct file_lock *); 28static int nlmclnt_lock(struct nlm_rqst *, struct file_lock *);
28static int nlmclnt_unlock(struct nlm_rqst *, struct file_lock *); 29static int nlmclnt_unlock(struct nlm_rqst *, struct file_lock *);
29static int nlm_stat_to_errno(u32 stat); 30static int nlm_stat_to_errno(__be32 stat);
30static void nlmclnt_locks_init_private(struct file_lock *fl, struct nlm_host *host); 31static void nlmclnt_locks_init_private(struct file_lock *fl, struct nlm_host *host);
31static int nlmclnt_cancel(struct nlm_host *, int , struct file_lock *); 32static int nlmclnt_cancel(struct nlm_host *, int , struct file_lock *);
32 33
@@ -128,7 +129,7 @@ static void nlmclnt_setlockargs(struct nlm_rqst *req, struct file_lock *fl)
128 129
129 nlmclnt_next_cookie(&argp->cookie); 130 nlmclnt_next_cookie(&argp->cookie);
130 argp->state = nsm_local_state; 131 argp->state = nsm_local_state;
131 memcpy(&lock->fh, NFS_FH(fl->fl_file->f_dentry->d_inode), sizeof(struct nfs_fh)); 132 memcpy(&lock->fh, NFS_FH(fl->fl_file->f_path.dentry->d_inode), sizeof(struct nfs_fh));
132 lock->caller = utsname()->nodename; 133 lock->caller = utsname()->nodename;
133 lock->oh.data = req->a_owner; 134 lock->oh.data = req->a_owner;
134 lock->oh.len = snprintf(req->a_owner, sizeof(req->a_owner), "%u@%s", 135 lock->oh.len = snprintf(req->a_owner, sizeof(req->a_owner), "%u@%s",
@@ -324,7 +325,7 @@ nlmclnt_call(struct nlm_rqst *req, u32 proc)
324 } 325 }
325 break; 326 break;
326 } else 327 } else
327 if (resp->status == NLM_LCK_DENIED_GRACE_PERIOD) { 328 if (resp->status == nlm_lck_denied_grace_period) {
328 dprintk("lockd: server in grace period\n"); 329 dprintk("lockd: server in grace period\n");
329 if (argp->reclaim) { 330 if (argp->reclaim) {
330 printk(KERN_WARNING 331 printk(KERN_WARNING
@@ -410,10 +411,10 @@ nlmclnt_test(struct nlm_rqst *req, struct file_lock *fl)
410 goto out; 411 goto out;
411 412
412 switch (req->a_res.status) { 413 switch (req->a_res.status) {
413 case NLM_LCK_GRANTED: 414 case nlm_granted:
414 fl->fl_type = F_UNLCK; 415 fl->fl_type = F_UNLCK;
415 break; 416 break;
416 case NLM_LCK_DENIED: 417 case nlm_lck_denied:
417 /* 418 /*
418 * Report the conflicting lock back to the application. 419 * Report the conflicting lock back to the application.
419 */ 420 */
@@ -523,9 +524,9 @@ again:
523 if (!req->a_args.block) 524 if (!req->a_args.block)
524 break; 525 break;
525 /* Did a reclaimer thread notify us of a server reboot? */ 526 /* Did a reclaimer thread notify us of a server reboot? */
526 if (resp->status == NLM_LCK_DENIED_GRACE_PERIOD) 527 if (resp->status == nlm_lck_denied_grace_period)
527 continue; 528 continue;
528 if (resp->status != NLM_LCK_BLOCKED) 529 if (resp->status != nlm_lck_blocked)
529 break; 530 break;
530 /* Wait on an NLM blocking lock */ 531 /* Wait on an NLM blocking lock */
531 status = nlmclnt_block(block, req, NLMCLNT_POLL_TIMEOUT); 532 status = nlmclnt_block(block, req, NLMCLNT_POLL_TIMEOUT);
@@ -534,11 +535,11 @@ again:
534 */ 535 */
535 if (status < 0) 536 if (status < 0)
536 goto out_unblock; 537 goto out_unblock;
537 if (resp->status != NLM_LCK_BLOCKED) 538 if (resp->status != nlm_lck_blocked)
538 break; 539 break;
539 } 540 }
540 541
541 if (resp->status == NLM_LCK_GRANTED) { 542 if (resp->status == nlm_granted) {
542 down_read(&host->h_rwsem); 543 down_read(&host->h_rwsem);
543 /* Check whether or not the server has rebooted */ 544 /* Check whether or not the server has rebooted */
544 if (fl->fl_u.nfs_fl.state != host->h_state) { 545 if (fl->fl_u.nfs_fl.state != host->h_state) {
@@ -555,7 +556,7 @@ again:
555out_unblock: 556out_unblock:
556 nlmclnt_finish_block(block); 557 nlmclnt_finish_block(block);
557 /* Cancel the blocked request if it is still pending */ 558 /* Cancel the blocked request if it is still pending */
558 if (resp->status == NLM_LCK_BLOCKED) 559 if (resp->status == nlm_lck_blocked)
559 nlmclnt_cancel(host, req->a_args.block, fl); 560 nlmclnt_cancel(host, req->a_args.block, fl);
560out: 561out:
561 nlm_release_call(req); 562 nlm_release_call(req);
@@ -584,12 +585,12 @@ nlmclnt_reclaim(struct nlm_host *host, struct file_lock *fl)
584 req->a_args.reclaim = 1; 585 req->a_args.reclaim = 1;
585 586
586 if ((status = nlmclnt_call(req, NLMPROC_LOCK)) >= 0 587 if ((status = nlmclnt_call(req, NLMPROC_LOCK)) >= 0
587 && req->a_res.status == NLM_LCK_GRANTED) 588 && req->a_res.status == nlm_granted)
588 return 0; 589 return 0;
589 590
590 printk(KERN_WARNING "lockd: failed to reclaim lock for pid %d " 591 printk(KERN_WARNING "lockd: failed to reclaim lock for pid %d "
591 "(errno %d, status %d)\n", fl->fl_pid, 592 "(errno %d, status %d)\n", fl->fl_pid,
592 status, req->a_res.status); 593 status, ntohl(req->a_res.status));
593 594
594 /* 595 /*
595 * FIXME: This is a serious failure. We can 596 * FIXME: This is a serious failure. We can
@@ -636,10 +637,10 @@ nlmclnt_unlock(struct nlm_rqst *req, struct file_lock *fl)
636 if (status < 0) 637 if (status < 0)
637 goto out; 638 goto out;
638 639
639 if (resp->status == NLM_LCK_GRANTED) 640 if (resp->status == nlm_granted)
640 goto out; 641 goto out;
641 642
642 if (resp->status != NLM_LCK_DENIED_NOLOCKS) 643 if (resp->status != nlm_lck_denied_nolocks)
643 printk("lockd: unexpected unlock status: %d\n", resp->status); 644 printk("lockd: unexpected unlock status: %d\n", resp->status);
644 /* What to do now? I'm out of my depth... */ 645 /* What to do now? I'm out of my depth... */
645 status = -ENOLCK; 646 status = -ENOLCK;
@@ -651,7 +652,7 @@ out:
651static void nlmclnt_unlock_callback(struct rpc_task *task, void *data) 652static void nlmclnt_unlock_callback(struct rpc_task *task, void *data)
652{ 653{
653 struct nlm_rqst *req = data; 654 struct nlm_rqst *req = data;
654 int status = req->a_res.status; 655 u32 status = ntohl(req->a_res.status);
655 656
656 if (RPC_ASSASSINATED(task)) 657 if (RPC_ASSASSINATED(task))
657 goto die; 658 goto die;
@@ -719,6 +720,7 @@ static int nlmclnt_cancel(struct nlm_host *host, int block, struct file_lock *fl
719static void nlmclnt_cancel_callback(struct rpc_task *task, void *data) 720static void nlmclnt_cancel_callback(struct rpc_task *task, void *data)
720{ 721{
721 struct nlm_rqst *req = data; 722 struct nlm_rqst *req = data;
723 u32 status = ntohl(req->a_res.status);
722 724
723 if (RPC_ASSASSINATED(task)) 725 if (RPC_ASSASSINATED(task))
724 goto die; 726 goto die;
@@ -729,10 +731,10 @@ static void nlmclnt_cancel_callback(struct rpc_task *task, void *data)
729 goto retry_cancel; 731 goto retry_cancel;
730 } 732 }
731 733
732 dprintk("lockd: cancel status %d (task %d)\n", 734 dprintk("lockd: cancel status %u (task %u)\n",
733 req->a_res.status, task->tk_pid); 735 status, task->tk_pid);
734 736
735 switch (req->a_res.status) { 737 switch (status) {
736 case NLM_LCK_GRANTED: 738 case NLM_LCK_GRANTED:
737 case NLM_LCK_DENIED_GRACE_PERIOD: 739 case NLM_LCK_DENIED_GRACE_PERIOD:
738 case NLM_LCK_DENIED: 740 case NLM_LCK_DENIED:
@@ -743,7 +745,7 @@ static void nlmclnt_cancel_callback(struct rpc_task *task, void *data)
743 goto retry_cancel; 745 goto retry_cancel;
744 default: 746 default:
745 printk(KERN_NOTICE "lockd: weird return %d for CANCEL call\n", 747 printk(KERN_NOTICE "lockd: weird return %d for CANCEL call\n",
746 req->a_res.status); 748 status);
747 } 749 }
748 750
749die: 751die:
@@ -767,9 +769,9 @@ static const struct rpc_call_ops nlmclnt_cancel_ops = {
767 * Convert an NLM status code to a generic kernel errno 769 * Convert an NLM status code to a generic kernel errno
768 */ 770 */
769static int 771static int
770nlm_stat_to_errno(u32 status) 772nlm_stat_to_errno(__be32 status)
771{ 773{
772 switch(status) { 774 switch(ntohl(status)) {
773 case NLM_LCK_GRANTED: 775 case NLM_LCK_GRANTED:
774 return 0; 776 return 0;
775 case NLM_LCK_DENIED: 777 case NLM_LCK_DENIED:
diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index fb24a9730345..3d4610c2a266 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
@@ -36,34 +36,14 @@ static DEFINE_MUTEX(nlm_host_mutex);
36static void nlm_gc_hosts(void); 36static void nlm_gc_hosts(void);
37static struct nsm_handle * __nsm_find(const struct sockaddr_in *, 37static struct nsm_handle * __nsm_find(const struct sockaddr_in *,
38 const char *, int, int); 38 const char *, int, int);
39 39static struct nsm_handle * nsm_find(const struct sockaddr_in *sin,
40/* 40 const char *hostname,
41 * Find an NLM server handle in the cache. If there is none, create it. 41 int hostname_len);
42 */
43struct nlm_host *
44nlmclnt_lookup_host(const struct sockaddr_in *sin, int proto, int version,
45 const char *hostname, int hostname_len)
46{
47 return nlm_lookup_host(0, sin, proto, version,
48 hostname, hostname_len);
49}
50
51/*
52 * Find an NLM client handle in the cache. If there is none, create it.
53 */
54struct nlm_host *
55nlmsvc_lookup_host(struct svc_rqst *rqstp,
56 const char *hostname, int hostname_len)
57{
58 return nlm_lookup_host(1, &rqstp->rq_addr,
59 rqstp->rq_prot, rqstp->rq_vers,
60 hostname, hostname_len);
61}
62 42
63/* 43/*
64 * Common host lookup routine for server & client 44 * Common host lookup routine for server & client
65 */ 45 */
66struct nlm_host * 46static struct nlm_host *
67nlm_lookup_host(int server, const struct sockaddr_in *sin, 47nlm_lookup_host(int server, const struct sockaddr_in *sin,
68 int proto, int version, 48 int proto, int version,
69 const char *hostname, 49 const char *hostname,
@@ -195,6 +175,29 @@ nlm_destroy_host(struct nlm_host *host)
195} 175}
196 176
197/* 177/*
178 * Find an NLM server handle in the cache. If there is none, create it.
179 */
180struct nlm_host *
181nlmclnt_lookup_host(const struct sockaddr_in *sin, int proto, int version,
182 const char *hostname, int hostname_len)
183{
184 return nlm_lookup_host(0, sin, proto, version,
185 hostname, hostname_len);
186}
187
188/*
189 * Find an NLM client handle in the cache. If there is none, create it.
190 */
191struct nlm_host *
192nlmsvc_lookup_host(struct svc_rqst *rqstp,
193 const char *hostname, int hostname_len)
194{
195 return nlm_lookup_host(1, &rqstp->rq_addr,
196 rqstp->rq_prot, rqstp->rq_vers,
197 hostname, hostname_len);
198}
199
200/*
198 * Create the NLM RPC client for an NLM peer 201 * Create the NLM RPC client for an NLM peer
199 */ 202 */
200struct rpc_clnt * 203struct rpc_clnt *
@@ -495,7 +498,7 @@ out:
495 return nsm; 498 return nsm;
496} 499}
497 500
498struct nsm_handle * 501static struct nsm_handle *
499nsm_find(const struct sockaddr_in *sin, const char *hostname, int hostname_len) 502nsm_find(const struct sockaddr_in *sin, const char *hostname, int hostname_len)
500{ 503{
501 return __nsm_find(sin, hostname, hostname_len, 1); 504 return __nsm_find(sin, hostname, hostname_len, 1);
diff --git a/fs/lockd/svc4proc.c b/fs/lockd/svc4proc.c
index 0ce5c81ff507..f67146a8199a 100644
--- a/fs/lockd/svc4proc.c
+++ b/fs/lockd/svc4proc.c
@@ -234,7 +234,7 @@ nlm4svc_proc_granted(struct svc_rqst *rqstp, struct nlm_args *argp,
234 */ 234 */
235static void nlm4svc_callback_exit(struct rpc_task *task, void *data) 235static void nlm4svc_callback_exit(struct rpc_task *task, void *data)
236{ 236{
237 dprintk("lockd: %4d callback returned %d\n", task->tk_pid, 237 dprintk("lockd: %5u callback returned %d\n", task->tk_pid,
238 -task->tk_status); 238 -task->tk_status);
239} 239}
240 240
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
index 7e219b938552..c7db0a5bccdc 100644
--- a/fs/lockd/svclock.c
+++ b/fs/lockd/svclock.c
@@ -343,8 +343,8 @@ nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file,
343 __be32 ret; 343 __be32 ret;
344 344
345 dprintk("lockd: nlmsvc_lock(%s/%ld, ty=%d, pi=%d, %Ld-%Ld, bl=%d)\n", 345 dprintk("lockd: nlmsvc_lock(%s/%ld, ty=%d, pi=%d, %Ld-%Ld, bl=%d)\n",
346 file->f_file->f_dentry->d_inode->i_sb->s_id, 346 file->f_file->f_path.dentry->d_inode->i_sb->s_id,
347 file->f_file->f_dentry->d_inode->i_ino, 347 file->f_file->f_path.dentry->d_inode->i_ino,
348 lock->fl.fl_type, lock->fl.fl_pid, 348 lock->fl.fl_type, lock->fl.fl_pid,
349 (long long)lock->fl.fl_start, 349 (long long)lock->fl.fl_start,
350 (long long)lock->fl.fl_end, 350 (long long)lock->fl.fl_end,
@@ -420,8 +420,8 @@ nlmsvc_testlock(struct nlm_file *file, struct nlm_lock *lock,
420 struct nlm_lock *conflock) 420 struct nlm_lock *conflock)
421{ 421{
422 dprintk("lockd: nlmsvc_testlock(%s/%ld, ty=%d, %Ld-%Ld)\n", 422 dprintk("lockd: nlmsvc_testlock(%s/%ld, ty=%d, %Ld-%Ld)\n",
423 file->f_file->f_dentry->d_inode->i_sb->s_id, 423 file->f_file->f_path.dentry->d_inode->i_sb->s_id,
424 file->f_file->f_dentry->d_inode->i_ino, 424 file->f_file->f_path.dentry->d_inode->i_ino,
425 lock->fl.fl_type, 425 lock->fl.fl_type,
426 (long long)lock->fl.fl_start, 426 (long long)lock->fl.fl_start,
427 (long long)lock->fl.fl_end); 427 (long long)lock->fl.fl_end);
@@ -454,8 +454,8 @@ nlmsvc_unlock(struct nlm_file *file, struct nlm_lock *lock)
454 int error; 454 int error;
455 455
456 dprintk("lockd: nlmsvc_unlock(%s/%ld, pi=%d, %Ld-%Ld)\n", 456 dprintk("lockd: nlmsvc_unlock(%s/%ld, pi=%d, %Ld-%Ld)\n",
457 file->f_file->f_dentry->d_inode->i_sb->s_id, 457 file->f_file->f_path.dentry->d_inode->i_sb->s_id,
458 file->f_file->f_dentry->d_inode->i_ino, 458 file->f_file->f_path.dentry->d_inode->i_ino,
459 lock->fl.fl_pid, 459 lock->fl.fl_pid,
460 (long long)lock->fl.fl_start, 460 (long long)lock->fl.fl_start,
461 (long long)lock->fl.fl_end); 461 (long long)lock->fl.fl_end);
@@ -483,8 +483,8 @@ nlmsvc_cancel_blocked(struct nlm_file *file, struct nlm_lock *lock)
483 int status = 0; 483 int status = 0;
484 484
485 dprintk("lockd: nlmsvc_cancel(%s/%ld, pi=%d, %Ld-%Ld)\n", 485 dprintk("lockd: nlmsvc_cancel(%s/%ld, pi=%d, %Ld-%Ld)\n",
486 file->f_file->f_dentry->d_inode->i_sb->s_id, 486 file->f_file->f_path.dentry->d_inode->i_sb->s_id,
487 file->f_file->f_dentry->d_inode->i_ino, 487 file->f_file->f_path.dentry->d_inode->i_ino,
488 lock->fl.fl_pid, 488 lock->fl.fl_pid,
489 (long long)lock->fl.fl_start, 489 (long long)lock->fl.fl_start,
490 (long long)lock->fl.fl_end); 490 (long long)lock->fl.fl_end);
@@ -645,7 +645,7 @@ static const struct rpc_call_ops nlmsvc_grant_ops = {
645 * block. 645 * block.
646 */ 646 */
647void 647void
648nlmsvc_grant_reply(struct nlm_cookie *cookie, u32 status) 648nlmsvc_grant_reply(struct nlm_cookie *cookie, __be32 status)
649{ 649{
650 struct nlm_block *block; 650 struct nlm_block *block;
651 651
@@ -655,7 +655,7 @@ nlmsvc_grant_reply(struct nlm_cookie *cookie, u32 status)
655 return; 655 return;
656 656
657 if (block) { 657 if (block) {
658 if (status == NLM_LCK_DENIED_GRACE_PERIOD) { 658 if (status == nlm_lck_denied_grace_period) {
659 /* Try again in a couple of seconds */ 659 /* Try again in a couple of seconds */
660 nlmsvc_insert_block(block, 10 * HZ); 660 nlmsvc_insert_block(block, 10 * HZ);
661 } else { 661 } else {
diff --git a/fs/lockd/svcproc.c b/fs/lockd/svcproc.c
index 32e99a6e8dca..3707c3a23e93 100644
--- a/fs/lockd/svcproc.c
+++ b/fs/lockd/svcproc.c
@@ -263,7 +263,7 @@ nlmsvc_proc_granted(struct svc_rqst *rqstp, struct nlm_args *argp,
263 */ 263 */
264static void nlmsvc_callback_exit(struct rpc_task *task, void *data) 264static void nlmsvc_callback_exit(struct rpc_task *task, void *data)
265{ 265{
266 dprintk("lockd: %4d callback returned %d\n", task->tk_pid, 266 dprintk("lockd: %5u callback returned %d\n", task->tk_pid,
267 -task->tk_status); 267 -task->tk_status);
268} 268}
269 269
diff --git a/fs/lockd/svcshare.c b/fs/lockd/svcshare.c
index 6220dc2a3f2c..068886de4dda 100644
--- a/fs/lockd/svcshare.c
+++ b/fs/lockd/svcshare.c
@@ -39,7 +39,7 @@ nlmsvc_share_file(struct nlm_host *host, struct nlm_file *file,
39 return nlm_lck_denied; 39 return nlm_lck_denied;
40 } 40 }
41 41
42 share = (struct nlm_share *) kmalloc(sizeof(*share) + oh->len, 42 share = kmalloc(sizeof(*share) + oh->len,
43 GFP_KERNEL); 43 GFP_KERNEL);
44 if (share == NULL) 44 if (share == NULL)
45 return nlm_lck_denied_nolocks; 45 return nlm_lck_denied_nolocks;
diff --git a/fs/lockd/svcsubs.c b/fs/lockd/svcsubs.c
index e83024e16042..c0df00c74ce3 100644
--- a/fs/lockd/svcsubs.c
+++ b/fs/lockd/svcsubs.c
@@ -43,7 +43,7 @@ static inline void nlm_debug_print_fh(char *msg, struct nfs_fh *f)
43 43
44static inline void nlm_debug_print_file(char *msg, struct nlm_file *file) 44static inline void nlm_debug_print_file(char *msg, struct nlm_file *file)
45{ 45{
46 struct inode *inode = file->f_file->f_dentry->d_inode; 46 struct inode *inode = file->f_file->f_path.dentry->d_inode;
47 47
48 dprintk("lockd: %s %s/%ld\n", 48 dprintk("lockd: %s %s/%ld\n",
49 msg, inode->i_sb->s_id, inode->i_ino); 49 msg, inode->i_sb->s_id, inode->i_ino);
diff --git a/fs/lockd/xdr.c b/fs/lockd/xdr.c
index b7c949256e5a..34dae5d70738 100644
--- a/fs/lockd/xdr.c
+++ b/fs/lockd/xdr.c
@@ -361,7 +361,7 @@ nlmsvc_decode_res(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp)
361{ 361{
362 if (!(p = nlm_decode_cookie(p, &resp->cookie))) 362 if (!(p = nlm_decode_cookie(p, &resp->cookie)))
363 return 0; 363 return 0;
364 resp->status = ntohl(*p++); 364 resp->status = *p++;
365 return xdr_argsize_check(rqstp, p); 365 return xdr_argsize_check(rqstp, p);
366} 366}
367 367
@@ -407,8 +407,8 @@ nlmclt_decode_testres(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp)
407{ 407{
408 if (!(p = nlm_decode_cookie(p, &resp->cookie))) 408 if (!(p = nlm_decode_cookie(p, &resp->cookie)))
409 return -EIO; 409 return -EIO;
410 resp->status = ntohl(*p++); 410 resp->status = *p++;
411 if (resp->status == NLM_LCK_DENIED) { 411 if (resp->status == nlm_lck_denied) {
412 struct file_lock *fl = &resp->lock.fl; 412 struct file_lock *fl = &resp->lock.fl;
413 u32 excl; 413 u32 excl;
414 s32 start, len, end; 414 s32 start, len, end;
@@ -506,7 +506,7 @@ nlmclt_decode_res(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp)
506{ 506{
507 if (!(p = nlm_decode_cookie(p, &resp->cookie))) 507 if (!(p = nlm_decode_cookie(p, &resp->cookie)))
508 return -EIO; 508 return -EIO;
509 resp->status = ntohl(*p++); 509 resp->status = *p++;
510 return 0; 510 return 0;
511} 511}
512 512
diff --git a/fs/lockd/xdr4.c b/fs/lockd/xdr4.c
index f4c0b2b9f75a..a78240551219 100644
--- a/fs/lockd/xdr4.c
+++ b/fs/lockd/xdr4.c
@@ -367,7 +367,7 @@ nlm4svc_decode_res(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp)
367{ 367{
368 if (!(p = nlm4_decode_cookie(p, &resp->cookie))) 368 if (!(p = nlm4_decode_cookie(p, &resp->cookie)))
369 return 0; 369 return 0;
370 resp->status = ntohl(*p++); 370 resp->status = *p++;
371 return xdr_argsize_check(rqstp, p); 371 return xdr_argsize_check(rqstp, p);
372} 372}
373 373
@@ -413,8 +413,8 @@ nlm4clt_decode_testres(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp)
413{ 413{
414 if (!(p = nlm4_decode_cookie(p, &resp->cookie))) 414 if (!(p = nlm4_decode_cookie(p, &resp->cookie)))
415 return -EIO; 415 return -EIO;
416 resp->status = ntohl(*p++); 416 resp->status = *p++;
417 if (resp->status == NLM_LCK_DENIED) { 417 if (resp->status == nlm_lck_denied) {
418 struct file_lock *fl = &resp->lock.fl; 418 struct file_lock *fl = &resp->lock.fl;
419 u32 excl; 419 u32 excl;
420 s64 start, end, len; 420 s64 start, end, len;
@@ -512,7 +512,7 @@ nlm4clt_decode_res(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp)
512{ 512{
513 if (!(p = nlm4_decode_cookie(p, &resp->cookie))) 513 if (!(p = nlm4_decode_cookie(p, &resp->cookie)))
514 return -EIO; 514 return -EIO;
515 resp->status = ntohl(*p++); 515 resp->status = *p++;
516 return 0; 516 return 0;
517} 517}
518 518