• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/fs/nfsd/

Lines Matching refs:rp

50 	struct svc_cacherep	*rp;
56 rp = kmalloc(sizeof(*rp), GFP_KERNEL);
57 if (!rp)
59 list_add(&rp->c_lru, &lru_head);
60 rp->c_state = RC_UNUSED;
61 rp->c_type = RC_NOCACHE;
62 INIT_HLIST_NODE(&rp->c_hash);
80 struct svc_cacherep *rp;
83 rp = list_entry(lru_head.next, struct svc_cacherep, c_lru);
84 if (rp->c_state == RC_DONE && rp->c_type == RC_REPLBUFF)
85 kfree(rp->c_replvec.iov_base);
86 list_del(&rp->c_lru);
87 kfree(rp);
100 lru_put_end(struct svc_cacherep *rp)
102 list_move_tail(&rp->c_lru, &lru_head);
109 hash_refile(struct svc_cacherep *rp)
111 hlist_del_init(&rp->c_hash);
112 hlist_add_head(&rp->c_hash, cache_hash + request_hash(rp->c_xid));
125 struct svc_cacherep *rp;
143 hlist_for_each_entry(rp, hn, rh, c_hash) {
144 if (rp->c_state != RC_UNUSED &&
145 xid == rp->c_xid && proc == rp->c_proc &&
146 proto == rp->c_prot && vers == rp->c_vers &&
147 time_before(jiffies, rp->c_timestamp + 120*HZ) &&
148 memcmp((char*)&rqstp->rq_addr, (char*)&rp->c_addr, sizeof(rp->c_addr))==0) {
158 list_for_each_entry(rp, &lru_head, c_lru) {
159 if (rp->c_state != RC_INPROG)
170 if (&rp->c_lru == &lru_head) {
181 rqstp->rq_cacherep = rp;
182 rp->c_state = RC_INPROG;
183 rp->c_xid = xid;
184 rp->c_proc = proc;
185 memcpy(&rp->c_addr, svc_addr_in(rqstp), sizeof(rp->c_addr));
186 rp->c_prot = proto;
187 rp->c_vers = vers;
188 rp->c_timestamp = jiffies;
190 hash_refile(rp);
193 if (rp->c_type == RC_REPLBUFF) {
194 kfree(rp->c_replvec.iov_base);
195 rp->c_replvec.iov_base = NULL;
197 rp->c_type = RC_NOCACHE;
204 age = jiffies - rp->c_timestamp;
205 rp->c_timestamp = jiffies;
206 lru_put_end(rp);
210 if (rp->c_state == RC_INPROG || age < RC_DELAY)
216 if (!rqstp->rq_secure && rp->c_secure)
220 switch (rp->c_type) {
224 svc_putu32(&rqstp->rq_res.head[0], rp->c_replstat);
228 if (!nfsd_cache_append(rqstp, &rp->c_replvec))
233 printk(KERN_WARNING "nfsd: bad repcache type %d\n", rp->c_type);
234 rp->c_state = RC_UNUSED;
259 struct svc_cacherep *rp;
263 if (!(rp = rqstp->rq_cacherep) || cache_disabled)
271 rp->c_state = RC_UNUSED;
279 rp->c_replstat = *statp;
282 cachv = &rp->c_replvec;
286 rp->c_state = RC_UNUSED;
295 lru_put_end(rp);
296 rp->c_secure = rqstp->rq_secure;
297 rp->c_type = cachetype;
298 rp->c_state = RC_DONE;
299 rp->c_timestamp = jiffies;