Lines Matching defs:vhcache

127 /* number of seconds the vhcache flush daemon will sleep idle before exiting */
7478 mdi_vhci_cache_t *vhcache;
7484 vhcache = &vhc->vhc_vhcache;
7491 rw_init(&vhcache->vhcache_lock, NULL, RW_DRIVER, NULL);
7497 vhcache->vhcache_client_hash = mod_hash_create_extended(vh->vh_class,
7522 rw_enter(&vhcache->vhcache_lock, RW_WRITER);
7523 if (mainnvl_to_vhcache(vhcache, nvl) == MDI_SUCCESS)
7524 vhcache->vhcache_flags |= MDI_VHCI_CACHE_SETUP_DONE;
7530 rw_exit(&vhcache->vhcache_lock);
7548 mdi_vhci_cache_t *vhcache = &vhc->vhc_vhcache;
7559 mod_hash_destroy_strhash(vhcache->vhcache_client_hash);
7561 for (cphci = vhcache->vhcache_phci_head; cphci != NULL;
7567 for (cct = vhcache->vhcache_client_head; cct != NULL; cct = cct_next) {
7576 rw_destroy(&vhcache->vhcache_lock);
7660 * Enqueue the vhcache phci (cphci) at the tail of the list
7663 enqueue_vhcache_phci(mdi_vhci_cache_t *vhcache, mdi_vhcache_phci_t *cphci)
7666 if (vhcache->vhcache_phci_head == NULL)
7667 vhcache->vhcache_phci_head = cphci;
7669 vhcache->vhcache_phci_tail->cphci_next = cphci;
7670 vhcache->vhcache_phci_tail = cphci;
7674 * Enqueue the vhcache pathinfo (cpi) at the tail of the list
7689 * Enqueue the vhcache pathinfo (cpi) at the correct location in the
7722 * Enqueue the vhcache client (cct) at the tail of the list
7725 enqueue_vhcache_client(mdi_vhci_cache_t *vhcache,
7729 if (vhcache->vhcache_client_head == NULL)
7730 vhcache->vhcache_client_head = cct;
7732 vhcache->vhcache_client_tail->cct_next = cct;
7733 vhcache->vhcache_client_tail = cct;
7819 caddrmapnvl_to_vhcache(mdi_vhci_cache_t *vhcache, nvlist_t *nvl,
7835 enqueue_vhcache_client(vhcache, cct);
7836 (void) mod_hash_insert(vhcache->vhcache_client_hash,
7878 mainnvl_to_vhcache(mdi_vhci_cache_t *vhcache, nvlist_t *nvl)
7888 ASSERT(RW_WRITE_HELD(&vhcache->vhcache_lock));
7905 enqueue_vhcache_phci(vhcache, cphci);
7909 ASSERT(vhcache->vhcache_phci_head != NULL);
7912 caddrmapnvl_to_vhcache(vhcache, caddrmapnvl, cphci_list);
7924 vhcache_to_paddrnvl(mdi_vhci_cache_t *vhcache, mdi_vhcache_client_t *cct,
7932 ASSERT(RW_LOCK_HELD(&vhcache->vhcache_lock));
7957 vhcache_to_caddrmapnvl(mdi_vhci_cache_t *vhcache, nvlist_t *mainnvl)
7963 ASSERT(RW_LOCK_HELD(&vhcache->vhcache_lock));
7968 for (cct = vhcache->vhcache_client_head; cct != NULL;
7970 if ((err = vhcache_to_paddrnvl(vhcache, cct, nvl)) != 0)
7986 vhcache_to_mainnvl(mdi_vhci_cache_t *vhcache)
8003 rw_enter(&vhcache->vhcache_lock, RW_READER);
8004 if (vhcache->vhcache_phci_head == NULL) {
8005 rw_exit(&vhcache->vhcache_lock);
8010 for (cphci = vhcache->vhcache_phci_head; cphci != NULL;
8016 for (cphci = vhcache->vhcache_phci_head, i = 0; cphci != NULL;
8025 (err = vhcache_to_caddrmapnvl(vhcache, nvl)) == 0) {
8026 rw_exit(&vhcache->vhcache_lock);
8030 rw_exit(&vhcache->vhcache_lock);
8037 * Lookup vhcache phci structure for the specified phci path.
8040 lookup_vhcache_phci_by_name(mdi_vhci_cache_t *vhcache, char *phci_path)
8044 ASSERT(RW_LOCK_HELD(&vhcache->vhcache_lock));
8046 for (cphci = vhcache->vhcache_phci_head; cphci != NULL;
8056 * Lookup vhcache phci structure for the specified phci.
8059 lookup_vhcache_phci_by_addr(mdi_vhci_cache_t *vhcache, mdi_phci_t *ph)
8063 ASSERT(RW_LOCK_HELD(&vhcache->vhcache_lock));
8065 for (cphci = vhcache->vhcache_phci_head; cphci != NULL;
8080 mdi_vhci_cache_t *vhcache = &vhc->vhc_vhcache;
8085 rw_enter(&vhcache->vhcache_lock, RW_WRITER);
8089 if ((cphci = lookup_vhcache_phci_by_name(vhcache, pathname))
8097 enqueue_vhcache_phci(vhcache, cphci);
8101 rw_exit(&vhcache->vhcache_lock);
8123 mdi_vhci_cache_t *vhcache = &vhc->vhc_vhcache;
8126 rw_enter(&vhcache->vhcache_lock, RW_WRITER);
8127 if ((cphci = lookup_vhcache_phci_by_addr(vhcache, ph)) != NULL) {
8131 rw_exit(&vhcache->vhcache_lock);
8148 * Look up vhcache client for the specified client.
8151 lookup_vhcache_client(mdi_vhci_cache_t *vhcache, char *ct_name, char *ct_addr,
8158 ASSERT(RW_LOCK_HELD(&vhcache->vhcache_lock));
8161 * If no vhcache clean occurred since the last lookup, we can
8163 * It works because ccts are never freed except during the vhcache
8167 vhcache->vhcache_clean_time < token->lt_cct_lookup_time)
8171 if (mod_hash_find(vhcache->vhcache_client_hash,
8190 * Also add the vhcache client for the client corresponding to this path
8196 mdi_vhci_cache_t *vhcache = &vhc->vhc_vhcache;
8203 rw_enter(&vhcache->vhcache_lock, RW_WRITER);
8205 /* if vhcache client for this pip doesn't already exist, add it */
8206 if ((cct = lookup_vhcache_client(vhcache, ct->ct_drvname, ct->ct_guid,
8211 enqueue_vhcache_client(vhcache, cct);
8212 (void) mod_hash_insert(vhcache->vhcache_client_hash,
8234 cpi->cpi_cphci = lookup_vhcache_phci_by_addr(vhcache, ph);
8241 rw_exit(&vhcache->vhcache_lock);
8253 mdi_vhci_cache_t *vhcache = &vhc->vhc_vhcache;
8258 rw_enter(&vhcache->vhcache_lock, RW_WRITER);
8259 if ((cct = lookup_vhcache_client(vhcache, ct->ct_drvname, ct->ct_guid,
8269 rw_exit(&vhcache->vhcache_lock);
8382 * Make vhci cache dirty and schedule flushing by vhcache flush thread.
8387 mdi_vhci_cache_t *vhcache = &vhc->vhc_vhcache;
8390 rw_enter(&vhcache->vhcache_lock, RW_READER);
8392 if (!(vhcache->vhcache_flags & MDI_VHCI_CACHE_SETUP_DONE)) {
8393 rw_exit(&vhcache->vhcache_lock);
8396 rw_exit(&vhcache->vhcache_lock);
8485 bus_config_all_phcis(mdi_vhci_cache_t *vhcache, uint_t flags,
8492 rw_enter(&vhcache->vhcache_lock, RW_READER);
8493 if (vhcache->vhcache_phci_head == NULL) {
8494 rw_exit(&vhcache->vhcache_lock);
8500 for (cphci = vhcache->vhcache_phci_head; cphci != NULL;
8513 rw_exit(&vhcache->vhcache_lock);
8550 mdi_vhci_cache_t *vhcache = &vhc->vhc_vhcache;
8553 bus_config_all_phcis(vhcache, flags, op, maj);
8688 * Sort vhcache pathinfos (cpis) of the specified client.
8708 * every vhcache pathinfo of the specified client. If not adjust the flag
8719 mdi_vhci_cache_t *vhcache = &vhc->vhc_vhcache;
8723 rw_enter(&vhcache->vhcache_lock, RW_READER);
8724 if ((cct = lookup_vhcache_client(vhcache, ct_name, ct_addr, tok))
8726 rw_exit(&vhcache->vhcache_lock);
8743 rw_exit(&vhcache->vhcache_lock);
8747 if (rw_tryupgrade(&vhcache->vhcache_lock) == 0) {
8748 rw_exit(&vhcache->vhcache_lock);
8749 rw_enter(&vhcache->vhcache_lock, RW_WRITER);
8750 if ((cct = lookup_vhcache_client(vhcache, ct_name, ct_addr,
8752 rw_exit(&vhcache->vhcache_lock);
8765 rw_exit(&vhcache->vhcache_lock);
8920 mdi_vhci_cache_t *vhcache = &vhc->vhc_vhcache;
8925 ASSERT(RW_LOCK_HELD(&vhcache->vhcache_lock));
8930 (cct = lookup_vhcache_client(vhcache, ct_name, ct_addr, &tok))
8933 rw_exit(&vhcache->vhcache_lock);
8939 rw_exit(&vhcache->vhcache_lock);
8944 rw_exit(&vhcache->vhcache_lock);
8948 rw_enter(&vhcache->vhcache_lock, RW_READER);
8950 if ((cct = lookup_vhcache_client(vhcache, ct_name,
8952 rw_exit(&vhcache->vhcache_lock);
8958 rw_exit(&vhcache->vhcache_lock);
8965 rw_exit(&vhcache->vhcache_lock);
9169 mdi_vhci_cache_t *vhcache = &vhc->vhc_vhcache;
9173 rw_enter(&vhcache->vhcache_lock, RW_READER);
9174 if (vhcache->vhcache_flags & MDI_VHCI_CACHE_SETUP_DONE) {
9175 rw_exit(&vhcache->vhcache_lock);
9179 rw_exit(&vhcache->vhcache_lock);
9182 bus_config_all_phcis(vhcache, NDI_DRV_CONF_REPROBE | NDI_NO_EVENT,
9185 rw_enter(&vhcache->vhcache_lock, RW_WRITER);
9186 vhcache->vhcache_flags |= MDI_VHCI_CACHE_SETUP_DONE;
9187 rw_exit(&vhcache->vhcache_lock);
9240 mdi_vhci_cache_t *vhcache = &vhc->vhc_vhcache;
9247 bus_config_all_phcis(vhcache, NDI_DRV_CONF_REPROBE |
9292 mdi_vhci_cache_t *vhcache = &vhc->vhc_vhcache;
9312 rw_enter(&vhcache->vhcache_lock, RW_READER);
9313 if (!(vhcache->vhcache_flags & MDI_VHCI_CACHE_SETUP_DONE)) {
9314 rw_exit(&vhcache->vhcache_lock);
9316 rw_enter(&vhcache->vhcache_lock, RW_READER);
9336 rw_exit(&vhcache->vhcache_lock);
9340 rw_exit(&vhcache->vhcache_lock);
9347 rw_exit(&vhcache->vhcache_lock);
9353 rw_exit(&vhcache->vhcache_lock);
9421 mdi_vhci_cache_t *vhcache = &vhc->vhc_vhcache;
9426 rw_enter(&vhcache->vhcache_lock, RW_WRITER);
9428 client = vhcache->vhcache_client_head;
9429 vhcache->vhcache_client_head = vhcache->vhcache_client_tail = NULL;
9447 enqueue_vhcache_client(vhcache, client);
9449 (void) mod_hash_destroy(vhcache->vhcache_client_hash,
9455 phci = vhcache->vhcache_phci_head;
9456 vhcache->vhcache_phci_head = vhcache->vhcache_phci_tail = NULL;
9461 enqueue_vhcache_phci(vhcache, phci);
9466 vhcache->vhcache_clean_time = ddi_get_lbolt64();
9467 rw_exit(&vhcache->vhcache_lock);