Lines Matching refs:rmp

582 	struct rpcm *rmp;
607 rmp = kmem_zalloc(sizeof (*rmp), KM_SLEEP);
609 mutex_init(&rmp->rm_lock, NULL, MUTEX_DEFAULT, NULL);
610 cv_init(&rmp->rm_cwait, NULL, CV_DEFAULT, NULL);
611 rmp->rm_zoneid = rpc_zoneid();
615 rmp->rm_type = 0;
617 q->q_ptr = (void *)rmp;
618 WR(q)->q_ptr = (void *)rmp;
632 struct rpcm *rmp;
635 rmp = (struct rpcm *)q->q_ptr;
640 mutex_enter(&rmp->rm_lock);
641 rmp->rm_state |= RM_CLOSING;
648 if (rmp->rm_type == RPC_SERVER) {
653 if (rmp->rm_ref) {
654 mutex_exit(&rmp->rm_lock);
659 mutex_enter(&rmp->rm_lock);
665 while (rmp->rm_ref)
666 cv_wait(&rmp->rm_cwait, &rmp->rm_lock);
669 mutex_exit(&rmp->rm_lock);
681 mutex_exit(&rmp->rm_lock);
687 mutex_destroy(&rmp->rm_lock);
688 cv_destroy(&rmp->rm_cwait);
689 kmem_free(rmp, sizeof (*rmp));
700 struct rpcm *rmp;
707 rmp = (struct rpcm *)q->q_ptr;
709 if (rmp->rm_type == 0) {
731 mutex_enter(&rmp->rm_lock);
732 if (rmp->rm_state & RM_CLOSING) {
733 mutex_exit(&rmp->rm_lock);
738 switch (rmp->rm_type) {
740 mutex_exit(&rmp->rm_lock);
762 rmp->rm_zoneid);
772 if (rmp->rm_krpc_cell &&
780 rmp->rm_ref++;
781 mutex_exit(&rmp->rm_lock);
783 mutex_exit(&rmp->rm_lock);
788 mutex_exit(&rmp->rm_lock);
791 } /* end switch(rmp->rm_type) */
793 mutex_enter(&rmp->rm_lock);
804 mutex_exit(&rmp->rm_lock);
814 mutex_exit(&rmp->rm_lock);
838 struct rpcm *rmp;
859 rmp = (struct rpcm *)q->q_ptr;
860 ASSERT(rmp != NULL);
868 mutex_enter(&rmp->rm_lock);
869 if (canputnext(q) || (rmp->rm_state & RM_CLOSING)) {
870 mutex_exit(&rmp->rm_lock);
878 mutex_exit(&rmp->rm_lock);
886 struct rpcm *rmp;
889 rmp = (struct rpcm *)q->q_ptr;
890 ASSERT(rmp != NULL);
899 mutex_enter(&rmp->rm_lock);
900 rmp->rm_type = iocp->ioc_cmd;
901 mutex_exit(&rmp->rm_lock);
930 struct rpcm *rmp;
933 rmp = (struct rpcm *)q->q_ptr;
934 ASSERT(rmp != NULL);
944 if (rmp->rm_type == RPC_SERVER || canputnext(q)) {
957 struct rpcm *rmp;
964 rmp = (struct rpcm *)q->q_ptr;
966 mutex_enter(&rmp->rm_lock);
967 rmp->rm_ref--;
969 if (rmp->rm_ref == 0 && (rmp->rm_state & RM_CLOSING)) {
970 cv_broadcast(&rmp->rm_cwait);
973 mutex_exit(&rmp->rm_lock);