summaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
authorJosef 'Jeff' Sipek <josef.sipek@nexenta.com>2014-05-07 01:24:12 -0400
committerRichard Lowe <richlowe@richlowe.net>2014-05-14 19:37:11 -0400
commitaa6577ebdcd1cd4be810e610056636f5df7904f9 (patch)
treee56681a3cb042843c0360d8babb9c1aed9f9a7e3 /usr
parent0529d5c654f682ce87e4f74affd1c83c429c50e1 (diff)
downloadillumos-joyent-aa6577ebdcd1cd4be810e610056636f5df7904f9.tar.gz
4779 vhci shouldn't abuse ddi_get_time(9f)
Reviewed by: Robert Mustacchi <rm@joyent.com> Reviewed by: Hans Rosenfeld <hans.rosenfeld@nexenta.com> Approved by: Richard Lowe <richlowe@richlowe.net>
Diffstat (limited to 'usr')
-rw-r--r--usr/src/uts/common/io/scsi/adapters/scsi_vhci/scsi_vhci.c18
-rw-r--r--usr/src/uts/common/sys/scsi/adapters/scsi_vhci.h9
2 files changed, 16 insertions, 11 deletions
diff --git a/usr/src/uts/common/io/scsi/adapters/scsi_vhci/scsi_vhci.c b/usr/src/uts/common/io/scsi/adapters/scsi_vhci/scsi_vhci.c
index 8808e30130..00668133ec 100644
--- a/usr/src/uts/common/io/scsi/adapters/scsi_vhci/scsi_vhci.c
+++ b/usr/src/uts/common/io/scsi/adapters/scsi_vhci/scsi_vhci.c
@@ -21,6 +21,9 @@
/*
* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
*/
+/*
+ * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
+ */
/*
* Multiplexed I/O SCSI vHCI implementation
@@ -2226,7 +2229,6 @@ vhci_bind_transport(struct scsi_address *ap, struct vhci_pkt *vpkt, int flags,
int held;
int mps_flag = MDI_SELECT_ONLINE_PATH;
struct scsi_vhci_lun *vlun;
- time_t tnow;
int path_instance = 0;
vlun = ADDR2VLUN(ap);
@@ -2364,7 +2366,7 @@ try_again:
if ((rval != MDI_SUCCESS) || (pip == NULL)) {
if (vlun->svl_waiting_for_activepath == 0) {
vlun->svl_waiting_for_activepath = 1;
- vlun->svl_wfa_time = ddi_get_time();
+ vlun->svl_wfa_time = gethrtime();
}
mps_flag |= MDI_SELECT_STANDBY_PATH;
rval = mdi_select_path(cdip,
@@ -2396,8 +2398,8 @@ try_again:
* show up obviating the need for a
* failover
*/
- tnow = ddi_get_time();
- if (tnow - vlun->svl_wfa_time >= 60) {
+ if ((gethrtime() - vlun->svl_wfa_time) >=
+ (60 * NANOSEC)) {
vlun->svl_waiting_for_activepath = 0;
} else {
drv_usecwait(1000);
@@ -3624,7 +3626,7 @@ vhci_handle_ext_fo(struct scsi_pkt *pkt, int fostat)
return (PKT_RETURN);
}
swarg->svs_svp = svp;
- swarg->svs_tos = ddi_get_time();
+ swarg->svs_tos = gethrtime();
swarg->svs_pi = vpkt->vpkt_path;
swarg->svs_release_lun = 0;
swarg->svs_done = 0;
@@ -3685,7 +3687,7 @@ vhci_efo_watch_cb(caddr_t arg, struct scsi_watch_result *resultp)
updt_paths = 0;
if (pkt->pkt_reason != CMD_CMPLT) {
- if ((ddi_get_time() - swarg->svs_tos) >= VHCI_EXTFO_TIMEOUT) {
+ if ((gethrtime() - swarg->svs_tos) >= VHCI_EXTFO_TIMEOUT) {
swarg->svs_release_lun = 1;
goto done;
}
@@ -3707,7 +3709,7 @@ vhci_efo_watch_cb(caddr_t arg, struct scsi_watch_result *resultp)
updt_paths = 1;
break;
default:
- if ((ddi_get_time() - swarg->svs_tos)
+ if ((gethrtime() - swarg->svs_tos)
>= VHCI_EXTFO_TIMEOUT) {
swarg->svs_release_lun = 1;
goto done;
@@ -3739,7 +3741,7 @@ vhci_efo_watch_cb(caddr_t arg, struct scsi_watch_result *resultp)
KM_SLEEP);
return (0);
}
- if ((ddi_get_time() - swarg->svs_tos) >= VHCI_EXTFO_TIMEOUT) {
+ if ((gethrtime() - swarg->svs_tos) >= VHCI_EXTFO_TIMEOUT) {
swarg->svs_release_lun = 1;
goto done;
}
diff --git a/usr/src/uts/common/sys/scsi/adapters/scsi_vhci.h b/usr/src/uts/common/sys/scsi/adapters/scsi_vhci.h
index 3f8b8f8229..d8d22c6802 100644
--- a/usr/src/uts/common/sys/scsi/adapters/scsi_vhci.h
+++ b/usr/src/uts/common/sys/scsi/adapters/scsi_vhci.h
@@ -22,6 +22,9 @@
/*
* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
*/
+/*
+ * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
+ */
#ifndef _SYS_SCSI_ADAPTERS_SCSI_VHCI_H
#define _SYS_SCSI_ADAPTERS_SCSI_VHCI_H
@@ -65,7 +68,7 @@ extern "C" {
#define TRAN2HBAPRIVATE(tran) ((struct scsi_vhci *)(tran)->tran_hba_private)
#define VHCI_INIT_WAIT_TIMEOUT 60000000
#define VHCI_FOWATCH_INTERVAL 1000000 /* in usecs */
-#define VHCI_EXTFO_TIMEOUT 3*60 /* 3 minutes */
+#define VHCI_EXTFO_TIMEOUT (3 * 60 * NANOSEC) /* 3 minutes in nsec */
#define SCBP_C(pkt) ((*(pkt)->pkt_scbp) & STATUS_MASK)
@@ -316,7 +319,7 @@ typedef struct scsi_vhci_lun {
* is still comng up
*/
int svl_waiting_for_activepath;
- time_t svl_wfa_time;
+ hrtime_t svl_wfa_time;
/*
* to keep the failover status in order to return the
@@ -462,7 +465,7 @@ typedef struct scsi_vhci_priv {
*/
typedef struct scsi_vhci_swarg {
scsi_vhci_priv_t *svs_svp;
- time_t svs_tos; /* time of submission */
+ hrtime_t svs_tos; /* time of submission */
mdi_pathinfo_t *svs_pi; /* pathinfo being "watched" */
int svs_release_lun;
int svs_done;