X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=fs%2Fnfsd%2Fnfscache.c;h=578f2c9d56bec09899d4dc1c0ca135320e7c6bf9;hb=54c66f6d781e03dc0b23956234963c4911e6d1c0;hp=6100bbe27432d6b6f826733a47b3a87dfdbc3041;hpb=6d03a68e6d5528630955452ec4b768dbde0dc00c;p=powerpc.git diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c index 6100bbe274..578f2c9d56 100644 --- a/fs/nfsd/nfscache.c +++ b/fs/nfsd/nfscache.c @@ -66,14 +66,13 @@ nfsd_cache_init(void) printk (KERN_ERR "nfsd: cannot allocate all %d cache entries, only got %d\n", CACHESIZE, CACHESIZE-i); - hash_list = kmalloc (HASHSIZE * sizeof(struct hlist_head), GFP_KERNEL); + hash_list = kcalloc (HASHSIZE, sizeof(struct hlist_head), GFP_KERNEL); if (!hash_list) { nfsd_cache_shutdown(); printk (KERN_ERR "nfsd: cannot allocate %Zd bytes for hash list\n", HASHSIZE * sizeof(struct hlist_head)); return; } - memset(hash_list, 0, HASHSIZE * sizeof(struct hlist_head)); cache_disabled = 0; } @@ -186,7 +185,7 @@ nfsd_cache_lookup(struct svc_rqst *rqstp, int type) rp->c_state = RC_INPROG; rp->c_xid = xid; rp->c_proc = proc; - rp->c_addr = rqstp->rq_addr; + memcpy(&rp->c_addr, svc_addr_in(rqstp), sizeof(rp->c_addr)); rp->c_prot = proto; rp->c_vers = vers; rp->c_timestamp = jiffies;