git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
DSS2: Small VRFB context allocation bug fixed
[pandora-kernel.git]
/
fs
/
nfsd
/
nfscache.c
diff --git
a/fs/nfsd/nfscache.c
b/fs/nfsd/nfscache.c
index
f90d704
..
5bfc2ac
100644
(file)
--- a/
fs/nfsd/nfscache.c
+++ b/
fs/nfsd/nfscache.c
@@
-44,17
+44,17
@@
static int nfsd_cache_append(struct svc_rqst *rqstp, struct kvec *vec);
*/
static DEFINE_SPINLOCK(cache_lock);
*/
static DEFINE_SPINLOCK(cache_lock);
-void
-nfsd_cache_init(void)
+int nfsd_reply_cache_init(void)
{
struct svc_cacherep *rp;
int i;
INIT_LIST_HEAD(&lru_head);
i = CACHESIZE;
{
struct svc_cacherep *rp;
int i;
INIT_LIST_HEAD(&lru_head);
i = CACHESIZE;
- while(i) {
+ while
(i) {
rp = kmalloc(sizeof(*rp), GFP_KERNEL);
rp = kmalloc(sizeof(*rp), GFP_KERNEL);
- if (!rp) break;
+ if (!rp)
+ goto out_nomem;
list_add(&rp->c_lru, &lru_head);
rp->c_state = RC_UNUSED;
rp->c_type = RC_NOCACHE;
list_add(&rp->c_lru, &lru_head);
rp->c_state = RC_UNUSED;
rp->c_type = RC_NOCACHE;
@@
-62,23
+62,19
@@
nfsd_cache_init(void)
i--;
}
i--;
}
- if (i)
- printk (KERN_ERR "nfsd: cannot allocate all %d cache entries, only got %d\n",
- CACHESIZE, CACHESIZE-i);
-
hash_list = kcalloc (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;
- }
+ if (!hash_list)
+ goto out_nomem;
cache_disabled = 0;
cache_disabled = 0;
+ return 0;
+out_nomem:
+ printk(KERN_ERR "nfsd: failed to allocate reply cache\n");
+ nfsd_reply_cache_shutdown();
+ return -ENOMEM;
}
}
-void
-nfsd_cache_shutdown(void)
+void nfsd_reply_cache_shutdown(void)
{
struct svc_cacherep *rp;
{
struct svc_cacherep *rp;
@@
-185,7
+181,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_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;
rp->c_prot = proto;
rp->c_vers = vers;
rp->c_timestamp = jiffies;