Lines Matching refs:user
53 struct key_user *candidate = NULL, *user; in key_user_lookup() local
64 user = rb_entry(parent, struct key_user, node); in key_user_lookup()
66 if (uid_lt(uid, user->uid)) in key_user_lookup()
68 else if (uid_gt(uid, user->uid)) in key_user_lookup()
80 user = NULL; in key_user_lookup()
105 user = candidate; in key_user_lookup()
110 refcount_inc(&user->usage); in key_user_lookup()
114 return user; in key_user_lookup()
120 void key_user_put(struct key_user *user) in key_user_put() argument
122 if (refcount_dec_and_lock(&user->usage, &key_user_lock)) { in key_user_put()
123 rb_erase(&user->node, &key_user_tree); in key_user_put()
126 kfree(user); in key_user_put()
230 struct key_user *user = NULL; in key_alloc() local
251 user = key_user_lookup(uid); in key_alloc()
252 if (!user) in key_alloc()
263 spin_lock(&user->lock); in key_alloc()
265 if (user->qnkeys + 1 > maxkeys || in key_alloc()
266 user->qnbytes + quotalen > maxbytes || in key_alloc()
267 user->qnbytes + quotalen < user->qnbytes) in key_alloc()
271 user->qnkeys++; in key_alloc()
272 user->qnbytes += quotalen; in key_alloc()
273 spin_unlock(&user->lock); in key_alloc()
291 key->user = user; in key_alloc()
320 atomic_inc(&user->nkeys); in key_alloc()
330 spin_lock(&user->lock); in key_alloc()
331 user->qnkeys--; in key_alloc()
332 user->qnbytes -= quotalen; in key_alloc()
333 spin_unlock(&user->lock); in key_alloc()
335 key_user_put(user); in key_alloc()
343 spin_lock(&user->lock); in key_alloc()
344 user->qnkeys--; in key_alloc()
345 user->qnbytes -= quotalen; in key_alloc()
346 spin_unlock(&user->lock); in key_alloc()
348 key_user_put(user); in key_alloc()
354 spin_unlock(&user->lock); in key_alloc()
355 key_user_put(user); in key_alloc()
381 unsigned maxbytes = uid_eq(key->user->uid, GLOBAL_ROOT_UID) ? in key_payload_reserve()
384 spin_lock(&key->user->lock); in key_payload_reserve()
387 (key->user->qnbytes + delta > maxbytes || in key_payload_reserve()
388 key->user->qnbytes + delta < key->user->qnbytes)) { in key_payload_reserve()
392 key->user->qnbytes += delta; in key_payload_reserve()
395 spin_unlock(&key->user->lock); in key_payload_reserve()
447 atomic_inc(&key->user->nikeys); in __key_instantiate_and_link()
606 atomic_inc(&key->user->nikeys); in key_reject_and_link()