1074
1075 cmn_err(CE_CONT, "!sv: rdev 0x%lx, nblocks %" NSC_SZFMT "\n",
1076 svp->sv_dev, nblocks);
1077
1078 return (0);
1079 }
1080
1081
1082 static int
1083 sv_prepare_unload()
1084 {
1085 int rc = 0;
1086
1087 mutex_enter(&sv_mutex);
1088
1089 if (sv_mod_status == SV_PREVENT_UNLOAD) {
1090 if ((sv_ndevices != 0) || (sv_tset != NULL)) {
1091 rc = EBUSY;
1092 } else {
1093 sv_mod_status = SV_ALLOW_UNLOAD;
1094 delay(SV_WAIT_UNLOAD * drv_usectohz(1000000));
1095 }
1096 }
1097
1098 mutex_exit(&sv_mutex);
1099 return (rc);
1100 }
1101
1102 static int
1103 svattach_fd(blind_t arg)
1104 {
1105 dev_t dev = (dev_t)arg;
1106 sv_dev_t *svp = sv_dev_to_sv(dev, NULL);
1107 int rc;
1108
1109 if (sv_debug > 0)
1110 cmn_err(CE_CONT, "!svattach_fd(%p, %p)\n", arg, (void *)svp);
1111
1112 if (svp == NULL) {
1113 cmn_err(CE_WARN, "!svattach_fd: no state (arg %p)", arg);
1114 return (0);
|
1074
1075 cmn_err(CE_CONT, "!sv: rdev 0x%lx, nblocks %" NSC_SZFMT "\n",
1076 svp->sv_dev, nblocks);
1077
1078 return (0);
1079 }
1080
1081
1082 static int
1083 sv_prepare_unload()
1084 {
1085 int rc = 0;
1086
1087 mutex_enter(&sv_mutex);
1088
1089 if (sv_mod_status == SV_PREVENT_UNLOAD) {
1090 if ((sv_ndevices != 0) || (sv_tset != NULL)) {
1091 rc = EBUSY;
1092 } else {
1093 sv_mod_status = SV_ALLOW_UNLOAD;
1094 delay(drv_sectohz(SV_WAIT_UNLOAD));
1095 }
1096 }
1097
1098 mutex_exit(&sv_mutex);
1099 return (rc);
1100 }
1101
1102 static int
1103 svattach_fd(blind_t arg)
1104 {
1105 dev_t dev = (dev_t)arg;
1106 sv_dev_t *svp = sv_dev_to_sv(dev, NULL);
1107 int rc;
1108
1109 if (sv_debug > 0)
1110 cmn_err(CE_CONT, "!svattach_fd(%p, %p)\n", arg, (void *)svp);
1111
1112 if (svp == NULL) {
1113 cmn_err(CE_WARN, "!svattach_fd: no state (arg %p)", arg);
1114 return (0);
|