Lines Matching refs:nsp

2121 	struct nlm_shres *nsp, *nsp_new;  in nlm_shres_track()  local
2131 for (nsp = hostp->nh_shrlist; nsp != NULL; nsp = nsp->ns_next) in nlm_shres_track()
2132 if (nsp->ns_vp == vp && nlm_shres_equal(shrp, nsp->ns_shr)) in nlm_shres_track()
2135 if (nsp != NULL) { in nlm_shres_track()
2143 nsp = nsp_new; in nlm_shres_track()
2145 nsp->ns_next = hostp->nh_shrlist; in nlm_shres_track()
2146 hostp->nh_shrlist = nsp; in nlm_shres_track()
2157 struct nlm_shres *nsp, *nsp_prev = NULL; in nlm_shres_untrack() local
2160 nsp = hostp->nh_shrlist; in nlm_shres_untrack()
2161 while (nsp != NULL) { in nlm_shres_untrack()
2162 if (nsp->ns_vp == vp && nlm_shres_equal(shrp, nsp->ns_shr)) { in nlm_shres_untrack()
2165 nsp_del = nsp; in nlm_shres_untrack()
2166 nsp = nsp->ns_next; in nlm_shres_untrack()
2168 nsp_prev->ns_next = nsp; in nlm_shres_untrack()
2170 hostp->nh_shrlist = nsp; in nlm_shres_untrack()
2176 nsp_prev = nsp; in nlm_shres_untrack()
2177 nsp = nsp->ns_next; in nlm_shres_untrack()
2192 struct nlm_shres *nsp, *nslist = NULL; in nlm_get_active_shres() local
2195 for (nsp = hostp->nh_shrlist; nsp != NULL; nsp = nsp->ns_next) { in nlm_get_active_shres()
2198 nsp_new = nlm_shres_create_item(nsp->ns_shr, nsp->ns_vp); in nlm_get_active_shres()
2214 struct nlm_shres *nsp; in nlm_free_shrlist() local
2217 nsp = nslist; in nlm_free_shrlist()
2220 nlm_shres_destroy_item(nsp); in nlm_free_shrlist()
2240 struct nlm_shres *nsp; in nlm_shres_create_item() local
2242 nsp = kmem_alloc(sizeof (*nsp), KM_SLEEP); in nlm_shres_create_item()
2243 nsp->ns_shr = kmem_alloc(sizeof (*shrp), KM_SLEEP); in nlm_shres_create_item()
2244 bcopy(shrp, nsp->ns_shr, sizeof (*shrp)); in nlm_shres_create_item()
2245 nsp->ns_shr->s_owner = kmem_alloc(shrp->s_own_len, KM_SLEEP); in nlm_shres_create_item()
2246 bcopy(shrp->s_owner, nsp->ns_shr->s_owner, shrp->s_own_len); in nlm_shres_create_item()
2247 nsp->ns_vp = vp; in nlm_shres_create_item()
2249 return (nsp); in nlm_shres_create_item()
2253 nlm_shres_destroy_item(struct nlm_shres *nsp) in nlm_shres_destroy_item() argument
2255 kmem_free(nsp->ns_shr->s_owner, in nlm_shres_destroy_item()
2256 nsp->ns_shr->s_own_len); in nlm_shres_destroy_item()
2257 kmem_free(nsp->ns_shr, sizeof (struct shrlock)); in nlm_shres_destroy_item()
2258 kmem_free(nsp, sizeof (*nsp)); in nlm_shres_destroy_item()