Lines Matching refs:clp

52 	sclass_t *clp;  in alloc_cid()  local
63 for (clp = sclass; clp < &sclass[nclass]; clp++) in alloc_cid()
64 if (clp->cl_name[0] == '\0' && clp->cl_lock == NULL) in alloc_cid()
67 if (clp == &sclass[nclass]) { in alloc_cid()
70 *cidp = clp - &sclass[0]; in alloc_cid()
71 clp->cl_lock = kmem_alloc(sizeof (krwlock_t), KM_SLEEP); in alloc_cid()
72 clp->cl_name = kmem_alloc(strlen(clname) + 1, KM_SLEEP); in alloc_cid()
73 (void) strcpy(clp->cl_name, clname); in alloc_cid()
74 rw_init(clp->cl_lock, NULL, RW_DEFAULT, NULL); in alloc_cid()
85 scheduler_load(char *clname, sclass_t *clp) in scheduler_load() argument
95 if (LOADABLE_SCHED(clp)) { in scheduler_load()
96 rw_enter(clp->cl_lock, RW_READER); in scheduler_load()
97 if (!SCHED_INSTALLED(clp)) { in scheduler_load()
98 rw_exit(clp->cl_lock); in scheduler_load()
101 rw_enter(clp->cl_lock, RW_READER); in scheduler_load()
103 if (!SCHED_INSTALLED(clp)) in scheduler_load()
106 rw_exit(clp->cl_lock); in scheduler_load()
117 sclass_t *clp; in getcid() local
122 clp = &sclass[*cidp]; in getcid()
123 clp->cl_count++; in getcid()
133 retval = scheduler_load(clname, clp); in getcid()
136 clp->cl_count--; in getcid()
137 if (retval != 0 && clp->cl_count == 0) { in getcid()
139 kmem_free(clp->cl_name, strlen(clname) + 1); in getcid()
140 kmem_free(clp->cl_lock, sizeof (krwlock_t)); in getcid()
141 clp->cl_name = ""; in getcid()
142 clp->cl_lock = (krwlock_t *)NULL; in getcid()
153 sclass_t *clp; in getcidbyname_locked() local
160 for (clp = &sclass[0]; clp < &sclass[nclass]; clp++) { in getcidbyname_locked()
161 if (strcmp(clp->cl_name, clname) == 0) { in getcidbyname_locked()
162 *cidp = clp - &sclass[0]; in getcidbyname_locked()