Print this page
XXXX introduce drv_sectohz

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/ib/mgt/ibcm/ibcm_path.c
          +++ new/usr/src/uts/common/io/ib/mgt/ibcm/ibcm_path.c
↓ open down ↓ 183 lines elided ↑ open up ↑
 184  184          int purges;
 185  185          int timeouts;
 186  186  } ibcm_path_cache_stats;
 187  187  
 188  188  /*ARGSUSED*/
 189  189  static void
 190  190  ibcm_path_cache_timeout_cb(void *arg)
 191  191  {
 192  192          clock_t timeout_in_hz;
 193  193  
 194      -        timeout_in_hz = drv_usectohz(ibcm_path_cache_timeout * 1000000);
      194 +        timeout_in_hz = drv_sectohz(ibcm_path_cache_timeout);
 195  195          mutex_enter(&ibcm_path_cache_mutex);
 196  196          ibcm_path_cache_invalidate = 1; /* invalidate cache on next check */
 197  197          if (ibcm_path_cache_timeout_id)
 198  198                  ibcm_path_cache_timeout_id = timeout(ibcm_path_cache_timeout_cb,
 199  199                      NULL, timeout_in_hz);
 200  200          /* else we're in _fini */
 201  201          mutex_exit(&ibcm_path_cache_mutex);
 202  202  }
 203  203  
 204  204  void
 205  205  ibcm_path_cache_init(void)
 206  206  {
 207  207          clock_t timeout_in_hz;
 208  208          int cache_size = ibcm_path_cache_size_init;
 209  209          ibcm_path_cache_t *path_cachep;
 210  210  
 211      -        timeout_in_hz = drv_usectohz(ibcm_path_cache_timeout * 1000000);
      211 +        timeout_in_hz = drv_sectohz(ibcm_path_cache_timeout);
 212  212          path_cachep = kmem_zalloc(cache_size * sizeof (*path_cachep), KM_SLEEP);
 213  213          mutex_init(&ibcm_path_cache_mutex, NULL, MUTEX_DEFAULT, NULL);
 214  214          mutex_enter(&ibcm_path_cache_mutex);
 215  215          ibcm_path_cache_size = cache_size;
 216  216          ibcm_path_cachep = path_cachep;
 217  217          ibcm_path_cache_timeout_id = timeout(ibcm_path_cache_timeout_cb,
 218  218              NULL, timeout_in_hz);
 219  219          mutex_exit(&ibcm_path_cache_mutex);
 220  220  }
 221  221  
↓ open down ↓ 4485 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX