Lines Matching defs:rv

444 	int	rv;
492 rv = vdc_access_set(vdc, VD_ACCESS_SET_CLEAR);
493 if (rv == 0) {
509 rv = ldc_set_cb_mode(srvr->ldc_handle, LDC_CB_DISABLE);
510 DMSG(vdc, 0, "callback disabled (ldc=%lu, rv=%d)\n",
511 srvr->ldc_id, rv);
1382 int rv, rval;
1404 rv = vd_process_ioctl(dev, DKIOCFLUSHWRITECACHE, NULL, FKIOCTL, &rval);
1406 if (rv != 0 && rv != ENOTSUP && rv != ENOTTY && rv != EROFS) {
1408 instance, rv);
1437 int rv, flags;
1464 rv = vdc_do_op(vdc, VD_OP_BWRITE, addr, nbytes, VDCPART(dev),
1467 if (rv) {
1468 DMSG(vdc, 0, "Failed to do a disk dump (err=%d)\n", rv);
1469 return (rv);
1656 "id(%lx) rv(%d) size(%ld)", vdc->instance,
1692 "[%d] Failed waiting for Ver negotiation response, rv(%d)",
1751 "id(%lx) rv(%d) size(%ld)", vdc->instance,
1787 "[%d] Failed waiting for Attr negotiation response, rv(%d)",
1895 " rv(%d)", vdcp->instance, status);
2002 DMSG(vdcp, 0, "[%d] Failed waiting for RDX response, rv(%d)",
2874 int rv;
2880 rv = vdc_populate_mem_hdl(vdcp, ldep);
2881 if (rv) {
2884 return (rv);
2934 int rv = 0;
2963 rv = vdc_populate_descriptor(vdcp, operation, addr,
2973 rv = ENXIO;
2983 rv = EIO;
3001 rv = EIO;
3020 if (rv == 0) {
3034 return (rv);
3073 int rv;
3120 rv = vdc_map_to_shared_dring(vdcp, idx);
3121 if (rv) {
3131 return (rv);
3167 rv = vdc_send(vdcp, (caddr_t)&dmsg, &msglen);
3168 switch (rv) {
3178 rv = 0;
3182 DMSG(vdcp, 1, "sent via LDC: rv=%d\n", rv);
3186 DMSG(vdcp, 0, "unexpected error, rv=%d\n", rv);
3187 rv = ENXIO;
3192 return (rv);
3242 int rv;
3256 rv = vdc_send_request(vdc, op, addr, nbytes, slice, offset, bufp,
3259 if (rv != 0)
3271 rv = vdc_drain_response(vdc, bufp);
3277 rv = vdc_wait_for_response(vdc, &vio_msg);
3279 if (rv == 0)
3280 rv = vdc_process_data_msg(vdc, &vio_msg);
3282 if (rv) {
3306 rv = biowait(bufp);
3311 } else if (rv != 0) {
3316 return (rv);
3434 int rv, idx, retries;
3446 rv = ldc_read(vdc->curr_server->ldc_handle, (caddr_t)&dmsg,
3448 if (rv) {
3449 rv = EINVAL;
3456 if ((rv == 0) && (msglen == 0)) {
3458 rv = EAGAIN;
3514 rv = vdc_depopulate_descriptor(vdc, idx);
3516 rv = 0;
3527 rv = (buf != NULL)? ESRCH: 0;
3536 return (rv);
3559 int rv = 0;
3607 rv = ldc_mem_unbind_handle(ldep->desc_mhdl);
3608 if (rv != 0) {
3610 vdc->instance, ldep->desc_mhdl, idx, rv);
3651 int rv = 0;
3699 rv = ldc_mem_bind_handle(mhdl, vaddr, P2ROUNDUP(nbytes, 8),
3703 if (rv != 0) {
3706 vdcp->instance, (void *)mhdl, (void *)vaddr, rv);
3719 rv = ldc_mem_nextcookie(mhdl, &dep->payload.cookie[i]);
3720 if (rv != 0) {
3724 vdcp->instance, mhdl, i, rv);
3734 return (rv);
3758 int rv = 0;
3788 rv = ldc_status(srvr->ldc_handle, &ldc_state);
3789 if (rv != 0) {
3791 vdc->instance, rv);
3944 int rv = 0;
3973 rv = vdc_do_op(vdcp, curr_ldep->operation,
3980 if (rv) {
4012 return (rv);
4215 int rv;
4232 rv = ldc_down(curr_server->ldc_handle);
4233 if (rv) {
5534 int rv;
5544 rv = vdc_do_sync_op(vdc, VD_OP_FLUSH, NULL, 0,
5546 if (rv != 0) {
5548 vdc->instance, rv,
5560 (*dkc->dkc_callback)(dkc->dkc_cookie, rv);
5594 int i, rv, size;
5598 if ((rv = vdc_validate_geometry(vdc)) != 0) {
5600 return (rv);
5659 int rv;
5667 if ((rv = vd_efi_alloc_and_read(&edev, &gpt, &gpe)) != 0) {
5668 return (rv);
5822 int rv;
5843 rv = EIO;
5871 rv = ENOTSUP;
5898 rv = EACCES;
5925 return (rv);
5945 int rv;
5961 rv = vdc_do_sync_op(vdc, VD_OP_RESET, NULL, 0, 0, 0,
5963 return (rv);
6017 rv = EFAULT;
6032 rv = EFAULT;
6038 rv = vdc_do_sync_op(vdc, VD_OP_SCSICMD, (caddr_t)vd_scsi, vd_scsi_len,
6041 if (rv != 0)
6059 rv = EFAULT;
6072 rv = EFAULT;
6086 rv = EFAULT;
6092 rv = EFAULT;
6098 rv = vdc_scsi_status(vdc, vd_scsi,
6103 return (rv);
6198 int listsize, listlen, rv;
6202 rv = ddi_copyin(arg, &inkeys32, sizeof (inkeys32), mode);
6203 if (rv != 0)
6206 rv = ddi_copyin((caddr_t)(uintptr_t)inkeys32.li, &klist32,
6208 if (rv != 0)
6213 rv = ddi_copyin(arg, &inkeys, sizeof (inkeys), mode);
6214 if (rv != 0)
6217 rv = ddi_copyin(inkeys.li, &klist, sizeof (klist), mode);
6218 if (rv != 0)
6232 rv = vdc_do_sync_op(vdc, VD_OP_SCSICMD, (caddr_t)vd_scsi, vd_scsi_len,
6235 if (rv != 0)
6242 rv = ddi_copyout(&inkeys32, arg, sizeof (inkeys32), mode);
6243 if (rv != 0) {
6244 rv = EFAULT;
6249 rv = ddi_copyout(&klist32, (caddr_t)(uintptr_t)inkeys32.li,
6251 if (rv != 0) {
6252 rv = EFAULT;
6259 rv = ddi_copyout(&inkeys, arg, sizeof (inkeys), mode);
6260 if (rv != 0) {
6261 rv = EFAULT;
6266 rv = ddi_copyout(&klist, inkeys.li, sizeof (klist), mode);
6267 if (rv != 0) {
6268 rv = EFAULT;
6279 rv = ddi_copyout(&scsi_keys->keylist, user_keys,
6281 if (rv != 0)
6282 rv = EFAULT;
6285 if (rv == 0)
6286 rv = vdc_scsi_status(vdc, vd_scsi, B_FALSE);
6291 return (rv);
6312 int listsize, listlen, i, rv;
6316 rv = ddi_copyin(arg, &inresv32, sizeof (inresv32), mode);
6317 if (rv != 0)
6320 rv = ddi_copyin((caddr_t)(uintptr_t)inresv32.li, &rlist32,
6322 if (rv != 0)
6327 rv = ddi_copyin(arg, &inresv, sizeof (inresv), mode);
6328 if (rv != 0)
6331 rv = ddi_copyin(inresv.li, &rlist, sizeof (rlist), mode);
6332 if (rv != 0)
6346 rv = vdc_do_sync_op(vdc, VD_OP_SCSICMD, (caddr_t)vd_scsi, vd_scsi_len,
6349 if (rv != 0)
6356 rv = ddi_copyout(&inresv32, arg, sizeof (inresv32), mode);
6357 if (rv != 0) {
6358 rv = EFAULT;
6363 rv = ddi_copyout(&rlist32, (caddr_t)(uintptr_t)inresv32.li,
6365 if (rv != 0) {
6366 rv = EFAULT;
6373 rv = ddi_copyout(&inresv, arg, sizeof (inresv), mode);
6374 if (rv != 0) {
6375 rv = EFAULT;
6380 rv = ddi_copyout(&rlist, inresv.li, sizeof (rlist), mode);
6381 if (rv != 0) {
6382 rv = EFAULT;
6403 rv = ddi_copyout(&mhd_resv, user_resv,
6405 if (rv != 0) {
6406 rv = EFAULT;
6414 if (rv == 0)
6415 rv = vdc_scsi_status(vdc, vd_scsi, B_FALSE);
6419 return (rv);
6433 int vd_scsi_len, rv;
6436 rv = ddi_copyin(arg, &mhd_reg, sizeof (mhd_reg), mode);
6437 if (rv != 0)
6451 rv = vdc_do_sync_op(vdc, VD_OP_SCSICMD, (caddr_t)vd_scsi, vd_scsi_len,
6454 if (rv == 0)
6455 rv = vdc_scsi_status(vdc, vd_scsi, B_FALSE);
6458 return (rv);
6473 int vd_scsi_len, rv;
6476 rv = ddi_copyin(arg, &mhd_resv, sizeof (mhd_resv), mode);
6477 if (rv != 0)
6492 rv = vdc_do_sync_op(vdc, VD_OP_SCSICMD, (caddr_t)vd_scsi, vd_scsi_len,
6495 if (rv == 0)
6496 rv = vdc_scsi_status(vdc, vd_scsi, B_FALSE);
6499 return (rv);
6514 int vd_scsi_len, rv;
6517 rv = ddi_copyin(arg, &mhd_preempt, sizeof (mhd_preempt), mode);
6518 if (rv != 0)
6537 rv = vdc_do_sync_op(vdc, VD_OP_SCSICMD, (caddr_t)vd_scsi, vd_scsi_len,
6540 if (rv == 0)
6541 rv = vdc_scsi_status(vdc, vd_scsi, B_FALSE);
6544 return (rv);
6558 int vd_scsi_len, rv;
6561 rv = ddi_copyin(arg, &mhd_regi, sizeof (mhd_regi), mode);
6562 if (rv != 0)
6576 rv = vdc_do_sync_op(vdc, VD_OP_SCSICMD, (caddr_t)vd_scsi, vd_scsi_len,
6579 if (rv == 0)
6580 rv = vdc_scsi_status(vdc, vd_scsi, B_FALSE);
6583 return (rv);
6595 int rv;
6621 rv = vdc_do_op(vdc, VD_OP_SCSICMD, (caddr_t)vd_scsi, vd_scsi_len,
6624 if (rv == 0)
6625 rv = vdc_scsi_status(vdc, vd_scsi, B_FALSE);
6628 return (rv);
6644 int rv;
6654 rv = vdc_eio_scsi_cmd(vdc, SCMD_TEST_UNIT_READY, flags);
6655 if (rv != 0 && rv != EACCES)
6686 int rv;
6714 rv = vdc_do_op(vdc, VD_OP_BREAD, (caddr_t)buffer,
6718 if (rv == 0)
6723 rv = vdc_do_op(vdc, VD_OP_BREAD, (caddr_t)buffer,
6727 if (rv == 0)
6733 rv = vdc_do_op(vdc, VD_OP_BREAD, (caddr_t)buffer, vdc->vdisk_bsize,
6738 return (rv);
6968 int rv;
6971 rv = vdc_do_sync_op(vdc, VD_OP_SET_ACCESS, (caddr_t)&flags,
6974 return (rv);
6984 int rv;
6987 rv = vdc_do_sync_op(vdc, VD_OP_GET_ACCESS, (caddr_t)status,
6990 return (rv);
7106 int rv = 0;
7116 rv = vdc_do_sync_op(vdc, VD_OP_GET_CAPACITY, (caddr_t)vd_cap, alloc_len,
7123 return (rv);
7136 int rv;
7146 if ((rv = vdc_get_capacity(vdc, &dsk_size, &blk_size)) != 0)
7147 return (rv);
7159 rv = vdc_update_vio_bsize(vdc, blk_size);
7160 if (rv == 0)
7165 return (rv);
7289 int rv = -1;
7335 rv = ddi_copyin(arg, &dk_efi, sizeof (dk_efi_t), mode);
7336 if (rv != 0)
7411 rv = vdc_access_set(vdc, VD_ACCESS_SET_EXCLUSIVE |
7413 if (rv == 0) {
7420 return (rv);
7426 rv = vdc_access_set(vdc, VD_ACCESS_SET_CLEAR);
7427 if (rv == 0) {
7431 return (rv);
7438 rv = vdc_access_get(vdc, &status);
7439 if (rv == 0 && rvalp != NULL)
7441 return (rv);
7446 rv = vdc_access_set(vdc, VD_ACCESS_SET_EXCLUSIVE);
7447 return (rv);
7482 rv = vdc_failfast(vdc, arg, mode);
7483 return (rv);
7508 rv = ddi_copyout(&cinfo, (void *)arg,
7510 if (rv != 0)
7520 rv = ddi_copyout(vdc->minfo, (void *)arg,
7522 if (rv != 0)
7573 rv = taskq_dispatch(system_taskq, vdc_dkio_flush_cb,
7575 if (rv == NULL) {
7583 return (rv == NULL ? ENOMEM : 0);
7611 rv = (iop->convert)(vdc, arg, mem_p, mode, VD_COPYIN);
7612 if (rv != 0) {
7614 instance, rv, cmd);
7617 return (rv);
7623 rv = vdc_do_sync_op(vdc, iop->op, mem_p, alloc_len,
7626 if (rv != 0) {
7633 instance, rv, cmd);
7637 return (rv);
7646 rv = (iop->convert)(vdc, mem_p, arg, mode, VD_COPYOUT);
7647 if (rv != 0) {
7649 instance, rv, cmd);
7652 return (rv);
7658 return (rv);
7742 int rv;
7763 rv = ddi_copyout(&vtoc32, to, sizeof (vtoc32), mode);
7764 if (rv != 0)
7765 rv = EFAULT;
7768 rv = ddi_copyout(&vtoc, to, sizeof (vtoc), mode);
7769 if (rv != 0)
7770 rv = EFAULT;
7773 return (rv);
7803 int i, rv;
7814 rv = ddi_copyin(uvtoc, &vtoc32, sizeof (vtoc32), mode);
7815 if (rv != 0)
7819 rv = ddi_copyin(uvtoc, &vtoc, sizeof (vtoc), mode);
7820 if (rv != 0)
7849 int i, rv;
7865 rv = ddi_copyout(&evtoc, to, sizeof (struct extvtoc), mode);
7866 if (rv != 0)
7867 rv = EFAULT;
7869 return (rv);
7877 int i, rv;
7884 rv = ddi_copyin(uvtoc, &evtoc, sizeof (struct extvtoc), mode);
7885 if (rv != 0)
7937 int rv = 0;
7946 rv = ddi_copyout(&geom, to, copy_len, mode);
7947 if (rv != 0)
7948 rv = EFAULT;
7950 return (rv);
7981 int rv = 0;
7991 rv = ddi_copyin(from, tmp_mem, copy_len, mode);
7992 if (rv != 0) {
8010 int rv = 0;
8020 rv = ddi_copyin(from, &dk_efi, sizeof (dk_efi_t), mode);
8021 if (rv != 0)
8030 rv = ddi_copyin(to, &dk_efi, sizeof (dk_efi_t), mode);
8031 if (rv != 0)
8040 rv = ddi_copyout(dk_efi.dki_data, uaddr, dk_efi.dki_length,
8042 if (rv != 0)
8305 int rv, rval;
8326 rv = vd_process_ioctl(dev, DKIOCGGEOM, (caddr_t)&geom, FKIOCTL, &rval);
8327 if (rv == 0)
8328 rv = vd_process_ioctl(dev, DKIOCGEXTVTOC, (caddr_t)&vtoc,
8331 if (rv == ENOTSUP) {
8347 rv = vd_efi_alloc_and_read(&edev, &gpt, &gpe);
8349 if (rv) {
8351 vdc->instance, rv);
8363 if (rv != 0) {
8365 vdc->instance, rv);
8368 if (rv != EINVAL)
8369 rv = EIO;
8370 return (rv);
8431 rv = vdc_do_op(vdc, VD_OP_BREAD, (caddr_t)label, vdc->vdisk_bsize,
8434 if (rv != 0 || label->dkl_magic != DKL_MAGIC ||
8469 int rv;
8487 rv = vdc_create_device_nodes_efi(vdc);
8489 rv = vdc_create_device_nodes_vtoc(vdc);
8491 if (rv != 0) {
8532 int rv;
8551 rv = vdc_do_op(vdc, VD_OP_GET_DEVID, (caddr_t)vd_devid,
8554 DMSG(vdc, 2, "do_op returned %d\n", rv);
8556 if (rv) {
8558 return (rv);
8572 rv = vdc_do_sync_op(vdc, VD_OP_GET_DEVID, (caddr_t)vd_devid,
8575 if (rv) {
8577 return (rv);