Print this page
4779 vhci shouldn't abuse ddi_get_time(9f)
Reviewed by: Robert Mustacchi <rm@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/scsi/adapters/scsi_vhci.h
          +++ new/usr/src/uts/common/sys/scsi/adapters/scsi_vhci.h
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  24   24   */
       25 +/*
       26 + * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
       27 + */
  25   28  
  26   29  #ifndef _SYS_SCSI_ADAPTERS_SCSI_VHCI_H
  27   30  #define _SYS_SCSI_ADAPTERS_SCSI_VHCI_H
  28   31  
  29   32  /*
  30   33   * Multiplexed I/O SCSI vHCI global include
  31   34   */
  32   35  #include <sys/note.h>
  33   36  #include <sys/taskq.h>
  34   37  #include <sys/mhd.h>
↓ open down ↓ 23 lines elided ↑ open up ↑
  58   61  #define VH_SLEEP                0x0
  59   62  #define VH_NOSLEEP              0x1
  60   63  
  61   64  /*
  62   65   * HBA interface macros
  63   66   */
  64   67  
  65   68  #define TRAN2HBAPRIVATE(tran)   ((struct scsi_vhci *)(tran)->tran_hba_private)
  66   69  #define VHCI_INIT_WAIT_TIMEOUT  60000000
  67   70  #define VHCI_FOWATCH_INTERVAL   1000000         /* in usecs */
  68      -#define VHCI_EXTFO_TIMEOUT      3*60            /* 3 minutes */
       71 +#define VHCI_EXTFO_TIMEOUT      (3 * 60 * NANOSEC)      /* 3 minutes in nsec */
  69   72  
  70   73  #define SCBP_C(pkt)     ((*(pkt)->pkt_scbp) & STATUS_MASK)
  71   74  
  72   75  int vhci_do_scsi_cmd(struct scsi_pkt *);
  73   76  /*PRINTFLIKE3*/
  74   77  void vhci_log(int, dev_info_t *, const char *, ...);
  75   78  
  76   79  /*
  77   80   * debugging stuff
  78   81   */
↓ open down ↓ 230 lines elided ↑ open up ↑
 309  312           * following three fields are under svl_mutex protection
 310  313           */
 311  314          int                     svl_transient;
 312  315  
 313  316          /*
 314  317           * to prevent unnecessary failover when a device is
 315  318           * is discovered across a passive path and active path
 316  319           * is still comng up
 317  320           */
 318  321          int                     svl_waiting_for_activepath;
 319      -        time_t                  svl_wfa_time;
      322 +        hrtime_t                svl_wfa_time;
 320  323  
 321  324          /*
 322  325           * to keep the failover status in order to return the
 323  326           * failure status to target driver when targer driver
 324  327           * retries the command which originally triggered the
 325  328           * failover.
 326  329           */
 327  330          int                     svl_failover_status;
 328  331  
 329  332          /*
↓ open down ↓ 125 lines elided ↑ open up ↑
 455  458          /* any cleanup operations for a newly found path. */
 456  459          int                     svp_new_path;
 457  460  } scsi_vhci_priv_t;
 458  461  
 459  462  /*
 460  463   * argument to scsi_watch callback.  Used for processing
 461  464   * externally initiated failovers
 462  465   */
 463  466  typedef struct scsi_vhci_swarg {
 464  467          scsi_vhci_priv_t        *svs_svp;
 465      -        time_t                  svs_tos;        /* time of submission */
      468 +        hrtime_t                svs_tos;        /* time of submission */
 466  469          mdi_pathinfo_t          *svs_pi;        /* pathinfo being "watched" */
 467  470          int                     svs_release_lun;
 468  471          int                     svs_done;
 469  472  } scsi_vhci_swarg_t;
 470  473  
 471  474  /*
 472  475   * scsi_vhci softstate
 473  476   *
 474  477   * vhci_mutex protects
 475  478   *      vhci_state
↓ open down ↓ 392 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX