Lines Matching refs:ns
24 static int key_create_persistent_register(struct user_namespace *ns) in key_create_persistent_register() argument
35 ns->persistent_keyring_register = reg; in key_create_persistent_register()
44 static key_ref_t key_create_persistent(struct user_namespace *ns, kuid_t uid, in key_create_persistent() argument
50 if (!ns->persistent_keyring_register) { in key_create_persistent()
51 long err = key_create_persistent_register(ns); in key_create_persistent()
55 reg_ref = make_key_ref(ns->persistent_keyring_register, true); in key_create_persistent()
66 ns->persistent_keyring_register); in key_create_persistent()
77 static long key_get_persistent(struct user_namespace *ns, kuid_t uid, in key_get_persistent() argument
89 index_key.desc_len = sprintf(buf, "_persistent.%u", from_kuid(ns, uid)); in key_get_persistent()
91 if (ns->persistent_keyring_register) { in key_get_persistent()
92 reg_ref = make_key_ref(ns->persistent_keyring_register, true); in key_get_persistent()
93 down_read(&ns->persistent_keyring_register_sem); in key_get_persistent()
95 up_read(&ns->persistent_keyring_register_sem); in key_get_persistent()
104 down_write(&ns->persistent_keyring_register_sem); in key_get_persistent()
105 persistent_ref = key_create_persistent(ns, uid, &index_key); in key_get_persistent()
106 up_write(&ns->persistent_keyring_register_sem); in key_get_persistent()
133 struct user_namespace *ns = current_user_ns(); in keyctl_get_persistent() local
142 uid = make_kuid(ns, _uid); in keyctl_get_persistent()
151 !ns_capable(ns, CAP_SETUID)) in keyctl_get_persistent()
164 ret = key_get_persistent(ns, uid, dest_ref); in keyctl_get_persistent()