Lines Matching refs:lun_req
2953 struct ctl_lun_req *lun_req; in ctl_ioctl() local
2959 lun_req = (struct ctl_lun_req *)addr; in ctl_ioctl()
2960 tmp_args_nvl = lun_req->args_nvl; in ctl_ioctl()
2962 backend = ctl_backend_find(lun_req->backend); in ctl_ioctl()
2964 lun_req->status = CTL_LUN_ERROR; in ctl_ioctl()
2965 snprintf(lun_req->error_str, in ctl_ioctl()
2966 sizeof(lun_req->error_str), in ctl_ioctl()
2968 lun_req->backend); in ctl_ioctl()
2972 if (lun_req->args != NULL) { in ctl_ioctl()
2973 if (lun_req->args_len > CTL_MAX_ARGS_LEN) { in ctl_ioctl()
2974 lun_req->status = CTL_LUN_ERROR; in ctl_ioctl()
2975 snprintf(lun_req->error_str, sizeof(lun_req->error_str), in ctl_ioctl()
2979 packed = malloc(lun_req->args_len, M_CTL, M_WAITOK); in ctl_ioctl()
2980 if (copyin(lun_req->args, packed, lun_req->args_len) != 0) { in ctl_ioctl()
2982 lun_req->status = CTL_LUN_ERROR; in ctl_ioctl()
2983 snprintf(lun_req->error_str, sizeof(lun_req->error_str), in ctl_ioctl()
2987 lun_req->args_nvl = nvlist_unpack(packed, in ctl_ioctl()
2988 lun_req->args_len, 0); in ctl_ioctl()
2991 if (lun_req->args_nvl == NULL) { in ctl_ioctl()
2992 lun_req->status = CTL_LUN_ERROR; in ctl_ioctl()
2993 snprintf(lun_req->error_str, sizeof(lun_req->error_str), in ctl_ioctl()
2998 lun_req->args_nvl = nvlist_create(0); in ctl_ioctl()
3000 lun_req->result_nvl = NULL; in ctl_ioctl()
3002 nvlist_destroy(lun_req->args_nvl); in ctl_ioctl()
3003 lun_req->args_nvl = tmp_args_nvl; in ctl_ioctl()
3005 if (lun_req->result_nvl != NULL) { in ctl_ioctl()
3006 if (lun_req->result != NULL) { in ctl_ioctl()
3007 packed = nvlist_pack(lun_req->result_nvl, in ctl_ioctl()
3010 lun_req->status = CTL_LUN_ERROR; in ctl_ioctl()
3011 snprintf(lun_req->error_str, in ctl_ioctl()
3012 sizeof(lun_req->error_str), in ctl_ioctl()
3017 if (packed_len > lun_req->result_len) { in ctl_ioctl()
3018 lun_req->status = CTL_LUN_ERROR; in ctl_ioctl()
3019 snprintf(lun_req->error_str, in ctl_ioctl()
3020 sizeof(lun_req->error_str), in ctl_ioctl()
3026 if (copyout(packed, lun_req->result, packed_len)) { in ctl_ioctl()
3027 lun_req->status = CTL_LUN_ERROR; in ctl_ioctl()
3028 snprintf(lun_req->error_str, in ctl_ioctl()
3029 sizeof(lun_req->error_str), in ctl_ioctl()
3035 lun_req->result_len = packed_len; in ctl_ioctl()
3039 nvlist_destroy(lun_req->result_nvl); in ctl_ioctl()