Lines Matching refs:idmap

332 struct idmap {  struct
359 struct idmap *idmap; in nfs_idmap_new() local
364 idmap = kzalloc(sizeof(*idmap), GFP_KERNEL); in nfs_idmap_new()
365 if (idmap == NULL) in nfs_idmap_new()
368 idmap->idmap_dentry = rpc_mkpipe(clp->cl_rpcclient->cl_path.dentry, in nfs_idmap_new()
369 "idmap", idmap, &idmap_upcall_ops, 0); in nfs_idmap_new()
370 if (IS_ERR(idmap->idmap_dentry)) { in nfs_idmap_new()
371 error = PTR_ERR(idmap->idmap_dentry); in nfs_idmap_new()
372 kfree(idmap); in nfs_idmap_new()
376 mutex_init(&idmap->idmap_lock); in nfs_idmap_new()
377 mutex_init(&idmap->idmap_im_lock); in nfs_idmap_new()
378 init_waitqueue_head(&idmap->idmap_wq); in nfs_idmap_new()
379 idmap->idmap_user_hash.h_type = IDMAP_TYPE_USER; in nfs_idmap_new()
380 idmap->idmap_group_hash.h_type = IDMAP_TYPE_GROUP; in nfs_idmap_new()
382 clp->cl_idmap = idmap; in nfs_idmap_new()
389 struct idmap *idmap = clp->cl_idmap; in nfs_idmap_delete() local
391 if (!idmap) in nfs_idmap_delete()
393 rpc_unlink(idmap->idmap_dentry); in nfs_idmap_delete()
395 kfree(idmap); in nfs_idmap_delete()
468 nfs_idmap_id(struct idmap *idmap, struct idmap_hashtable *h, in nfs_idmap_id() argument
477 im = &idmap->idmap_im; in nfs_idmap_id()
493 mutex_lock(&idmap->idmap_lock); in nfs_idmap_id()
494 mutex_lock(&idmap->idmap_im_lock); in nfs_idmap_id()
513 add_wait_queue(&idmap->idmap_wq, &wq); in nfs_idmap_id()
514 if (rpc_queue_upcall(idmap->idmap_dentry->d_inode, &msg) < 0) { in nfs_idmap_id()
515 remove_wait_queue(&idmap->idmap_wq, &wq); in nfs_idmap_id()
520 mutex_unlock(&idmap->idmap_im_lock); in nfs_idmap_id()
523 remove_wait_queue(&idmap->idmap_wq, &wq); in nfs_idmap_id()
524 mutex_lock(&idmap->idmap_im_lock); in nfs_idmap_id()
533 mutex_unlock(&idmap->idmap_im_lock); in nfs_idmap_id()
534 mutex_unlock(&idmap->idmap_lock); in nfs_idmap_id()
542 nfs_idmap_name(struct idmap *idmap, struct idmap_hashtable *h, in nfs_idmap_name() argument
552 im = &idmap->idmap_im; in nfs_idmap_name()
554 mutex_lock(&idmap->idmap_lock); in nfs_idmap_name()
555 mutex_lock(&idmap->idmap_im_lock); in nfs_idmap_name()
573 add_wait_queue(&idmap->idmap_wq, &wq); in nfs_idmap_name()
575 if (rpc_queue_upcall(idmap->idmap_dentry->d_inode, &msg) < 0) { in nfs_idmap_name()
576 remove_wait_queue(&idmap->idmap_wq, &wq); in nfs_idmap_name()
581 mutex_unlock(&idmap->idmap_im_lock); in nfs_idmap_name()
584 remove_wait_queue(&idmap->idmap_wq, &wq); in nfs_idmap_name()
585 mutex_lock(&idmap->idmap_im_lock); in nfs_idmap_name()
596 mutex_unlock(&idmap->idmap_im_lock); in nfs_idmap_name()
597 mutex_unlock(&idmap->idmap_lock); in nfs_idmap_name()
626 struct idmap *idmap = (struct idmap *)rpci->private; in idmap_pipe_downcall() local
627 struct idmap_msg im_in, *im = &idmap->idmap_im; in idmap_pipe_downcall()
639 mutex_lock(&idmap->idmap_im_lock); in idmap_pipe_downcall()
645 wake_up(&idmap->idmap_wq); in idmap_pipe_downcall()
657 h = &idmap->idmap_user_hash; in idmap_pipe_downcall()
660 h = &idmap->idmap_group_hash; in idmap_pipe_downcall()
675 wake_up(&idmap->idmap_wq); in idmap_pipe_downcall()
686 wake_up(&idmap->idmap_wq); in idmap_pipe_downcall()
699 mutex_unlock(&idmap->idmap_im_lock); in idmap_pipe_downcall()
707 struct idmap *idmap = container_of(im, struct idmap, idmap_im); in idmap_pipe_destroy_msg() local
711 mutex_lock(&idmap->idmap_im_lock); in idmap_pipe_destroy_msg()
713 wake_up(&idmap->idmap_wq); in idmap_pipe_destroy_msg()
714 mutex_unlock(&idmap->idmap_im_lock); in idmap_pipe_destroy_msg()
740 struct idmap *idmap = server->nfs_client->cl_idmap; in nfs_map_name_to_uid() local
744 return nfs_idmap_id(idmap, &idmap->idmap_user_hash, name, namelen, uid); in nfs_map_name_to_uid()
749 struct idmap *idmap = server->nfs_client->cl_idmap; in nfs_map_group_to_gid() local
753 return nfs_idmap_id(idmap, &idmap->idmap_group_hash, name, namelen, uid); in nfs_map_group_to_gid()
758 struct idmap *idmap = server->nfs_client->cl_idmap; in nfs_map_uid_to_name() local
762 ret = nfs_idmap_name(idmap, &idmap->idmap_user_hash, uid, buf); in nfs_map_uid_to_name()
769 struct idmap *idmap = server->nfs_client->cl_idmap; in nfs_map_gid_to_group() local
773 ret = nfs_idmap_name(idmap, &idmap->idmap_group_hash, uid, buf); in nfs_map_gid_to_group()