linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / fs / lockd / xdr.c
index 033ea4a..200fbda 100644 (file)
@@ -6,6 +6,7 @@
  * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
  */
 
+#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/sched.h>
 #include <linux/utsname.h>
@@ -130,11 +131,10 @@ nlm_decode_lock(u32 *p, struct nlm_lock *lock)
         || !(p = nlm_decode_fh(p, &lock->fh))
         || !(p = nlm_decode_oh(p, &lock->oh)))
                return NULL;
-       lock->svid  = ntohl(*p++);
 
        locks_init_lock(fl);
        fl->fl_owner = current->files;
-       fl->fl_pid   = (pid_t)lock->svid;
+       fl->fl_pid   = ntohl(*p++);
        fl->fl_flags = FL_POSIX;
        fl->fl_type  = F_RDLCK;         /* as good as anything else */
        start = ntohl(*p++);
@@ -174,7 +174,7 @@ nlm_encode_lock(u32 *p, struct nlm_lock *lock)
        else
                len = loff_t_to_s32(fl->fl_end - fl->fl_start + 1);
 
-       *p++ = htonl(lock->svid);
+       *p++ = htonl(fl->fl_pid);
        *p++ = htonl(start);
        *p++ = htonl(len);
 
@@ -197,7 +197,7 @@ nlm_encode_testres(u32 *p, struct nlm_res *resp)
                struct file_lock        *fl = &resp->lock.fl;
 
                *p++ = (fl->fl_type == F_RDLCK)? xdr_zero : xdr_one;
-               *p++ = htonl(resp->lock.svid);
+               *p++ = htonl(fl->fl_pid);
 
                /* Encode owner handle. */
                if (!(p = xdr_encode_netobj(p, &resp->lock.oh)))
@@ -298,8 +298,7 @@ nlmsvc_decode_shareargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp)
 
        memset(lock, 0, sizeof(*lock));
        locks_init_lock(&lock->fl);
-       lock->svid = ~(u32) 0;
-       lock->fl.fl_pid = (pid_t)lock->svid;
+       lock->fl.fl_pid = ~(u32) 0;
 
        if (!(p = nlm_decode_cookie(p, &argp->cookie))
         || !(p = xdr_decode_string_inplace(p, &lock->caller,
@@ -416,8 +415,7 @@ nlmclt_decode_testres(struct rpc_rqst *req, u32 *p, struct nlm_res *resp)
                memset(&resp->lock, 0, sizeof(resp->lock));
                locks_init_lock(fl);
                excl = ntohl(*p++);
-               resp->lock.svid = ntohl(*p++);
-               fl->fl_pid = (pid_t)resp->lock.svid;
+               fl->fl_pid = ntohl(*p++);
                if (!(p = nlm_decode_oh(p, &resp->lock.oh)))
                        return -EIO;
 
@@ -545,9 +543,7 @@ nlmclt_decode_res(struct rpc_rqst *req, u32 *p, struct nlm_res *resp)
        .p_proc      = NLMPROC_##proc,                                  \
        .p_encode    = (kxdrproc_t) nlmclt_encode_##argtype,            \
        .p_decode    = (kxdrproc_t) nlmclt_decode_##restype,            \
-       .p_bufsiz    = MAX(NLM_##argtype##_sz, NLM_##restype##_sz) << 2,        \
-       .p_statidx   = NLMPROC_##proc,                                  \
-       .p_name      = #proc,                                           \
+       .p_bufsiz    = MAX(NLM_##argtype##_sz, NLM_##restype##_sz) << 2 \
        }
 
 static struct rpc_procinfo     nlm_procedures[] = {
@@ -603,7 +599,7 @@ static struct rpc_stat              nlm_stats;
 struct rpc_program             nlm_program = {
                .name           = "lockd",
                .number         = NLM_PROGRAM,
-               .nrvers         = ARRAY_SIZE(nlm_versions),
+               .nrvers         = sizeof(nlm_versions) / sizeof(nlm_versions[0]),
                .version        = nlm_versions,
                .stats          = &nlm_stats,
 };