Lines Matching defs:vhcache

126 /* number of seconds the vhcache flush daemon will sleep idle before exiting */
7489 mdi_vhci_cache_t *vhcache;
7495 vhcache = &vhc->vhc_vhcache;
7502 rw_init(&vhcache->vhcache_lock, NULL, RW_DRIVER, NULL);
7508 vhcache->vhcache_client_hash = mod_hash_create_extended(vh->vh_class,
7533 rw_enter(&vhcache->vhcache_lock, RW_WRITER);
7534 if (mainnvl_to_vhcache(vhcache, nvl) == MDI_SUCCESS)
7535 vhcache->vhcache_flags |= MDI_VHCI_CACHE_SETUP_DONE;
7541 rw_exit(&vhcache->vhcache_lock);
7559 mdi_vhci_cache_t *vhcache = &vhc->vhc_vhcache;
7570 mod_hash_destroy_strhash(vhcache->vhcache_client_hash);
7572 for (cphci = vhcache->vhcache_phci_head; cphci != NULL;
7578 for (cct = vhcache->vhcache_client_head; cct != NULL; cct = cct_next) {
7587 rw_destroy(&vhcache->vhcache_lock);
7671 * Enqueue the vhcache phci (cphci) at the tail of the list
7674 enqueue_vhcache_phci(mdi_vhci_cache_t *vhcache, mdi_vhcache_phci_t *cphci)
7677 if (vhcache->vhcache_phci_head == NULL)
7678 vhcache->vhcache_phci_head = cphci;
7680 vhcache->vhcache_phci_tail->cphci_next = cphci;
7681 vhcache->vhcache_phci_tail = cphci;
7685 * Enqueue the vhcache pathinfo (cpi) at the tail of the list
7700 * Enqueue the vhcache pathinfo (cpi) at the correct location in the
7733 * Enqueue the vhcache client (cct) at the tail of the list
7736 enqueue_vhcache_client(mdi_vhci_cache_t *vhcache,
7740 if (vhcache->vhcache_client_head == NULL)
7741 vhcache->vhcache_client_head = cct;
7743 vhcache->vhcache_client_tail->cct_next = cct;
7744 vhcache->vhcache_client_tail = cct;
7830 caddrmapnvl_to_vhcache(mdi_vhci_cache_t *vhcache, nvlist_t *nvl,
7846 enqueue_vhcache_client(vhcache, cct);
7847 (void) mod_hash_insert(vhcache->vhcache_client_hash,
7889 mainnvl_to_vhcache(mdi_vhci_cache_t *vhcache, nvlist_t *nvl)
7899 ASSERT(RW_WRITE_HELD(&vhcache->vhcache_lock));
7916 enqueue_vhcache_phci(vhcache, cphci);
7920 ASSERT(vhcache->vhcache_phci_head != NULL);
7923 caddrmapnvl_to_vhcache(vhcache, caddrmapnvl, cphci_list);
7935 vhcache_to_paddrnvl(mdi_vhci_cache_t *vhcache, mdi_vhcache_client_t *cct,
7943 ASSERT(RW_LOCK_HELD(&vhcache->vhcache_lock));
7968 vhcache_to_caddrmapnvl(mdi_vhci_cache_t *vhcache, nvlist_t *mainnvl)
7974 ASSERT(RW_LOCK_HELD(&vhcache->vhcache_lock));
7979 for (cct = vhcache->vhcache_client_head; cct != NULL;
7981 if ((err = vhcache_to_paddrnvl(vhcache, cct, nvl)) != 0)
7997 vhcache_to_mainnvl(mdi_vhci_cache_t *vhcache)
8014 rw_enter(&vhcache->vhcache_lock, RW_READER);
8015 if (vhcache->vhcache_phci_head == NULL) {
8016 rw_exit(&vhcache->vhcache_lock);
8021 for (cphci = vhcache->vhcache_phci_head; cphci != NULL;
8027 for (cphci = vhcache->vhcache_phci_head, i = 0; cphci != NULL;
8036 (err = vhcache_to_caddrmapnvl(vhcache, nvl)) == 0) {
8037 rw_exit(&vhcache->vhcache_lock);
8041 rw_exit(&vhcache->vhcache_lock);
8049 * Lookup vhcache phci structure for the specified phci path.
8052 lookup_vhcache_phci_by_name(mdi_vhci_cache_t *vhcache, char *phci_path)
8056 ASSERT(RW_LOCK_HELD(&vhcache->vhcache_lock));
8058 for (cphci = vhcache->vhcache_phci_head; cphci != NULL;
8068 * Lookup vhcache phci structure for the specified phci.
8071 lookup_vhcache_phci_by_addr(mdi_vhci_cache_t *vhcache, mdi_phci_t *ph)
8075 ASSERT(RW_LOCK_HELD(&vhcache->vhcache_lock));
8077 for (cphci = vhcache->vhcache_phci_head; cphci != NULL;
8092 mdi_vhci_cache_t *vhcache = &vhc->vhc_vhcache;
8097 rw_enter(&vhcache->vhcache_lock, RW_WRITER);
8101 if ((cphci = lookup_vhcache_phci_by_name(vhcache, pathname))
8109 enqueue_vhcache_phci(vhcache, cphci);
8113 rw_exit(&vhcache->vhcache_lock);
8135 mdi_vhci_cache_t *vhcache = &vhc->vhc_vhcache;
8138 rw_enter(&vhcache->vhcache_lock, RW_WRITER);
8139 if ((cphci = lookup_vhcache_phci_by_addr(vhcache, ph)) != NULL) {
8143 rw_exit(&vhcache->vhcache_lock);
8160 * Look up vhcache client for the specified client.
8163 lookup_vhcache_client(mdi_vhci_cache_t *vhcache, char *ct_name, char *ct_addr,
8170 ASSERT(RW_LOCK_HELD(&vhcache->vhcache_lock));
8173 * If no vhcache clean occurred since the last lookup, we can
8175 * It works because ccts are never freed except during the vhcache
8179 vhcache->vhcache_clean_time < token->lt_cct_lookup_time)
8183 if (mod_hash_find(vhcache->vhcache_client_hash,
8202 * Also add the vhcache client for the client corresponding to this path
8208 mdi_vhci_cache_t *vhcache = &vhc->vhc_vhcache;
8215 rw_enter(&vhcache->vhcache_lock, RW_WRITER);
8217 /* if vhcache client for this pip doesn't already exist, add it */
8218 if ((cct = lookup_vhcache_client(vhcache, ct->ct_drvname, ct->ct_guid,
8223 enqueue_vhcache_client(vhcache, cct);
8224 (void) mod_hash_insert(vhcache->vhcache_client_hash,
8246 cpi->cpi_cphci = lookup_vhcache_phci_by_addr(vhcache, ph);
8253 rw_exit(&vhcache->vhcache_lock);
8265 mdi_vhci_cache_t *vhcache = &vhc->vhc_vhcache;
8270 rw_enter(&vhcache->vhcache_lock, RW_WRITER);
8271 if ((cct = lookup_vhcache_client(vhcache, ct->ct_drvname, ct->ct_guid,
8281 rw_exit(&vhcache->vhcache_lock);
8394 * Make vhci cache dirty and schedule flushing by vhcache flush thread.
8399 mdi_vhci_cache_t *vhcache = &vhc->vhc_vhcache;
8402 rw_enter(&vhcache->vhcache_lock, RW_READER);
8404 if (!(vhcache->vhcache_flags & MDI_VHCI_CACHE_SETUP_DONE)) {
8405 rw_exit(&vhcache->vhcache_lock);
8408 rw_exit(&vhcache->vhcache_lock);
8497 bus_config_all_phcis(mdi_vhci_cache_t *vhcache, uint_t flags,
8504 rw_enter(&vhcache->vhcache_lock, RW_READER);
8505 if (vhcache->vhcache_phci_head == NULL) {
8506 rw_exit(&vhcache->vhcache_lock);
8512 for (cphci = vhcache->vhcache_phci_head; cphci != NULL;
8525 rw_exit(&vhcache->vhcache_lock);
8562 mdi_vhci_cache_t *vhcache = &vhc->vhc_vhcache;
8565 bus_config_all_phcis(vhcache, flags, op, maj);
8700 * Sort vhcache pathinfos (cpis) of the specified client.
8720 * every vhcache pathinfo of the specified client. If not adjust the flag
8731 mdi_vhci_cache_t *vhcache = &vhc->vhc_vhcache;
8735 rw_enter(&vhcache->vhcache_lock, RW_READER);
8736 if ((cct = lookup_vhcache_client(vhcache, ct_name, ct_addr, tok))
8738 rw_exit(&vhcache->vhcache_lock);
8755 rw_exit(&vhcache->vhcache_lock);
8759 if (rw_tryupgrade(&vhcache->vhcache_lock) == 0) {
8760 rw_exit(&vhcache->vhcache_lock);
8761 rw_enter(&vhcache->vhcache_lock, RW_WRITER);
8762 if ((cct = lookup_vhcache_client(vhcache, ct_name, ct_addr,
8764 rw_exit(&vhcache->vhcache_lock);
8777 rw_exit(&vhcache->vhcache_lock);
8932 mdi_vhci_cache_t *vhcache = &vhc->vhc_vhcache;
8937 ASSERT(RW_LOCK_HELD(&vhcache->vhcache_lock));
8942 (cct = lookup_vhcache_client(vhcache, ct_name, ct_addr, &tok))
8945 rw_exit(&vhcache->vhcache_lock);
8951 rw_exit(&vhcache->vhcache_lock);
8956 rw_exit(&vhcache->vhcache_lock);
8960 rw_enter(&vhcache->vhcache_lock, RW_READER);
8962 if ((cct = lookup_vhcache_client(vhcache, ct_name,
8964 rw_exit(&vhcache->vhcache_lock);
8970 rw_exit(&vhcache->vhcache_lock);
8977 rw_exit(&vhcache->vhcache_lock);
9181 mdi_vhci_cache_t *vhcache = &vhc->vhc_vhcache;
9185 rw_enter(&vhcache->vhcache_lock, RW_READER);
9186 if (vhcache->vhcache_flags & MDI_VHCI_CACHE_SETUP_DONE) {
9187 rw_exit(&vhcache->vhcache_lock);
9191 rw_exit(&vhcache->vhcache_lock);
9194 bus_config_all_phcis(vhcache, NDI_DRV_CONF_REPROBE | NDI_NO_EVENT,
9197 rw_enter(&vhcache->vhcache_lock, RW_WRITER);
9198 vhcache->vhcache_flags |= MDI_VHCI_CACHE_SETUP_DONE;
9199 rw_exit(&vhcache->vhcache_lock);
9252 mdi_vhci_cache_t *vhcache = &vhc->vhc_vhcache;
9259 bus_config_all_phcis(vhcache, NDI_DRV_CONF_REPROBE |
9304 mdi_vhci_cache_t *vhcache = &vhc->vhc_vhcache;
9324 rw_enter(&vhcache->vhcache_lock, RW_READER);
9325 if (!(vhcache->vhcache_flags & MDI_VHCI_CACHE_SETUP_DONE)) {
9326 rw_exit(&vhcache->vhcache_lock);
9328 rw_enter(&vhcache->vhcache_lock, RW_READER);
9348 rw_exit(&vhcache->vhcache_lock);
9352 rw_exit(&vhcache->vhcache_lock);
9359 rw_exit(&vhcache->vhcache_lock);
9365 rw_exit(&vhcache->vhcache_lock);
9433 mdi_vhci_cache_t *vhcache = &vhc->vhc_vhcache;
9438 rw_enter(&vhcache->vhcache_lock, RW_WRITER);
9440 client = vhcache->vhcache_client_head;
9441 vhcache->vhcache_client_head = vhcache->vhcache_client_tail = NULL;
9459 enqueue_vhcache_client(vhcache, client);
9461 (void) mod_hash_destroy(vhcache->vhcache_client_hash,
9467 phci = vhcache->vhcache_phci_head;
9468 vhcache->vhcache_phci_head = vhcache->vhcache_phci_tail = NULL;
9473 enqueue_vhcache_phci(vhcache, phci);
9478 vhcache->vhcache_clean_time = ddi_get_lbolt64();
9479 rw_exit(&vhcache->vhcache_lock);