Lines Matching refs:idmap
2 * fs/nfs/idmap.c
65 struct idmap *idmap;
68 struct idmap {
76 static struct user_namespace *idmap_userns(const struct idmap *idmap)
78 if (idmap && idmap->user_ns)
79 return idmap->user_ns;
280 const char *type, struct idmap *idmap)
290 if (!idmap->user_ns || idmap->user_ns == &init_user_ns)
293 mutex_lock(&idmap->idmap_mutex);
295 desc, NULL, "", 0, idmap);
296 mutex_unlock(&idmap->idmap_mutex);
307 size_t data_size, struct idmap *idmap)
315 rkey = nfs_idmap_request_key(name, namelen, type, idmap);
351 size_t buflen, struct idmap *idmap)
358 ret = nfs_idmap_get_key(id_str, id_len, type, buf, buflen, idmap);
366 __u32 *id, struct idmap *idmap)
373 data_size = nfs_idmap_get_key(name, namelen, type, id_str, NFS_UINT_MAXLEN, idmap);
384 /* idmap classic begins here */
426 struct idmap *idmap = pdo->pdo_data;
427 struct rpc_pipe *pipe = idmap->idmap_pipe;
438 struct idmap *idmap = pdo->pdo_data;
439 struct rpc_pipe *pipe = idmap->idmap_pipe;
442 dentry = rpc_mkpipe_dentry(dir, "idmap", idmap, pipe);
457 struct idmap *idmap;
461 idmap = kzalloc(sizeof(*idmap), GFP_KERNEL);
462 if (idmap == NULL)
465 mutex_init(&idmap->idmap_mutex);
466 idmap->user_ns = get_user_ns(clp->cl_rpcclient->cl_cred->user_ns);
468 rpc_init_pipe_dir_object(&idmap->idmap_pdo,
470 idmap);
477 idmap->idmap_pipe = pipe;
481 &idmap->idmap_pdo);
485 clp->cl_idmap = idmap;
488 rpc_destroy_pipe_data(idmap->idmap_pipe);
490 put_user_ns(idmap->user_ns);
491 kfree(idmap);
498 struct idmap *idmap = clp->cl_idmap;
500 if (!idmap)
505 &idmap->idmap_pdo);
506 rpc_destroy_pipe_data(idmap->idmap_pipe);
507 put_user_ns(idmap->user_ns);
508 kfree(idmap);
511 static int nfs_idmap_prepare_message(char *desc, struct idmap *idmap,
553 nfs_idmap_prepare_pipe_upcall(struct idmap *idmap,
556 if (idmap->idmap_upcall_data != NULL) {
560 idmap->idmap_upcall_data = data;
572 static void nfs_idmap_abort_pipe_upcall(struct idmap *idmap,
576 if (cmpxchg(&idmap->idmap_upcall_data, data, NULL) == data)
586 struct idmap *idmap = (struct idmap *)aux;
601 data->idmap = idmap;
604 ret = nfs_idmap_prepare_message(key->description, idmap, im, msg);
609 if (!nfs_idmap_prepare_pipe_upcall(idmap, data))
612 ret = rpc_queue_upcall(idmap->idmap_pipe, msg);
614 nfs_idmap_abort_pipe_upcall(idmap, data, ret);
669 struct idmap *idmap = (struct idmap *)rpci->private;
680 data = xchg(&idmap->idmap_upcall_data, NULL);
727 struct idmap *idmap = data->idmap;
730 nfs_idmap_abort_pipe_upcall(idmap, data, msg->errno);
737 struct idmap *idmap = (struct idmap *)rpci->private;
740 data = xchg(&idmap->idmap_upcall_data, NULL);
747 struct idmap *idmap = server->nfs_client->cl_idmap;
752 ret = nfs_idmap_lookup_id(name, namelen, "uid", &id, idmap);
754 *uid = make_kuid(idmap_userns(idmap), id);
764 struct idmap *idmap = server->nfs_client->cl_idmap;
769 ret = nfs_idmap_lookup_id(name, namelen, "gid", &id, idmap);
771 *gid = make_kgid(idmap_userns(idmap), id);
781 struct idmap *idmap = server->nfs_client->cl_idmap;
785 id = from_kuid_munged(idmap_userns(idmap), uid);
787 ret = nfs_idmap_lookup_name(id, "user", buf, buflen, idmap);
795 struct idmap *idmap = server->nfs_client->cl_idmap;
799 id = from_kgid_munged(idmap_userns(idmap), gid);
801 ret = nfs_idmap_lookup_name(id, "group", buf, buflen, idmap);