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()
231 if (j == i && permits->permits[i].key > key) { in afs_cache_permit()
232 new->permits[j].key = key; in afs_cache_permit()
236 new->permits[j].key = permits->permits[i].key; in afs_cache_permit()
243 new->permits[j].key = key; in afs_cache_permit()
269 key_get(new->permits[i].key); in afs_cache_permit()
303 static bool afs_check_permit_rcu(struct afs_vnode *vnode, struct key *key, in afs_check_permit_rcu() argument
310 vnode->fid.vid, vnode->fid.vnode, key_serial(key)); in afs_check_permit_rcu()
313 if (key == vnode->volume->cell->anonymous_key) { in afs_check_permit_rcu()
322 if (permits->permits[i].key < key) in afs_check_permit_rcu()
324 if (permits->permits[i].key > key) in afs_check_permit_rcu()
342 int afs_check_permit(struct afs_vnode *vnode, struct key *key, in afs_check_permit() argument
350 vnode->fid.vid, vnode->fid.vnode, key_serial(key)); in afs_check_permit()
353 if (key == vnode->volume->cell->anonymous_key) { in afs_check_permit()
362 if (permits->permits[i].key < key) in afs_check_permit()
364 if (permits->permits[i].key > key) in afs_check_permit()
381 ret = afs_fetch_status(vnode, key, false, _access); in afs_check_permit()
403 struct key *key; in afs_permission() local
410 key = afs_request_key_rcu(vnode->volume->cell); in afs_permission()
411 if (IS_ERR(key)) in afs_permission()
416 !afs_check_permit_rcu(vnode, key, &access)) in afs_permission()
419 key = afs_request_key(vnode->volume->cell); in afs_permission()
420 if (IS_ERR(key)) { in afs_permission()
421 _leave(" = %ld [key]", PTR_ERR(key)); in afs_permission()
422 return PTR_ERR(key); in afs_permission()
425 ret = afs_validate(vnode, key); in afs_permission()
430 ret = afs_check_permit(vnode, key, &access); in afs_permission()
468 key_put(key); in afs_permission()
475 key_put(key); in afs_permission()