Lines Matching refs:pl
1524 pcachelink_locked_rele(pcachelink_t *pl) in pcachelink_locked_rele() argument
1526 ASSERT(MUTEX_HELD(&pl->pcl_lock)); in pcachelink_locked_rele()
1527 VERIFY(pl->pcl_refcnt >= 1); in pcachelink_locked_rele()
1529 pl->pcl_refcnt--; in pcachelink_locked_rele()
1530 if (pl->pcl_refcnt == 0) { in pcachelink_locked_rele()
1531 VERIFY(pl->pcl_state == PCL_INVALID); in pcachelink_locked_rele()
1532 ASSERT(pl->pcl_parent_pc == NULL); in pcachelink_locked_rele()
1533 ASSERT(pl->pcl_child_pc == NULL); in pcachelink_locked_rele()
1534 ASSERT(pl->pcl_parent_next == NULL); in pcachelink_locked_rele()
1535 ASSERT(pl->pcl_child_next == NULL); in pcachelink_locked_rele()
1537 pl->pcl_state = PCL_FREE; in pcachelink_locked_rele()
1538 mutex_destroy(&pl->pcl_lock); in pcachelink_locked_rele()
1539 kmem_free(pl, sizeof (pcachelink_t)); in pcachelink_locked_rele()
1541 mutex_exit(&pl->pcl_lock); in pcachelink_locked_rele()
1553 pcachelink_t *pl, **plpn; in pcachelink_assoc() local
1560 for (pl = child->pc_parents; pl != NULL; pl = *plpn) { in pcachelink_assoc()
1561 mutex_enter(&pl->pcl_lock); in pcachelink_assoc()
1562 if (pl->pcl_state == PCL_INVALID) { in pcachelink_assoc()
1564 *plpn = pl->pcl_parent_next; in pcachelink_assoc()
1565 pl->pcl_child_pc = NULL; in pcachelink_assoc()
1566 pl->pcl_parent_next = NULL; in pcachelink_assoc()
1567 pcachelink_locked_rele(pl); in pcachelink_assoc()
1568 } else if (pl->pcl_parent_pc == parent) { in pcachelink_assoc()
1570 ASSERT(pl->pcl_state == PCL_VALID || in pcachelink_assoc()
1571 pl->pcl_state == PCL_STALE); in pcachelink_assoc()
1572 pl->pcl_state = PCL_VALID; in pcachelink_assoc()
1573 mutex_exit(&pl->pcl_lock); in pcachelink_assoc()
1576 plpn = &pl->pcl_parent_next; in pcachelink_assoc()
1577 mutex_exit(&pl->pcl_lock); in pcachelink_assoc()
1582 pl = kmem_zalloc(sizeof (pcachelink_t), KM_SLEEP); in pcachelink_assoc()
1583 mutex_init(&pl->pcl_lock, NULL, MUTEX_DEFAULT, NULL); in pcachelink_assoc()
1585 pl->pcl_parent_pc = parent; in pcachelink_assoc()
1586 pl->pcl_child_next = parent->pc_children; in pcachelink_assoc()
1587 parent->pc_children = pl; in pcachelink_assoc()
1588 pl->pcl_refcnt++; in pcachelink_assoc()
1590 pl->pcl_child_pc = child; in pcachelink_assoc()
1591 pl->pcl_parent_next = child->pc_parents; in pcachelink_assoc()
1592 child->pc_parents = pl; in pcachelink_assoc()
1593 pl->pcl_refcnt++; in pcachelink_assoc()
1595 pl->pcl_state = PCL_VALID; in pcachelink_assoc()
1605 pcachelink_t *pl, **plpn; in pcachelink_mark_stale() local
1610 for (pl = pcp->pc_children; pl != NULL; pl = *plpn) { in pcachelink_mark_stale()
1611 mutex_enter(&pl->pcl_lock); in pcachelink_mark_stale()
1612 if (pl->pcl_state == PCL_INVALID) { in pcachelink_mark_stale()
1617 *plpn = pl->pcl_child_next; in pcachelink_mark_stale()
1618 pl->pcl_parent_pc = NULL; in pcachelink_mark_stale()
1619 pl->pcl_child_next = NULL; in pcachelink_mark_stale()
1620 pcachelink_locked_rele(pl); in pcachelink_mark_stale()
1622 pl->pcl_state = PCL_STALE; in pcachelink_mark_stale()
1623 plpn = &pl->pcl_child_next; in pcachelink_mark_stale()
1624 mutex_exit(&pl->pcl_lock); in pcachelink_mark_stale()
1635 pcachelink_t *pl, **plpn; in pcachelink_purge_stale() local
1640 for (pl = pcp->pc_children; pl != NULL; pl = *plpn) { in pcachelink_purge_stale()
1641 mutex_enter(&pl->pcl_lock); in pcachelink_purge_stale()
1642 switch (pl->pcl_state) { in pcachelink_purge_stale()
1644 pl->pcl_state = PCL_INVALID; in pcachelink_purge_stale()
1647 *plpn = pl->pcl_child_next; in pcachelink_purge_stale()
1648 pl->pcl_parent_pc = NULL; in pcachelink_purge_stale()
1649 pl->pcl_child_next = NULL; in pcachelink_purge_stale()
1650 pcachelink_locked_rele(pl); in pcachelink_purge_stale()
1653 plpn = &pl->pcl_child_next; in pcachelink_purge_stale()
1654 mutex_exit(&pl->pcl_lock); in pcachelink_purge_stale()
1665 pcachelink_t *pl, **plpn; in pcachelink_purge_all() local
1670 for (pl = pcp->pc_parents; pl != NULL; pl = *plpn) { in pcachelink_purge_all()
1671 mutex_enter(&pl->pcl_lock); in pcachelink_purge_all()
1672 pl->pcl_state = PCL_INVALID; in pcachelink_purge_all()
1673 *plpn = pl->pcl_parent_next; in pcachelink_purge_all()
1674 pl->pcl_child_pc = NULL; in pcachelink_purge_all()
1675 pl->pcl_parent_next = NULL; in pcachelink_purge_all()
1676 pcachelink_locked_rele(pl); in pcachelink_purge_all()
1680 for (pl = pcp->pc_children; pl != NULL; pl = *plpn) { in pcachelink_purge_all()
1681 mutex_enter(&pl->pcl_lock); in pcachelink_purge_all()
1682 pl->pcl_state = PCL_INVALID; in pcachelink_purge_all()
1683 *plpn = pl->pcl_child_next; in pcachelink_purge_all()
1684 pl->pcl_parent_pc = NULL; in pcachelink_purge_all()
1685 pl->pcl_child_next = NULL; in pcachelink_purge_all()
1686 pcachelink_locked_rele(pl); in pcachelink_purge_all()