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

Lines Matching refs:cred

169 rpcauth_unhash_cred_locked(struct rpc_cred *cred)
171 hlist_del_rcu(&cred->cr_hash);
173 clear_bit(RPCAUTH_CRED_HASHED, &cred->cr_flags);
177 rpcauth_unhash_cred(struct rpc_cred *cred)
182 cache_lock = &cred->cr_auth->au_credcache->lock;
184 ret = atomic_read(&cred->cr_count) == 0;
186 rpcauth_unhash_cred_locked(cred);
224 struct rpc_cred *cred;
227 cred = list_entry(head->next, struct rpc_cred, cr_lru);
228 list_del_init(&cred->cr_lru);
229 put_rpccred(cred);
242 struct rpc_cred *cred;
251 cred = hlist_entry(head->first, struct rpc_cred, cr_hash);
252 get_rpccred(cred);
253 if (!list_empty(&cred->cr_lru)) {
254 list_del(&cred->cr_lru);
257 list_add_tail(&cred->cr_lru, &free);
258 rpcauth_unhash_cred_locked(cred);
293 struct rpc_cred *cred, *next;
296 list_for_each_entry_safe(cred, next, &cred_unused, cr_lru) {
304 if (time_in_range(cred->cr_expire, expired, jiffies) &&
305 test_bit(RPCAUTH_CRED_HASHED, &cred->cr_flags) != 0)
308 list_del_init(&cred->cr_lru);
310 if (atomic_read(&cred->cr_count) != 0)
313 cache_lock = &cred->cr_auth->au_credcache->lock;
315 if (atomic_read(&cred->cr_count) == 0) {
316 get_rpccred(cred);
317 list_add_tail(&cred->cr_lru, free);
318 rpcauth_unhash_cred_locked(cred);
355 struct rpc_cred *cred = NULL,
370 cred = get_rpccred(entry);
376 if (cred != NULL)
381 cred = new;
389 cred = get_rpccred(entry);
392 if (cred == NULL) {
393 cred = new;
394 set_bit(RPCAUTH_CRED_HASHED, &cred->cr_flags);
395 hlist_add_head_rcu(&cred->cr_hash, &cache->hashtable[nr]);
400 if (test_bit(RPCAUTH_CRED_NEW, &cred->cr_flags) &&
401 cred->cr_ops->cr_init != NULL &&
403 int res = cred->cr_ops->cr_init(auth, cred);
405 put_rpccred(cred);
406 cred = ERR_PTR(res);
411 return cred;
420 const struct cred *cred = current_cred();
422 dprintk("RPC: looking up %s cred\n",
426 acred.uid = cred->fsuid;
427 acred.gid = cred->fsgid;
428 acred.group_info = get_group_info(((struct cred *)cred)->group_info);
436 rpcauth_init_cred(struct rpc_cred *cred, const struct auth_cred *acred,
439 INIT_HLIST_NODE(&cred->cr_hash);
440 INIT_LIST_HEAD(&cred->cr_lru);
441 atomic_set(&cred->cr_count, 1);
442 cred->cr_auth = auth;
443 cred->cr_ops = ops;
444 cred->cr_expire = jiffies;
446 cred->cr_magic = RPCAUTH_CRED_MAGIC;
448 cred->cr_uid = acred->uid;
453 rpcauth_generic_bind_cred(struct rpc_task *task, struct rpc_cred *cred, int lookupflags)
455 dprintk("RPC: %5u holding %s cred %p\n", task->tk_pid,
456 cred->cr_auth->au_ops->au_name, cred);
457 return get_rpccred(cred);
470 dprintk("RPC: %5u looking up %s cred\n",
480 dprintk("RPC: %5u looking up %s cred\n",
486 rpcauth_bindcred(struct rpc_task *task, struct rpc_cred *cred, int flags)
494 if (cred != NULL)
495 new = cred->cr_ops->crbind(task, cred, lookupflags);
509 put_rpccred(struct rpc_cred *cred)
512 if (test_bit(RPCAUTH_CRED_HASHED, &cred->cr_flags) == 0) {
513 if (atomic_dec_and_test(&cred->cr_count))
514 cred->cr_ops->crdestroy(cred);
518 if (!atomic_dec_and_lock(&cred->cr_count, &rpc_credcache_lock))
520 if (!list_empty(&cred->cr_lru)) {
522 list_del_init(&cred->cr_lru);
524 if (test_bit(RPCAUTH_CRED_HASHED, &cred->cr_flags) != 0) {
525 if (test_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags) != 0) {
526 cred->cr_expire = jiffies;
527 list_add_tail(&cred->cr_lru, &cred_unused);
531 if (!rpcauth_unhash_cred(cred)) {
537 cred->cr_ops->crdestroy(cred);
547 struct rpc_cred *cred = task->tk_rqstp->rq_cred;
549 dprintk("RPC: %5u marshaling %s cred %p\n",
550 task->tk_pid, cred->cr_auth->au_ops->au_name, cred);
552 return cred->cr_ops->crmarshal(task, p);
558 struct rpc_cred *cred = task->tk_rqstp->rq_cred;
560 dprintk("RPC: %5u validating %s cred %p\n",
561 task->tk_pid, cred->cr_auth->au_ops->au_name, cred);
563 return cred->cr_ops->crvalidate(task, p);
570 struct rpc_cred *cred = task->tk_rqstp->rq_cred;
572 dprintk("RPC: %5u using %s cred %p to wrap rpc data\n",
573 task->tk_pid, cred->cr_ops->cr_name, cred);
574 if (cred->cr_ops->crwrap_req)
575 return cred->cr_ops->crwrap_req(task, encode, rqstp, data, obj);
584 struct rpc_cred *cred = task->tk_rqstp->rq_cred;
586 dprintk("RPC: %5u using %s cred %p to unwrap rpc data\n",
587 task->tk_pid, cred->cr_ops->cr_name, cred);
588 if (cred->cr_ops->crunwrap_resp)
589 return cred->cr_ops->crunwrap_resp(task, decode, rqstp,
598 struct rpc_cred *cred = task->tk_rqstp->rq_cred;
601 cred = task->tk_rqstp->rq_cred;
602 if (cred == NULL) {
606 cred = task->tk_rqstp->rq_cred;
608 dprintk("RPC: %5u refreshing %s cred %p\n",
609 task->tk_pid, cred->cr_auth->au_ops->au_name, cred);
611 err = cred->cr_ops->crrefresh(task);
621 struct rpc_cred *cred = task->tk_rqstp->rq_cred;
623 dprintk("RPC: %5u invalidating %s cred %p\n",
624 task->tk_pid, cred->cr_auth->au_ops->au_name, cred);
625 if (cred)
626 clear_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags);
632 struct rpc_cred *cred = task->tk_rqstp->rq_cred;
634 return cred == NULL ||
635 test_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags) != 0;