]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/lockd/xdr.c
drm: cleanup DRM_DEBUG() parameters
[linux-2.6-omap-h63xx.git] / fs / lockd / xdr.c
index 34dae5d70738bff79bc78945fd647dc4f16bdbca..3e459e18cc31ba2efeaca67dc9b40ae506604247 100644 (file)
@@ -62,8 +62,9 @@ static __be32 *nlm_decode_cookie(__be32 *p, struct nlm_cookie *c)
        }
        else 
        {
-               printk(KERN_NOTICE
-                       "lockd: bad cookie size %d (only cookies under %d bytes are supported.)\n", len, NLM_MAXCOOKIELEN);
+               dprintk("lockd: bad cookie size %d (only cookies under "
+                       "%d bytes are supported.)\n",
+                               len, NLM_MAXCOOKIELEN);
                return NULL;
        }
        return p;
@@ -84,8 +85,7 @@ nlm_decode_fh(__be32 *p, struct nfs_fh *f)
        unsigned int    len;
 
        if ((len = ntohl(*p++)) != NFS2_FHSIZE) {
-               printk(KERN_NOTICE
-                       "lockd: bad fhandle size %d (should be %d)\n",
+               dprintk("lockd: bad fhandle size %d (should be %d)\n",
                        len, NFS2_FHSIZE);
                return NULL;
        }
@@ -510,17 +510,20 @@ nlmclt_decode_res(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp)
        return 0;
 }
 
+#if (NLMCLNT_OHSIZE > XDR_MAX_NETOBJ)
+#  error "NLM host name cannot be larger than XDR_MAX_NETOBJ!"
+#endif
+
 /*
  * Buffer requirements for NLM
  */
 #define NLM_void_sz            0
 #define NLM_cookie_sz          1+XDR_QUADLEN(NLM_MAXCOOKIELEN)
-#define NLM_caller_sz          1+XDR_QUADLEN(sizeof(utsname()->nodename))
-#define NLM_netobj_sz          1+XDR_QUADLEN(XDR_MAX_NETOBJ)
-/* #define NLM_owner_sz                1+XDR_QUADLEN(NLM_MAXOWNER) */
+#define NLM_caller_sz          1+XDR_QUADLEN(NLMCLNT_OHSIZE)
+#define NLM_owner_sz           1+XDR_QUADLEN(NLMCLNT_OHSIZE)
 #define NLM_fhandle_sz         1+XDR_QUADLEN(NFS2_FHSIZE)
-#define NLM_lock_sz            3+NLM_caller_sz+NLM_netobj_sz+NLM_fhandle_sz
-#define NLM_holder_sz          4+NLM_netobj_sz
+#define NLM_lock_sz            3+NLM_caller_sz+NLM_owner_sz+NLM_fhandle_sz
+#define NLM_holder_sz          4+NLM_owner_sz
 
 #define NLM_testargs_sz                NLM_cookie_sz+1+NLM_lock_sz
 #define NLM_lockargs_sz                NLM_cookie_sz+4+NLM_lock_sz
@@ -531,10 +534,6 @@ nlmclt_decode_res(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp)
 #define NLM_res_sz             NLM_cookie_sz+1
 #define NLM_norep_sz           0
 
-#ifndef MAX
-# define MAX(a, b)             (((a) > (b))? (a) : (b))
-#endif
-
 /*
  * For NLM, a void procedure really returns nothing
  */
@@ -545,7 +544,8 @@ nlmclt_decode_res(struct rpc_rqst *req, __be32 *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_arglen    = NLM_##argtype##_sz,                              \
+       .p_replen    = NLM_##restype##_sz,                              \
        .p_statidx   = NLMPROC_##proc,                                  \
        .p_name      = #proc,                                           \
        }
@@ -586,10 +586,6 @@ static struct rpc_version  nlm_version3 = {
                .procs          = nlm_procedures,
 };
 
-#ifdef         CONFIG_LOCKD_V4
-extern struct rpc_version nlm_version4;
-#endif
-
 static struct rpc_version *    nlm_versions[] = {
        [1] = &nlm_version1,
        [3] = &nlm_version3,
@@ -616,8 +612,7 @@ const char *nlmdbg_cookie2a(const struct nlm_cookie *cookie)
         * called with BKL held.
         */
        static char buf[2*NLM_MAXCOOKIELEN+1];
-       int i;
-       int len = sizeof(buf);
+       unsigned int i, len = sizeof(buf);
        char *p = buf;
 
        len--;  /* allow for trailing \0 */