Lines Matching refs:key
23 struct key *afs_request_key(struct afs_cell *cell) in afs_request_key()
25 struct key *key; in afs_request_key() local
30 key = request_key_net(&key_type_rxrpc, cell->anonymous_key->description, in afs_request_key()
32 if (IS_ERR(key)) { in afs_request_key()
33 if (PTR_ERR(key) != -ENOKEY) { in afs_request_key()
34 _leave(" = %ld", PTR_ERR(key)); in afs_request_key()
35 return key; in afs_request_key()
43 _leave(" = {%x} [auth]", key_serial(key)); in afs_request_key()
44 return key; in afs_request_key()
51 struct key *afs_request_key_rcu(struct afs_cell *cell) in afs_request_key_rcu()
53 struct key *key; in afs_request_key_rcu() local
58 key = request_key_net_rcu(&key_type_rxrpc, in afs_request_key_rcu()
61 if (IS_ERR(key)) { in afs_request_key_rcu()
62 if (PTR_ERR(key) != -ENOKEY) { in afs_request_key_rcu()
63 _leave(" = %ld", PTR_ERR(key)); in afs_request_key_rcu()
64 return key; in afs_request_key_rcu()
72 _leave(" = {%x} [auth]", key_serial(key)); in afs_request_key_rcu()
73 return key; in afs_request_key_rcu()
87 key_put(permits->permits[i].key); in afs_permits_rcu()
130 h += (unsigned long)permits->permits[i].key / sizeof(void *); in afs_hash_permits()
143 void afs_cache_permit(struct afs_vnode *vnode, struct key *key, in afs_cache_permit() argument
153 vnode->fid.vid, vnode->fid.vnode, key_serial(key), caller_access); in afs_cache_permit()
164 if (permits->permits[i].key < key) in afs_cache_permit()
166 if (permits->permits[i].key > key) in afs_cache_permit()
232 if (j == i && permits->permits[i].key > key) { in afs_cache_permit()
233 new->permits[j].key = key; in afs_cache_permit()
237 new->permits[j].key = permits->permits[i].key; in afs_cache_permit()
244 new->permits[j].key = key; in afs_cache_permit()
270 key_get(new->permits[i].key); in afs_cache_permit()
304 static bool afs_check_permit_rcu(struct afs_vnode *vnode, struct key *key, in afs_check_permit_rcu() argument
311 vnode->fid.vid, vnode->fid.vnode, key_serial(key)); in afs_check_permit_rcu()
314 if (key == vnode->volume->cell->anonymous_key) { in afs_check_permit_rcu()
323 if (permits->permits[i].key < key) in afs_check_permit_rcu()
325 if (permits->permits[i].key > key) in afs_check_permit_rcu()
343 int afs_check_permit(struct afs_vnode *vnode, struct key *key, in afs_check_permit() argument
351 vnode->fid.vid, vnode->fid.vnode, key_serial(key)); in afs_check_permit()
354 if (key == vnode->volume->cell->anonymous_key) { in afs_check_permit()
363 if (permits->permits[i].key < key) in afs_check_permit()
365 if (permits->permits[i].key > key) in afs_check_permit()
382 ret = afs_fetch_status(vnode, key, false, _access); in afs_check_permit()
404 struct key *key; in afs_permission() local
411 key = afs_request_key_rcu(vnode->volume->cell); in afs_permission()
412 if (IS_ERR(key)) in afs_permission()
417 !afs_check_permit_rcu(vnode, key, &access)) in afs_permission()
420 key = afs_request_key(vnode->volume->cell); in afs_permission()
421 if (IS_ERR(key)) { in afs_permission()
422 _leave(" = %ld [key]", PTR_ERR(key)); in afs_permission()
423 return PTR_ERR(key); in afs_permission()
426 ret = afs_validate(vnode, key); in afs_permission()
431 ret = afs_check_permit(vnode, key, &access); in afs_permission()
469 key_put(key); in afs_permission()
476 key_put(key); in afs_permission()