Lines Matching refs:ccp
76 corectl_content_t *ccp;
78 ccp = kmem_zalloc(sizeof (corectl_content_t), KM_SLEEP);
79 ccp->ccc_content = cc;
80 ccp->ccc_refcnt = 1;
82 return (ccp);
86 corectl_content_value(corectl_content_t *ccp)
90 mutex_enter(&ccp->ccc_mtx);
91 content = ccp->ccc_content;
92 mutex_exit(&ccp->ccc_mtx);
98 corectl_content_set(corectl_content_t *ccp, core_content_t content)
100 mutex_enter(&ccp->ccc_mtx);
101 ccp->ccc_content = content;
102 mutex_exit(&ccp->ccc_mtx);
106 corectl_content_hold(corectl_content_t *ccp)
108 atomic_add_32(&ccp->ccc_refcnt, 1);
112 corectl_content_rele(corectl_content_t *ccp)
114 if (atomic_add_32_nv(&ccp->ccc_refcnt, -1) == 0)
115 kmem_free(ccp, sizeof (corectl_content_t));
122 corectl_path_t *ccp;
124 ccp = kmem_zalloc(sizeof (corectl_path_t), KM_SLEEP);
125 ccp->ccp_path = refstr_alloc(path);
126 ccp->ccp_refcnt = 1;
128 return (ccp);
132 corectl_path_value(corectl_path_t *ccp)
136 mutex_enter(&ccp->ccp_mtx);
137 refstr_hold(path = ccp->ccp_path);
138 mutex_exit(&ccp->ccp_mtx);
144 corectl_path_set(corectl_path_t *ccp, const char *path)
148 mutex_enter(&ccp->ccp_mtx);
149 refstr_rele(ccp->ccp_path);
150 ccp->ccp_path = npath;
151 mutex_exit(&ccp->ccp_mtx);
155 corectl_path_hold(corectl_path_t *ccp)
157 atomic_add_32(&ccp->ccp_refcnt, 1);
161 corectl_path_rele(corectl_path_t *ccp)
163 if (atomic_add_32_nv(&ccp->ccp_refcnt, -1) == 0) {
164 refstr_rele(ccp->ccp_path);
165 kmem_free(ccp, sizeof (corectl_path_t));