2705 }
2706
2707 int
2708 conn_untrace_ref(conn_t *connp)
2709 {
2710 int last;
2711 conn_trace_t *ctb;
2712
2713 ASSERT(MUTEX_HELD(&connp->conn_lock));
2714 last = connp->conn_trace_last;
2715 last++;
2716 if (last == CONN_TRACE_MAX)
2717 last = 0;
2718
2719 ctb = &connp->conn_trace_buf[last];
2720 ctb->ctb_depth = getpcstack(ctb->ctb_stack, CONN_STACK_DEPTH);
2721 connp->conn_trace_last = last;
2722 return (1);
2723 }
2724 #endif
|
2705 }
2706
2707 int
2708 conn_untrace_ref(conn_t *connp)
2709 {
2710 int last;
2711 conn_trace_t *ctb;
2712
2713 ASSERT(MUTEX_HELD(&connp->conn_lock));
2714 last = connp->conn_trace_last;
2715 last++;
2716 if (last == CONN_TRACE_MAX)
2717 last = 0;
2718
2719 ctb = &connp->conn_trace_buf[last];
2720 ctb->ctb_depth = getpcstack(ctb->ctb_stack, CONN_STACK_DEPTH);
2721 connp->conn_trace_last = last;
2722 return (1);
2723 }
2724 #endif
2725
2726 conn_pid_node_list_hdr_t *
2727 conn_get_pid_list(conn_t *connp)
2728 {
2729 conn_pid_node_list_hdr_t *cph;
2730
2731 if (connp->conn_upper_handle != NULL) {
2732 return (*connp->conn_upcalls->su_get_sock_pid_list)
2733 (connp->conn_upper_handle);
2734 } else if (!IPCL_IS_NONSTR(connp) && connp->conn_rq != NULL &&
2735 connp->conn_rq->q_stream != NULL) {
2736 return (sh_get_pid_list(connp->conn_rq->q_stream));
2737 }
2738
2739 /* return an empty header */
2740 cph = kmem_zalloc(sizeof (conn_pid_node_list_hdr_t), KM_SLEEP);
2741 cph->cph_magic = CONN_PID_NODE_LIST_HDR_MAGIC;
2742 cph->cph_contents = CONN_PID_NODE_LIST_HDR_NON;
2743 cph->cph_pn_cnt = 0;
2744 cph->cph_tot_size = sizeof (conn_pid_node_list_hdr_t);
2745 cph->cph_flags = 0;
2746 cph->cph_optional1 = 0;
2747 cph->cph_optional2 = 0;
2748
2749 return (cph);
2750 }
|