Print this page
XXXX introduce drv_sectohz

@@ -985,11 +985,11 @@
                         p->cku_err.re_status = RPC_CANTCONNECT;
                         p->cku_err.re_errno = EIO;
                         break;
                 }
                 if (delay_first == TRUE)
-                        ticks = clnt_cots_min_tout * drv_usectohz(1000000);
+                        ticks = drv_sectohz(clnt_cots_min_tout);
                 goto cots_done;
         }
 
         /*
          * If we've never sent any request on this connection (send count

@@ -1117,11 +1117,11 @@
                 if ((waitsecs++ < max_waitsecs) &&
                     !(zone_status_get(curproc->p_zone) >=
                     ZONE_IS_SHUTTING_DOWN)) {
 
                         /* wait 1 sec for queue to drain */
-                        if (clnt_delay(drv_usectohz(1000000),
+                        if (clnt_delay(drv_sectohz(1),
                             h->cl_nosignal) == EINTR) {
                                 p->cku_err.re_errno = EINTR;
                                 p->cku_err.re_status = RPC_INTR;
 
                                 goto cots_done;

@@ -1181,11 +1181,11 @@
 
                 if (lwp != NULL)
                         lwp->lwp_nostop++;
 
                 oldlbolt = ddi_get_lbolt();
-                timout = wait.tv_sec * drv_usectohz(1000000) +
+                timout = drv_sectohz(wait.tv_sec) +
                     drv_usectohz(wait.tv_usec) + oldlbolt;
                 /*
                  * Iterate until the call_status is changed to something
                  * other that RPC_TIMEDOUT, or if cv_timedwait_sig() returns
                  * something <=0 zero. The latter means that we timed

@@ -1230,12 +1230,11 @@
                         if (call->call_status != RPC_SUCCESS) {
                                 clock_t curlbolt;
                                 clock_t diff;
 
                                 curlbolt = ddi_get_lbolt();
-                                ticks = clnt_cots_min_tout *
-                                    drv_usectohz(1000000);
+                                ticks = drv_sectohz(clnt_cots_min_tout);
                                 diff = curlbolt - oldlbolt;
                                 if (diff < ticks) {
                                         delay_first = TRUE;
                                         if (diff > 0)
                                                 ticks -= diff;

@@ -1713,11 +1712,11 @@
          * a signal(0) or timeout(-1) or cv_signal(>0). But it may be
          * cv_signalled for various other reasons too. So loop
          * until there is a state change on the connection.
          */
 
-        timout = waitp->tv_sec * drv_usectohz(1000000) +
+        timout = drv_sectohz(waitp->tv_sec) +
             drv_usectohz(waitp->tv_usec) + ddi_get_lbolt();
 
         if (nosignal) {
                 while ((cv_stat = cv_timedwait(&cm_entry->x_conn_cv,
                     &connmgr_lock, timout)) > 0 &&

@@ -2351,11 +2350,11 @@
 
                 while (cm_entry->x_needrel == TRUE) {
                         cm_entry->x_needrel = FALSE;
 
                         connmgr_sndrel(cm_entry);
-                        delay(drv_usectohz(1000000));
+                        delay(drv_sectohz(1));
 
                         mutex_enter(&connmgr_lock);
                 }
 
                 /*

@@ -2467,11 +2466,11 @@
 
                         RPCLOG(8, "connmgr_dis_and_wait waiting for "
                             "T_DISCON_REQ's ACK for connection %p\n",
                             (void *)cm_entry);
 
-                        timout = clnt_cots_min_conntout * drv_usectohz(1000000);
+                        timout = drv_sectohz(clnt_cots_min_conntout);
 
                         /*
                          * The TPI spec says that the T_DISCON_REQ
                          * will get acknowledged, but in practice
                          * the ACK may never get sent. So don't

@@ -3706,11 +3705,11 @@
         int cv_stat = 1;
 
         ASSERT(MUTEX_HELD(&clnt_pending_lock));
         while (e->call_reply == NULL) {
                 if (waitp != NULL) {
-                        timout = waitp->tv_sec * drv_usectohz(MICROSEC) +
+                        timout = drv_sectohz(waitp->tv_sec) +
                             drv_usectohz(waitp->tv_usec);
                         if (nosignal)
                                 cv_stat = cv_reltimedwait(&e->call_cv,
                                     &clnt_pending_lock, timout, TR_CLOCK_TICK);
                         else