Lines Matching refs:idmap

65 	struct idmap *idmap;  member
68 struct idmap { struct
76 static struct user_namespace *idmap_userns(const struct idmap *idmap) in idmap_userns() argument
78 if (idmap && idmap->user_ns) in idmap_userns()
79 return idmap->user_ns; in idmap_userns()
280 const char *type, struct idmap *idmap) in nfs_idmap_request_key() argument
290 if (!idmap->user_ns || idmap->user_ns == &init_user_ns) in nfs_idmap_request_key()
293 mutex_lock(&idmap->idmap_mutex); in nfs_idmap_request_key()
295 desc, NULL, "", 0, idmap); in nfs_idmap_request_key()
296 mutex_unlock(&idmap->idmap_mutex); in nfs_idmap_request_key()
307 size_t data_size, struct idmap *idmap) in nfs_idmap_get_key() argument
315 rkey = nfs_idmap_request_key(name, namelen, type, idmap); in nfs_idmap_get_key()
351 size_t buflen, struct idmap *idmap) in nfs_idmap_lookup_name() argument
358 ret = nfs_idmap_get_key(id_str, id_len, type, buf, buflen, idmap); in nfs_idmap_lookup_name()
366 __u32 *id, struct idmap *idmap) in nfs_idmap_lookup_id() argument
373 data_size = nfs_idmap_get_key(name, namelen, type, id_str, NFS_UINT_MAXLEN, idmap); in nfs_idmap_lookup_id()
426 struct idmap *idmap = pdo->pdo_data; in nfs_idmap_pipe_destroy() local
427 struct rpc_pipe *pipe = idmap->idmap_pipe; in nfs_idmap_pipe_destroy()
438 struct idmap *idmap = pdo->pdo_data; in nfs_idmap_pipe_create() local
439 struct rpc_pipe *pipe = idmap->idmap_pipe; in nfs_idmap_pipe_create()
442 dentry = rpc_mkpipe_dentry(dir, "idmap", idmap, pipe); in nfs_idmap_pipe_create()
457 struct idmap *idmap; in nfs_idmap_new() local
461 idmap = kzalloc(sizeof(*idmap), GFP_KERNEL); in nfs_idmap_new()
462 if (idmap == NULL) in nfs_idmap_new()
465 mutex_init(&idmap->idmap_mutex); in nfs_idmap_new()
466 idmap->user_ns = get_user_ns(clp->cl_rpcclient->cl_cred->user_ns); in nfs_idmap_new()
468 rpc_init_pipe_dir_object(&idmap->idmap_pdo, in nfs_idmap_new()
470 idmap); in nfs_idmap_new()
477 idmap->idmap_pipe = pipe; in nfs_idmap_new()
481 &idmap->idmap_pdo); in nfs_idmap_new()
485 clp->cl_idmap = idmap; in nfs_idmap_new()
488 rpc_destroy_pipe_data(idmap->idmap_pipe); in nfs_idmap_new()
490 put_user_ns(idmap->user_ns); in nfs_idmap_new()
491 kfree(idmap); in nfs_idmap_new()
498 struct idmap *idmap = clp->cl_idmap; in nfs_idmap_delete() local
500 if (!idmap) in nfs_idmap_delete()
505 &idmap->idmap_pdo); in nfs_idmap_delete()
506 rpc_destroy_pipe_data(idmap->idmap_pipe); in nfs_idmap_delete()
507 put_user_ns(idmap->user_ns); in nfs_idmap_delete()
508 kfree(idmap); in nfs_idmap_delete()
511 static int nfs_idmap_prepare_message(char *desc, struct idmap *idmap, in nfs_idmap_prepare_message() argument
553 nfs_idmap_prepare_pipe_upcall(struct idmap *idmap, in nfs_idmap_prepare_pipe_upcall() argument
556 if (idmap->idmap_upcall_data != NULL) { in nfs_idmap_prepare_pipe_upcall()
560 idmap->idmap_upcall_data = data; in nfs_idmap_prepare_pipe_upcall()
565 nfs_idmap_complete_pipe_upcall_locked(struct idmap *idmap, int ret) in nfs_idmap_complete_pipe_upcall_locked() argument
567 struct key *authkey = idmap->idmap_upcall_data->authkey; in nfs_idmap_complete_pipe_upcall_locked()
569 kfree(idmap->idmap_upcall_data); in nfs_idmap_complete_pipe_upcall_locked()
570 idmap->idmap_upcall_data = NULL; in nfs_idmap_complete_pipe_upcall_locked()
576 nfs_idmap_abort_pipe_upcall(struct idmap *idmap, int ret) in nfs_idmap_abort_pipe_upcall() argument
578 if (idmap->idmap_upcall_data != NULL) in nfs_idmap_abort_pipe_upcall()
579 nfs_idmap_complete_pipe_upcall_locked(idmap, ret); in nfs_idmap_abort_pipe_upcall()
588 struct idmap *idmap = (struct idmap *)aux; in nfs_idmap_legacy_upcall() local
603 data->idmap = idmap; in nfs_idmap_legacy_upcall()
606 ret = nfs_idmap_prepare_message(key->description, idmap, im, msg); in nfs_idmap_legacy_upcall()
611 if (!nfs_idmap_prepare_pipe_upcall(idmap, data)) in nfs_idmap_legacy_upcall()
614 ret = rpc_queue_upcall(idmap->idmap_pipe, msg); in nfs_idmap_legacy_upcall()
616 nfs_idmap_abort_pipe_upcall(idmap, ret); in nfs_idmap_legacy_upcall()
671 struct idmap *idmap = (struct idmap *)rpci->private; in idmap_pipe_downcall() local
681 if (idmap->idmap_upcall_data == NULL) in idmap_pipe_downcall()
684 authkey = idmap->idmap_upcall_data->authkey; in idmap_pipe_downcall()
709 &idmap->idmap_upcall_data->idmap_msg, in idmap_pipe_downcall()
717 nfs_idmap_complete_pipe_upcall_locked(idmap, ret); in idmap_pipe_downcall()
728 struct idmap *idmap = data->idmap; in idmap_pipe_destroy_msg() local
731 nfs_idmap_abort_pipe_upcall(idmap, msg->errno); in idmap_pipe_destroy_msg()
738 struct idmap *idmap = (struct idmap *)rpci->private; in idmap_release_pipe() local
740 nfs_idmap_abort_pipe_upcall(idmap, -EPIPE); in idmap_release_pipe()
745 struct idmap *idmap = server->nfs_client->cl_idmap; in nfs_map_name_to_uid() local
750 ret = nfs_idmap_lookup_id(name, namelen, "uid", &id, idmap); in nfs_map_name_to_uid()
752 *uid = make_kuid(idmap_userns(idmap), id); in nfs_map_name_to_uid()
762 struct idmap *idmap = server->nfs_client->cl_idmap; in nfs_map_group_to_gid() local
767 ret = nfs_idmap_lookup_id(name, namelen, "gid", &id, idmap); in nfs_map_group_to_gid()
769 *gid = make_kgid(idmap_userns(idmap), id); in nfs_map_group_to_gid()
779 struct idmap *idmap = server->nfs_client->cl_idmap; in nfs_map_uid_to_name() local
783 id = from_kuid_munged(idmap_userns(idmap), uid); in nfs_map_uid_to_name()
785 ret = nfs_idmap_lookup_name(id, "user", buf, buflen, idmap); in nfs_map_uid_to_name()
793 struct idmap *idmap = server->nfs_client->cl_idmap; in nfs_map_gid_to_group() local
797 id = from_kgid_munged(idmap_userns(idmap), gid); in nfs_map_gid_to_group()
799 ret = nfs_idmap_lookup_name(id, "group", buf, buflen, idmap); in nfs_map_gid_to_group()