Lines Matching refs:user
52 struct key_user *candidate = NULL, *user; in key_user_lookup() local
63 user = rb_entry(parent, struct key_user, node); in key_user_lookup()
65 if (uid_lt(uid, user->uid)) in key_user_lookup()
67 else if (uid_gt(uid, user->uid)) in key_user_lookup()
79 user = NULL; in key_user_lookup()
104 user = candidate; in key_user_lookup()
109 refcount_inc(&user->usage); in key_user_lookup()
113 return user; in key_user_lookup()
119 void key_user_put(struct key_user *user) in key_user_put() argument
121 if (refcount_dec_and_lock(&user->usage, &key_user_lock)) { in key_user_put()
122 rb_erase(&user->node, &key_user_tree); in key_user_put()
125 kfree(user); in key_user_put()
229 struct key_user *user = NULL; in key_alloc() local
250 user = key_user_lookup(uid); in key_alloc()
251 if (!user) in key_alloc()
262 spin_lock(&user->lock); in key_alloc()
264 if (user->qnkeys + 1 > maxkeys || in key_alloc()
265 user->qnbytes + quotalen > maxbytes || in key_alloc()
266 user->qnbytes + quotalen < user->qnbytes) in key_alloc()
270 user->qnkeys++; in key_alloc()
271 user->qnbytes += quotalen; in key_alloc()
272 spin_unlock(&user->lock); in key_alloc()
290 key->user = user; in key_alloc()
317 atomic_inc(&user->nkeys); in key_alloc()
327 spin_lock(&user->lock); in key_alloc()
328 user->qnkeys--; in key_alloc()
329 user->qnbytes -= quotalen; in key_alloc()
330 spin_unlock(&user->lock); in key_alloc()
332 key_user_put(user); in key_alloc()
340 spin_lock(&user->lock); in key_alloc()
341 user->qnkeys--; in key_alloc()
342 user->qnbytes -= quotalen; in key_alloc()
343 spin_unlock(&user->lock); in key_alloc()
345 key_user_put(user); in key_alloc()
351 spin_unlock(&user->lock); in key_alloc()
352 key_user_put(user); in key_alloc()
378 unsigned maxbytes = uid_eq(key->user->uid, GLOBAL_ROOT_UID) ? in key_payload_reserve()
381 spin_lock(&key->user->lock); in key_payload_reserve()
384 (key->user->qnbytes + delta >= maxbytes || in key_payload_reserve()
385 key->user->qnbytes + delta < key->user->qnbytes)) { in key_payload_reserve()
389 key->user->qnbytes += delta; in key_payload_reserve()
392 spin_unlock(&key->user->lock); in key_payload_reserve()
444 atomic_inc(&key->user->nikeys); in __key_instantiate_and_link()
601 atomic_inc(&key->user->nikeys); in key_reject_and_link()