Lines Matching refs:ret
191 int ret = 0; in nfs_idmap_init() local
206 ret = PTR_ERR(keyring); in nfs_idmap_init()
210 ret = register_key_type(&key_type_id_resolver); in nfs_idmap_init()
211 if (ret < 0) in nfs_idmap_init()
214 ret = register_key_type(&key_type_id_resolver_legacy); in nfs_idmap_init()
215 if (ret < 0) in nfs_idmap_init()
230 return ret; in nfs_idmap_init()
274 ssize_t ret; in nfs_idmap_request_key() local
276 ret = nfs_idmap_get_desc(name, namelen, type, strlen(type), &desc); in nfs_idmap_request_key()
277 if (ret <= 0) in nfs_idmap_request_key()
278 return ERR_PTR(ret); in nfs_idmap_request_key()
301 ssize_t ret; in nfs_idmap_get_key() local
308 ret = PTR_ERR(rkey); in nfs_idmap_get_key()
315 ret = key_validate(rkey); in nfs_idmap_get_key()
316 if (ret < 0) in nfs_idmap_get_key()
321 ret = PTR_ERR(payload); in nfs_idmap_get_key()
325 ret = payload->datalen; in nfs_idmap_get_key()
326 if (ret > 0 && ret <= data_size) in nfs_idmap_get_key()
327 memcpy(data, payload->data, ret); in nfs_idmap_get_key()
329 ret = -EINVAL; in nfs_idmap_get_key()
335 return ret; in nfs_idmap_get_key()
344 ssize_t ret; in nfs_idmap_lookup_name() local
347 ret = nfs_idmap_get_key(id_str, id_len, type, buf, buflen, idmap); in nfs_idmap_lookup_name()
348 if (ret < 0) in nfs_idmap_lookup_name()
350 return ret; in nfs_idmap_lookup_name()
360 int ret = 0; in nfs_idmap_lookup_id() local
364 ret = -EINVAL; in nfs_idmap_lookup_id()
366 ret = kstrtol(id_str, 10, &id_long); in nfs_idmap_lookup_id()
369 return ret; in nfs_idmap_lookup_id()
500 int token, ret; in nfs_idmap_prepare_message() local
510 ret = match_strlcpy(im->im_name, &substr, IDMAP_NAMESZ); in nfs_idmap_prepare_message()
517 ret = match_int(&substr, &im->im_id); in nfs_idmap_prepare_message()
521 ret = -EINVAL; in nfs_idmap_prepare_message()
529 return ret; in nfs_idmap_prepare_message()
545 nfs_idmap_complete_pipe_upcall_locked(struct idmap *idmap, int ret) in nfs_idmap_complete_pipe_upcall_locked() argument
551 complete_request_key(cons, ret); in nfs_idmap_complete_pipe_upcall_locked()
555 nfs_idmap_abort_pipe_upcall(struct idmap *idmap, int ret) in nfs_idmap_abort_pipe_upcall() argument
558 nfs_idmap_complete_pipe_upcall_locked(idmap, ret); in nfs_idmap_abort_pipe_upcall()
570 int ret = -ENOKEY; in nfs_idmap_legacy_upcall() local
576 ret = -ENOMEM; in nfs_idmap_legacy_upcall()
586 ret = nfs_idmap_prepare_message(key->description, idmap, im, msg); in nfs_idmap_legacy_upcall()
587 if (ret < 0) in nfs_idmap_legacy_upcall()
590 ret = -EAGAIN; in nfs_idmap_legacy_upcall()
594 ret = rpc_queue_upcall(idmap->idmap_pipe, msg); in nfs_idmap_legacy_upcall()
595 if (ret < 0) in nfs_idmap_legacy_upcall()
596 nfs_idmap_abort_pipe_upcall(idmap, ret); in nfs_idmap_legacy_upcall()
598 return ret; in nfs_idmap_legacy_upcall()
602 complete_request_key(cons, ret); in nfs_idmap_legacy_upcall()
603 return ret; in nfs_idmap_legacy_upcall()
619 int ret = -ENOKEY; in nfs_idmap_read_and_verify_message() local
631 ret = nfs_idmap_instantiate(key, authkey, id_str, len); in nfs_idmap_read_and_verify_message()
637 ret = nfs_idmap_instantiate(key, authkey, im->im_name, len); in nfs_idmap_read_and_verify_message()
640 ret = -EINVAL; in nfs_idmap_read_and_verify_message()
643 return ret; in nfs_idmap_read_and_verify_message()
654 int ret = -ENOKEY; in idmap_pipe_downcall() local
666 ret = -ENOSPC; in idmap_pipe_downcall()
671 ret = -EFAULT; in idmap_pipe_downcall()
676 ret = -ENOKEY; in idmap_pipe_downcall()
682 ret = -EINVAL; in idmap_pipe_downcall()
686 ret = nfs_idmap_read_and_verify_message(&im, in idmap_pipe_downcall()
689 if (ret >= 0) { in idmap_pipe_downcall()
691 ret = mlen; in idmap_pipe_downcall()
695 nfs_idmap_complete_pipe_upcall_locked(idmap, ret); in idmap_pipe_downcall()
697 return ret; in idmap_pipe_downcall()
725 int ret = 0; in nfs_map_name_to_uid() local
728 ret = nfs_idmap_lookup_id(name, namelen, "uid", &id, idmap); in nfs_map_name_to_uid()
729 if (ret == 0) { in nfs_map_name_to_uid()
732 ret = -ERANGE; in nfs_map_name_to_uid()
734 trace_nfs4_map_name_to_uid(name, namelen, id, ret); in nfs_map_name_to_uid()
735 return ret; in nfs_map_name_to_uid()
742 int ret = 0; in nfs_map_group_to_gid() local
745 ret = nfs_idmap_lookup_id(name, namelen, "gid", &id, idmap); in nfs_map_group_to_gid()
746 if (ret == 0) { in nfs_map_group_to_gid()
749 ret = -ERANGE; in nfs_map_group_to_gid()
751 trace_nfs4_map_group_to_gid(name, namelen, id, ret); in nfs_map_group_to_gid()
752 return ret; in nfs_map_group_to_gid()
758 int ret = -EINVAL; in nfs_map_uid_to_name() local
763 ret = nfs_idmap_lookup_name(id, "user", buf, buflen, idmap); in nfs_map_uid_to_name()
764 if (ret < 0) in nfs_map_uid_to_name()
765 ret = nfs_map_numeric_to_string(id, buf, buflen); in nfs_map_uid_to_name()
766 trace_nfs4_map_uid_to_name(buf, ret, id, ret); in nfs_map_uid_to_name()
767 return ret; in nfs_map_uid_to_name()
772 int ret = -EINVAL; in nfs_map_gid_to_group() local
777 ret = nfs_idmap_lookup_name(id, "group", buf, buflen, idmap); in nfs_map_gid_to_group()
778 if (ret < 0) in nfs_map_gid_to_group()
779 ret = nfs_map_numeric_to_string(id, buf, buflen); in nfs_map_gid_to_group()
780 trace_nfs4_map_gid_to_group(buf, ret, id, ret); in nfs_map_gid_to_group()
781 return ret; in nfs_map_gid_to_group()