• Home
  • Raw
  • Download

Lines Matching refs:rp

124 	struct svc_cacherep	*rp;  in nfsd_reply_cache_alloc()  local
126 rp = kmem_cache_alloc(drc_slab, GFP_KERNEL); in nfsd_reply_cache_alloc()
127 if (rp) { in nfsd_reply_cache_alloc()
128 rp->c_state = RC_UNUSED; in nfsd_reply_cache_alloc()
129 rp->c_type = RC_NOCACHE; in nfsd_reply_cache_alloc()
130 INIT_LIST_HEAD(&rp->c_lru); in nfsd_reply_cache_alloc()
132 return rp; in nfsd_reply_cache_alloc()
136 nfsd_reply_cache_free_locked(struct svc_cacherep *rp) in nfsd_reply_cache_free_locked() argument
138 if (rp->c_type == RC_REPLBUFF && rp->c_replvec.iov_base) { in nfsd_reply_cache_free_locked()
139 drc_mem_usage -= rp->c_replvec.iov_len; in nfsd_reply_cache_free_locked()
140 kfree(rp->c_replvec.iov_base); in nfsd_reply_cache_free_locked()
142 list_del(&rp->c_lru); in nfsd_reply_cache_free_locked()
144 drc_mem_usage -= sizeof(*rp); in nfsd_reply_cache_free_locked()
145 kmem_cache_free(drc_slab, rp); in nfsd_reply_cache_free_locked()
149 nfsd_reply_cache_free(struct nfsd_drc_bucket *b, struct svc_cacherep *rp) in nfsd_reply_cache_free() argument
152 nfsd_reply_cache_free_locked(rp); in nfsd_reply_cache_free()
194 struct svc_cacherep *rp; in nfsd_reply_cache_shutdown() local
202 rp = list_first_entry(head, struct svc_cacherep, c_lru); in nfsd_reply_cache_shutdown()
203 nfsd_reply_cache_free_locked(rp); in nfsd_reply_cache_shutdown()
220 lru_put_end(struct nfsd_drc_bucket *b, struct svc_cacherep *rp) in lru_put_end() argument
222 rp->c_timestamp = jiffies; in lru_put_end()
223 list_move_tail(&rp->c_lru, &b->lru_head); in lru_put_end()
229 struct svc_cacherep *rp, *tmp; in prune_bucket() local
232 list_for_each_entry_safe(rp, tmp, &b->lru_head, c_lru) { in prune_bucket()
237 if (rp->c_state == RC_INPROG) in prune_bucket()
240 time_before(jiffies, rp->c_timestamp + RC_EXPIRE)) in prune_bucket()
242 nfsd_reply_cache_free_locked(rp); in prune_bucket()
315 nfsd_cache_match(struct svc_rqst *rqstp, __wsum csum, struct svc_cacherep *rp) in nfsd_cache_match() argument
318 if (rqstp->rq_xid != rp->c_xid) in nfsd_cache_match()
321 if (csum != rp->c_csum) { in nfsd_cache_match()
327 if (rqstp->rq_proc != rp->c_proc || in nfsd_cache_match()
328 rqstp->rq_prot != rp->c_prot || in nfsd_cache_match()
329 rqstp->rq_vers != rp->c_vers || in nfsd_cache_match()
330 rqstp->rq_arg.len != rp->c_len || in nfsd_cache_match()
331 !rpc_cmp_addr(svc_addr(rqstp), (struct sockaddr *)&rp->c_addr) || in nfsd_cache_match()
332 rpc_get_port(svc_addr(rqstp)) != rpc_get_port((struct sockaddr *)&rp->c_addr)) in nfsd_cache_match()
347 struct svc_cacherep *rp, *ret = NULL; in nfsd_cache_search() local
351 list_for_each_entry(rp, rh, c_lru) { in nfsd_cache_search()
353 if (nfsd_cache_match(rqstp, csum, rp)) { in nfsd_cache_search()
354 ret = rp; in nfsd_cache_search()
383 struct svc_cacherep *rp, *found; in nfsd_cache_lookup() local
407 rp = nfsd_reply_cache_alloc(); in nfsd_cache_lookup()
409 if (likely(rp)) { in nfsd_cache_lookup()
411 drc_mem_usage += sizeof(*rp); in nfsd_cache_lookup()
419 if (likely(rp)) in nfsd_cache_lookup()
420 nfsd_reply_cache_free_locked(rp); in nfsd_cache_lookup()
421 rp = found; in nfsd_cache_lookup()
425 if (!rp) { in nfsd_cache_lookup()
431 rqstp->rq_cacherep = rp; in nfsd_cache_lookup()
432 rp->c_state = RC_INPROG; in nfsd_cache_lookup()
433 rp->c_xid = xid; in nfsd_cache_lookup()
434 rp->c_proc = proc; in nfsd_cache_lookup()
435 rpc_copy_addr((struct sockaddr *)&rp->c_addr, svc_addr(rqstp)); in nfsd_cache_lookup()
436 rpc_set_port((struct sockaddr *)&rp->c_addr, rpc_get_port(svc_addr(rqstp))); in nfsd_cache_lookup()
437 rp->c_prot = proto; in nfsd_cache_lookup()
438 rp->c_vers = vers; in nfsd_cache_lookup()
439 rp->c_len = rqstp->rq_arg.len; in nfsd_cache_lookup()
440 rp->c_csum = csum; in nfsd_cache_lookup()
442 lru_put_end(b, rp); in nfsd_cache_lookup()
445 if (rp->c_type == RC_REPLBUFF) { in nfsd_cache_lookup()
446 drc_mem_usage -= rp->c_replvec.iov_len; in nfsd_cache_lookup()
447 kfree(rp->c_replvec.iov_base); in nfsd_cache_lookup()
448 rp->c_replvec.iov_base = NULL; in nfsd_cache_lookup()
450 rp->c_type = RC_NOCACHE; in nfsd_cache_lookup()
458 age = jiffies - rp->c_timestamp; in nfsd_cache_lookup()
459 lru_put_end(b, rp); in nfsd_cache_lookup()
463 if (rp->c_state == RC_INPROG || age < RC_DELAY) in nfsd_cache_lookup()
469 if (!test_bit(RQ_SECURE, &rqstp->rq_flags) && rp->c_secure) in nfsd_cache_lookup()
473 switch (rp->c_type) { in nfsd_cache_lookup()
477 svc_putu32(&rqstp->rq_res.head[0], rp->c_replstat); in nfsd_cache_lookup()
481 if (!nfsd_cache_append(rqstp, &rp->c_replvec)) in nfsd_cache_lookup()
486 printk(KERN_WARNING "nfsd: bad repcache type %d\n", rp->c_type); in nfsd_cache_lookup()
487 nfsd_reply_cache_free_locked(rp); in nfsd_cache_lookup()
512 struct svc_cacherep *rp = rqstp->rq_cacherep; in nfsd_cache_update() local
519 if (!rp) in nfsd_cache_update()
522 hash = nfsd_cache_hash(rp->c_xid); in nfsd_cache_update()
530 nfsd_reply_cache_free(b, rp); in nfsd_cache_update()
538 rp->c_replstat = *statp; in nfsd_cache_update()
541 cachv = &rp->c_replvec; in nfsd_cache_update()
545 nfsd_reply_cache_free(b, rp); in nfsd_cache_update()
552 nfsd_reply_cache_free(b, rp); in nfsd_cache_update()
557 lru_put_end(b, rp); in nfsd_cache_update()
558 rp->c_secure = test_bit(RQ_SECURE, &rqstp->rq_flags); in nfsd_cache_update()
559 rp->c_type = cachetype; in nfsd_cache_update()
560 rp->c_state = RC_DONE; in nfsd_cache_update()